diff options
author | Richard Levitte <levitte@openssl.org> | 2020-11-08 10:25:47 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-10 10:57:16 +0100 |
commit | 00eae3f9cf4c45f3d0c6561512a51aef74ac8b3d (patch) | |
tree | ed9f12e4141d5970bc066d9a4af16017d068e3bc /crypto | |
parent | 457856f27a282a9f7ebb3a72eaedc81268f4c5bb (diff) | |
download | openssl-00eae3f9cf4c45f3d0c6561512a51aef74ac8b3d.tar.gz |
PEM: Always use PEM_def_callback() when cb == NULL in pem_read_bio_key()
Too many other functions depend on this being done.
Fixes #13340
Reviewed-by: Paul Dale <paul.dale@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13346)
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/pem/pem_pkey.c | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 214fd1267c..91f6f30cf6 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -48,12 +48,9 @@ static EVP_PKEY *pem_read_bio_key(BIO *bp, EVP_PKEY **x, return NULL; } - if (u != NULL && cb == NULL) - cb = PEM_def_callback; if (cb == NULL) - ui_method = UI_null(); - else - ui_method = allocated_ui_method = UI_UTIL_wrap_read_pem_callback(cb, 0); + cb = PEM_def_callback; + ui_method = allocated_ui_method = UI_UTIL_wrap_read_pem_callback(cb, 0); if (ui_method == NULL) return NULL; |