diff mbox series

[meta-oe,4/9] librelp: upgrade 1.14.0 -> 1.15.0

Message ID 20261130211916.1887290-5-khem.raj@oss.qualcomm.com
State New
Headers show
Series Upgrades, tip updates and _git recipe removal | expand

Commit Message

Khem Raj Nov. 30, 2026, 9:19 p.m. UTC
librelp is now licensed entirely under Apache-2.0. Earlier releases
were GPL-3.0-or-later (with part of the files already Apache-2.0 in
1.14.0); code whose contributors could not be cleared was rewritten.
COPYING now states the license and points to COPYING.ASL20, which holds
the license text, so track both.

This is the last 1.x release and the last to support OpenSSL 1.0.2 and
1.1.0. The API is extended in a backward compatible way and the soname
is unchanged.

Behaviour changes:
- servers accept at most 500 sessions, an incomplete session open must
  finish within 30 s and an idle session is closed after 3600 s; new
  relpEngineSetMaxSessions(), relpEngineSetOpenTimeout() and
  relpEngineSetIdleTimeout() change the limits
- OpenSSL clients in "certvalid" and "name" auth modes verify the
  certificate chain, each client and listener with its own SSL context
- a TLS listener no longer falls back to plain TCP in a build without
  TLS support
- client-only commands are rejected, and syslog messages are not
  acknowledged when the host callback is missing or fails

Fixes: no SIGPIPE on plain TCP sends to a closed peer, the default
listen port, a listener leak on failed startup, the connect timeout
(monotonic clock, EINTR) and relpTcpWaitWriteable() timing. The GnuTLS
fingerprint matcher is rewritten, and librelp.h can be included from
C++.

Add a patch for building with OpenSSL 4.1: 1.15.0 calls the now
deprecated ASN1_STRING_length() and passes the const X509_NAME * that
X509_get_issuer_name() returns to a non-const parameter, both errors
under the -Werror the build uses.

License-Update: relicensed from GPL-3.0-or-later to Apache-2.0

AI-Generated: Uses Claude Code
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 .../0002-tcp-build-with-OpenSSL-4.1.patch     | 59 +++++++++++++++++++
 .../{librelp_1.14.0.bb => librelp_1.15.0.bb}  |  8 ++-
 2 files changed, 64 insertions(+), 3 deletions(-)
 create mode 100644 meta-oe/recipes-extended/rsyslog/librelp/0002-tcp-build-with-OpenSSL-4.1.patch
 rename meta-oe/recipes-extended/rsyslog/{librelp_1.14.0.bb => librelp_1.15.0.bb} (91%)
diff mbox series

Patch

diff --git a/meta-oe/recipes-extended/rsyslog/librelp/0002-tcp-build-with-OpenSSL-4.1.patch b/meta-oe/recipes-extended/rsyslog/librelp/0002-tcp-build-with-OpenSSL-4.1.patch
new file mode 100644
index 0000000000..c0bcf3394b
--- /dev/null
+++ b/meta-oe/recipes-extended/rsyslog/librelp/0002-tcp-build-with-OpenSSL-4.1.patch
@@ -0,0 +1,59 @@ 
+From c8bdb8edceccab7ceeb9cd554784a1a44a25f94e Mon Sep 17 00:00:00 2001
+From: Khem Raj <khem.raj@oss.qualcomm.com>
+Date: Mon, 30 Nov 2026 11:00:38 -0800
+Subject: [PATCH] tcp: build with OpenSSL 4.1
+
+OpenSSL 4.1 deprecates ASN1_STRING_length() in favour of
+ASN1_STRING_get_length(), which returns a size_t, and makes
+X509_get_issuer_name() and X509_get_subject_name() return a
+const X509_NAME *. With -Werror, the build fails with:
+
+  src/tcp.c:395:14: error: 'ASN1_STRING_length' is deprecated: Since OpenSSL 4.1; use ASN1_STRING_get_length() [-Werror,-Wdeprecated-declarations]
+  src/tcp.c:485:22: error: passing 'const X509_NAME *' (aka 'const struct X509_name_st *') to parameter of type 'X509_NAME *' (aka 'struct X509_name_st *') discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]
+
+Use ASN1_STRING_get_length() with OpenSSL 4.1 and later, treating a
+length above INT_MAX as invalid, and let relpTcpCertNameText() take a
+const X509_NAME *. X509_NAME_oneline() takes a const name since
+OpenSSL 1.1.0; cast for older versions.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
+---
+ src/tcp.c | 14 +++++++++++++-
+ 1 file changed, 13 insertions(+), 1 deletion(-)
+
+diff --git a/src/tcp.c b/src/tcp.c
+index e748b3f..abf70b2 100644
+--- a/src/tcp.c
++++ b/src/tcp.c
+@@ -392,7 +392,14 @@ relpTcpChkPeerName_ossl(relpTcp_t *const pThis, void *vcert)
+ 					continue;
+ 				if(asDnsName == NULL)
+ 					ABORT_FINALIZE(RELP_RET_AUTH_CERT_INVL);
++#				if OPENSSL_VERSION_NUMBER >= 0x40100000L
++				{
++					const size_t getLen = ASN1_STRING_get_length(asDnsName);
++					sanLen = (getLen > INT_MAX) ? -1 : (int) getLen;
++				}
++#				else
+ 				sanLen = ASN1_STRING_length(asDnsName);
++#				endif
+ 
+ #				if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ 				sanData = ASN1_STRING_get0_data(asDnsName);
+@@ -448,9 +455,14 @@ finalize_it:
+  * A missing certificate or name yields "(none)".
+  */
+ static void
+-relpTcpCertNameText(X509_NAME *const name, char *const buf, const size_t lenBuf)
++relpTcpCertNameText(const X509_NAME *const name, char *const buf, const size_t lenBuf)
+ {
++#	if OPENSSL_VERSION_NUMBER >= 0x10100000L
+ 	if(name == NULL || X509_NAME_oneline(name, buf, (int) lenBuf) == NULL) {
++#	else
++	/* before OpenSSL 1.1.0, X509_NAME_oneline() takes a non-const name */
++	if(name == NULL || X509_NAME_oneline((X509_NAME *) name, buf, (int) lenBuf) == NULL) {
++#	endif
+ 		snprintf(buf, lenBuf, "(none)");
+ 	}
+ }
diff --git a/meta-oe/recipes-extended/rsyslog/librelp_1.14.0.bb b/meta-oe/recipes-extended/rsyslog/librelp_1.15.0.bb
similarity index 91%
rename from meta-oe/recipes-extended/rsyslog/librelp_1.14.0.bb
rename to meta-oe/recipes-extended/rsyslog/librelp_1.15.0.bb
index 55dbef2509..3ee31be3ec 100644
--- a/meta-oe/recipes-extended/rsyslog/librelp_1.14.0.bb
+++ b/meta-oe/recipes-extended/rsyslog/librelp_1.15.0.bb
@@ -1,17 +1,19 @@ 
 SUMMARY = "A reliable logging library"
 HOMEPAGE = "https://github.com/rsyslog/librelp"
 
-LICENSE = "GPL-3.0-only"
-LIC_FILES_CHKSUM = "file://COPYING;md5=1fb9c10ed9fd6826757615455ca893a9"
+LICENSE = "Apache-2.0"
+LIC_FILES_CHKSUM = "file://COPYING;md5=12b2b1deab5b47f85769b01d9a339204 \
+                    file://COPYING.ASL20;md5=3b83ef96387f14655fc854ddc3c6bd57"
 
 DEPENDS = "gmp libidn zlib"
 
 SRC_URI = "git://github.com/rsyslog/librelp.git;protocol=https;branch=main;tag=v${PV} \
            file://run-ptest \
            file://0001-tests-skip-tls-ossl-connect-failure-vg.sh-without-li.patch \
+           file://0002-tcp-build-with-OpenSSL-4.1.patch \
 "
 
-SRCREV = "87a447e3f656d3e4d6e5f9d1f0e72a16527d342d"
+SRCREV = "9212985f9309413d520558a0682bcb29cd6a0cdc"
 
 CVE_PRODUCT = "rsyslog:librelp"