diff options
author | tb <> | 2023-03-02 20:18:40 +0000 |
---|---|---|
committer | tb <> | 2023-03-02 20:18:40 +0000 |
commit | 7629f9e9832905462fa17486da1974c090cead50 (patch) | |
tree | 2d13e0f86168339135a5a8c797a859a4714aac66 | |
parent | d6a4b295d5e43ec0e0b7ea6aa5f73c24afc03cbe (diff) | |
download | openbsd-7629f9e9832905462fa17486da1974c090cead50.tar.gz openbsd-7629f9e9832905462fa17486da1974c090cead50.tar.bz2 openbsd-7629f9e9832905462fa17486da1974c090cead50.zip |
evp_pkey_check: make this test silent on success
-rw-r--r-- | src/regress/lib/libcrypto/evp/evp_pkey_check.c | 31 |
1 files changed, 13 insertions, 18 deletions
diff --git a/src/regress/lib/libcrypto/evp/evp_pkey_check.c b/src/regress/lib/libcrypto/evp/evp_pkey_check.c index a186347736..7b73316b9b 100644 --- a/src/regress/lib/libcrypto/evp/evp_pkey_check.c +++ b/src/regress/lib/libcrypto/evp/evp_pkey_check.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: evp_pkey_check.c,v 1.3 2022/12/01 13:49:12 tb Exp $ */ | 1 | /* $OpenBSD: evp_pkey_check.c,v 1.4 2023/03/02 20:18:40 tb Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2021-2022 Theo Buehler <tb@openbsd.org> | 3 | * Copyright (c) 2021-2022 Theo Buehler <tb@openbsd.org> |
4 | * | 4 | * |
@@ -130,14 +130,11 @@ evp_pkey_check_rsa(void) | |||
130 | fail_soft = 1; | 130 | fail_soft = 1; |
131 | } | 131 | } |
132 | 132 | ||
133 | /* | 133 | if (ERR_peek_error() == 0) { |
134 | * Spew some garbage to stderr. | 134 | fprintf(stderr, "%s: expected some RSA errors\n", __func__); |
135 | */ | 135 | fail_soft = 1; |
136 | 136 | } | |
137 | fprintf(stderr, "We should see some errors about RSA d:\n"); | ||
138 | ERR_print_errors_fp(stderr); | ||
139 | ERR_clear_error(); | 137 | ERR_clear_error(); |
140 | fprintf(stderr, "EVP_PKEY_check test for RSA done.\n"); | ||
141 | 138 | ||
142 | failed = 0; | 139 | failed = 0; |
143 | 140 | ||
@@ -272,12 +269,10 @@ evp_pkey_check_ec(void) | |||
272 | fail_soft = 1; | 269 | fail_soft = 1; |
273 | } | 270 | } |
274 | 271 | ||
275 | /* | 272 | if (ERR_peek_error() == 0) { |
276 | * Spew some garbage to stderr. | 273 | fprintf(stderr, "%s: expected a private key error\n", __func__); |
277 | */ | 274 | fail_soft = 1; |
278 | 275 | } | |
279 | fprintf(stderr, "We should see an error about the EC private key:\n"); | ||
280 | ERR_print_errors_fp(stderr); | ||
281 | ERR_clear_error(); | 276 | ERR_clear_error(); |
282 | 277 | ||
283 | /* EVP_PKEY_public_check checks the private key (sigh), so we fail. */ | 278 | /* EVP_PKEY_public_check checks the private key (sigh), so we fail. */ |
@@ -373,12 +368,12 @@ evp_pkey_check_ec(void) | |||
373 | fail_soft = 1; | 368 | fail_soft = 1; |
374 | } | 369 | } |
375 | 370 | ||
376 | fprintf(stderr, "We should see an error on invalid group order\n"); | 371 | if (ERR_peek_error() == 0) { |
377 | ERR_print_errors_fp(stderr); | 372 | fprintf(stderr, "%s: expected a group order error\n", __func__); |
373 | fail_soft = 1; | ||
374 | } | ||
378 | ERR_clear_error(); | 375 | ERR_clear_error(); |
379 | 376 | ||
380 | fprintf(stderr, "EVP_PKEY_check test for EC done.\n"); | ||
381 | |||
382 | failed = 0; | 377 | failed = 0; |
383 | 378 | ||
384 | err: | 379 | err: |