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)
diff --git a/crypto/pem/pem_pkey.c b/crypto/pem/pem_pkey.c index 5ecae86..e6c07b8 100644 --- a/crypto/pem/pem_pkey.c +++ b/crypto/pem/pem_pkey.c
@@ -67,6 +67,9 @@ # 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) {