diff options
author | Richard Levitte <levitte@openssl.org> | 2020-12-01 19:21:04 +0100 |
---|---|---|
committer | Richard Levitte <levitte@openssl.org> | 2020-12-16 11:56:38 +0100 |
commit | 565b33990cc03d757f493616c040addbedfc80f8 (patch) | |
tree | 09090928a2875229b60d02f4dd6b43bb745e9cba /crypto/evp/pmeth_lib.c | |
parent | c829c23b67308ad8e8ab677c78db1d5151106c3c (diff) |
EVP_PKEY & EC_KEY: Make EC EVP_PKEY_CTX parameter ctrls / setters more available
EVP_PKEY_CTX_set_ec_ functions were only available when EC was enabled
('no-ec' not configured). However, that makes it impossible to use
these functions with an engine or a provider that happens to implement
EC_KEY. This change solves that problem by shuffling these functions
to more appropriate places.
Partially fixes #13550
squash! EVP_PKEY & EC_KEY: Make EC EVP_PKEY_CTX parameter ctrls / setters more available
By consequence, there are a number of places where we can remove the
check of OPENSSL_NO_EC. This requires some re-arrangements of
internal tables to translate between numeric identities and names.
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/13589)
Diffstat (limited to 'crypto/evp/pmeth_lib.c')
-rw-r--r-- | crypto/evp/pmeth_lib.c | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/crypto/evp/pmeth_lib.c b/crypto/evp/pmeth_lib.c index 58ca1d1d93..3823855008 100644 --- a/crypto/evp/pmeth_lib.c +++ b/crypto/evp/pmeth_lib.c @@ -1278,7 +1278,6 @@ static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype, } } # endif -# ifndef OPENSSL_NO_EC if (keytype == EVP_PKEY_EC) { switch (cmd) { case EVP_PKEY_CTRL_EC_PARAM_ENC: @@ -1314,7 +1313,6 @@ static int legacy_ctrl_to_param(EVP_PKEY_CTX *ctx, int keytype, int optype, return EVP_PKEY_CTX_set0_ecdh_kdf_ukm(ctx, p2, p1); } } -# endif if (keytype == EVP_PKEY_RSA) { switch (cmd) { case EVP_PKEY_CTRL_RSA_OAEP_MD: @@ -1572,7 +1570,6 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name, ossl_ffc_named_group_get_name(ossl_ffc_uid_to_dh_named_group(num)); } else if (strcmp(name, "dh_pad") == 0) name = OSSL_EXCHANGE_PARAM_PAD; -# ifndef OPENSSL_NO_EC else if (strcmp(name, "ec_paramgen_curve") == 0) name = OSSL_PKEY_PARAM_GROUP_NAME; else if (strcmp(name, "ecdh_cofactor_mode") == 0) @@ -1581,7 +1578,6 @@ static int legacy_ctrl_str_to_param(EVP_PKEY_CTX *ctx, const char *name, name = OSSL_EXCHANGE_PARAM_KDF_DIGEST; else if (strcmp(name, "ec_param_enc") == 0) name = OSSL_PKEY_PARAM_EC_ENCODING; -# endif else if (strcmp(name, "N") == 0) name = OSSL_KDF_PARAM_SCRYPT_N; |