summaryrefslogtreecommitdiffstats
path: root/meta-oe
diff options
context:
space:
mode:
authorMartin Jansa <martin.jansa@gmail.com>2024-07-12 11:23:52 +0200
committerKhem Raj <raj.khem@gmail.com>2024-07-14 12:06:20 -0700
commit23777ac6dd8920fc7ffa02fb829b30e0da3af19b (patch)
treedbb413e027f00dd1345ae23ac1d8cd6ce502940b /meta-oe
parent9f4361418d58941d058fb94a3671b9d0904b6300 (diff)
downloadmeta-openembedded-23777ac6dd8920fc7ffa02fb829b30e0da3af19b.tar.gz
pkcs11-provider: backport a fix for build with gcc-14
* fails only with 32bit MACHINEs, e.g. full log from qemux86: http://errors.yoctoproject.org/Errors/Details/790494/ Signed-off-by: Martin Jansa <martin.jansa@gmail.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
Diffstat (limited to 'meta-oe')
-rw-r--r--meta-oe/recipes-support/pkcs11-provider/pkcs11-provider/0001-Fix-types-for-old-32-bit-systems.patch49
-rw-r--r--meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_0.5.bb4
2 files changed, 52 insertions, 1 deletions
diff --git a/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider/0001-Fix-types-for-old-32-bit-systems.patch b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider/0001-Fix-types-for-old-32-bit-systems.patch
new file mode 100644
index 000000000..189a0e21b
--- /dev/null
+++ b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider/0001-Fix-types-for-old-32-bit-systems.patch
@@ -0,0 +1,49 @@
1From 088f038de633b5de777fb0f95cd9598f320151f6 Mon Sep 17 00:00:00 2001
2From: Simo Sorce <simo@redhat.com>
3Date: Wed, 5 Jun 2024 11:22:35 -0400
4Subject: [PATCH] Fix types for old 32 bit systems
5
6On x86 CK_ULONG and size_t have different sizes, ensure we use
7compatible types on our helper functions.
8
9Signed-off-by: Simo Sorce <simo@redhat.com>
10Signed-off-by: Martin Jansa <martin.jansa@gmail.com>
11---
12Upstream-Status: Backport [https://github.com/latchset/pkcs11-provider/commit/9fa16b7fd398b62f06cb10892fe93dc574d67399]
13
14 src/asymmetric_cipher.c | 4 ++--
15 src/util.h | 2 +-
16 2 files changed, 3 insertions(+), 3 deletions(-)
17
18diff --git a/src/asymmetric_cipher.c b/src/asymmetric_cipher.c
19index 4d87b1c..3256fd2 100644
20--- a/src/asymmetric_cipher.c
21+++ b/src/asymmetric_cipher.c
22@@ -251,12 +251,12 @@ static int p11prov_rsaenc_decrypt_init(void *ctx, void *provkey,
23 static int
24 p11prov_tls_constant_time_depadding(struct p11prov_rsaenc_ctx *encctx,
25 unsigned char *out, unsigned char *buf,
26- size_t *out_size, CK_ULONG *ret_cond)
27+ CK_ULONG *out_size, CK_ULONG *ret_cond)
28 {
29 unsigned char randbuf[SSL_MAX_MASTER_KEY_LENGTH];
30 CK_ULONG ver_cond = 0;
31 CK_ULONG cond = 0;
32- size_t length = SSL_MAX_MASTER_KEY_LENGTH;
33+ CK_ULONG length = SSL_MAX_MASTER_KEY_LENGTH;
34 int err;
35
36 /* always generate a random buffer, to constant_time swap in
37diff --git a/src/util.h b/src/util.h
38index bcbc2db..1b24666 100644
39--- a/src/util.h
40+++ b/src/util.h
41@@ -120,7 +120,7 @@ static inline int constant_select_int(CK_ULONG cond, int a, int b)
42 return (int)((A & mask) | (B & ~mask));
43 }
44
45-static inline void constant_select_buf(CK_ULONG cond, size_t size,
46+static inline void constant_select_buf(CK_ULONG cond, CK_ULONG size,
47 unsigned char *dst, unsigned char *a,
48 unsigned char *b)
49 {
diff --git a/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_0.5.bb b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_0.5.bb
index 6c19b6616..fcd8fe631 100644
--- a/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_0.5.bb
+++ b/meta-oe/recipes-support/pkcs11-provider/pkcs11-provider_0.5.bb
@@ -14,7 +14,9 @@ DEPENDS = "openssl"
14 14
15SRCREV = "3a4fdd2a2e5643af2a0f857b66a19b9fa109d40f" 15SRCREV = "3a4fdd2a2e5643af2a0f857b66a19b9fa109d40f"
16 16
17SRC_URI = "git://github.com/latchset/${BPN}.git;branch=main;protocol=https" 17SRC_URI = "git://github.com/latchset/${BPN}.git;branch=main;protocol=https \
18 file://0001-Fix-types-for-old-32-bit-systems.patch \
19"
18 20
19S = "${WORKDIR}/git" 21S = "${WORKDIR}/git"
20 22