summaryrefslogtreecommitdiff
path: root/regress/lib/libcrypto
diff options
context:
space:
mode:
authorJoel Sing <jsing@cvs.openbsd.org>2022-04-27 17:43:42 +0000
committerJoel Sing <jsing@cvs.openbsd.org>2022-04-27 17:43:42 +0000
commit2ac98a3a81bad903dfec60a0dfa1daa39314ae50 (patch)
tree15ae92b909141e4388ecbec4f1bea6fc6ec30703 /regress/lib/libcrypto
parent7e1c51e137d21d01c49bcc9852f06b12089b116a (diff)
Ensure we clear the error stack before running tests that print errors.
Diffstat (limited to 'regress/lib/libcrypto')
-rw-r--r--regress/lib/libcrypto/asn1/asn1complex.c4
-rw-r--r--regress/lib/libcrypto/asn1/asn1x509.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/regress/lib/libcrypto/asn1/asn1complex.c b/regress/lib/libcrypto/asn1/asn1complex.c
index eaabd9e8c34..dfad345c6d2 100644
--- a/regress/lib/libcrypto/asn1/asn1complex.c
+++ b/regress/lib/libcrypto/asn1/asn1complex.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1complex.c,v 1.1 2021/12/09 16:30:57 jsing Exp $ */
+/* $OpenBSD: asn1complex.c,v 1.2 2022/04/27 17:43:41 jsing Exp $ */
/*
* Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org>
*
@@ -163,6 +163,8 @@ do_asn1_constructed_test(const struct asn1_constructed_test *act)
long err;
int failed = 1;
+ ERR_clear_error();
+
p = act->asn1;
aos = d2i_ASN1_OCTET_STRING(NULL, &p, act->asn1_len);
if (!act->valid) {
diff --git a/regress/lib/libcrypto/asn1/asn1x509.c b/regress/lib/libcrypto/asn1/asn1x509.c
index fb0ae011f23..bb9e2ecdff3 100644
--- a/regress/lib/libcrypto/asn1/asn1x509.c
+++ b/regress/lib/libcrypto/asn1/asn1x509.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: asn1x509.c,v 1.2 2022/01/12 08:45:09 tb Exp $ */
+/* $OpenBSD: asn1x509.c,v 1.3 2022/04/27 17:43:41 jsing Exp $ */
/*
* Copyright (c) 2017 Joel Sing <jsing@openbsd.org>
*
@@ -163,6 +163,8 @@ dsa_pubkey_test(void)
int failure = 1;
int len;
+ ERR_clear_error();
+
if ((bio_mem = BIO_new_mem_buf((void *)dsa_test_key, -1)) == NULL)
errx(1, "failed to create BIO");
@@ -288,6 +290,8 @@ ec_pubkey_test(void)
int failure = 1;
int len;
+ ERR_clear_error();
+
if ((bio_mem = BIO_new_mem_buf((void *)ec_test_key, -1)) == NULL)
errx(1, "failed to create BIO");
@@ -437,6 +441,8 @@ rsa_pubkey_test(void)
int failure = 1;
int len;
+ ERR_clear_error();
+
if ((bio_mem = BIO_new_mem_buf((void *)rsa_test_key, -1)) == NULL)
errx(1, "failed to create BIO");