diff mbox series

[meta-oe] spdm-emu: Switch default crypto backend to mbedtls and update to latest tip

Message ID 20260910060106.2214089-1-khem.raj@oss.qualcomm.com
State New
Headers show
Series [meta-oe] spdm-emu: Switch default crypto backend to mbedtls and update to latest tip | expand

Commit Message

Khem Raj Sept. 10, 2026, 6:01 a.m. UTC
The openssl backend no longer compiles against openssl 4.x. OpenSSL 4.0
made struct asn1_string_st opaque (asn1.h only forward declares it now),
while libspdm's cryptlib_openssl still reaches into ASN1_INTEGER and
ASN1_TIME members directly:

  libspdm/os_stub/cryptlib_openssl/pk/x509.c:814:51: error: incomplete
    definition of type 'ASN1_INTEGER' (aka 'struct asn1_string_st')
  libspdm/os_stub/cryptlib_openssl/pk/x509.c:1131:14: error: invalid
    application of 'sizeof' to an incomplete type 'ASN1_TIME'

make the crypto backend a PACKAGECONFIG choice and default to mbedtls,
which builds fine. openssl stays selectable for anyone still on openssl
3.x, and the two options are marked as mutually exclusive.

While at it, update SRCREV to the current tip of main, which carries 41
commits including a build refactor, TPM support, Linux kernel MCTP stack
support and several libspdm syncs.

Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
---
 meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
diff mbox series

Patch

diff --git a/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb b/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb
index 060cb055fc..99fd0a45b7 100644
--- a/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb
+++ b/meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb
@@ -8,7 +8,7 @@  LIC_FILES_CHKSUM = "file://LICENSE.md;md5=ed4cfe4688e1ac2cc2e6748766571949"

 SRC_URI = "gitsm://github.com/DMTF/spdm-emu;protocol=https;branch=main"

-SRCREV = "5fca359b15e4edd4f070ca83c9da02799b6f78ae"
+SRCREV = "ea77f25410cc01098320c0b44b3e150192ec4d5e"
 # Upstream release tags are "X.Y.Z" (newest 3.8.0).
 UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 # PV is "git" (AUTOINC recipe with no numeric PV), so the resolved tag (3.8.0)
@@ -16,9 +16,11 @@  UPSTREAM_CHECK_GITTAGREGEX = "(?P<pver>\d+(\.\d+)+)"
 UPSTREAM_VERSION_UNKNOWN = "1"
 inherit cmake pkgconfig systemd

-DEPENDS = "openssl"
-PACKAGECONFIG ??= "${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
+PACKAGECONFIG ??= "mbedtls ${@bb.utils.filter('DISTRO_FEATURES', 'systemd', d)}"
 PACKAGECONFIG[systemd] = "-DENABLE_SYSTEMD=ON,-DENABLE_SYSTEMD=OFF,systemd"
+PACKAGECONFIG[openssl] = "-DCRYPTO=openssl -DENABLE_BINARY_BUILD=1,,openssl,,,mbedtls"
+# ENABLE_BINARY_BUILD=0 makes libspdm compile its own bundled mbedtls
+PACKAGECONFIG[mbedtls] = "-DCRYPTO=mbedtls -DENABLE_BINARY_BUILD=0,,,,,openssl"

 SYSTEMD_SERVICE:${PN} = "spdm-responder-emu.service"

@@ -45,8 +47,6 @@  EXTRA_OECMAKE += "\
     -DARCH=${@get_spdm_multiarch(d)} \
     -DTOOLCHAIN=NONE \
     -DTARGET=Release \
-    -DCRYPTO=openssl \
-    -DENABLE_BINARY_BUILD=1 \
     -DCOMPILED_LIBCRYPTO_PATH=${libdir} \
     -DCOMPILED_LIBSSL_PATH=${libdir} \
 "