]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Make evp_privatekey_from_binary() completely libcrypto internal
authorRichard Levitte <levitte@openssl.org>
Thu, 18 Mar 2021 12:13:47 +0000 (13:13 +0100)
committerRichard Levitte <levitte@openssl.org>
Fri, 19 Mar 2021 15:46:39 +0000 (16:46 +0100)
We also rename it to d2i_PrivateKey_legacy(), to match d2i_PrivateKey_decoder()

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/14314)

crypto/asn1/d2i_pr.c
include/crypto/evp.h

index 4da5a0c9bec8205934ec31adf41848fe119c3678..5d95c9e0429b859ce2ae8e4e6a114cd0572aaf43 100644 (file)
@@ -69,9 +69,9 @@ err:
     return NULL;
 }
 
-EVP_PKEY *evp_privatekey_from_binary(int keytype, EVP_PKEY **a,
-                                     const unsigned char **pp, long length,
-                                     OSSL_LIB_CTX *libctx, const char *propq)
+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 *ret;
     const unsigned char *p = *pp;
@@ -144,7 +144,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 = evp_privatekey_from_binary(keytype, a, pp, length, libctx, propq);
+        ret = d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq);
     return ret;
 }
 
@@ -203,7 +203,7 @@ static EVP_PKEY *d2i_AutoPrivateKey_legacy(EVP_PKEY **a,
         keytype = EVP_PKEY_RSA;
     }
     sk_ASN1_TYPE_pop_free(inkey, ASN1_TYPE_free);
-    return evp_privatekey_from_binary(keytype, a, pp, length, libctx, propq);
+    return d2i_PrivateKey_legacy(keytype, a, pp, length, libctx, propq);
 }
 
 /*
index 751b330b43afcc150541146ca83b1f1c4e1fea9a..18c50cdd33a8680dc646be9e55596188bb5447c9 100644 (file)
@@ -868,10 +868,6 @@ int evp_set_default_properties_int(OSSL_LIB_CTX *libctx, const char *propq,
 
 void evp_md_ctx_clear_digest(EVP_MD_CTX *ctx, int force);
 
-EVP_PKEY *evp_privatekey_from_binary(int keytype, EVP_PKEY **a,
-                                     const unsigned char **pp, long length,
-                                     OSSL_LIB_CTX *libctx, const char *propq);
-
 /* Three possible states: */
 # define EVP_PKEY_STATE_UNKNOWN         0
 # define EVP_PKEY_STATE_LEGACY          1