From: Norbert Pocs Date: Tue, 16 Sep 2025 12:58:08 +0000 (+0200) Subject: crypto/ec: Remove ENGINE usage X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=03771bcd3f5f52e154341d6751ffd7a01fc8fa16;p=thirdparty%2Fopenssl.git crypto/ec: Remove ENGINE usage Resolves: https://github.com/openssl/project/issues/1615 Signed-off-by: Norbert Pocs Reviewed-by: Paul Dale Reviewed-by: Matt Caswell Reviewed-by: Tomas Mraz Reviewed-by: Saša Nedvědický Reviewed-by: Eugene Syromiatnikov Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/29305) --- diff --git a/crypto/ec/ec_backend.c b/crypto/ec/ec_backend.c index 1adb5062798..7abf37753e8 100644 --- a/crypto/ec/ec_backend.c +++ b/crypto/ec/ec_backend.c @@ -603,8 +603,7 @@ EC_KEY *ossl_ec_key_dup(const EC_KEY *src, int selection) return NULL; } - if ((ret = ossl_ec_key_new_method_int(src->libctx, src->propq, - NULL)) == NULL) + if ((ret = ossl_ec_key_new_method_int(src->libctx, src->propq)) == NULL) return NULL; /* copy the parameters */ diff --git a/crypto/ec/ec_key.c b/crypto/ec/ec_key.c index 238bce9fbbb..e4461474ddc 100644 --- a/crypto/ec/ec_key.c +++ b/crypto/ec/ec_key.c @@ -33,13 +33,13 @@ static int ecdsa_keygen_pairwise_test(EC_KEY *eckey, OSSL_CALLBACK *cb, #ifndef FIPS_MODULE EC_KEY *EC_KEY_new(void) { - return ossl_ec_key_new_method_int(NULL, NULL, NULL); + return ossl_ec_key_new_method_int(NULL, NULL); } #endif EC_KEY *EC_KEY_new_ex(OSSL_LIB_CTX *ctx, const char *propq) { - return ossl_ec_key_new_method_int(ctx, propq, NULL); + return ossl_ec_key_new_method_int(ctx, propq); } EC_KEY *EC_KEY_new_by_curve_name_ex(OSSL_LIB_CTX *ctx, const char *propq, diff --git a/crypto/ec/ec_kmeth.c b/crypto/ec/ec_kmeth.c index 3093feb44a6..89c4985f3e5 100644 --- a/crypto/ec/ec_kmeth.c +++ b/crypto/ec/ec_kmeth.c @@ -73,8 +73,7 @@ int EC_KEY_set_method(EC_KEY *key, const EC_KEY_METHOD *meth) return 1; } -EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq, - ENGINE *engine) +EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq) { EC_KEY *ret = OPENSSL_zalloc(sizeof(*ret)); @@ -117,9 +116,11 @@ EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq, } #ifndef FIPS_MODULE -EC_KEY *EC_KEY_new_method(ENGINE *engine) +EC_KEY *EC_KEY_new_method(ossl_unused ENGINE *engine) { - return ossl_ec_key_new_method_int(NULL, NULL, engine); + if (engine != NULL) + return NULL; + return ossl_ec_key_new_method_int(NULL, NULL); } #endif diff --git a/crypto/ec/ec_local.h b/crypto/ec/ec_local.h index 148bbc72523..80729f370f8 100644 --- a/crypto/ec/ec_local.h +++ b/crypto/ec/ec_local.h @@ -691,8 +691,7 @@ struct ec_key_method_st { #define EC_KEY_METHOD_DYNAMIC 1 -EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq, - ENGINE *engine); +EC_KEY *ossl_ec_key_new_method_int(OSSL_LIB_CTX *libctx, const char *propq); int ossl_ec_key_gen(EC_KEY *eckey); int ossl_ecdh_compute_key(unsigned char **pout, size_t *poutlen,