summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2021-02-05 13:55:50 +1000
committerShane Lontis <shane.lontis@oracle.com>2021-02-08 16:33:43 +1000
commit2db985b7b1e20ac670d196981aa7e8f31881d2eb (patch)
tree9c2a8d81fd86e6d92f497908488abb1766f93490 /providers
parent64954e2f34b8839ca7ad1e9576a6efaf3e49e17c (diff)
Simplify the EVP_PKEY_XXX_fromdata_XX methods.
The existing names such as EVP_PKEY_param_fromdata_settable were a bit confusing since the 'param' referred to key params not OSSL_PARAM. To simplify the interface a 'selection' parameter will be passed instead. The changes are: (1) EVP_PKEY_fromdata_init() replaces both EVP_PKEY_key_fromdata_init() and EVP_PKEY_param_fromdata_init(). (2) EVP_PKEY_fromdata() has an additional selection parameter. (3) EVP_PKEY_fromdata_settable() replaces EVP_PKEY_key_fromdata_settable() and EVP_PKEY_param_fromdata_settable(). EVP_PKEY_fromdata_settable() also uses a selection parameter. Fixes #12989 Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/14076)
Diffstat (limited to 'providers')
-rw-r--r--providers/fips/self_test_kats.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/providers/fips/self_test_kats.c b/providers/fips/self_test_kats.c
index d4102f25bd..c408339298 100644
--- a/providers/fips/self_test_kats.c
+++ b/providers/fips/self_test_kats.c
@@ -392,11 +392,11 @@ static int self_test_ka(const ST_KAT_KAS *t,
kactx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, "");
if (kactx == NULL)
goto err;
- if (EVP_PKEY_key_fromdata_init(kactx) <= 0
- || EVP_PKEY_fromdata(kactx, &pkey, params) <= 0)
+ if (EVP_PKEY_fromdata_init(kactx) <= 0
+ || EVP_PKEY_fromdata(kactx, &pkey, EVP_PKEY_KEYPAIR, params) <= 0)
goto err;
- if (EVP_PKEY_key_fromdata_init(kactx) <= 0
- || EVP_PKEY_fromdata(kactx, &peerkey, params_peer) <= 0)
+ if (EVP_PKEY_fromdata_init(kactx) <= 0
+ || EVP_PKEY_fromdata(kactx, &peerkey, EVP_PKEY_KEYPAIR, params_peer) <= 0)
goto err;
/* Create a EVP_PKEY_CTX to perform key derivation */
@@ -464,8 +464,8 @@ static int self_test_sign(const ST_KAT_SIGN *t,
kctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, "");
if (kctx == NULL || params == NULL)
goto err;
- if (EVP_PKEY_key_fromdata_init(kctx) <= 0
- || EVP_PKEY_fromdata(kctx, &pkey, params) <= 0)
+ if (EVP_PKEY_fromdata_init(kctx) <= 0
+ || EVP_PKEY_fromdata(kctx, &pkey, EVP_PKEY_KEYPAIR, params) <= 0)
goto err;
/* Create a EVP_PKEY_CTX to use for the signing operation */
@@ -546,8 +546,8 @@ static int self_test_asym_cipher(const ST_KAT_ASYM_CIPHER *t, OSSL_SELF_TEST *st
keyctx = EVP_PKEY_CTX_new_from_name(libctx, t->algorithm, NULL);
if (keyctx == NULL || keyparams == NULL)
goto err;
- if (EVP_PKEY_key_fromdata_init(keyctx) <= 0
- || EVP_PKEY_fromdata(keyctx, &key, keyparams) <= 0)
+ if (EVP_PKEY_fromdata_init(keyctx) <= 0
+ || EVP_PKEY_fromdata(keyctx, &key, EVP_PKEY_KEYPAIR, keyparams) <= 0)
goto err;
/* Create a EVP_PKEY_CTX to use for the encrypt or decrypt operation */