/*
- * Copyright 2017 The OpenSSL Project Authors. All Rights Reserved.
+ * Copyright 2017-2018 The OpenSSL Project Authors. All Rights Reserved.
*
- * Licensed under the OpenSSL license (the "License"). You may not use
+ * Licensed under the Apache License 2.0 (the "License"). You may not use
* this file except in compliance with the License. You can obtain a copy
* in the file LICENSE in the source distribution or at
* https://www.openssl.org/source/license.html
#include <openssl/asn1.h>
#include <openssl/x509.h>
#include "testutil.h"
-#include "e_os.h"
+#include "internal/nelem.h"
typedef struct {
const char *data;
at.data = (unsigned char*)testdata->data;
at.length = strlen(testdata->data);
at.type = testdata->type;
+ at.flags = 0;
if (!TEST_true(ASN1_TIME_diff(&day, &sec, &the_asn1_time, &at))) {
TEST_info("ASN1_TIME_diff() failed for %s\n", at.data);
return 0;
}
- if (at.type == V_ASN1_UTCTIME)
- ret = ASN1_UTCTIME_cmp_time_t(&at, the_time);
- else
- return 1; /* no other cmp_time_t() functions available, yet */
+ ret = ASN1_TIME_cmp_time_t(&at, the_time);
if (!TEST_int_eq(testdata->time_result, ret)) {
TEST_info("ASN1_UTCTIME_cmp_time_t() test failed for %s\n", at.data);
return 1;
}
-void register_tests()
+int setup_tests(void)
{
ADD_ALL_TESTS(test_offset, OSSL_NELEM(tests));
+ return 1;
}