summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch81
-rw-r--r--meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb (renamed from meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb)7
2 files changed, 4 insertions, 84 deletions
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch b/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch
deleted file mode 100644
index 687eb359cf..0000000000
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch
+++ /dev/null
@@ -1,81 +0,0 @@
1From d54e532821d40f8094a49742831d32ec7e76caed Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Thu, 16 Dec 2021 15:18:21 -0800
4Subject: [PATCH] kcapi-kernel-if: Adjust for musl msghdr struct compatibility
5
6musl sticks to POSIX and defines msg_iovlen and msg_controllen as int
7and socklen_t types respectively whereas glibc and kernel mark them as
8size_t which is them assumed as such in the code here as well, Make the
9needed conversions to get it going on musl/linux also see [1] for more
10info
11
12[1] https://git.musl-libc.org/cgit/musl/commit/?id=7168790763cdeb794df52be6e3b39fbb021c5a64
13
14Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/131]
15Signed-off-by: Khem Raj <raj.khem@gmail.com>
16---
17 lib/kcapi-kernel-if.c | 22 ++++++++++++++++++----
18 1 file changed, 18 insertions(+), 4 deletions(-)
19
20diff --git a/lib/kcapi-kernel-if.c b/lib/kcapi-kernel-if.c
21index 739841e..e5d15d4 100644
22--- a/lib/kcapi-kernel-if.c
23+++ b/lib/kcapi-kernel-if.c
24@@ -168,10 +168,14 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle,
25 }
26
27 msg.msg_control = buffer_p;
28- msg.msg_controllen = bufferlen;
29 msg.msg_iov = iov;
30+#ifdef __GLIBC__
31 msg.msg_iovlen = iovlen;
32-
33+ msg.msg_controllen = bufferlen;
34+#else
35+ msg.msg_iovlen = (int)iovlen;
36+ msg.msg_controllen = (socklen_t)bufferlen;
37+#endif
38 /* encrypt/decrypt operation */
39 header = CMSG_FIRSTHDR(&msg);
40 if (!header) {
41@@ -193,7 +197,11 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle,
42 }
43 header->cmsg_level = SOL_ALG;
44 header->cmsg_type = ALG_SET_IV;
45+#ifdef __GLIBC__
46 header->cmsg_len = iv_msg_size;
47+#else
48+ header->cmsg_len = (socklen_t)iv_msg_size;
49+#endif
50 alg_iv = (void*)CMSG_DATA(header);
51 alg_iv->ivlen = tfm->info.ivsize;
52 memcpy(alg_iv->iv, handle->cipher.iv, tfm->info.ivsize);
53@@ -244,8 +252,11 @@ ssize_t _kcapi_common_send_data(struct kcapi_handle *handle,
54 msg.msg_controllen = 0;
55 msg.msg_flags = 0;
56 msg.msg_iov = iov;
57+#ifdef __GLIBC__
58 msg.msg_iovlen = iovlen;
59-
60+#else
61+ msg.msg_iovlen = (int)iovlen;
62+#endif
63 ret = sendmsg(*_kcapi_get_opfd(handle), &msg, (int)flags);
64 if (ret < 0)
65 ret = -errno;
66@@ -542,8 +553,11 @@ ssize_t _kcapi_common_recv_data(struct kcapi_handle *handle,
67 msg.msg_controllen = 0;
68 msg.msg_flags = 0;
69 msg.msg_iov = iov;
70+#ifdef __GLIBC__
71 msg.msg_iovlen = iovlen;
72-
73+#else
74+ msg.msg_iovlen = (int)iovlen;
75+#endif
76 ret = recvmsg(*_kcapi_get_opfd(handle), &msg, 0);
77 if (ret < 0)
78 ret = -errno;
79--
802.34.1
81
diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb
index 8ff5ddd175..3be8c76b54 100644
--- a/meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb
+++ b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb
@@ -1,12 +1,11 @@
1SUMMARY = "Linux Kernel Crypto API User Space Interface Library" 1SUMMARY = "Linux Kernel Crypto API User Space Interface Library"
2HOMEPAGE = "http://www.chronox.de/libkcapi.html" 2HOMEPAGE = "http://www.chronox.de/libkcapi.html"
3LICENSE = "BSD-3-Clause | GPL-2.0-only" 3LICENSE = "BSD-3-Clause | GPL-2.0-only"
4LIC_FILES_CHKSUM = "file://COPYING;md5=80c467906eb826339c7f09e61808ed23" 4LIC_FILES_CHKSUM = "file://COPYING;md5=a2562899bc38f1735868f0bf0c1dd1a5"
5 5
6S = "${WORKDIR}/git" 6S = "${WORKDIR}/git"
7SRCREV = "2936ecd060c299157ac880650ba2c9fd94d27bb1" 7SRCREV = "1429ab42d48123cc8f73b96c69a87fb9c6d8a7c9"
8SRC_URI = "git://github.com/smuellerDD/libkcapi.git;branch=master;protocol=https \ 8SRC_URI = "git://github.com/smuellerDD/libkcapi.git;branch=master;protocol=https \
9 file://0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch \
10 " 9 "
11 10
12inherit autotools 11inherit autotools
@@ -27,5 +26,7 @@ do_install:append() {
27} 26}
28 27
29CPPFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare" 28CPPFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare"
29CPPFLAGS:remove:libc-musl:toolchain-clang = "-Wno-error=sign-conversion"
30CPPFLAGS:append:libc-musl = " -Wno-error=sign-conversion"
30 31
31BBCLASSEXTEND = "native" 32BBCLASSEXTEND = "native"