Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
To: openembedded-core@lists.openembedded.org
Cc: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
Subject: [PATCH 7/7] kea: fix build with OpenSSL 4.0
Date: Fri, 14 Aug 2026 07:18:29 +0200	[thread overview]
Message-ID: <20260814051829.35088-8-jaipaul.cheernam@est.tech> (raw)
In-Reply-To: <20260814051829.35088-1-jaipaul.cheernam@est.tech>

OpenSSL 4.0 added const qualifiers to X509_get_subject_name() and
X509_get_issuer_name() return types. kea assigns these to non-const
pointers causing compilation errors with -fpermissive.

Add const qualifiers to X509_NAME and X509_NAME_ENTRY pointer
declarations in openssl_tls.h.

Tracked upstream: https://gitlab.isc.org/isc-projects/kea/-/issues/4673
(milestone: kea3.3.2, labeled: backport-candidate)

Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
---
 ...-qualifiers-to-OpenSSL-X509-pointers.patch | 49 +++++++++++++++++++
 meta/recipes-connectivity/kea/kea_3.2.0.bb    |  1 +
 2 files changed, 50 insertions(+)
 create mode 100644 meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch

diff --git a/meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch b/meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
new file mode 100644
index 0000000000..85f6fe1dbd
--- /dev/null
+++ b/meta/recipes-connectivity/kea/files/0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch
@@ -0,0 +1,49 @@
+From 82d28b1be73bbc00e73e59d0c59c51a1e76519a5 Mon Sep 17 00:00:00 2001
+From: Simo Sorce <simo@redhat.com>
+Date: Mon, 27 Apr 2026 17:49:56 -0400
+Subject: [PATCH] Add const qualifiers to OpenSSL X509 pointers
+
+Added const qualifiers to the X509_NAME and X509_NAME_ENTRY pointers when
+retrieving subject and issuer names from TLS certificates. This ensures const-
+correctness and maintains compatibility with newer OpenSSL versions, which
+return const pointers from these getter functions.
+
+Signed-off-by: Simo Sorce <simo@redhat.com>
+
+Upstream-Status: Backport [https://gitlab.isc.org/isc-projects/kea/-/issues/4673]
+Signed-off-by: Jaipaul Cheernam <jaipaul.cheernam@est.tech>
+---
+ src/lib/asiolink/openssl_tls.h | 8 ++++----
+ 1 file changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/lib/asiolink/openssl_tls.h b/src/lib/asiolink/openssl_tls.h
+index 57c3323..52a969b 100644
+--- a/src/lib/asiolink/openssl_tls.h
++++ b/src/lib/asiolink/openssl_tls.h
+@@ -175,9 +175,9 @@ public:
+         if (!cert) {
+             return ("");
+         }
+-        ::X509_NAME *name = ::X509_get_subject_name(cert);
++        const ::X509_NAME *name = ::X509_get_subject_name(cert);
+         int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1);
+-        ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc);
++        const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc);
+         if (!ne) {
+             ::X509_free(cert);
+             return ("");
+@@ -209,9 +209,9 @@ public:
+         if (!cert) {
+             return ("");
+         }
+-        ::X509_NAME *name = ::X509_get_issuer_name(cert);
++        const ::X509_NAME *name = ::X509_get_issuer_name(cert);
+         int loc = ::X509_NAME_get_index_by_NID(name, NID_commonName, -1);
+-        ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc);
++        const ::X509_NAME_ENTRY* ne = ::X509_NAME_get_entry(name, loc);
+         if (!ne) {
+             ::X509_free(cert);
+             return ("");
+-- 
+2.53.0
+
diff --git a/meta/recipes-connectivity/kea/kea_3.2.0.bb b/meta/recipes-connectivity/kea/kea_3.2.0.bb
index feeacc8883..38b24eed1f 100644
--- a/meta/recipes-connectivity/kea/kea_3.2.0.bb
+++ b/meta/recipes-connectivity/kea/kea_3.2.0.bb
@@ -19,6 +19,7 @@ SRC_URI = "http://ftp.isc.org/isc/kea/${PV}/${BP}.tar.xz \
            file://0001-src-lib-log-logger_unittest_support.cc-do-not-write-.patch \
            file://0001-meson-use-a-runtime-safe-interpreter-string.patch \
            file://0001-mk_cfgrpt.sh-strip-prefixes.patch \
+           file://0001-Add-const-qualifiers-to-OpenSSL-X509-pointers.patch \
            "
 SRC_URI[sha256sum] = "14bf695d37b65b9b1bf550fea5d0adaf9806c50e5419ef2a176a4b8e9aade3df"
 


  parent reply	other threads:[~2026-08-14  5:18 UTC|newest]

Thread overview: 13+ 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 ` Jaipaul Cheernam [this message]
2026-08-14 11:14   ` [OE-core] [PATCH 7/7] kea: " Alexander Kanavin

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=20260814051829.35088-8-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