From: Matt Caswell Date: Thu, 5 Nov 2020 17:28:59 +0000 (+0000) Subject: Don't forget the datatype when decoding a PEM file X-Git-Tag: openssl-3.0.0-alpha9~13 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=337ade3d2c9691aeb4a6ca1720f00346db91ac60;p=thirdparty%2Fopenssl.git Don't forget the datatype when decoding a PEM file The OSSL_STORE code was forgetting the datatype that we read from the PEM header when decoding the DER. Fixes #13046 Reviewed-by: Richard Levitte (Merged from https://github.com/openssl/openssl/pull/13329) --- diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c index 175891d29f6..25100e0248c 100644 --- a/crypto/store/store_result.c +++ b/crypto/store/store_result.c @@ -274,8 +274,8 @@ static EVP_PKEY *try_key_value(struct extracted_param_data_st *data, } decoderctx = - OSSL_DECODER_CTX_new_by_EVP_PKEY(&pk, NULL, NULL, NULL, selection, - libctx, propq); + OSSL_DECODER_CTX_new_by_EVP_PKEY(&pk, "DER", NULL, data->data_type, + selection, libctx, propq); (void)OSSL_DECODER_CTX_set_passphrase_cb(decoderctx, cb, cbarg); /* No error if this couldn't be decoded */