A couple of small updates (11/16)
cover A couple of small updates (11/16)
These are a couple of small build fixes to get clean builds on master after some recent oe-core changes. I have pushed them to master-next if you want to try them locally, and plan to merge to master by end of day tomorrow (11/17, EST) if there are no objections.
Scott
Changes:
Scott Murray (2):
tpm2-openssl: Fix building with OpenSSL 4.1.0
dm-verity-image-initramfs: Fix IMAGE_PREPROCESS_COMMAND
...key-fix-compilation-with-OpenSSL-4.1.patch | 87 +++++++++++++++++++ .../tpm2-openssl/tpm2-openssl_1.3.0.bb | 1 + .../images/dm-verity-image-initramfs.bb | 2 +- 3 files changed, 89 insertions(+), 1 deletion(-) create mode 100644 meta-tpm/recipes-tpm2/tpm2-openssl/tpm2-openssl/0002-pkey-fix-compilation-with-OpenSSL-4.1.patch
Signature · 1 line
2.47.3
PATCH 1/2 tpm2-openssl: Fix building with OpenSSL 4.1.0
Backport a patch to fix building tpm2-openssl after oe-core's upgrade to OpenSSL 4.1.0
Signed-off-by Scott Murray <[email protected]>
--- ...key-fix-compilation-with-OpenSSL-4.1.patch | 87 +++++++++++++++++++ .../tpm2-openssl/tpm2-openssl_1.3.0.bb | 1 + 2 files changed, 88 insertions(+) create mode 100644 meta-tpm/recipes-tpm2/tpm2-openssl/tpm2-openssl/0002-pkey-fix-compilation-with-OpenSSL-4.1.patch
meta-tpm/recipes-tpm2/tpm2-openssl/tpm2-openssl/0002-pkey-fix-compilation-with-OpenSSL-4.1.patch new file +87 -0
@@ -0,0 +1,87 @@ +From 7260f90e981279e078835814d02968c134122a8a Mon Sep 17 00:00:00 2001 +From: Moritz Buhl <[email protected]> +Date: Tue, 1 Sep 2026 09:58:28 +0200 +Subject: [PATCH] pkey: fix compilation with OpenSSL 4.1 + +Avoid deprecated OpenSSL functions, add fallback defines for older +versions: +src/tpm2-provider-pkey.c:91:5: error: 'ASN1_STRING_set' is deprecated: +Since OpenSSL 4.1; use ASN1_STRING_set1_data() or ASN1_STRING_set1_string() +[-Werror,-Wdeprecated-declarations] +src/tpm2-provider-pkey.c:165:41: error: 'ASN1_STRING_length' is deprecated: +Since OpenSSL 4.1; use ASN1_STRING_get_length() +[-Werror,-Wdeprecated-declarations] + +Add missing header: +src/tpm2-provider-pkey.c:32:1: error: call to undeclared function 'ERR_raise'; +ISO C99 and later do not support implicit function declarations +[-Wimplicit-function-declaration] + +Signed-off-by: Moritz Buhl <[email protected]> + +Upstream-Status: Backport [https://github.com/tpm2-software/tpm2-openssl/commit/6dcc3b2984e3f4dc1849c79d89c6ce736a8435b3] +Signed-off-by: Scott Murray <[email protected]> +--- + src/tpm2-provider-pkey.c | 22 ++++++++++++++++------ + 1 file changed, 16 insertions(+), 6 deletions(-) + +diff --git a/src/tpm2-provider-pkey.c b/src/tpm2-provider-pkey.c +index 80213af..bb56ba7 100644 +--- a/src/tpm2-provider-pkey.c ++++ b/src/tpm2-provider-pkey.c +@@ -2,6 +2,8 @@ + + #include <string.h> + ++#include <openssl/err.h> ++#include <openssl/opensslv.h> + #include <openssl/pem.h> + #include <openssl/rand.h> + +@@ -9,6 +11,14 @@ + + #include "tpm2-provider-pkey.h" + ++#if OPENSSL_VERSION_NUMBER >= 0x40100000 ++#define TPM2_ASN1_STRING_get_length(x) ASN1_STRING_get_length(x) ++#define TPM2_ASN1_STRING_set1_data(s, d, l) ASN1_STRING_set1_data(s, d, l) ++#else ++#define TPM2_ASN1_STRING_get_length(x) ASN1_STRING_length(x) ++#define TPM2_ASN1_STRING_set1_data(s, d, l) ASN1_STRING_set(s, d, l) ++#endif ++ + typedef struct { + ASN1_OBJECT *type; + ASN1_BOOLEAN emptyAuth; +@@ -81,8 +91,8 @@ tpm2_keydata_write(const TPM2_KEYDATA *keydata, BIO *bout, TPM2_PKEY_FORMAT form + else + ASN1_INTEGER_set_uint64(tpk->parent, TPM2_RH_OWNER); + +- ASN1_STRING_set(tpk->privkey, &privbuf[0], privbuf_len); +- ASN1_STRING_set(tpk->pubkey, &pubbuf[0], pubbuf_len); ++ TPM2_ASN1_STRING_set1_data(tpk->privkey, &privbuf[0], privbuf_len); ++ TPM2_ASN1_STRING_set1_data(tpk->pubkey, &pubbuf[0], pubbuf_len); + + switch (format) { + case KEY_FORMAT_PEM: +@@ -150,13 +160,13 @@ tpm2_keydata_read(BIO *bin, TPM2_KEYDATA *keydata, TPM2_PKEY_FORMAT format) + goto error; + + if (Tss2_MU_TPM2B_PRIVATE_Unmarshal(ASN1_STRING_get0_data(tpk->privkey), +- ASN1_STRING_length(tpk->privkey), NULL, +- &keydata->priv)) ++ TPM2_ASN1_STRING_get_length(tpk->privkey), ++ NULL, &keydata->priv)) + goto error; + + if (Tss2_MU_TPM2B_PUBLIC_Unmarshal(ASN1_STRING_get0_data(tpk->pubkey), +- ASN1_STRING_length(tpk->pubkey), NULL, +- &keydata->pub)) ++ TPM2_ASN1_STRING_get_length(tpk->pubkey), ++ NULL, &keydata->pub)) + goto error; + + TSSPRIVKEY_free(tpk); +-- +2.47.3 +
meta-tpm/recipes-tpm2/tpm2-openssl/tpm2-openssl_1.3.0.bb +1 -0
@@ -7,6 +7,7 @@ DEPENDS = "autoconf-archive-native tpm2-tss openssl" SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz \ file://0001-Fix-ASN1_OCTET_STRING-and-X509_NAME-access-for-OpenS.patch \ + file://0002-pkey-fix-compilation-with-OpenSSL-4.1.patch \ " SRC_URI[sha256sum] = "9a9aca55d4265ec501bcf9c56d21d6ca18dba902553f21c888fe725b42ea9964"
Signature · 1 line
2.47.3
PATCH 2/2 dm-verity-image-initramfs: Fix IMAGE_PREPROCESS_COMMAND
In reply to Scott MurrayRemove semi-colon to quiet new warning about them being incorrect in IMAGE_PREPROCESS_COMMAND.
Signed-off-by Scott Murray <[email protected]>
--- recipes-core/images/dm-verity-image-initramfs.bb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-core/images/dm-verity-image-initramfs.bb +1 -1
@@ -40,4 +40,4 @@ deploy_verity_hash() { ${STAGING_VERITY_DIR}/${DM_VERITY_IMAGE}.${DM_VERITY_IMAGE_TYPE}.verity.env \ ${IMAGE_ROOTFS}${datadir}/misc/dm-verity.env } -IMAGE_PREPROCESS_COMMAND += "deploy_verity_hash;" +IMAGE_PREPROCESS_COMMAND += "deploy_verity_hash "
Signature · 1 line
2.47.3