2 * Copyright 1999-2024 The OpenSSL Project Authors. All Rights Reserved.
4 * Licensed under the Apache License 2.0 (the "License"). You may not use
5 * this file except in compliance with the License. You can obtain a copy
6 * in the file LICENSE in the source distribution or at
7 * https://www.openssl.org/source/license.html
10 /* Time tests for the asn1 module */
16 #include <crypto/asn1.h>
17 #include <openssl/asn1.h>
18 #include <openssl/evp.h>
19 #include <openssl/objects.h>
21 #include "internal/nelem.h"
24 char *data
; /* TIME string value */
25 int type
; /* GENERALIZED OR UTC */
26 int expected_type
; /* expected type after set/set_string_gmt */
27 int check_result
; /* check result */
28 time_t t
; /* expected time_t*/
29 int cmp_result
; /* comparison to baseline result */
30 int convert_result
; /* conversion result */
33 struct TESTDATA_asn1_to_utc
{
38 static const struct TESTDATA_asn1_to_utc asn1_to_utc
[] = {
41 * last second of standard time in central Europe in 2021
49 * first second of daylight saving time in central Europe in 2021
57 * last second of standard time in central Europe in 2021
58 * specified in offset to GMT
60 "20210328015959+0100",
65 * first second of daylight saving time in central Europe in 2021
66 * specified in offset to GMT
68 "20210328030000+0200",
73 * Invalid strings should get -1 as a result
80 static struct testdata tbl_testdata_pos
[] = {
81 { "0", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, }, /* Bad time */
82 { "ABCD", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
83 { "0ABCD", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
84 { "1-700101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
85 { "`9700101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
86 { "19700101000000Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 0, },
87 { "A00101000000Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 0, },
88 { "A9700101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
89 { "1A700101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
90 { "19A00101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
91 { "197A0101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
92 { "1970A101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
93 { "19700A01000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
94 { "197001A1000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
95 { "1970010A000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
96 { "19700101A00000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
97 { "197001010A0000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
98 { "1970010100A000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
99 { "19700101000A00Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
100 { "197001010000A0Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
101 { "1970010100000AZ", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
102 { "700101000000X", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 0, },
103 { "19700101000000X", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
104 { "209912312359Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
105 { "199912310000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 0, 0, 0, 0, },
106 { "9912312359Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 0, },
107 { "9912310000Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 0, },
108 { "19700101000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 0, -1, 1, }, /* Epoch begins */
109 { "700101000000Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 0, -1, 1, }, /* ditto */
110 { "20380119031407Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 0x7FFFFFFF, 1, 1, }, /* Max 32bit time_t */
111 { "380119031407Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 0x7FFFFFFF, 1, 1, },
112 { "20371231235959Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 2145916799, 1, 1, }, /* Just before 2038 */
113 { "20371231235959Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 0, 0, 0, 1, }, /* Bad UTC time */
114 { "371231235959Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 2145916799, 1, 1, },
115 { "19701006121456Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 24063296, -1, 1, },
116 { "701006121456Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 24063296, -1, 1, },
117 { "19991231000000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, }, /* Match baseline */
118 { "991231000000Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
119 { "9912310000+0000", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
120 { "199912310000+0000", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
121 { "9912310000-0000", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
122 { "199912310000-0000", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
123 { "199912310100+0100", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
124 { "199912302300-0100", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
125 { "199912302300-A000", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 0, 946598400, 0, 1, },
126 { "199912302300-0A00", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 0, 946598400, 0, 1, },
127 { "9912310100+0100", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
128 { "9912302300-0100", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, 946598400, 0, 1, },
131 /* ASSUMES SIGNED TIME_T */
132 static struct testdata tbl_testdata_neg
[] = {
133 { "19011213204552Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 1, INT_MIN
, -1, 0, },
134 { "691006121456Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, -7472704, -1, 1, },
135 { "19691006121456Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, -7472704, -1, 1, },
138 /* explicit casts to time_t short warnings on systems with 32-bit time_t */
139 static struct testdata tbl_testdata_pos_64bit
[] = {
140 { "20380119031408Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, (time_t)0x80000000, 1, 1, },
141 { "20380119031409Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_UTCTIME
, 1, (time_t)0x80000001, 1, 1, },
142 { "380119031408Z", V_ASN1_UTCTIME
, V_ASN1_UTCTIME
, 1, (time_t)0x80000000, 1, 1, },
143 { "20500101120000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 1, (time_t)0x967b1ec0, 1, 0, },
146 /* ASSUMES SIGNED TIME_T */
147 static struct testdata tbl_testdata_neg_64bit
[] = {
148 { "19011213204551Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 1, (time_t)-2147483649LL, -1, 0, },
149 { "19000101120000Z", V_ASN1_GENERALIZEDTIME
, V_ASN1_GENERALIZEDTIME
, 1, (time_t)-2208945600LL, -1, 0, },
152 /* A baseline time to compare to */
153 static ASN1_TIME gtime
= {
155 V_ASN1_GENERALIZEDTIME
,
156 (unsigned char*)"19991231000000Z",
159 static time_t gtime_t
= 946598400;
161 static int test_table(struct testdata
*tbl
, int idx
)
166 struct testdata
*td
= &tbl
[idx
];
169 atime
.data
= (unsigned char*)td
->data
;
170 atime
.length
= strlen((char*)atime
.data
);
171 atime
.type
= td
->type
;
174 if (!TEST_int_eq(ASN1_TIME_check(&atime
), td
->check_result
)) {
175 TEST_info("ASN1_TIME_check(%s) unexpected result", atime
.data
);
178 if (td
->check_result
== 0)
181 if (!TEST_int_eq(ASN1_TIME_cmp_time_t(&atime
, td
->t
), 0)) {
182 TEST_info("ASN1_TIME_cmp_time_t(%s vs %ld) compare failed", atime
.data
, (long)td
->t
);
186 if (!TEST_true(ASN1_TIME_diff(&day
, &sec
, &atime
, &atime
))) {
187 TEST_info("ASN1_TIME_diff(%s) to self failed", atime
.data
);
190 if (!TEST_int_eq(day
, 0) || !TEST_int_eq(sec
, 0)) {
191 TEST_info("ASN1_TIME_diff(%s) to self not equal", atime
.data
);
195 if (!TEST_true(ASN1_TIME_diff(&day
, &sec
, >ime
, &atime
))) {
196 TEST_info("ASN1_TIME_diff(%s) to baseline failed", atime
.data
);
198 } else if (!((td
->cmp_result
== 0 && TEST_true((day
== 0 && sec
== 0))) ||
199 (td
->cmp_result
== -1 && TEST_true((day
< 0 || sec
< 0))) ||
200 (td
->cmp_result
== 1 && TEST_true((day
> 0 || sec
> 0))))) {
201 TEST_info("ASN1_TIME_diff(%s) to baseline bad comparison", atime
.data
);
205 if (!TEST_int_eq(ASN1_TIME_cmp_time_t(&atime
, gtime_t
), td
->cmp_result
)) {
206 TEST_info("ASN1_TIME_cmp_time_t(%s) to baseline bad comparison", atime
.data
);
210 ptime
= ASN1_TIME_set(NULL
, td
->t
);
211 if (!TEST_ptr(ptime
)) {
212 TEST_info("ASN1_TIME_set(%ld) failed", (long)td
->t
);
216 if (!TEST_int_eq(ASN1_TIME_cmp_time_t(ptime
, td
->t
), 0)) {
217 TEST_info("ASN1_TIME_set(%ld) compare failed (%s->%s)",
218 (long)td
->t
, td
->data
, ptime
->data
);
219 local_error
= error
= 1;
221 if (!TEST_int_eq(ptime
->type
, td
->expected_type
)) {
222 TEST_info("ASN1_TIME_set(%ld) unexpected type", (long)td
->t
);
223 local_error
= error
= 1;
226 TEST_info("ASN1_TIME_set() = %*s", ptime
->length
, ptime
->data
);
227 ASN1_TIME_free(ptime
);
230 ptime
= ASN1_TIME_new();
231 if (!TEST_ptr(ptime
)) {
232 TEST_info("ASN1_TIME_new() failed");
236 if (!TEST_int_eq(ASN1_TIME_set_string(ptime
, td
->data
), td
->check_result
)) {
237 TEST_info("ASN1_TIME_set_string_gmt(%s) failed", td
->data
);
238 local_error
= error
= 1;
240 if (!TEST_int_eq(ASN1_TIME_normalize(ptime
), td
->check_result
)) {
241 TEST_info("ASN1_TIME_normalize(%s) failed", td
->data
);
242 local_error
= error
= 1;
244 if (!TEST_int_eq(ptime
->type
, td
->expected_type
)) {
245 TEST_info("ASN1_TIME_set_string_gmt(%s) unexpected type", td
->data
);
246 local_error
= error
= 1;
249 if (!TEST_true(ASN1_TIME_diff(&day
, &sec
, ptime
, &atime
)) || !TEST_int_eq(day
, 0) || !TEST_int_eq(sec
, 0)) {
250 TEST_info("ASN1_TIME_diff(day=%d, sec=%d, %s) after ASN1_TIME_set_string_gmt() failed", day
, sec
, td
->data
);
251 local_error
= error
= 1;
253 if (!TEST_int_eq(ASN1_TIME_cmp_time_t(ptime
, gtime_t
), td
->cmp_result
)) {
254 TEST_info("ASN1_TIME_cmp_time_t(%s) after ASN1_TIME_set_string_gnt() to baseline bad comparison", td
->data
);
255 local_error
= error
= 1;
258 TEST_info("ASN1_TIME_set_string_gmt() = %*s", ptime
->length
, ptime
->data
);
259 ASN1_TIME_free(ptime
);
262 ptime
= ASN1_TIME_new();
263 if (!TEST_ptr(ptime
)) {
264 TEST_info("ASN1_TIME_new() failed");
268 if (!TEST_int_eq(ASN1_TIME_set_string(ptime
, td
->data
), td
->check_result
)) {
269 TEST_info("ASN1_TIME_set_string(%s) failed", td
->data
);
270 local_error
= error
= 1;
273 if (!TEST_true(ASN1_TIME_diff(&day
, &sec
, ptime
, &atime
)) || !TEST_int_eq(day
, 0) || !TEST_int_eq(sec
, 0)) {
274 TEST_info("ASN1_TIME_diff(day=%d, sec=%d, %s) after ASN1_TIME_set_string() failed", day
, sec
, td
->data
);
275 local_error
= error
= 1;
277 if (!TEST_int_eq(ASN1_TIME_cmp_time_t(ptime
, gtime_t
), td
->cmp_result
)) {
278 TEST_info("ASN1_TIME_cmp_time_t(%s) after ASN1_TIME_set_string() to baseline bad comparison", td
->data
);
279 local_error
= error
= 1;
282 TEST_info("ASN1_TIME_set_string() = %*s", ptime
->length
, ptime
->data
);
283 ASN1_TIME_free(ptime
);
286 if (td
->type
== V_ASN1_UTCTIME
) {
287 ptime
= ASN1_TIME_to_generalizedtime(&atime
, NULL
);
288 if (td
->convert_result
== 1 && !TEST_ptr(ptime
)) {
289 TEST_info("ASN1_TIME_to_generalizedtime(%s) failed", atime
.data
);
291 } else if (td
->convert_result
== 0 && !TEST_ptr_null(ptime
)) {
292 TEST_info("ASN1_TIME_to_generalizedtime(%s) should have failed", atime
.data
);
295 if (ptime
!= NULL
&& !TEST_int_eq(ASN1_TIME_cmp_time_t(ptime
, td
->t
), 0)) {
296 TEST_info("ASN1_TIME_to_generalizedtime(%s->%s) bad result", atime
.data
, ptime
->data
);
299 ASN1_TIME_free(ptime
);
301 /* else cannot simply convert GENERALIZEDTIME to UTCTIME */
304 TEST_error("atime=%s", atime
.data
);
309 static int test_table_pos(int idx
)
311 return test_table(tbl_testdata_pos
, idx
);
314 static int test_table_neg(int idx
)
316 return test_table(tbl_testdata_neg
, idx
);
319 static int test_table_pos_64bit(int idx
)
321 return test_table(tbl_testdata_pos_64bit
, idx
);
324 static int test_table_neg_64bit(int idx
)
326 return test_table(tbl_testdata_neg_64bit
, idx
);
329 struct compare_testdata
{
335 static unsigned char TODAY_GEN_STR
[] = "20170825000000Z";
336 static unsigned char TOMORROW_GEN_STR
[] = "20170826000000Z";
337 static unsigned char TODAY_UTC_STR
[] = "170825000000Z";
338 static unsigned char TOMORROW_UTC_STR
[] = "170826000000Z";
340 #define TODAY_GEN { sizeof(TODAY_GEN_STR)-1, V_ASN1_GENERALIZEDTIME, TODAY_GEN_STR, 0 }
341 #define TOMORROW_GEN { sizeof(TOMORROW_GEN_STR)-1, V_ASN1_GENERALIZEDTIME, TOMORROW_GEN_STR, 0 }
342 #define TODAY_UTC { sizeof(TODAY_UTC_STR)-1, V_ASN1_UTCTIME, TODAY_UTC_STR, 0 }
343 #define TOMORROW_UTC { sizeof(TOMORROW_UTC_STR)-1, V_ASN1_UTCTIME, TOMORROW_UTC_STR, 0 }
345 static struct compare_testdata tbl_compare_testdata
[] = {
346 { TODAY_GEN
, TODAY_GEN
, 0 },
347 { TODAY_GEN
, TODAY_UTC
, 0 },
348 { TODAY_GEN
, TOMORROW_GEN
, -1 },
349 { TODAY_GEN
, TOMORROW_UTC
, -1 },
351 { TODAY_UTC
, TODAY_GEN
, 0 },
352 { TODAY_UTC
, TODAY_UTC
, 0 },
353 { TODAY_UTC
, TOMORROW_GEN
, -1 },
354 { TODAY_UTC
, TOMORROW_UTC
, -1 },
356 { TOMORROW_GEN
, TODAY_GEN
, 1 },
357 { TOMORROW_GEN
, TODAY_UTC
, 1 },
358 { TOMORROW_GEN
, TOMORROW_GEN
, 0 },
359 { TOMORROW_GEN
, TOMORROW_UTC
, 0 },
361 { TOMORROW_UTC
, TODAY_GEN
, 1 },
362 { TOMORROW_UTC
, TODAY_UTC
, 1 },
363 { TOMORROW_UTC
, TOMORROW_GEN
, 0 },
364 { TOMORROW_UTC
, TOMORROW_UTC
, 0 }
367 static int test_table_compare(int idx
)
369 struct compare_testdata
*td
= &tbl_compare_testdata
[idx
];
371 return TEST_int_eq(ASN1_TIME_compare(&td
->t1
, &td
->t2
), td
->result
);
374 static int test_time_dup(void)
377 ASN1_TIME
*asn1_time
= NULL
;
378 ASN1_TIME
*asn1_time_dup
= NULL
;
379 ASN1_TIME
*asn1_gentime
= NULL
;
381 asn1_time
= ASN1_TIME_adj(NULL
, time(NULL
), 0, 0);
382 if (asn1_time
== NULL
) {
383 TEST_info("Internal error.");
387 asn1_gentime
= ASN1_TIME_to_generalizedtime(asn1_time
, NULL
);
388 if (asn1_gentime
== NULL
) {
389 TEST_info("Internal error.");
393 asn1_time_dup
= ASN1_TIME_dup(asn1_time
);
394 if (!TEST_ptr_ne(asn1_time_dup
, NULL
)) {
395 TEST_info("ASN1_TIME_dup() failed.");
398 if (!TEST_int_eq(ASN1_TIME_compare(asn1_time
, asn1_time_dup
), 0)) {
399 TEST_info("ASN1_TIME_dup() duplicated non-identical value.");
402 ASN1_STRING_free(asn1_time_dup
);
404 asn1_time_dup
= ASN1_UTCTIME_dup(asn1_time
);
405 if (!TEST_ptr_ne(asn1_time_dup
, NULL
)) {
406 TEST_info("ASN1_UTCTIME_dup() failed.");
409 if (!TEST_int_eq(ASN1_TIME_compare(asn1_time
, asn1_time_dup
), 0)) {
410 TEST_info("ASN1_UTCTIME_dup() duplicated non-identical UTCTIME value.");
413 ASN1_STRING_free(asn1_time_dup
);
415 asn1_time_dup
= ASN1_GENERALIZEDTIME_dup(asn1_gentime
);
416 if (!TEST_ptr_ne(asn1_time_dup
, NULL
)) {
417 TEST_info("ASN1_GENERALIZEDTIME_dup() failed.");
420 if (!TEST_int_eq(ASN1_TIME_compare(asn1_gentime
, asn1_time_dup
), 0)) {
421 TEST_info("ASN1_GENERALIZEDTIME_dup() dup'ed non-identical value.");
427 ASN1_STRING_free(asn1_time
);
428 ASN1_STRING_free(asn1_gentime
);
429 ASN1_STRING_free(asn1_time_dup
);
433 static int convert_asn1_to_time_t(int idx
)
437 testdateutc
= ossl_asn1_string_to_time_t(asn1_to_utc
[idx
].input
);
439 if (!TEST_time_t_eq(testdateutc
, asn1_to_utc
[idx
].expected
)) {
440 TEST_info("ossl_asn1_string_to_time_t (%s) failed: expected %lli, got %lli\n",
441 asn1_to_utc
[idx
].input
,
442 (long long int)asn1_to_utc
[idx
].expected
,
443 (long long int)testdateutc
);
450 * this test is here to exercise ossl_asn1_time_from_tm
451 * with an integer year close to INT_MAX.
453 static int convert_tm_to_asn1_time(void)
455 /* we need 64 bit time_t */
456 #if ((ULONG_MAX >> 31) >> 31) >= 1
460 if (sizeof(time_t) * CHAR_BIT
>= 64) {
461 t
= 67768011791126057ULL;
462 at
= ASN1_TIME_set(NULL
, t
);
464 * If ASN1_TIME_set returns NULL, it means it could not handle the input
465 * which is fine for this edge case.
467 ASN1_STRING_free(at
);
473 int setup_tests(void)
476 * On platforms where |time_t| is an unsigned integer, t will be a
479 * We check if we're on a platform with a signed |time_t| with '!(t > 0)'
480 * because some compilers are picky if you do 't < 0', or even 't <= 0'
481 * if |t| is unsigned.
485 * On some platforms, |time_t| is signed, but a negative value is an
486 * error, and using it with gmtime() or localtime() generates a NULL.
487 * If that is the case, we can't perform tests on negative values.
489 struct tm
*ptm
= localtime(&t
);
491 ADD_ALL_TESTS(test_table_pos
, OSSL_NELEM(tbl_testdata_pos
));
492 if (!(t
> 0) && ptm
!= NULL
) {
493 TEST_info("Adding negative-sign time_t tests");
494 ADD_ALL_TESTS(test_table_neg
, OSSL_NELEM(tbl_testdata_neg
));
496 if (sizeof(time_t) > sizeof(uint32_t)) {
497 TEST_info("Adding 64-bit time_t tests");
498 ADD_ALL_TESTS(test_table_pos_64bit
, OSSL_NELEM(tbl_testdata_pos_64bit
));
500 if (!(t
> 0) && ptm
!= NULL
) {
501 TEST_info("Adding negative-sign 64-bit time_t tests");
502 ADD_ALL_TESTS(test_table_neg_64bit
, OSSL_NELEM(tbl_testdata_neg_64bit
));
506 ADD_ALL_TESTS(test_table_compare
, OSSL_NELEM(tbl_compare_testdata
));
507 ADD_TEST(test_time_dup
);
508 ADD_ALL_TESTS(convert_asn1_to_time_t
, OSSL_NELEM(asn1_to_utc
));
509 ADD_TEST(convert_tm_to_asn1_time
);