From 31c2cd2bc0ead6277ed77d0e9c166becb627cdf5 Mon Sep 17 00:00:00 2001 From: beck Date: Thu, 30 Jun 2022 08:41:01 +0000 Subject: [PATCH] add valid utc time that should fail to parse as generalized --- regress/lib/libcrypto/asn1/asn1time.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/regress/lib/libcrypto/asn1/asn1time.c b/regress/lib/libcrypto/asn1/asn1time.c index 2bcf3d69cae..ca54087dd78 100644 --- a/regress/lib/libcrypto/asn1/asn1time.c +++ b/regress/lib/libcrypto/asn1/asn1time.c @@ -1,4 +1,4 @@ -/* $OpenBSD: asn1time.c,v 1.11 2022/06/30 08:32:26 beck Exp $ */ +/* $OpenBSD: asn1time.c,v 1.12 2022/06/30 08:41:01 beck Exp $ */ /* * Copyright (c) 2015 Joel Sing * @@ -77,6 +77,10 @@ struct asn1_time_test asn1_invgentime_tests[] = { { .str = "201612081934Z", }, + /* Valid UTC time, should fail as a generalized time */ + { + .str = "160908234300Z", + }, }; struct asn1_time_test asn1_goodtime_tests[] = { @@ -473,7 +477,7 @@ main(int argc, char **argv) fprintf(stderr, "Invalid generalized time tests...\n"); for (i = 0; i < N_INVGENTIME_TESTS; i++) { att = &asn1_invgentime_tests[i]; - failed |= asn1_invtime_test(i, att, 0); + failed |= asn1_invtime_test(i, att, 1); } fprintf(stderr, "GENERALIZEDTIME tests...\n"); -- 2.20.1