spdm-emu: Switch default crypto backend to mbedtls and update to latest tip
PATCH 1/1 spdm-emu: Switch default crypto backend to mbedtls and update to latest tip
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.
--- meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-)
meta-oe/recipes-security/spdm-emu/spdm-emu_git.bb +5 -5
@@ -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} \ "
Quoted 3 lines · Khem Raj via lists.openembedded.org
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.
Has a ticket been filed upstream? It’s important to note that mbedtls doesn’t have long-term support unlike OpenSSL, which is why it’s actively being removed entirely from Fedora and I plan to do the same for OE in the next release cycle.
Cheers,
Ross
Quoted 12 lines · Ross Burton
Quoted 3 lines · Khem Raj via lists.openembedded.org
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.
Has a ticket been filed upstream? It’s important to note that mbedtls doesn’t have long-term support unlike OpenSSL, which is why it’s actively being removed entirely from Fedora and I plan to do the same for OE in the next release cycle.
There is already an issue where I chimed in -
https://github.com/DMTF/libspdm/issues/3752
spdm-emu uses its own copy of mbedtls and links statically with it. So removing mbedtls recipe wont affect it
I would still like to get this building until openSSL build it fixed when we can toggle the backend by choosing openssl packageconfig.
Quoted 2 lines
Cheers,
Ross