From: beck Date: Thu, 30 Jun 2022 08:41:01 +0000 (+0000) Subject: add valid utc time that should fail to parse as generalized X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=31c2cd2bc0ead6277ed77d0e9c166becb627cdf5;p=openbsd add valid utc time that should fail to parse as generalized --- 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");