Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
To: openembedded-core@lists.openembedded.org
Subject: [RFC v2 4/6] serf: fix build with OpenSSL 4.0
Date: Thu, 20 Aug 2026 20:10:20 +0200	[thread overview]
Message-ID: <20260820181022.44434-5-jaipaul.cheernam@est.tech> (raw)
In-Reply-To: <20260820181022.44434-1-jaipaul.cheernam@est.tech>

OpenSSL 4.0 made ASN1_STRING opaque. serf directly accesses
nm->d.ia5->data and nm->d.ia5->length which is no longer allowed.

Use ASN1_STRING_get0_data() and ASN1_STRING_length() accessor
functions instead. These have been available since OpenSSL 1.1.0
so this is backward compatible.

The fix is already in serf trunk (r1935023) but no new release
has been made.

Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 ...penSSL-4.0-use-ASN1_STRING-accessors.patch | 35 +++++++++++++++++++
 meta/recipes-support/serf/serf_1.3.10.bb      |  1 +
 2 files changed, 36 insertions(+)
 create mode 100644 meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch

diff --git a/meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch b/meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
new file mode 100644
index 0000000000..2392cf1dca
--- /dev/null
+++ b/meta/recipes-support/serf/serf/0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch
@@ -0,0 +1,35 @@
+From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
+From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+Date: Thu, 13 Aug 2026 11:52:00 +0000
+Subject: [PATCH] Fix build with OpenSSL 4.0: use ASN1_STRING accessors
+
+OpenSSL 4.0 made ASN1_STRING opaque. Direct access to struct members
+(->data, ->length) is no longer possible. Use the accessor functions
+ASN1_STRING_get0_data() and ASN1_STRING_length() instead.
+
+These accessors have been available since OpenSSL 1.1.0, so this change
+is backward compatible.
+
+Upstream-Status: Backport [https://svn.apache.org/repos/asf/serf/trunk r1935023]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ buckets/ssl_buckets.c | 6 +++---
+ 1 file changed, 3 insertions(+), 3 deletions(-)
+
+--- a/buckets/ssl_buckets.c
++++ b/buckets/ssl_buckets.c
+@@ -567,11 +567,11 @@
+             switch (nm->type) {
+                 case GEN_DNS:
+                     if (copy_action == ErrorOnNul &&
+-                        strlen(nm->d.ia5->data) != nm->d.ia5->length)
++                        strlen((const char *)ASN1_STRING_get0_data(nm->d.ia5)) != (size_t)ASN1_STRING_length(nm->d.ia5))
+                         return SERF_ERROR_SSL_CERT_FAILED;
+                     if (san_arr && *san_arr)
+-                        p = pstrdup_escape_nul_bytes((const char *)nm->d.ia5->data,
+-                                                     nm->d.ia5->length,
++                        p = pstrdup_escape_nul_bytes((const char *)ASN1_STRING_get0_data(nm->d.ia5),
++                                                     ASN1_STRING_length(nm->d.ia5),
+                                                      pool);
+                     break;
+                 default:
diff --git a/meta/recipes-support/serf/serf_1.3.10.bb b/meta/recipes-support/serf/serf_1.3.10.bb
index c6b51452aa..fd3560876b 100644
--- a/meta/recipes-support/serf/serf_1.3.10.bb
+++ b/meta/recipes-support/serf/serf_1.3.10.bb
@@ -10,6 +10,7 @@ SRC_URI = "${APACHE_MIRROR}/${BPN}/${BPN}-${PV}.tar.bz2 \
            file://0002-SConstruct-Fix-path-quoting-for-.def-generator.patch \
            file://0003-gen_def.patch \
            file://SConstruct.stop.creating.directories.without.sandbox-install.prefix.patch \
+           file://0001-Fix-build-with-OpenSSL-4.0-use-ASN1_STRING-accessors.patch \
            "
 
 SRC_URI[sha256sum] = "be81ef08baa2516ecda76a77adf7def7bc3227eeb578b9a33b45f7b41dc064e6"


  parent reply	other threads:[~2026-08-20 18:10 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14  5:18 [RFC 0/7] openssl: upgrade to 4.0.1 and fix dependent recipes Jaipaul Cheernam
2026-08-14  5:18 ` [PATCH 1/7] openssl: upgrade 3.5.7 -> 4.0.1 Jaipaul Cheernam
2026-08-15 16:20   ` [OE-core] " Mathieu Dubois-Briand
2026-08-14  5:18 ` [PATCH 2/7] python3: backport OpenSSL 4.0 support from upstream Jaipaul Cheernam
2026-08-14  5:18 ` [PATCH 3/7] socat: fix build with OpenSSL 4.0 Jaipaul Cheernam
2026-08-14  5:18 ` [PATCH 4/7] rust: Upgrade 1.96.1 -> 1.97.1 Jaipaul Cheernam
2026-08-15 16:11   ` [OE-core] " Mathieu Dubois-Briand
2026-08-14  5:18 ` [PATCH 5/7] serf: fix build with OpenSSL 4.0 Jaipaul Cheernam
2026-08-14  5:18 ` [PATCH 6/7] u-boot-tools: " Jaipaul Cheernam
2026-08-14 11:12   ` [OE-core] " Alexander Kanavin
2026-08-15 16:14   ` Mathieu Dubois-Briand
2026-08-14  5:18 ` [PATCH 7/7] kea: " Jaipaul Cheernam
2026-08-14 11:14   ` [OE-core] " Alexander Kanavin
2026-08-20 18:10 ` [RFC v2 0/6] openssl: upgrade to 4.0.1 and fix dependent recipes Jaipaul Cheernam
2026-08-20 18:10   ` [RFC v2 1/6] openssl: upgrade 3.5.7 -> 4.0.1 Jaipaul Cheernam
2026-08-20 18:10   ` [RFC v2 2/6] python3: backport OpenSSL 4.0 support from upstream Jaipaul Cheernam
2026-08-20 18:10   ` [RFC v2 3/6] socat: fix build with OpenSSL 4.0 Jaipaul Cheernam
2026-08-20 18:10   ` Jaipaul Cheernam [this message]
2026-08-20 18:10   ` [RFC v2 5/6] u-boot: " Jaipaul Cheernam
2026-08-20 18:10   ` [RFC v2 6/6] kea: " Jaipaul Cheernam

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260820181022.44434-5-jaipaul.cheernam@est.tech \
    --to=jaipaul.cheernam@est.tech \
    --cc=openembedded-core@lists.openembedded.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox