Rename EVP_PKEY_new_private_key()/EVP_PKEY_new_public_key()
authorMatt Caswell <matt@openssl.org>
Thu, 15 Mar 2018 12:19:16 +0000 (12:19 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 15 Mar 2018 12:47:27 +0000 (12:47 +0000)
Renamed to EVP_PKEY_new_raw_private_key()/EVP_new_raw_public_key() as per
feedback.

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/5520)

18 files changed:
apps/dgst.c
crypto/err/openssl.txt
crypto/evp/evp_err.c
crypto/evp/p_lib.c
crypto/kdf/tls1_prf.c
doc/man3/EVP_PKEY_ASN1_METHOD.pod
doc/man3/EVP_PKEY_CTX_ctrl.pod
doc/man3/EVP_PKEY_new.pod
doc/man7/Ed25519.pod
doc/man7/X25519.pod
include/openssl/evp.h
include/openssl/evperr.h
ssl/statem/extensions.c
ssl/statem/extensions_srvr.c
ssl/t1_enc.c
ssl/tls13_enc.c
test/evp_test.c
util/libcrypto.num

index d5646c91e25bbfe0ed1a715ee9ea0e1494369934..4bf20f33e5fe877d97682afbd63ceae103948333 100644 (file)
@@ -277,8 +277,8 @@ int dgst_main(int argc, char **argv)
     }
 
     if (hmac_key != NULL) {
-        sigkey = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, impl,
-                                          (unsigned char *)hmac_key, -1);
+        sigkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, impl,
+                                              (unsigned char *)hmac_key, -1);
         if (sigkey == NULL)
             goto end;
     }
index 1e396adfe12b43de451bb6e7b5b47e78766f2dc1..896c089da6a38c453b304682deeb76c5497b2b4b 100644 (file)
@@ -704,8 +704,8 @@ EVP_F_EVP_PKEY_KEYGEN:146:EVP_PKEY_keygen
 EVP_F_EVP_PKEY_KEYGEN_INIT:147:EVP_PKEY_keygen_init
 EVP_F_EVP_PKEY_NEW:106:EVP_PKEY_new
 EVP_F_EVP_PKEY_NEW_CMAC_KEY:193:EVP_PKEY_new_CMAC_key
-EVP_F_EVP_PKEY_NEW_PRIVATE_KEY:191:EVP_PKEY_new_private_key
-EVP_F_EVP_PKEY_NEW_PUBLIC_KEY:192:EVP_PKEY_new_public_key
+EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY:191:EVP_PKEY_new_raw_private_key
+EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY:192:EVP_PKEY_new_raw_public_key
 EVP_F_EVP_PKEY_PARAMGEN:148:EVP_PKEY_paramgen
 EVP_F_EVP_PKEY_PARAMGEN_INIT:149:EVP_PKEY_paramgen_init
 EVP_F_EVP_PKEY_PARAM_CHECK:189:EVP_PKEY_param_check
index 7ab2a249fd3fb2bf63e2f8d0fc9cf405cc344f6a..8678abd5b417f90efba3b623f9b3440c7f57bb64 100644 (file)
@@ -95,10 +95,10 @@ static const ERR_STRING_DATA EVP_str_functs[] = {
     {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW, 0), "EVP_PKEY_new"},
     {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW_CMAC_KEY, 0),
      "EVP_PKEY_new_CMAC_key"},
-    {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW_PRIVATE_KEY, 0),
-     "EVP_PKEY_new_private_key"},
-    {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW_PUBLIC_KEY, 0),
-     "EVP_PKEY_new_public_key"},
+    {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY, 0),
+     "EVP_PKEY_new_raw_private_key"},
+    {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY, 0),
+     "EVP_PKEY_new_raw_public_key"},
     {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_PARAMGEN, 0), "EVP_PKEY_paramgen"},
     {ERR_PACK(ERR_LIB_EVP, EVP_F_EVP_PKEY_PARAMGEN_INIT, 0),
      "EVP_PKEY_paramgen_init"},
index 073d2df8884db3f67d9e3e3e8c8b78546ecb7ae0..c1b3393aa92f85acaf807f5eebd7ae6759a56702 100644 (file)
@@ -220,9 +220,9 @@ static int pkey_set_type(EVP_PKEY *pkey, ENGINE *e, int type, const char *str,
     return 1;
 }
 
-EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
-                                   const unsigned char *priv,
-                                   size_t len)
+EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
+                                       const unsigned char *priv,
+                                       size_t len)
 {
     EVP_PKEY *ret = EVP_PKEY_new();
 
@@ -233,13 +233,13 @@ EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
     }
 
     if (ret->ameth->set_priv_key == NULL) {
-        EVPerr(EVP_F_EVP_PKEY_NEW_PRIVATE_KEY,
+        EVPerr(EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY,
                EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
         goto err;
     }
 
     if (!ret->ameth->set_priv_key(ret, priv, len)) {
-        EVPerr(EVP_F_EVP_PKEY_NEW_PRIVATE_KEY, EVP_R_KEY_SETUP_FAILED);
+        EVPerr(EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY, EVP_R_KEY_SETUP_FAILED);
         goto err;
     }
 
@@ -250,9 +250,9 @@ EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
     return NULL;
 }
 
-EVP_PKEY *EVP_PKEY_new_public_key(int type, ENGINE *e,
-                                  const unsigned char *pub,
-                                  size_t len)
+EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
+                                      const unsigned char *pub,
+                                      size_t len)
 {
     EVP_PKEY *ret = EVP_PKEY_new();
 
@@ -263,13 +263,13 @@ EVP_PKEY *EVP_PKEY_new_public_key(int type, ENGINE *e,
     }
 
     if (ret->ameth->set_pub_key == NULL) {
-        EVPerr(EVP_F_EVP_PKEY_NEW_PUBLIC_KEY,
+        EVPerr(EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY,
                EVP_R_OPERATION_NOT_SUPPORTED_FOR_THIS_KEYTYPE);
         goto err;
     }
 
     if (!ret->ameth->set_pub_key(ret, pub, len)) {
-        EVPerr(EVP_F_EVP_PKEY_NEW_PUBLIC_KEY, EVP_R_KEY_SETUP_FAILED);
+        EVPerr(EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY, EVP_R_KEY_SETUP_FAILED);
         goto err;
     }
 
index f618362c0a2c6b4f6bb07dbe1021357d37d113eb..fb7d2ce36f544127dca1b31e1375369ca2c3f3ca 100644 (file)
@@ -193,7 +193,7 @@ static int tls1_prf_P_hash(const EVP_MD *md,
     if (ctx == NULL || ctx_tmp == NULL || ctx_init == NULL)
         goto err;
     EVP_MD_CTX_set_flags(ctx_init, EVP_MD_CTX_FLAG_NON_FIPS_ALLOW);
-    mac_key = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL, sec, sec_len);
+    mac_key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, sec, sec_len);
     if (mac_key == NULL)
         goto err;
     if (!EVP_DigestSignInit(ctx_init, NULL, md, NULL, mac_key))
index 9b635c480ef6c108f8f297c29deae2cf06cffdc5..eb15e4288dddc31646afcd7dbbd44f0c09e10eb7 100644 (file)
@@ -345,8 +345,8 @@ L<EVP_PKEY_param_check(3)> respectively.
 
 The set_priv_key() and set_pub_key() methods are used to set the raw private and
 public key data for an EVP_PKEY. They MUST return 0 on error, or 1 on success.
-They are called by L<EVP_PKEY_new_private_key(3)>, and
-L<EVP_PKEY_new_public_key(3)> respectively.
+They are called by L<EVP_PKEY_new_raw_private_key(3)>, and
+L<EVP_PKEY_new_raw_public_key(3)> respectively.
 
 =head2 Functions
 
index ed4fd80917df3b53258c0d8832d74c8f5ec66abf..bfc5c85c49b36e1cb432e18a3783e48e8a68bf4f 100644 (file)
@@ -88,10 +88,10 @@ allow private key data to be set explicitly using the EVP_PKEY_CTX_set_mac_key()
 macro. In this case key generation is simply the process of setting up the
 parameters for the key and then setting the raw key data to the value explicitly
 provided by that macro. Normally applications would call
-L<EVP_PKEY_new_private_key(3)> or similar functions instead of this macro.
+L<EVP_PKEY_new_raw_private_key(3)> or similar functions instead of this macro.
 
 The EVP_PKEY_CTX_set_mac_key() macro can be used with any of the algorithms
-supported by the L<EVP_PKEY_new_private_key(3)> function.
+supported by the L<EVP_PKEY_new_raw_private_key(3)> function.
 
 The macro EVP_PKEY_CTX_set_rsa_padding() sets the RSA padding mode for B<ctx>.
 The B<pad> parameter can take the value RSA_PKCS1_PADDING for PKCS#1 padding,
index e426a38c98562bfe5c082eec5428d6b27de06152..98a0dd158a7d977e71da7ed423a294f62abfb998 100644 (file)
@@ -5,8 +5,8 @@
 EVP_PKEY_new,
 EVP_PKEY_up_ref,
 EVP_PKEY_free,
-EVP_PKEY_new_private_key,
-EVP_PKEY_new_public_key,
+EVP_PKEY_new_raw_private_key,
+EVP_PKEY_new_raw_public_key,
 EVP_PKEY_new_CMAC_key,
 EVP_PKEY_new_mac_key
 - public/private key allocation functions
@@ -19,10 +19,10 @@ EVP_PKEY_new_mac_key
  int EVP_PKEY_up_ref(EVP_PKEY *key);
  void EVP_PKEY_free(EVP_PKEY *key);
 
- EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
-                                    const unsigned char *key, size_t keylen);
- EVP_PKEY *EVP_PKEY_new_public_key(int type, ENGINE *e,
-                                   const unsigned char *key, size_t keylen);
+ EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
+                                        const unsigned char *key, size_t keylen);
+ EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
+                                       const unsigned char *key, size_t keylen);
  EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
                                  size_t len, const EVP_CIPHER *cipher);
  EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e, const unsigned char *key,
@@ -38,10 +38,10 @@ EVP_PKEY_up_ref() increments the reference count of B<key>.
 EVP_PKEY_free() decrements the reference count of B<key> and, if the reference
 count is zero, frees it up. If B<key> is NULL, nothing is done.
 
-EVP_PKEY_new_private_key() allocates a new B<EVP_PKEY>. If B<e> is non-NULL then
-the new B<EVP_PKEY> structure is associated with the engine B<e>. The B<type>
-argument indicates what kind of key this is. The value should be a NID for a
-public key algorithm that supports raw private keys, i.e. one of
+EVP_PKEY_new_raw_private_key() allocates a new B<EVP_PKEY>. If B<e> is non-NULL
+then the new B<EVP_PKEY> structure is associated with the engine B<e>. The
+B<type> argument indicates what kind of key this is. The value should be a NID
+for a public key algorithm that supports raw private keys, i.e. one of
 B<EVP_PKEY_HMAC>, B<EVP_PKEY_POLY1305>, B<EVP_PKEY_SIPHASH>, B<EVP_PKEY_X25519>,
 B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>. B<key> points to the
 raw private key data for this B<EVP_PKEY> which should be of length B<keylen>.
@@ -49,19 +49,19 @@ The length should be appropriate for the type of the key. The public key data
 will be automatically derived from the given private key data (if appropriate
 for the algorithm type).
 
-EVP_PKEY_new_public_key() works in the same way as EVP_PKEY_new_private_key()
-except that B<key> points to the raw public key data. The B<EVP_PKEY> structure
-will be initialised without any private key information. Algorithm types that
-support raw public keys are B<EVP_PKEY_X25519>, B<EVP_PKEY_ED25519>,
-B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>.
+EVP_PKEY_new_raw_public_key() works in the same way as
+EVP_PKEY_new_raw_private_key() except that B<key> points to the raw public key
+data. The B<EVP_PKEY> structure will be initialised without any private key
+information. Algorithm types that support raw public keys are
+B<EVP_PKEY_X25519>, B<EVP_PKEY_ED25519>, B<EVP_PKEY_X448> or B<EVP_PKEY_ED448>.
 
-EVP_PKEY_new_CMAC_key() works in the same way as EVP_PKEY_new_private_key()
+EVP_PKEY_new_CMAC_key() works in the same way as EVP_PKEY_new_raw_private_key()
 except it is only for the B<EVP_PKEY_CMAC> algorithm type. In addition to the
 raw private key data, it also takes a cipher algorithm to be used during
 creation of a CMAC in the B<cipher> argument.
 
-EVP_PKEY_new_mac_key() works in the same way as EVP_PKEY_new_private_key(). New
-applications should use EVP_PKEY_new_private_key() instead.
+EVP_PKEY_new_mac_key() works in the same way as EVP_PKEY_new_raw_private_key().
+New applications should use EVP_PKEY_new_raw_private_key() instead.
 
 =head1 NOTES
 
@@ -74,7 +74,7 @@ used.
 
 =head1 RETURN VALUES
 
-EVP_PKEY_new(), EVP_PKEY_new_private_key(), EVP_PKEY_new_public_key(),
+EVP_PKEY_new(), EVP_PKEY_new_raw_private_key(), EVP_PKEY_new_raw_public_key(),
 EVP_PKEY_new_CMAC_key() and EVP_PKEY_new_mac_key() return either the newly
 allocated B<EVP_PKEY> structure or B<NULL> if an error occurred.
 
@@ -88,9 +88,9 @@ L<EVP_PKEY_set1_RSA(3)>
 
 EVP_PKEY_new() and EVP_PKEY_free() exist in all versions of OpenSSL.
 
-EVP_PKEY_up_ref() was first added to OpenSSL 1.1.0. EVP_PKEY_new_private_key(),
-EVP_PKEY_new_public_key() and EVP_PKEY_new_CMAC_key() were first added to
-OpenSSL 1.1.1.
+EVP_PKEY_up_ref() was first added to OpenSSL 1.1.0.
+EVP_PKEY_new_raw_private_key(), EVP_PKEY_new_raw_public_key() and
+EVP_PKEY_new_CMAC_key() were first added to OpenSSL 1.1.1.
 
 =head1 COPYRIGHT
 
index f2f6fb2a326b7a090dc753100be704a2dfe732e5..eacc05f2ed1a11e42b5ce7098ac7bb326d8f057d 100644 (file)
@@ -40,14 +40,14 @@ For the B<Ed448> algorithm a context can be obtained by calling:
  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_ED448, NULL);
 
 Ed25519 or Ed448 private keys can be set directly using
-L<EVP_PKEY_new_private_key(3)> or loaded from a PKCS#8 private key file using
-L<PEM_read_bio_PrivateKey(3)> (or similar function). Completely new keys can
-also be generated (see the example below). Setting a private key also sets the
-associated public key.
+L<EVP_PKEY_new_raw_private_key(3)> or loaded from a PKCS#8 private key file
+using L<PEM_read_bio_PrivateKey(3)> (or similar function). Completely new keys
+can also be generated (see the example below). Setting a private key also sets
+the associated public key.
 
 Ed25519 or Ed448 public keys can be set directly using
-L<EVP_PKEY_new_public_key(3)> or loaded from a SubjectPublicKeyInfo structure
-in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function).
+L<EVP_PKEY_new_raw_public_key(3)> or loaded from a SubjectPublicKeyInfo
+structure in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function).
 
 =head1 EXAMPLE
 
index f1a9c4928ed8e75438325ea68c3bc2b47796ad35..7cb6ff6b3bed09927f7cedb9570ae6ec3972c489 100644 (file)
@@ -28,14 +28,14 @@ For the B<X448> algorithm a context can be obtained by calling:
  EVP_PKEY_CTX *pctx = EVP_PKEY_CTX_new_id(EVP_PKEY_X448, NULL);
 
 X25519 or X448 private keys can be set directly using
-L<EVP_PKEY_new_private_key(3)> or loaded from a PKCS#8 private key file using
-L<PEM_read_bio_PrivateKey(3)> (or similar function). Completely new keys can
-also be generated (see the example below). Setting a private key also sets the
-associated public key.
+L<EVP_PKEY_new_raw_private_key(3)> or loaded from a PKCS#8 private key file
+using L<PEM_read_bio_PrivateKey(3)> (or similar function). Completely new keys
+can also be generated (see the example below). Setting a private key also sets
+the associated public key.
 
 X25519 or X448 public keys can be set directly using
-L<EVP_PKEY_new_public_key(3)> or loaded from a SubjectPublicKeyInfo structure
-in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function).
+L<EVP_PKEY_new_raw_public_key(3)> or loaded from a SubjectPublicKeyInfo
+structure in a PEM file using L<PEM_read_bio_PUBKEY(3)> (or similar function).
 
 =head1 EXAMPLE
 
index 055f2b7df369f9fc5fde92afc16d5ae0e9285746..8b81b1236259bc5c7e07485ccbcc1ec2513a0bdd 100644 (file)
@@ -1347,12 +1347,12 @@ void EVP_PKEY_CTX_set0_keygen_info(EVP_PKEY_CTX *ctx, int *dat, int datlen);
 
 EVP_PKEY *EVP_PKEY_new_mac_key(int type, ENGINE *e,
                                const unsigned char *key, int keylen);
-EVP_PKEY *EVP_PKEY_new_private_key(int type, ENGINE *e,
-                                   const unsigned char *priv,
-                                   size_t len);
-EVP_PKEY *EVP_PKEY_new_public_key(int type, ENGINE *e,
-                                  const unsigned char *pub,
-                                  size_t len);
+EVP_PKEY *EVP_PKEY_new_raw_private_key(int type, ENGINE *e,
+                                       const unsigned char *priv,
+                                       size_t len);
+EVP_PKEY *EVP_PKEY_new_raw_public_key(int type, ENGINE *e,
+                                      const unsigned char *pub,
+                                      size_t len);
 EVP_PKEY *EVP_PKEY_new_CMAC_key(ENGINE *e, const unsigned char *priv,
                                 size_t len, const EVP_CIPHER *cipher);
 
index 3cdd554f31d9980badf4383997e37bcafd4d79f7..b269a8e0deef7e5b825217e354e69770cf54b24e 100644 (file)
@@ -79,8 +79,8 @@ int ERR_load_EVP_strings(void);
 # define EVP_F_EVP_PKEY_KEYGEN_INIT                       147
 # define EVP_F_EVP_PKEY_NEW                               106
 # define EVP_F_EVP_PKEY_NEW_CMAC_KEY                      193
-# define EVP_F_EVP_PKEY_NEW_PRIVATE_KEY                   191
-# define EVP_F_EVP_PKEY_NEW_PUBLIC_KEY                    192
+# define EVP_F_EVP_PKEY_NEW_RAW_PRIVATE_KEY               191
+# define EVP_F_EVP_PKEY_NEW_RAW_PUBLIC_KEY                192
 # define EVP_F_EVP_PKEY_PARAMGEN                          148
 # define EVP_F_EVP_PKEY_PARAMGEN_INIT                     149
 # define EVP_F_EVP_PKEY_PARAM_CHECK                       189
index 9b8fc43bf1c1c4593b25190267cf8c467c97acfb..7f9fd5f02e0453d588cd2ce5ddf402309bbf0e6f 100644 (file)
@@ -1559,8 +1559,8 @@ int tls_psk_do_binder(SSL *s, const EVP_MD *md, const unsigned char *msgstart,
         goto err;
     }
 
-    mackey = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL, finishedkey,
-                                      hashsize);
+    mackey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL, finishedkey,
+                                          hashsize);
     if (mackey == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_PSK_DO_BINDER,
                  ERR_R_INTERNAL_ERROR);
index 0f997c40f552e7362c7fe4f937d6b6749ff16a7b..7c9a3f7a6a66079fe6c70e8ab0d1f236cac80da4 100644 (file)
@@ -752,9 +752,10 @@ int tls_parse_ctos_cookie(SSL *s, PACKET *pkt, unsigned int context, X509 *x,
 
     /* Verify the HMAC of the cookie */
     hctx = EVP_MD_CTX_create();
-    pkey = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL,
-                                    s->session_ctx->ext.cookie_hmac_key,
-                                    sizeof(s->session_ctx->ext.cookie_hmac_key));
+    pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL,
+                                        s->session_ctx->ext.cookie_hmac_key,
+                                        sizeof(s->session_ctx->ext
+                                               .cookie_hmac_key));
     if (hctx == NULL || pkey == NULL) {
         EVP_MD_CTX_free(hctx);
         EVP_PKEY_free(pkey);
@@ -1762,9 +1763,10 @@ EXT_RETURN tls_construct_stoc_cookie(SSL *s, WPACKET *pkt, unsigned int context,
 
     /* HMAC the cookie */
     hctx = EVP_MD_CTX_create();
-    pkey = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL,
-                                    s->session_ctx->ext.cookie_hmac_key,
-                                    sizeof(s->session_ctx->ext.cookie_hmac_key));
+    pkey = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL,
+                                        s->session_ctx->ext.cookie_hmac_key,
+                                        sizeof(s->session_ctx->ext
+                                               .cookie_hmac_key));
     if (hctx == NULL || pkey == NULL) {
         SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_TLS_CONSTRUCT_STOC_COOKIE,
                  ERR_R_MALLOC_FAILURE);
index a9e28bcd9066158e9444a01ecd448829fa9894e7..bd7ff50c2137a17fece6edd120abdb5abcb89c50 100644 (file)
@@ -257,8 +257,8 @@ int tls1_change_cipher_state(SSL *s, int which)
 
     if (!(EVP_CIPHER_flags(c) & EVP_CIPH_FLAG_AEAD_CIPHER)) {
         /* TODO(size_t): Convert this function */
-        mac_key = EVP_PKEY_new_private_key(mac_type, NULL,
-                                           mac_secret, (int)*mac_secret_size);
+        mac_key = EVP_PKEY_new_raw_private_key(mac_type, NULL, mac_secret,
+                                               (int)*mac_secret_size);
         if (mac_key == NULL
             || EVP_DigestSignInit(mac_ctx, NULL, m, NULL, mac_key) <= 0) {
             EVP_PKEY_free(mac_key);
index 23a2c59ecfde2e9f318c4c266002ca8bb5036848..08fbee59fa9eb1c124fe02e9ae5f781d2328d7c2 100644 (file)
@@ -248,11 +248,11 @@ size_t tls13_final_finish_mac(SSL *s, const char *str, size_t slen,
     }
 
     if (str == s->method->ssl3_enc->server_finished_label)
-        key = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL,
-                                   s->server_finished_secret, hashlen);
+        key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL,
+                                           s->server_finished_secret, hashlen);
     else
-        key = EVP_PKEY_new_private_key(EVP_PKEY_HMAC, NULL,
-                                   s->client_finished_secret, hashlen);
+        key = EVP_PKEY_new_raw_private_key(EVP_PKEY_HMAC, NULL,
+                                           s->client_finished_secret, hashlen);
 
     if (key == NULL
             || ctx == NULL
index a804a9f73a38db374fe4aa8cc4f99a396592be25..3e237b014bb71b16ec277b4c5851c875ff4e2dd2 100644 (file)
@@ -915,8 +915,8 @@ static int mac_test_run(EVP_TEST *t)
         key = EVP_PKEY_new_CMAC_key(NULL, expected->key, expected->key_len,
                                     EVP_get_cipherbyname(expected->alg));
     else
-        key = EVP_PKEY_new_private_key(expected->type, NULL, expected->key,
-                                       expected->key_len);
+        key = EVP_PKEY_new_raw_private_key(expected->type, NULL, expected->key,
+                                           expected->key_len);
     if (key == NULL) {
         t->err = "MAC_KEY_CREATE_ERROR";
         goto err;
@@ -2486,9 +2486,9 @@ top:
             return 0;
         }
         if (klist == &private_keys)
-            pkey = EVP_PKEY_new_private_key(nid, NULL, keybin, keylen);
+            pkey = EVP_PKEY_new_raw_private_key(nid, NULL, keybin, keylen);
         else
-            pkey = EVP_PKEY_new_public_key(nid, NULL, keybin, keylen);
+            pkey = EVP_PKEY_new_raw_public_key(nid, NULL, keybin, keylen);
         if (pkey == NULL) {
             TEST_info("Can't read %s data", pp->key);
             OPENSSL_free(keybin);
index 1c6efc7fb6199d1c8decb5143ed0a831a17dbe19..a965bb54ef570e23fc53790850ca81e1b883e39e 100644 (file)
@@ -4522,8 +4522,8 @@ OSSL_STORE_LOADER_set_find              4463      1_1_1   EXIST::FUNCTION:
 OSSL_STORE_SEARCH_free                  4464   1_1_1   EXIST::FUNCTION:
 OSSL_STORE_SEARCH_get0_digest           4465   1_1_1   EXIST::FUNCTION:
 RAND_DRBG_set_reseed_defaults           4466   1_1_1   EXIST::FUNCTION:
-EVP_PKEY_new_private_key                4467   1_1_1   EXIST::FUNCTION:
-EVP_PKEY_new_public_key                 4468   1_1_1   EXIST::FUNCTION:
+EVP_PKEY_new_raw_private_key            4467   1_1_1   EXIST::FUNCTION:
+EVP_PKEY_new_raw_public_key             4468   1_1_1   EXIST::FUNCTION:
 EVP_PKEY_new_CMAC_key                   4469   1_1_1   EXIST::FUNCTION:
 EVP_PKEY_asn1_set_set_priv_key          4470   1_1_1   EXIST::FUNCTION:
 EVP_PKEY_asn1_set_set_pub_key           4471   1_1_1   EXIST::FUNCTION: