summaryrefslogtreecommitdiffstats
path: root/providers
diff options
context:
space:
mode:
authorShane Lontis <shane.lontis@oracle.com>2020-05-07 07:31:05 +0200
committerShane Lontis <shane.lontis@oracle.com>2020-05-07 07:31:05 +0200
commit5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4 (patch)
treef93d6603fd386aa19d5536a0a66f5b882aebc7cf /providers
parentRemove cipher table lookup from EVP_CipherInit_ex (diff)
downloadopenssl-5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4.tar.xz
openssl-5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4.zip
Remove gen_get_params & gen_gettable_params from keygen operation
EVP_PKEY_CTX_gettable_params() was missing code for the keygen operation. After adding it it was noticed that it is probably not required for this type, so instead the gen_get_params and gen_gettable_params have been remnoved from the provider interface. gen_get_params was only implemented for ec to get the curve name. This seems redundant since normally you would set parameters into the keygen_init() and then generate a key. Normally you would expect to extract data from the key - not the object that we just set up to do the keygen. Added a simple settable and gettable test into a test that does keygen. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/11683)
Diffstat (limited to 'providers')
-rw-r--r--providers/implementations/keymgmt/ec_kmgmt.c38
1 files changed, 0 insertions, 38 deletions
diff --git a/providers/implementations/keymgmt/ec_kmgmt.c b/providers/implementations/keymgmt/ec_kmgmt.c
index 9466b4fd0b..a48b279547 100644
--- a/providers/implementations/keymgmt/ec_kmgmt.c
+++ b/providers/implementations/keymgmt/ec_kmgmt.c
@@ -31,8 +31,6 @@ static OSSL_OP_keymgmt_gen_init_fn ec_gen_init;
static OSSL_OP_keymgmt_gen_set_template_fn ec_gen_set_template;
static OSSL_OP_keymgmt_gen_set_params_fn ec_gen_set_params;
static OSSL_OP_keymgmt_gen_settable_params_fn ec_gen_settable_params;
-static OSSL_OP_keymgmt_gen_get_params_fn ec_gen_get_params;
-static OSSL_OP_keymgmt_gen_gettable_params_fn ec_gen_gettable_params;
static OSSL_OP_keymgmt_gen_fn ec_gen;
static OSSL_OP_keymgmt_gen_cleanup_fn ec_gen_cleanup;
static OSSL_OP_keymgmt_free_fn ec_freedata;
@@ -679,39 +677,6 @@ static const OSSL_PARAM *ec_gen_settable_params(void *provctx)
return settable;
}
-static int ec_gen_get_params(void *genctx, OSSL_PARAM params[])
-{
- struct ec_gen_ctx *gctx = genctx;
- OSSL_PARAM *p;
-
- if ((p = OSSL_PARAM_locate(params, OSSL_PKEY_PARAM_EC_NAME)) != NULL) {
- int nid = EC_GROUP_get_curve_name(gctx->gen_group);
- int ret = 0;
- const char *curve_name = ec_curve_nid2name(nid);
-
- switch (p->data_type) {
- case OSSL_PARAM_UTF8_STRING:
- ret = OSSL_PARAM_set_utf8_string(p, curve_name);
- break;
- case OSSL_PARAM_UTF8_PTR:
- ret = OSSL_PARAM_set_utf8_ptr(p, curve_name);
- break;
- }
- return ret;
- }
- return 1;
-}
-
-static const OSSL_PARAM *ec_gen_gettable_params(void *provctx)
-{
- static OSSL_PARAM gettable[] = {
- { OSSL_PKEY_PARAM_EC_NAME, OSSL_PARAM_UTF8_PTR, NULL, 0, 0 },
- OSSL_PARAM_END
- };
-
- return gettable;
-}
-
static int ec_gen_assign_group(EC_KEY *ec, EC_GROUP *group)
{
if (group == NULL) {
@@ -767,9 +732,6 @@ const OSSL_DISPATCH ec_keymgmt_functions[] = {
{ OSSL_FUNC_KEYMGMT_GEN_SET_PARAMS, (void (*)(void))ec_gen_set_params },
{ OSSL_FUNC_KEYMGMT_GEN_SETTABLE_PARAMS,
(void (*)(void))ec_gen_settable_params },
- { OSSL_FUNC_KEYMGMT_GEN_GET_PARAMS, (void (*)(void))ec_gen_get_params },
- { OSSL_FUNC_KEYMGMT_GEN_GETTABLE_PARAMS,
- (void (*)(void))ec_gen_gettable_params },
{ OSSL_FUNC_KEYMGMT_GEN, (void (*)(void))ec_gen },
{ OSSL_FUNC_KEYMGMT_GEN_CLEANUP, (void (*)(void))ec_gen_cleanup },
{ OSSL_FUNC_KEYMGMT_FREE, (void (*)(void))ec_freedata },