diff options
author | tb <> | 2024-05-25 12:47:25 +0000 |
---|---|---|
committer | tb <> | 2024-05-25 12:47:25 +0000 |
commit | 853b1f60de98d7ea1096afbbaa355f7fff30219d (patch) | |
tree | 21f79ca710c6e292aeabba3dc643283a18acfebd | |
parent | 0b18503b8e8261f13127e58a3aa7b003be49cc0e (diff) | |
download | openbsd-853b1f60de98d7ea1096afbbaa355f7fff30219d.tar.gz openbsd-853b1f60de98d7ea1096afbbaa355f7fff30219d.tar.bz2 openbsd-853b1f60de98d7ea1096afbbaa355f7fff30219d.zip |
Revert previous
It wasn't quite right, but I also think the test is bogus.
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1time.c | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/src/regress/lib/libcrypto/asn1/asn1time.c b/src/regress/lib/libcrypto/asn1/asn1time.c index f7df794c54..95c5d24dba 100644 --- a/src/regress/lib/libcrypto/asn1/asn1time.c +++ b/src/regress/lib/libcrypto/asn1/asn1time.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: asn1time.c,v 1.27 2024/05/25 06:42:15 tb Exp $ */ | 1 | /* $OpenBSD: asn1time.c,v 1.28 2024/05/25 12:47:25 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
4 | * Copyright (c) 2024 Google Inc. | 4 | * Copyright (c) 2024 Google Inc. |
@@ -280,7 +280,6 @@ asn1_gentime_test(int test_no, const struct asn1_time_test *att) | |||
280 | const unsigned char *der; | 280 | const unsigned char *der; |
281 | unsigned char *p = NULL; | 281 | unsigned char *p = NULL; |
282 | ASN1_GENERALIZEDTIME *gt = NULL; | 282 | ASN1_GENERALIZEDTIME *gt = NULL; |
283 | int64_t a; | ||
284 | int failure = 1; | 283 | int failure = 1; |
285 | int len; | 284 | int len; |
286 | struct tm tm; | 285 | struct tm tm; |
@@ -308,16 +307,11 @@ asn1_gentime_test(int test_no, const struct asn1_time_test *att) | |||
308 | goto done; | 307 | goto done; |
309 | } | 308 | } |
310 | 309 | ||
311 | if (!OPENSSL_timegm(&tm, &a)) { | 310 | if (timegm(&tm) != att->time) { |
312 | fprintf(stderr, "FAIL: test %d - OPENSSL_timegm falied '%s'\n", | ||
313 | test_no, att->str); | ||
314 | goto done; | ||
315 | } | ||
316 | if (a != att->time) { | ||
317 | /* things with crappy time_t should die in fire */ | 311 | /* things with crappy time_t should die in fire */ |
312 | int64_t a = timegm(&tm); | ||
318 | int64_t b = att->time; | 313 | int64_t b = att->time; |
319 | fprintf(stderr, "FAIL: test %d - times don't match, " | 314 | fprintf(stderr, "FAIL: test %d - times don't match, expected %lld got %lld\n", |
320 | "expected %lld got %lld\n", | ||
321 | test_no, (long long)b, (long long)a); | 315 | test_no, (long long)b, (long long)a); |
322 | goto done; | 316 | goto done; |
323 | } | 317 | } |