This is an automated email from the ASF dual-hosted git repository.

markt-asf pushed a commit to branch 1.3.x
in repository https://gitbox.apache.org/repos/asf/tomcat-native.git

commit 9013363ee16f88fda59f431e972405b6229c5537
Author: Mark Thomas <[email protected]>
AuthorDate: Tue Sep 1 16:04:07 2026 +0100

    Make setTmpECDHByCurveName() a NO-OP.
---
 native/src/sslcontext.c           | 43 ++++-----------------------------------
 xdocs/miscellaneous/changelog.xml |  3 +++
 2 files changed, 7 insertions(+), 39 deletions(-)

diff --git a/native/src/sslcontext.c b/native/src/sslcontext.c
index 9a8d144d5..5f0f608da 100644
--- a/native/src/sslcontext.c
+++ b/native/src/sslcontext.c
@@ -810,45 +810,10 @@ TCN_IMPLEMENT_CALL(void, SSLContext, 
setTmpDH)(TCN_STDARGS, jlong ctx,
 TCN_IMPLEMENT_CALL(void, SSLContext, setTmpECDHByCurveName)(TCN_STDARGS, jlong 
ctx,
                                                                   jstring 
curveName)
 {
-#ifdef HAVE_ECC
-    tcn_ssl_ctxt_t *c = J2P(ctx, tcn_ssl_ctxt_t *);
-    int i;
-    EC_KEY  *ecdh;
-    TCN_ALLOC_CSTRING(curveName);
-    UNREFERENCED(o);
-    TCN_ASSERT(ctx != 0);
-    TCN_ASSERT(curveName);
-
-    /* First try to get curve by name */
-    i = OBJ_sn2nid(J2S(curveName));
-    if (!i) {
-        tcn_Throw(e, "Can't configure elliptic curve: unknown curve name %s", 
J2S(curveName));
-        TCN_FREE_CSTRING(curveName);
-        return;
-    }
-
-    ecdh = EC_KEY_new_by_curve_name(i);
-    if (!ecdh) {
-        tcn_Throw(e, "Can't configure elliptic curve: unknown curve name %s", 
J2S(curveName));
-        TCN_FREE_CSTRING(curveName);
-        return;
-    }
-
-    /* Setting found curve to context */
-    if (1 != SSL_CTX_set_tmp_ecdh(c->ctx, ecdh)) {
-        char err[TCN_OPENSSL_ERROR_STRING_LENGTH];
-        EC_KEY_free(ecdh);
-        ERR_error_string_n(SSL_ERR_get(), err, 
TCN_OPENSSL_ERROR_STRING_LENGTH);
-        tcn_Throw(e, "Error while configuring elliptic curve %s: %s", 
J2S(curveName), err);
-        TCN_FREE_CSTRING(curveName);
-        return;
-    }
-    EC_KEY_free(ecdh);
-    TCN_FREE_CSTRING(curveName);
-#else
-    tcn_Throw(e, "Cant't configure elliptic curve: unsupported by this OpenSSL 
version");
-    return;
-#endif
+    UNREFERENCED_STDARGS;
+    UNREFERENCED(ctx);
+    UNREFERENCED(curveName);
+    // NO-OP
 }
 
 TCN_IMPLEMENT_CALL(void, SSLContext, setShutdownType)(TCN_STDARGS, jlong ctx,
diff --git a/xdocs/miscellaneous/changelog.xml 
b/xdocs/miscellaneous/changelog.xml
index 11729ae08..2760e556a 100644
--- a/xdocs/miscellaneous/changelog.xml
+++ b/xdocs/miscellaneous/changelog.xml
@@ -100,6 +100,9 @@
       Switch to automatic configuration of DH parameters. Manual configuration
       attempts will be ignored. (markt)
     </fix>
+    <scode>
+      Make <code>setTmpECDHByCurveName()</code> a NO-OP. (markt)
+    </scode>
   </changelog>
 </section>
 <section name="1.3.8" rtext="2026-06-15">


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to