diff options
Diffstat (limited to 'meta-oe/recipes-support/libspdm')
-rw-r--r-- | meta-oe/recipes-support/libspdm/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch | 33 | ||||
-rw-r--r-- | meta-oe/recipes-support/libspdm/libspdm_3.7.0.bb | 83 |
2 files changed, 116 insertions, 0 deletions
diff --git a/meta-oe/recipes-support/libspdm/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch b/meta-oe/recipes-support/libspdm/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch new file mode 100644 index 0000000000..2df9a18c68 --- /dev/null +++ b/meta-oe/recipes-support/libspdm/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch | |||
@@ -0,0 +1,33 @@ | |||
1 | From 92f6c3d8fa26d9019ba27e0c1aa894517ada93b9 Mon Sep 17 00:00:00 2001 | ||
2 | From: Khem Raj <raj.khem@gmail.com> | ||
3 | Date: Fri, 11 Apr 2025 17:47:05 -0700 | ||
4 | Subject: [PATCH] Backport API introduced in openssl 3.5.0 | ||
5 | |||
6 | This commit [1] introduced this new API which is used by pem.h from | ||
7 | openssl and it should be provided by asn1.h which is vendored here so | ||
8 | it goes out of sync and causes build errors e.g | ||
9 | |||
10 | In file included from ./os_stub/cryptlib_openssl/pk/x509.c:18: | ||
11 | /usr/include/openssl/pem.h:399:28: error: unknown type name 'OSSL_i2d_of_void_ctx' | ||
12 | 399 | int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx, | ||
13 | |||
14 | [1] https://github.com/openssl/openssl/commit/35f6e7ea02b599d5aaf220b4720cbadd946d8023 | ||
15 | |||
16 | Upstream-Status: Submitted [https://github.com/DMTF/libspdm/pull/3033] | ||
17 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
18 | --- | ||
19 | os_stub/openssllib/openssl_gen/openssl/asn1.h | 1 + | ||
20 | 1 file changed, 1 insertion(+) | ||
21 | |||
22 | diff --git a/os_stub/openssllib/openssl_gen/openssl/asn1.h b/os_stub/openssllib/openssl_gen/openssl/asn1.h | ||
23 | index a90152ee..fcfbe42e 100644 | ||
24 | --- a/os_stub/openssllib/openssl_gen/openssl/asn1.h | ||
25 | +++ b/os_stub/openssllib/openssl_gen/openssl/asn1.h | ||
26 | @@ -368,6 +368,7 @@ typedef struct ASN1_VALUE_st ASN1_VALUE; | ||
27 | |||
28 | typedef void *d2i_of_void(void **, const unsigned char **, long); | ||
29 | typedef int i2d_of_void(const void *, unsigned char **); | ||
30 | +typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx); | ||
31 | |||
32 | /*- | ||
33 | * The following macros and typedefs allow an ASN1_ITEM | ||
diff --git a/meta-oe/recipes-support/libspdm/libspdm_3.7.0.bb b/meta-oe/recipes-support/libspdm/libspdm_3.7.0.bb new file mode 100644 index 0000000000..c6bbd1716b --- /dev/null +++ b/meta-oe/recipes-support/libspdm/libspdm_3.7.0.bb | |||
@@ -0,0 +1,83 @@ | |||
1 | SUMMARY = "DMTF's Reference Implementation of SPDM" | ||
2 | DESCRIPTION = "libspdm is a reference implementation of the DMTF’s Security Protocols and \ | ||
3 | Data Models (SPDM). This is used to enable authentication, attestation and key exchange to \ | ||
4 | assist in providing infrastructure security enablement" | ||
5 | HOMEPAGE = "https://github.com/DMTF/libspdm" | ||
6 | BUGTRACKER = "https://github.com/DMTF/libspdm/issues" | ||
7 | LICENSE = "BSD-3-Clause" | ||
8 | LIC_FILES_CHKSUM = "file://LICENSE.md;md5=8f9b59a81a88da8e812af43728b72dd7" | ||
9 | |||
10 | DEPENDS = "openssl" | ||
11 | |||
12 | SRC_URI = "git://github.com/DMTF/libspdm.git;branch=main;protocol=https \ | ||
13 | file://0001-Backport-API-introduced-in-openssl-3.5.0.patch" | ||
14 | SRCREV = "1be116c7b7713fa9003e1bd53b53a34758549eb9" | ||
15 | |||
16 | |||
17 | inherit cmake | ||
18 | |||
19 | LIBSPDM_CFLAGS = "\ | ||
20 | ${OECMAKE_C_FLAGS} \ | ||
21 | -DLIBSPDM_ENABLE_CAPABILITY_EVENT_CAP=0 \ | ||
22 | -DLIBSPDM_ENABLE_CAPABILITY_MEL_CAP=0 \ | ||
23 | -DLIBSPDM_ENABLE_CAPABILITY_GET_KEY_PAIR_INFO_CAP=0 \ | ||
24 | -DLIBSPDM_ENABLE_CAPABILITY_SET_KEY_PAIR_INFO_CAP=0 \ | ||
25 | -DLIBSPDM_HAL_PASS_SPDM_CONTEXT=1 \ | ||
26 | -DLIBSPDM_ENABLE_CAPABILITY_ENDPOINT_INFO_CAP=0 \ | ||
27 | " | ||
28 | |||
29 | LIBSPDM_CFLAGS:append:toolchain-gcc = " -fPIE" | ||
30 | |||
31 | def get_spdm_multiarch(bb, d): | ||
32 | target_arch = d.getVar('TARGET_ARCH') | ||
33 | multiarch_options = { | ||
34 | "x86_64": "x64", | ||
35 | "i586": "ia32", | ||
36 | "i686": "ia32", | ||
37 | "arm": "arm", | ||
38 | "aarch64": "aarch64", | ||
39 | "riscv32": "riscv32", | ||
40 | "riscv64": "riscv64", | ||
41 | "ppc64le": "ppc64le", | ||
42 | } | ||
43 | |||
44 | if target_arch in multiarch_options : | ||
45 | return multiarch_options[target_arch] | ||
46 | |||
47 | bb.error("unsupported architecture '%s'" % target_arch) | ||
48 | |||
49 | EXTRA_OECMAKE += "\ | ||
50 | -DARCH=${@get_spdm_multiarch(bb, d)} \ | ||
51 | -DTOOLCHAIN=NONE \ | ||
52 | -DTARGET=Release \ | ||
53 | -DCRYPTO=openssl \ | ||
54 | -DENABLE_BINARY_BUILD=1 \ | ||
55 | -DCOMPILED_LIBCRYPTO_PATH=${libdir} \ | ||
56 | -DCOMPILED_LIBSSL_PATH=${libdir} \ | ||
57 | -DDISABLE_TESTS=1 \ | ||
58 | -DDISABLE_EDDSA=1 \ | ||
59 | -DCMAKE_C_FLAGS='${LIBSPDM_CFLAGS}' \ | ||
60 | " | ||
61 | |||
62 | do_install () { | ||
63 | install -d ${D}/${libdir} | ||
64 | install -m 0644 lib/* ${D}/${libdir}/ | ||
65 | |||
66 | install -d ${D}/${includedir}/${BPN}/ | ||
67 | cp -rf ${S}/include/* ${D}/${includedir}/${BPN}/ | ||
68 | |||
69 | install -d ${D}/${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib | ||
70 | cp -rf ${S}/os_stub/spdm_crypt_ext_lib/*.h ${D}/${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib/ | ||
71 | } | ||
72 | |||
73 | FILES:${PN} += "${libdir}/*.a" | ||
74 | FILES:${PN} += "${includedir}/${BPN}/*.h" | ||
75 | FILES:${PN} += "${includedir}/${BPN}/os_stub/spdm_crypt_ext_lib/*.h" | ||
76 | |||
77 | COMPATIBLE_HOST:powerpc = "null" | ||
78 | COMPATIBLE_HOST:powerpc64 = "null" | ||
79 | COMPATIBLE_HOST:mipsarchn32 = "null" | ||
80 | COMPATIBLE_HOST:mipsarcho32 = "null" | ||
81 | COMPATIBLE_HOST:mipsarchn64 = "null" | ||
82 | |||
83 | BBCLASSEXTEND = "native nativesdk" | ||