aboutsummaryrefslogtreecommitdiff
path: root/test/ectest.c
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 /test/ectest.c
parent64954e2f34b8839ca7ad1e9576a6efaf3e49e17c (diff)
downloadopenssl-2db985b7b1e20ac670d196981aa7e8f31881d2eb.zip
openssl-2db985b7b1e20ac670d196981aa7e8f31881d2eb.tar.gz
openssl-2db985b7b1e20ac670d196981aa7e8f31881d2eb.tar.bz2
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 'test/ectest.c')
-rw-r--r--test/ectest.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/test/ectest.c b/test/ectest.c
index e00e7c2..6d08d04 100644
--- a/test/ectest.c
+++ b/test/ectest.c
@@ -2409,8 +2409,9 @@ static int do_test_custom_explicit_fromdata(EC_GROUP *group, BN_CTX *ctx,
if (!TEST_ptr(params = OSSL_PARAM_BLD_to_param(bld))
|| !TEST_ptr(pctx = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL))
- || !TEST_int_gt(EVP_PKEY_param_fromdata_init(pctx), 0)
- || !TEST_int_gt(EVP_PKEY_fromdata(pctx, &pkeyparam, params), 0))
+ || !TEST_int_gt(EVP_PKEY_fromdata_init(pctx), 0)
+ || !TEST_int_gt(EVP_PKEY_fromdata(pctx, &pkeyparam,
+ EVP_PKEY_KEY_PARAMETERS, params), 0))
goto err;
/*- Check that all the set values are retrievable -*/
@@ -2869,9 +2870,11 @@ static int custom_params_test(int id)
/* create two new provider-native `EVP_PKEY`s */
EVP_PKEY_CTX_free(pctx2);
if (!TEST_ptr(pctx2 = EVP_PKEY_CTX_new_from_name(NULL, "EC", NULL))
- || !TEST_true(EVP_PKEY_key_fromdata_init(pctx2))
- || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey1, params1))
- || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey2, params2)))
+ || !TEST_true(EVP_PKEY_fromdata_init(pctx2))
+ || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey1, EVP_PKEY_KEYPAIR,
+ params1))
+ || !TEST_true(EVP_PKEY_fromdata(pctx2, &pkey2, EVP_PKEY_PUBLIC_KEY,
+ params2)))
goto err;
/* compute keyexchange once more using the provider keys */