diff options
author | Matt Caswell <matt@openssl.org> | 2021-05-28 11:07:24 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2021-06-08 18:53:39 +0100 |
commit | b2f1b36592806afcaae79289c33756fb0af5b4ca (patch) | |
tree | 35073737fd3e45fe90a2bc3c6399d7ca61e429c7 /crypto/asn1 | |
parent | 237cb05d342338ac42852cfdec21b900458a537c (diff) |
Actually use a legacy route in pem_read_bio_key_legacy()
The function pem_read_bio_key_legacy() is a fallback route if we
failed to load a key via a provider. We should be using the legacy
specific d2i functions to force legacy otherwise we end up using a
provider anyway
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15504)
Diffstat (limited to 'crypto/asn1')
-rw-r--r-- | crypto/asn1/d2i_pr.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/crypto/asn1/d2i_pr.c b/crypto/asn1/d2i_pr.c index 58b7646227..3b28460d4b 100644 --- a/crypto/asn1/d2i_pr.c +++ b/crypto/asn1/d2i_pr.c @@ -74,9 +74,9 @@ err: return NULL; } -static EVP_PKEY * -d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a, const unsigned char **pp, - long length, OSSL_LIB_CTX *libctx, const char *propq) +EVP_PKEY * +ossl_d2i_PrivateKey_legacy(int keytype, EVP_PKEY **a, const unsigned char **pp, + long length, OSSL_LIB_CTX *libctx, const char *propq) { EVP_PKEY *ret; const unsigned char *p = *pp; @@ -149,7 +149,7 @@ EVP_PKEY *d2i_PrivateKey_ex(int keytype, EVP_PKEY **a, const unsigned char **pp, ret = d2i_PrivateKey_decoder(keytype, a, pp, length, libctx, propq); /* try the legacy path if the decoder failed */ if (ret == NULL) - ret = d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq); + ret = ossl_d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq); return ret; } @@ -208,7 +208,7 @@ static EVP_PKEY *d2i_AutoPrivateKey_legacy(EVP_PKEY **a, keytype = EVP_PKEY_RSA; } sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free); - return d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq); + return ossl_d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq); } /* |