public inbox for git-commits@fedoraproject.org
help / color / mirror / Atom feed
* [rpms/tomcat-native] epel8: Backport OpenSSL 1.1.1 compatibility to fix the EL8 build
@ 2026-10-06 12:16 Dimitris Soumis
  0 siblings, 0 replies; only message in thread
From: Dimitris Soumis @ 2026-10-06 12:16 UTC (permalink / raw)
  To: git-commits

A new commit has been pushed.

Repo   : rpms/tomcat-native
Branch : epel8
Commit : 6d4bbd8d468cdc6ce3f1d27ec8edcea886fcd02e
Author : Dimitris Soumis <dsoumis@redhat.com>
Date   : 2026-10-06T15:16:25+03:00
Stats  : +81/-2 in 2 file(s)
URL    : https://src.fedoraproject.org/rpms/tomcat-native/c/6d4bbd8d468cdc6ce3f1d27ec8edcea886fcd02e?branch=epel8

Log:
Backport OpenSSL 1.1.1 compatibility to fix the EL8 build

---
diff --git a/tomcat-native-1.3.9-openssl111-compat.patch b/tomcat-native-1.3.9-openssl111-compat.patch
new file mode 100644
index 0000000..54df0e3
--- /dev/null
+++ b/tomcat-native-1.3.9-openssl111-compat.patch
@@ -0,0 +1,72 @@
+Restore OpenSSL 1.1.1 compatibility (needed for EL8 / EPEL8).
+
+EL8 ships OpenSSL 1.1.1, which has neither <openssl/core_names.h> nor the
+OSSL_PARAM API. tomcat-native 1.3.9 broke the build against OpenSSL < 3.0 by:
+
+  1. adding an unconditional "#include <openssl/core_names.h>" in
+     native/include/ssl_private.h (the provider.h include right above it is
+     correctly wrapped in an OPENSSL_VERSION_NUMBER > 0x2FFFFFFFL guard), and
+  2. rewriting SSL_ec_GetParamFromFile() in native/src/sslutils.c to use the
+     OpenSSL 3.0-only OSSL_PARAM API, guarded only by #ifdef HAVE_ECC with no
+     version check.
+
+Other OpenSSL 3.0 code in the tree (e.g. the FIPS handling in ssl.c) is already
+version-guarded, so this is an upstream oversight rather than an intentional
+drop of 1.1.1 support.
+
+This patch moves the core_names.h include inside the existing version guard and
+adds an OpenSSL < 3.0 fallback for SSL_ec_GetParamFromFile() that reads the EC
+parameters with the 1.1.1 API and returns the curve NID the caller expects.
+
+Should be reported upstream (Apache Tomcat Native / tomcat-connectors).
+
+diff --git a/native/include/ssl_private.h b/native/include/ssl_private.h
+index f569167..294140a 100644
+--- a/native/include/ssl_private.h
++++ b/native/include/ssl_private.h
+@@ -48,8 +48,8 @@
+ #include <openssl/bn.h>
+ #if OPENSSL_VERSION_NUMBER > 0x2FFFFFFFL && !defined(LIBRESSL_VERSION_NUMBER)
+ #include <openssl/provider.h>
+-#endif
+ #include <openssl/core_names.h>
++#endif
+
+ #ifndef RAND_MAX
+ #include <limits.h>
+diff --git a/native/src/sslutils.c b/native/src/sslutils.c
+index 30b81cb..35a1f70 100644
+--- a/native/src/sslutils.c
++++ b/native/src/sslutils.c
+@@ -221,6 +221,7 @@ EVP_PKEY *SSL_dh_GetParamFromFile(const char *file)
+ #ifdef HAVE_ECC
+ int SSL_ec_GetParamFromFile(const char *file)
+ {
++#if OPENSSL_VERSION_NUMBER > 0x2FFFFFFFL
+     EVP_PKEY *evp = NULL;
+     BIO *bio;
+     char curve_name[80];
+@@ -254,6 +255,24 @@ int SSL_ec_GetParamFromFile(const char *file)
+
+     EVP_PKEY_free(evp);
+     return nid; /* Returns the curve's NID, or NID_undef on failure */
++#else
++    /* OpenSSL < 3.0 fallback (e.g. OpenSSL 1.1.1 on EL8): the OSSL_PARAM /
++     * core_names.h API above is unavailable, so read the EC parameters
++     * directly and return the curve NID expected by the caller. */
++    EC_GROUP *group = NULL;
++    BIO *bio;
++    int nid;
++
++    if ((bio = BIO_new_file(file, "r")) == NULL)
++        return NID_undef;
++    group = PEM_read_bio_ECPKParameters(bio, NULL, NULL, NULL);
++    BIO_free(bio);
++    if (group == NULL)
++        return NID_undef;
++    nid = EC_GROUP_get_curve_name(group);
++    EC_GROUP_free(group);
++    return nid; /* Returns the curve's NID, or NID_undef on failure */
++#endif
+ }
+ #endif

diff --git a/tomcat-native.spec b/tomcat-native.spec
index c915d92..85a743b 100644
--- a/tomcat-native.spec
+++ b/tomcat-native.spec
@@ -8,6 +8,8 @@ Summary:        Tomcat native library
 License:        Apache-2.0
 URL:            http://tomcat.apache.org/tomcat-9.0-doc/apr.html
 Source0:        http://www.apache.org/dist/tomcat/tomcat-connectors/native/%{version}/source/%{name}-%{version}-src.tar.gz
+# Restore OpenSSL 1.1.1 compatibility for the EL8 build (no core_names.h / OSSL_PARAM).
+Patch0:         %{name}-1.3.9-openssl111-compat.patch
 ExclusiveArch: %{java_arches}
 
 BuildRequires:  make
@@ -32,7 +34,7 @@ provides support for using APR in Tomcat.
 
 
 %prep
-%setup -q -n %{name}-%{version}-src
+%autosetup -p1 -n %{name}-%{version}-src
 f=CHANGELOG.txt ; iconv -f iso-8859-1 -t utf-8 $f > $f.utf8 ; mv $f.utf8 $f
 
 
@@ -66,10 +68,15 @@ rm -rf ${RPM_BUILD_ROOT}%{_includedir}/*.h
 
 
 %changelog
+* Tue Oct 06 2026 Dimitris Soumis <dsoumis@redhat.com> - 1:1.3.9-2
+- Backport OpenSSL 1.1.1 compatibility to fix the EL8 build
+  (guard the core_names.h include, add a pre-3.0 fallback in
+  SSL_ec_GetParamFromFile)
+
 * Mon Oct 5 2026 Dimitris Soumis <dsoumis@redhat.com> - 1:1.3.9-1
 - Update to 1.3.9
 
-* Wed Jun 8 2026 Dimitris Soumis <dsoumis@redhat.com> - 1:1.3.8-1
+* Mon Jun 8 2026 Dimitris Soumis <dsoumis@redhat.com> - 1:1.3.8-1
 - Update to 1.3.8
 
 * Wed Mar 11 2026 Dimitris Soumis <dsoumis@redhat.com> - 1:1.3.7-1

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-10-06 12:16 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-06 12:16 [rpms/tomcat-native] epel8: Backport OpenSSL 1.1.1 compatibility to fix the EL8 build Dimitris Soumis

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox