diff options
author | tb <> | 2024-07-21 13:25:11 +0000 |
---|---|---|
committer | tb <> | 2024-07-21 13:25:11 +0000 |
commit | de2497dade37f29dbde49f4162d9cba984e350cf (patch) | |
tree | ae1341b51008e5cf0ca3d580c11aa16059539031 /src | |
parent | 2c7da7a426a5e04726c67a2b5bc323d0e8842063 (diff) | |
download | openbsd-de2497dade37f29dbde49f4162d9cba984e350cf.tar.gz openbsd-de2497dade37f29dbde49f4162d9cba984e350cf.tar.bz2 openbsd-de2497dade37f29dbde49f4162d9cba984e350cf.zip |
asn1time: indicate which comparison function failed
extracted from a diff by Kenjiro Nakayama
Diffstat (limited to 'src')
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1time.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/src/regress/lib/libcrypto/asn1/asn1time.c b/src/regress/lib/libcrypto/asn1/asn1time.c index b11a892300..7223ad9c9b 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.29 2024/05/25 18:59:03 tb Exp $ */ | 1 | /* $OpenBSD: asn1time.c,v 1.30 2024/07/21 13:25:11 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. |
@@ -581,14 +581,16 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size, | |||
581 | asn1_cmp = ASN1_TIME_compare(t1, t2); | 581 | asn1_cmp = ASN1_TIME_compare(t1, t2); |
582 | 582 | ||
583 | if (time_cmp != asn1_cmp) { | 583 | if (time_cmp != asn1_cmp) { |
584 | fprintf(stderr, "%s vs. %s: want %d, got %d\n", | 584 | fprintf(stderr, "ASN1_TIME_compare - %s vs. %s: " |
585 | "want %d, got %d\n", | ||
585 | att1->str, att2->str, time_cmp, asn1_cmp); | 586 | att1->str, att2->str, time_cmp, asn1_cmp); |
586 | comparison_failure |= 1; | 587 | comparison_failure |= 1; |
587 | } | 588 | } |
588 | 589 | ||
589 | time_cmp = ASN1_TIME_cmp_time_t(t1, att2->time); | 590 | time_cmp = ASN1_TIME_cmp_time_t(t1, att2->time); |
590 | if (time_cmp != asn1_cmp) { | 591 | if (time_cmp != asn1_cmp) { |
591 | fprintf(stderr, "%s vs. %lld: want %d, got %d\n", | 592 | fprintf(stderr, "ASN1_TIME_cmp_time_t - %s vs. %lld: " |
593 | "want %d, got %d\n", | ||
592 | att1->str, (long long)att2->time, | 594 | att1->str, (long long)att2->time, |
593 | asn1_cmp, time_cmp); | 595 | asn1_cmp, time_cmp); |
594 | comparison_failure |= 1; | 596 | comparison_failure |= 1; |
@@ -598,7 +600,8 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size, | |||
598 | if (t1->type != V_ASN1_UTCTIME) | 600 | if (t1->type != V_ASN1_UTCTIME) |
599 | asn1_cmp = -2; | 601 | asn1_cmp = -2; |
600 | if (time_cmp != asn1_cmp) { | 602 | if (time_cmp != asn1_cmp) { |
601 | fprintf(stderr, "%s vs. %lld: want %d, got %d\n", | 603 | fprintf(stderr, "ASN1_UTCTIME_cmp_time_t - %s vs. %lld: " |
604 | "want %d, got %d\n", | ||
602 | att1->str, (long long)att2->time, | 605 | att1->str, (long long)att2->time, |
603 | asn1_cmp, time_cmp); | 606 | asn1_cmp, time_cmp); |
604 | comparison_failure |= 1; | 607 | comparison_failure |= 1; |