diff options
author | jsing <> | 2022-04-27 17:43:41 +0000 |
---|---|---|
committer | jsing <> | 2022-04-27 17:43:41 +0000 |
commit | a0891038a231c61f34300f962e748ef0b1b92a8b (patch) | |
tree | cd47d5fa9579a403052437e037971997dc08d843 /src/regress/lib | |
parent | d456e91e904fdcb8519b8f7668bc85d3e1467fec (diff) | |
download | openbsd-a0891038a231c61f34300f962e748ef0b1b92a8b.tar.gz openbsd-a0891038a231c61f34300f962e748ef0b1b92a8b.tar.bz2 openbsd-a0891038a231c61f34300f962e748ef0b1b92a8b.zip |
Ensure we clear the error stack before running tests that print errors.
Diffstat (limited to 'src/regress/lib')
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1complex.c | 4 | ||||
-rw-r--r-- | src/regress/lib/libcrypto/asn1/asn1x509.c | 8 |
2 files changed, 10 insertions, 2 deletions
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 @@ | |||
1 | /* $OpenBSD: asn1complex.c,v 1.1 2021/12/09 16:30:57 jsing Exp $ */ | 1 | /* $OpenBSD: asn1complex.c,v 1.2 2022/04/27 17:43:41 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2017, 2021 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -163,6 +163,8 @@ do_asn1_constructed_test(const struct asn1_constructed_test *act) | |||
163 | long err; | 163 | long err; |
164 | int failed = 1; | 164 | int failed = 1; |
165 | 165 | ||
166 | ERR_clear_error(); | ||
167 | |||
166 | p = act->asn1; | 168 | p = act->asn1; |
167 | aos = d2i_ASN1_OCTET_STRING(NULL, &p, act->asn1_len); | 169 | aos = d2i_ASN1_OCTET_STRING(NULL, &p, act->asn1_len); |
168 | if (!act->valid) { | 170 | 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 @@ | |||
1 | /* $OpenBSD: asn1x509.c,v 1.2 2022/01/12 08:45:09 tb Exp $ */ | 1 | /* $OpenBSD: asn1x509.c,v 1.3 2022/04/27 17:43:41 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> | 3 | * Copyright (c) 2017 Joel Sing <jsing@openbsd.org> |
4 | * | 4 | * |
@@ -163,6 +163,8 @@ dsa_pubkey_test(void) | |||
163 | int failure = 1; | 163 | int failure = 1; |
164 | int len; | 164 | int len; |
165 | 165 | ||
166 | ERR_clear_error(); | ||
167 | |||
166 | if ((bio_mem = BIO_new_mem_buf((void *)dsa_test_key, -1)) == NULL) | 168 | if ((bio_mem = BIO_new_mem_buf((void *)dsa_test_key, -1)) == NULL) |
167 | errx(1, "failed to create BIO"); | 169 | errx(1, "failed to create BIO"); |
168 | 170 | ||
@@ -288,6 +290,8 @@ ec_pubkey_test(void) | |||
288 | int failure = 1; | 290 | int failure = 1; |
289 | int len; | 291 | int len; |
290 | 292 | ||
293 | ERR_clear_error(); | ||
294 | |||
291 | if ((bio_mem = BIO_new_mem_buf((void *)ec_test_key, -1)) == NULL) | 295 | if ((bio_mem = BIO_new_mem_buf((void *)ec_test_key, -1)) == NULL) |
292 | errx(1, "failed to create BIO"); | 296 | errx(1, "failed to create BIO"); |
293 | 297 | ||
@@ -437,6 +441,8 @@ rsa_pubkey_test(void) | |||
437 | int failure = 1; | 441 | int failure = 1; |
438 | int len; | 442 | int len; |
439 | 443 | ||
444 | ERR_clear_error(); | ||
445 | |||
440 | if ((bio_mem = BIO_new_mem_buf((void *)rsa_test_key, -1)) == NULL) | 446 | if ((bio_mem = BIO_new_mem_buf((void *)rsa_test_key, -1)) == NULL) |
441 | errx(1, "failed to create BIO"); | 447 | errx(1, "failed to create BIO"); |
442 | 448 | ||