diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-01-21 12:36:58 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-02-22 08:49:52 +0100 |
commit | 7f90026b3fca9cfd3d9098d358d949d37509a2e5 (patch) | |
tree | d91a6f22702f8977560f7ffec75ac0e10e942bc9 /apps/pkey.c | |
parent | 4718326a46ad460fefc5cc240a8599af4b5993c7 (diff) |
Handle NULL result of ERR_reason_error_string() in some apps
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13920)
Diffstat (limited to 'apps/pkey.c')
-rw-r--r-- | apps/pkey.c | 11 |
1 files changed, 2 insertions, 9 deletions
diff --git a/apps/pkey.c b/apps/pkey.c index 1a53447401..5cf0abe04b 100644 --- a/apps/pkey.c +++ b/apps/pkey.c @@ -258,15 +258,8 @@ int pkey_main(int argc, char **argv) * Note: at least for RSA keys if this function returns * -1, there will be no error reasons. */ - unsigned long err; - - BIO_printf(out, "Key is invalid\n"); - - while ((err = ERR_peek_error()) != 0) { - BIO_printf(out, "Detailed error: %s\n", - ERR_reason_error_string(err)); - ERR_get_error(); /* remove err from error stack */ - } + BIO_printf(bio_err, "Key is invalid\n"); + ERR_print_errors(bio_err); goto end; } } |