]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Don't forget the datatype when decoding a PEM file
authorMatt Caswell <matt@openssl.org>
Thu, 5 Nov 2020 17:28:59 +0000 (17:28 +0000)
committerMatt Caswell <matt@openssl.org>
Wed, 25 Nov 2020 10:02:49 +0000 (10:02 +0000)
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)

crypto/store/store_result.c

index 175891d29f66338dab4f5afc1636ffda887b7f5f..25100e0248c71f8dc4afe339914c2abd5077aca6 100644 (file)
@@ -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 */