diff mbox series

[meta-networking] unbound: fix build with OpenSSL 4.0

Message ID 20260910061723.199239-1-alperyasinak1@gmail.com
State Under Review
Headers show
Series [meta-networking] unbound: fix build with OpenSSL 4.0 | expand

Commit Message

Alper Ak Sept. 10, 2026, 6:17 a.m. UTC
do_compile fails with:

  keyraw.c:158:16: error: implicit declaration of function
  'EVP_PKEY_asn1_find_str'

The GOST code needs the OpenSSL ENGINE API, which 4.0 removed. configure
cannot run its GOST test when cross compiling and answers "maybe", which
enables GOST anyway. Make it check that the API is there first.

Nothing is lost by this and no layer ships a GOST engine, so the lookup
already returned 0 at runtime. gost-engine has not been ported to
providers yet [1].

[1] https://github.com/gost-engine/engine/issues/496

Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
---
 ...assume-GOST-works-when-cross-compili.patch | 31 +++++++++++++++++++
 .../recipes-support/unbound/unbound_1.26.0.bb |  1 +
 2 files changed, 32 insertions(+)
 create mode 100644 meta-networking/recipes-support/unbound/unbound/0001-configure-do-not-assume-GOST-works-when-cross-compili.patch
diff mbox series

Patch

diff --git a/meta-networking/recipes-support/unbound/unbound/0001-configure-do-not-assume-GOST-works-when-cross-compili.patch b/meta-networking/recipes-support/unbound/unbound/0001-configure-do-not-assume-GOST-works-when-cross-compili.patch
new file mode 100644
index 0000000000..f074f74386
--- /dev/null
+++ b/meta-networking/recipes-support/unbound/unbound/0001-configure-do-not-assume-GOST-works-when-cross-compili.patch
@@ -0,0 +1,31 @@ 
+From: Alper Ak <alperyasinak1@gmail.com>
+Date: Thu, 10 Sep 2026 00:10:00 +0300
+Subject: [PATCH] configure: do not assume GOST works when cross compiling
+
+The GOST check is a run test, so when cross compiling configure cannot
+execute it and falls back to "maybe", which enables GOST. The GOST code
+needs the OpenSSL ENGINE API, and OpenSSL 4.0 removed it, so the build
+then fails on implicit declarations of EVP_PKEY_asn1_find_str.
+
+We still cannot run the test, but we can check that the API the GOST
+code calls is present at all.
+
+Upstream-Status: Pending
+Signed-off-by: Alper Ak <alperyasinak1@gmail.com>
+---
+ configure.ac | 4 +++-
+ 1 file changed, 3 insertions(+), 1 deletion(-)
+
+--- a/configure.ac
++++ b/configure.ac
+@@ -1295,7 +1295,9 @@
+ [eval "ac_cv_c_gost_works=maybe"])
+ CFLAGS="$BAKCFLAGS"
+ else
+-eval "ac_cv_c_gost_works=maybe"
++AC_CHECK_FUNC([EVP_PKEY_asn1_find_str],
++	[eval "ac_cv_c_gost_works=maybe"],
++	[eval "ac_cv_c_gost_works=no"])
+ fi
+ AC_MSG_RESULT($ac_cv_c_gost_works)
+ ])dnl
diff --git a/meta-networking/recipes-support/unbound/unbound_1.26.0.bb b/meta-networking/recipes-support/unbound/unbound_1.26.0.bb
index 9134bb64e5..711c93ef6f 100644
--- a/meta-networking/recipes-support/unbound/unbound_1.26.0.bb
+++ b/meta-networking/recipes-support/unbound/unbound_1.26.0.bb
@@ -10,6 +10,7 @@  LICENSE = "BSD-3-Clause"
 LIC_FILES_CHKSUM = "file://LICENSE;md5=5308494bc0590c0cb036afd781d78f06"
 
 SRC_URI = "git://github.com/NLnetLabs/unbound.git;protocol=https;branch=master;tag=release-${PV} \
+           file://0001-configure-do-not-assume-GOST-works-when-cross-compili.patch \
            file://run-ptest \
            "