]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
crypto/ec: Remove ENGINE usage
authorNorbert Pocs <norbertp@openssl.org>
Tue, 16 Sep 2025 12:58:08 +0000 (14:58 +0200)
committerNeil Horman <nhorman@openssl.org>
Fri, 3 Oct 2025 17:00:27 +0000 (13:00 -0400)
Resolves: https://github.com/openssl/project/issues/1615

Signed-off-by: Norbert Pocs <norbertp@openssl.org>
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/28570)

crypto/ec/ec_backend.c
crypto/ec/ec_key.c
crypto/ec/ec_kmeth.c
crypto/ec/ec_local.h

index 1adb506279848707ec70ad583a0ac4c2dd08c74f..7abf37753e80db8e418e6e8dd1b6f513a9b81b0f 100644 (file)
@@ -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 */
index 238bce9fbbb0b628e1cc9ec8f5f24f8c62c7c5f0..e4461474ddc2824943af94f74339d325915c98f1 100644 (file)
@@ -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,
index 3093feb44a6d435c053fbf45b0d0001570a16e6e..89c4985f3e53061f904cac3dfc73df5514c95194 100644 (file)
@@ -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
 
index 148bbc72523b5bd755c22083cd3300eb5ee6fd05..80729f370f82592c8bf69afc88b8e82b736bcf7b 100644 (file)
@@ -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,