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
@@ -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 */
