From 4fb9ab680e2b4d2af177cf6cbecece075cda4341 Mon Sep 17 00:00:00 2001 From: tb Date: Sun, 21 Jul 2024 13:25:11 +0000 Subject: [PATCH] asn1time: indicate which comparison function failed extracted from a diff by Kenjiro Nakayama --- regress/lib/libcrypto/asn1/asn1time.c | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/regress/lib/libcrypto/asn1/asn1time.c b/regress/lib/libcrypto/asn1/asn1time.c index b11a8923008..7223ad9c9be 100644 --- a/regress/lib/libcrypto/asn1/asn1time.c +++ b/regress/lib/libcrypto/asn1/asn1time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1time.c,v 1.29 2024/05/25 18:59:03 tb Exp $ */ +/* $OpenBSD: asn1time.c,v 1.30 2024/07/21 13:25:11 tb Exp $ */ /* * Copyright (c) 2015 Joel Sing * Copyright (c) 2024 Google Inc. @@ -581,14 +581,16 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size, asn1_cmp = ASN1_TIME_compare(t1, t2); if (time_cmp != asn1_cmp) { - fprintf(stderr, "%s vs. %s: want %d, got %d\n", + fprintf(stderr, "ASN1_TIME_compare - %s vs. %s: " + "want %d, got %d\n", att1->str, att2->str, time_cmp, asn1_cmp); comparison_failure |= 1; } time_cmp = ASN1_TIME_cmp_time_t(t1, att2->time); if (time_cmp != asn1_cmp) { - fprintf(stderr, "%s vs. %lld: want %d, got %d\n", + fprintf(stderr, "ASN1_TIME_cmp_time_t - %s vs. %lld: " + "want %d, got %d\n", att1->str, (long long)att2->time, asn1_cmp, time_cmp); comparison_failure |= 1; @@ -598,7 +600,8 @@ asn1_time_compare_families(const struct asn1_time_test *fam1, size_t fam1_size, if (t1->type != V_ASN1_UTCTIME) asn1_cmp = -2; if (time_cmp != asn1_cmp) { - fprintf(stderr, "%s vs. %lld: want %d, got %d\n", + fprintf(stderr, "ASN1_UTCTIME_cmp_time_t - %s vs. %lld: " + "want %d, got %d\n", att1->str, (long long)att2->time, asn1_cmp, time_cmp); comparison_failure |= 1; -- 2.20.1