diff options
author | Dr. David von Oheimb <David.von.Oheimb@siemens.com> | 2021-03-22 14:16:56 +0100 |
---|---|---|
committer | Dr. David von Oheimb <dev@ddvo.net> | 2021-04-08 15:18:58 +0200 |
commit | c1fd710297a21336ec0410fe86784c322945b805 (patch) | |
tree | a03b44f007e132f873630fab2bb36d153d92a8d2 /crypto/pem | |
parent | 321ac1f2973c01f4a4a2719e4400c26ff01c3231 (diff) |
d2i_PrivateKey{,_ex}() and PEM_X509_INFO_read_bio_ex(): Fix handling of RSA/DSA/EC private key
This is needed to correct d2i_PrivateKey() after it was changed by commit 576892d78f80cf9a.
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14647)
Diffstat (limited to 'crypto/pem')
-rw-r--r-- | crypto/pem/pem_info.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/pem/pem_info.c b/crypto/pem/pem_info.c index 54e29ab41f..2714009103 100644 --- a/crypto/pem/pem_info.c +++ b/crypto/pem/pem_info.c @@ -209,7 +209,8 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk, goto err; p = data; if (ptype) { - if (!d2i_PrivateKey(ptype, pp, &p, len)) { + if (d2i_PrivateKey_ex(ptype, pp, &p, len, + libctx, propq) == NULL) { ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB); goto err; } @@ -217,7 +218,7 @@ STACK_OF(X509_INFO) *PEM_X509_INFO_read_bio_ex(BIO *bp, STACK_OF(X509_INFO) *sk, ERR_raise(ERR_LIB_PEM, ERR_R_ASN1_LIB); goto err; } - } else { /* encrypted RSA data */ + } else { /* encrypted key data */ if (!PEM_get_EVP_CIPHER_INFO(header, &xi->enc_cipher)) goto err; xi->enc_data = (char *)data; |