summaryrefslogtreecommitdiff
path: root/regress/lib
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2016-12-21 15:13:30 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2016-12-21 15:13:30 +0000
commite7ef01b8e76c5e1303396dd4a7b5a55ccd2f6190 (patch)
treea3e04588fe6b11d90905b111ae6a25cb9873bf68 /regress/lib
parentfeee380330b909aee0ad7bf38319f136696274b2 (diff)
Ensure negative time/timeout are handled appropriately.
Diffstat (limited to 'regress/lib')
-rw-r--r--regress/lib/libssl/asn1/asn1test.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/regress/lib/libssl/asn1/asn1test.c b/regress/lib/libssl/asn1/asn1test.c
index f71044c62bb..946c672d745 100644
--- a/regress/lib/libssl/asn1/asn1test.c
+++ b/regress/lib/libssl/asn1/asn1test.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1test.c,v 1.3 2014/12/07 20:00:13 bcook Exp $ */
+/* $OpenBSD: asn1test.c,v 1.4 2016/12/21 15:13:29 jsing Exp $ */
/*
* Copyright (c) 2014 Joel Sing <jsing@openbsd.org>
*
@@ -165,6 +165,28 @@ struct ssl_asn1_test ssl_asn1_tests[] = {
},
348,
},
+ {
+ {
+ .cipher_id = 0x03000000L | 1,
+ .ssl_version = TLS1_2_VERSION,
+ .timeout = -1,
+ },
+ {
+ 0x0,
+ },
+ -1,
+ },
+ {
+ {
+ .cipher_id = 0x03000000L | 1,
+ .ssl_version = TLS1_2_VERSION,
+ .time = -1,
+ },
+ {
+ 0x0,
+ },
+ -1,
+ },
};
#define N_SSL_ASN1_TESTS \
@@ -295,6 +317,10 @@ do_ssl_asn1_test(int test_no, struct ssl_asn1_test *sat)
goto failed;
}
+ /* See if the test is expected to fail... */
+ if (sat->asn1_len == -1)
+ return (0);
+
if ((asn1 = malloc(len)) == NULL)
errx(1, "failed to allocate memory");