From a0891038a231c61f34300f962e748ef0b1b92a8b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Wed, 27 Apr 2022 17:43:41 +0000 Subject: Ensure we clear the error stack before running tests that print errors. --- src/regress/lib/libcrypto/asn1/asn1complex.c | 4 +++- src/regress/lib/libcrypto/asn1/asn1x509.c | 8 +++++++- 2 files changed, 10 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/regress/lib/libcrypto/asn1/asn1complex.c b/src/regress/lib/libcrypto/asn1/asn1complex.c index eaabd9e8c3..dfad345c6d 100644 --- a/src/regress/lib/libcrypto/asn1/asn1complex.c +++ b/src/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 * @@ -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/src/regress/lib/libcrypto/asn1/asn1x509.c b/src/regress/lib/libcrypto/asn1/asn1x509.c index fb0ae011f2..bb9e2ecdff 100644 --- a/src/regress/lib/libcrypto/asn1/asn1x509.c +++ b/src/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 * @@ -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"); -- cgit v1.2.3-55-g6feb