diff options
author | Richard Levitte <levitte@openssl.org> | 2020-10-28 19:11:24 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-11-11 11:42:06 +0100 |
commit | 8d8fee64005d0757ba75e2b24b730cfc7b8edbef (patch) | |
tree | 004c2ac45f8306edba6855147865c242b4e3f745 /crypto/pem/pem_pkey.c | |
parent | Restore the legacy implementation of PEM_read_bio_DHparams() (diff) | |
download | openssl-8d8fee64005d0757ba75e2b24b730cfc7b8edbef.tar.xz openssl-8d8fee64005d0757ba75e2b24b730cfc7b8edbef.zip |
PEM: Have pem_read_bio_key() set the OSSL_STORE expected type
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/13248)
Diffstat (limited to '')
-rw-r--r-- | crypto/pem/pem_pkey.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 5ecae8651b..e6c07b8fd6 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c @@ -67,6 +67,9 @@ static EVP_PKEY *pem_read_bio_key(BIO *bp, EVP_PKEY **x, # endif #endif + if (!OSSL_STORE_expect(ctx, expected_store_info_type)) + goto err; + while (!OSSL_STORE_eof(ctx) && (info = OSSL_STORE_load(ctx)) != NULL) { if (OSSL_STORE_INFO_get_type(info) == expected_store_info_type) { |