diff options
author | Shane Lontis <shane.lontis@oracle.com> | 2020-05-07 15:31:05 +1000 |
---|---|---|
committer | Shane Lontis <shane.lontis@oracle.com> | 2020-05-07 15:31:05 +1000 |
commit | 5e77b79a8c47f0801f656cfccfcbaaa3ca1035b4 (patch) | |
tree | f93d6603fd386aa19d5536a0a66f5b882aebc7cf /crypto/evp/pmeth_gn.c | |
parent | 9f2058611f7aec733d4a476f4f28c895d9e5667b (diff) |
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 'crypto/evp/pmeth_gn.c')
-rw-r--r-- | crypto/evp/pmeth_gn.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/crypto/evp/pmeth_gn.c b/crypto/evp/pmeth_gn.c index dc1dad86ba..a775d2bee7 100644 --- a/crypto/evp/pmeth_gn.c +++ b/crypto/evp/pmeth_gn.c @@ -210,8 +210,9 @@ int EVP_PKEY_gen(EVP_PKEY_CTX *ctx, EVP_PKEY **ppkey) { char curve_name[OSSL_MAX_NAME_SIZE] = ""; - if (EVP_PKEY_CTX_get_ec_paramgen_curve_name(ctx, curve_name, - sizeof(curve_name)) < 1 + if (!EVP_PKEY_get_utf8_string_param(*ppkey, OSSL_PKEY_PARAM_EC_NAME, + curve_name, sizeof(curve_name), + NULL) || strcmp(curve_name, "SM2") != 0) goto end; } |