Fix regression in ASN1_UTCTIME_cmp_time_t Previously, ASN1_UTCTIME_cmp_time_t would return 1 if s > t, -1 if s < t, and 0 if s == t. This behavior was broken in upstream's 904348a4922333106b613754136305db229475ea, resulting in the opposite time comparison behavior. PR#3706 (Imported from upstream's da27006df06853a33b132133699a7aa9d4277920.) Change-Id: I9c1c28ba21d82ff4b587e33b262f46be4e846ff9 Reviewed-on: https://boringssl-review.googlesource.com/4043 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/asn1/a_utctm.c b/crypto/asn1/a_utctm.c index 7a3f5f6..9304377 100644 --- a/crypto/asn1/a_utctm.c +++ b/crypto/asn1/a_utctm.c
@@ -287,7 +287,7 @@ if (!OPENSSL_gmtime(&t, &ttm)) return -2; - if (!OPENSSL_gmtime_diff(&day, &sec, &stm, &ttm)) + if (!OPENSSL_gmtime_diff(&day, &sec, &ttm, &stm)) return -2; if (day > 0)