diff options
| author | Peter Marko <peter.marko@siemens.com> | 2026-04-09 15:10:32 +0200 |
|---|---|---|
| committer | Scott Murray <scott.murray@konsulko.com> | 2026-04-15 00:18:23 +0300 |
| commit | d975a55a6594cabed377a8f61a41f867a7e02405 (patch) | |
| tree | 62af7364587d31e340b4b7ced56426e7e9a3ad2b /meta-tpm/recipes-tpm2 | |
| parent | 596b966a0d047c2f48cb768821558e918ae0c477 (diff) | |
| download | meta-security-d975a55a6594cabed377a8f61a41f867a7e02405.tar.gz | |
tpm2-pkcs11: fix build failure
Use patch submitted upstream to fix build error:
| src/lib/tpm.c: In function ‘tpm_unseal’:
| src/lib/tpm.c:1040:16: error: incompatible types when returning type ‘_Bool’ but ‘twist’ {aka ‘const char *’} was expected
| 1040 | return false;
| | ^~~~~
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Signed-off-by: Scott Murray <scott.murray@konsulko.com>
Diffstat (limited to 'meta-tpm/recipes-tpm2')
| -rw-r--r-- | meta-tpm/recipes-tpm2/tpm2-pkcs11/files/0001-src-lib-tpm-return-NULL-for-twist-on-auth-failure.patch | 28 | ||||
| -rw-r--r-- | meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/meta-tpm/recipes-tpm2/tpm2-pkcs11/files/0001-src-lib-tpm-return-NULL-for-twist-on-auth-failure.patch b/meta-tpm/recipes-tpm2/tpm2-pkcs11/files/0001-src-lib-tpm-return-NULL-for-twist-on-auth-failure.patch new file mode 100644 index 0000000..2992b11 --- /dev/null +++ b/meta-tpm/recipes-tpm2/tpm2-pkcs11/files/0001-src-lib-tpm-return-NULL-for-twist-on-auth-failure.patch | |||
| @@ -0,0 +1,28 @@ | |||
| 1 | From 0db779aecaae93633be963ffb8fdb097c85cc166 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Peter Marko <peter.marko@siemens.com> | ||
| 3 | Date: Thu, 9 Apr 2026 00:00:00 +0000 | ||
| 4 | Subject: [PATCH] src/lib/tpm: return NULL for twist on auth failure | ||
| 5 | |||
| 6 | `tpm_unseal` returns `twist` (a const char pointer alias). Returning | ||
| 7 | `false` in the error path is a type mismatch that fails with stricter | ||
| 8 | compiler settings. Return `NULL` instead. | ||
| 9 | |||
| 10 | Upstream-Status: Submitted [https://github.com/tpm2-software/tpm2-pkcs11/pull/923] | ||
| 11 | Signed-off-by: Peter Marko <peter.marko@siemens.com> | ||
| 12 | --- | ||
| 13 | src/lib/tpm.c | 2 +- | ||
| 14 | 1 file changed, 1 insertion(+), 1 deletion(-) | ||
| 15 | |||
| 16 | diff --git a/src/lib/tpm.c b/src/lib/tpm.c | ||
| 17 | index 5fff5d5..c51d984 100644 | ||
| 18 | --- a/src/lib/tpm.c | ||
| 19 | +++ b/src/lib/tpm.c | ||
| 20 | @@ -1037,7 +1037,7 @@ twist tpm_unseal(tpm_ctx *ctx, uint32_t handle, twist objauth) { | ||
| 21 | |||
| 22 | bool result = set_esys_auth(ctx->esys_ctx, handle, objauth); | ||
| 23 | if (!result) { | ||
| 24 | - return false; | ||
| 25 | + return NULL; | ||
| 26 | } | ||
| 27 | |||
| 28 | TPM2B_SENSITIVE_DATA *unsealed_data = NULL; | ||
diff --git a/meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb b/meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb index 331dc4f..762b82f 100644 --- a/meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb +++ b/meta-tpm/recipes-tpm2/tpm2-pkcs11/tpm2-pkcs11_1.9.1.bb | |||
| @@ -7,6 +7,7 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=0fc19f620a102768d6dbd1e7166e78ab" | |||
| 7 | DEPENDS = "autoconf-archive pkgconfig sqlite3 openssl libtss2-dev tpm2-tools libyaml p11-kit python3-setuptools-native" | 7 | DEPENDS = "autoconf-archive pkgconfig sqlite3 openssl libtss2-dev tpm2-tools libyaml p11-kit python3-setuptools-native" |
| 8 | 8 | ||
| 9 | SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz" | 9 | SRC_URI = "https://github.com/tpm2-software/${BPN}/releases/download/${PV}/${BPN}-${PV}.tar.gz" |
| 10 | SRC_URI += "file://0001-src-lib-tpm-return-NULL-for-twist-on-auth-failure.patch" | ||
| 10 | 11 | ||
| 11 | SRC_URI[sha256sum] = "ce24aa5ec2471545576e892b6f64fd873a424371bbf9be4ca3a0e689ea11c9b7" | 12 | SRC_URI[sha256sum] = "ce24aa5ec2471545576e892b6f64fd873a424371bbf9be4ca3a0e689ea11c9b7" |
| 12 | 13 | ||
