Skip to contentSkip to conversation

package/libspdm: add patch to support openssl 3.5

PATCH Applied Thomas Perale via buildroot 1 participant 2 messages Apr 13 – Apr 17

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/libspdm: add patch to support openssl 3.5

The master branch bumped libspdm in commit [1] that fixes the build error that appeared with openssl bump [2].
The 2025.02.x branch remained on openssl 3.4 and didn't need a backport. With the EOL of openssl 3.4 and 2025.02.x is moving to 3.5 this backport is now necessary to build libspdm.

[1] a01c07f572 package/libspdm: bump version to 3.8.0
[2] 9868ca6ec9 package/libopenssl: bump version to 3.5.0

---

NOTE: if applied from patchwork this patch won't apply because of
encoding issues.

 ...port-API-introduced-in-openssl-3.5.0.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch
package/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch new file +34 -0
new file mode 100644
index 0000000000..72ea0ec7e1
@@ -0,0 +1,34 @@
+From 88797f83daf6654d6381e3539abe1670763f2ac1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 11 Apr 2025 17:47:05 -0700
+Subject: [PATCH] Backport API introduced in openssl 3.5.0
+
+This commit [1] introduced this new API which is used by pem.h from
+openssl and it should be provided by asn1.h which is vendored here so
+it goes out of sync and causes build errors e.g
+
+In file included from ./os_stub/cryptlib_openssl/pk/x509.c:18:
+/usr/include/openssl/pem.h:399:28: error: unknown type name 'OSSL_i2d_of_void_ctx'
+  399 | int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx,
+
+[1] https://github.com/openssl/openssl/commit/35f6e7ea02b599d5aaf220b4720cbadd946d8023
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream: https://github.com/DMTF/libspdm/commit/88797f83daf6654d6381e3539abe1670763f2ac1
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ os_stub/openssllib/openssl_gen/openssl/asn1.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/os_stub/openssllib/openssl_gen/openssl/asn1.h b/os_stub/openssllib/openssl_gen/openssl/asn1.h
+index a90152ee0dc..fcfbe42ec0b 100644
+--- a/os_stub/openssllib/openssl_gen/openssl/asn1.h
++++ b/os_stub/openssllib/openssl_gen/openssl/asn1.h
+@@ -368,6 +368,7 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
+ 
+ typedef void *d2i_of_void(void **, const unsigned char **, long);
+ typedef int i2d_of_void(const void *, unsigned char **);
++typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx);
+ 
+ /*-
+  * The following macros and typedefs allow an ASN1_ITEM
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#1 lore raw

In reply of:

Quoted 10 lines

The master branch bumped libspdm in commit [1] that fixes the build error that appeared with openssl bump [2].
The 2025.02.x branch remained on openssl 3.4 and didn't need a backport. With the EOL of openssl 3.4 and 2025.02.x is moving to 3.5 this backport is now necessary to build libspdm.

[1] a01c07f572 package/libspdm: bump version to 3.8.0
[2] 9868ca6ec9 package/libopenssl: bump version to 3.5.0

Applied to 2025.02.x. Thanks

Quoted 56 lines

---

NOTE: if applied from patchwork this patch won't apply because of
encoding issues.

 ...port-API-introduced-in-openssl-3.5.0.patch | 34 +++++++++++++++++++
 1 file changed, 34 insertions(+)
 create mode 100644 package/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch
package/libspdm/0001-Backport-API-introduced-in-openssl-3.5.0.patch new file +34 -0
new file mode 100644
index 0000000000..72ea0ec7e1
@@ -0,0 +1,34 @@
+From 88797f83daf6654d6381e3539abe1670763f2ac1 Mon Sep 17 00:00:00 2001
+From: Khem Raj <[email protected]>
+Date: Fri, 11 Apr 2025 17:47:05 -0700
+Subject: [PATCH] Backport API introduced in openssl 3.5.0
+
+This commit [1] introduced this new API which is used by pem.h from
+openssl and it should be provided by asn1.h which is vendored here so
+it goes out of sync and causes build errors e.g
+
+In file included from ./os_stub/cryptlib_openssl/pk/x509.c:18:
+/usr/include/openssl/pem.h:399:28: error: unknown type name 'OSSL_i2d_of_void_ctx'
+  399 | int PEM_ASN1_write_bio_ctx(OSSL_i2d_of_void_ctx *i2d, void *vctx,
+
+[1] https://github.com/openssl/openssl/commit/35f6e7ea02b599d5aaf220b4720cbadd946d8023
+
+Signed-off-by: Khem Raj <[email protected]>
+Upstream: https://github.com/DMTF/libspdm/commit/88797f83daf6654d6381e3539abe1670763f2ac1
+Signed-off-by: Thomas Perale <[email protected]>
+---
+ os_stub/openssllib/openssl_gen/openssl/asn1.h | 1 +
+ 1 file changed, 1 insertion(+)
+
+diff --git a/os_stub/openssllib/openssl_gen/openssl/asn1.h b/os_stub/openssllib/openssl_gen/openssl/asn1.h
+index a90152ee0dc..fcfbe42ec0b 100644
+--- a/os_stub/openssllib/openssl_gen/openssl/asn1.h
++++ b/os_stub/openssllib/openssl_gen/openssl/asn1.h
+@@ -368,6 +368,7 @@ typedef struct ASN1_VALUE_st ASN1_VALUE;
+ 
+ typedef void *d2i_of_void(void **, const unsigned char **, long);
+ typedef int i2d_of_void(const void *, unsigned char **);
++typedef int OSSL_i2d_of_void_ctx(const void *, unsigned char **, void *vctx);
+ 
+ /*-
+  * The following macros and typedefs allow an ASN1_ITEM
Signature · 6 lines
2.53.0

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot