diff options
author | tb <> | 2023-10-02 11:14:15 +0000 |
---|---|---|
committer | tb <> | 2023-10-02 11:14:15 +0000 |
commit | 084d42f169ee36fc3201abbc01a5a6e9e4720e5a (patch) | |
tree | 7fa31355a6e0ab44fe564cc20e6633a75479945d | |
parent | 77244010743d8feba675d3d49bcf943b9f239445 (diff) | |
download | openbsd-084d42f169ee36fc3201abbc01a5a6e9e4720e5a.tar.gz openbsd-084d42f169ee36fc3201abbc01a5a6e9e4720e5a.tar.bz2 openbsd-084d42f169ee36fc3201abbc01a5a6e9e4720e5a.zip |
Add some coverage for ASN1_TIME_cmp_time_t() as well
ASN1_UTCTIME_cmp_tim_t() could be done similarly, but then I have to mess
with LIBRESSL_INTERNAL. Let's do this after unlock.
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1time.c | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/src/regress/lib/libcrypto/asn1/asn1time.c b/src/regress/lib/libcrypto/asn1/asn1time.c index f21c284e1c..bb58f61722 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.19 2023/10/02 10:40:43 tb Exp $ */ | 1 | /* $OpenBSD: asn1time.c,v 1.20 2023/10/02 11:14:15 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2015 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -518,6 +518,19 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size, | |||
518 | att1->str, att2->str, time_cmp, asn1_cmp); | 518 | att1->str, att2->str, time_cmp, asn1_cmp); |
519 | comparison_failure |= 1; | 519 | comparison_failure |= 1; |
520 | } | 520 | } |
521 | |||
522 | time_cmp = ASN1_TIME_cmp_time_t(t1, att2->time); | ||
523 | if (time_cmp != asn1_cmp) { | ||
524 | fprintf(stderr, "%s vs. %lld: want %d, got %d\n", | ||
525 | att1->str, (long long)att2->time, | ||
526 | asn1_cmp, time_cmp); | ||
527 | comparison_failure |= 1; | ||
528 | } | ||
529 | |||
530 | /* | ||
531 | * XXX - add ASN1_UTCTIME_cmp_time_t later. Don't want | ||
532 | * to mess with LIBRESSL_INTERNAL right before lock. | ||
533 | */ | ||
521 | } | 534 | } |
522 | } | 535 | } |
523 | 536 | ||