summaryrefslogtreecommitdiffstats
path: root/crypto/store
diff options
context:
space:
mode:
authorMatt Caswell <matt@openssl.org>2020-11-05 17:28:59 +0000
committerMatt Caswell <matt@openssl.org>2020-11-25 10:02:49 +0000
commit337ade3d2c9691aeb4a6ca1720f00346db91ac60 (patch)
tree6c2a86d5e5855dfe4887248542f51b261e82766e /crypto/store
parent403ef8cea73e9b4924dce39e3706778618507cd6 (diff)
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 <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/13329)
Diffstat (limited to 'crypto/store')
-rw-r--r--crypto/store/store_result.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/crypto/store/store_result.c b/crypto/store/store_result.c
index 175891d29f..25100e0248 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 */