unbound: fix build with OpenSSL 4.0

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>
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
This commit is contained in:
Alper Ak
2026-09-11 07:07:59 -07:00
committed by Khem Raj
parent d0b74dcba3
commit b183cb8a1c
2 changed files with 32 additions and 0 deletions
@@ -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
@@ -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 \
"