From 8d8fee64005d0757ba75e2b24b730cfc7b8edbef Mon Sep 17 00:00:00 2001 From: Richard Levitte Date: Wed, 28 Oct 2020 19:11:24 +0100 Subject: [PATCH] PEM: Have pem_read_bio_key() set the OSSL_STORE expected type Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/13248) --- crypto/pem/pem_pkey.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 5ecae8651b4..e6c07b8fd60 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) { -- 2.47.2