From a0aaf7a23a8dadcfbea6dd6000fbbf9911fd6096 Mon Sep 17 00:00:00 2001 From: Khem Raj Date: Tue, 12 Apr 2022 11:16:10 -0700 Subject: libkcapi: Upgrade to 1.4.0 Drop upstreamed patch Disable new warnings seen with gcc 12 Signed-off-by: Khem Raj --- ...l-if-Adjust-for-musl-msghdr-struct-compat.patch | 81 ---------------------- meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb | 31 --------- meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb | 32 +++++++++ 3 files changed, 32 insertions(+), 112 deletions(-) delete mode 100644 meta-oe/recipes-crypto/libkcapi/libkcapi/0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch delete mode 100644 meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb create mode 100644 meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb (limited to 'meta-oe/recipes-crypto') 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 @@ -From d54e532821d40f8094a49742831d32ec7e76caed Mon Sep 17 00:00:00 2001 -From: Khem Raj -Date: Thu, 16 Dec 2021 15:18:21 -0800 -Subject: [PATCH] kcapi-kernel-if: Adjust for musl msghdr struct compatibility - -musl sticks to POSIX and defines msg_iovlen and msg_controllen as int -and socklen_t types respectively whereas glibc and kernel mark them as -size_t which is them assumed as such in the code here as well, Make the -needed conversions to get it going on musl/linux also see [1] for more -info - -[1] https://git.musl-libc.org/cgit/musl/commit/?id=7168790763cdeb794df52be6e3b39fbb021c5a64 - -Upstream-Status: Submitted [https://github.com/smuellerDD/libkcapi/pull/131] -Signed-off-by: Khem Raj ---- - lib/kcapi-kernel-if.c | 22 ++++++++++++++++++---- - 1 file changed, 18 insertions(+), 4 deletions(-) - -diff --git a/lib/kcapi-kernel-if.c b/lib/kcapi-kernel-if.c -index 739841e..e5d15d4 100644 ---- a/lib/kcapi-kernel-if.c -+++ b/lib/kcapi-kernel-if.c -@@ -168,10 +168,14 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle, - } - - msg.msg_control = buffer_p; -- msg.msg_controllen = bufferlen; - msg.msg_iov = iov; -+#ifdef __GLIBC__ - msg.msg_iovlen = iovlen; -- -+ msg.msg_controllen = bufferlen; -+#else -+ msg.msg_iovlen = (int)iovlen; -+ msg.msg_controllen = (socklen_t)bufferlen; -+#endif - /* encrypt/decrypt operation */ - header = CMSG_FIRSTHDR(&msg); - if (!header) { -@@ -193,7 +197,11 @@ ssize_t _kcapi_common_send_meta(struct kcapi_handle *handle, - } - header->cmsg_level = SOL_ALG; - header->cmsg_type = ALG_SET_IV; -+#ifdef __GLIBC__ - header->cmsg_len = iv_msg_size; -+#else -+ header->cmsg_len = (socklen_t)iv_msg_size; -+#endif - alg_iv = (void*)CMSG_DATA(header); - alg_iv->ivlen = tfm->info.ivsize; - memcpy(alg_iv->iv, handle->cipher.iv, tfm->info.ivsize); -@@ -244,8 +252,11 @@ ssize_t _kcapi_common_send_data(struct kcapi_handle *handle, - msg.msg_controllen = 0; - msg.msg_flags = 0; - msg.msg_iov = iov; -+#ifdef __GLIBC__ - msg.msg_iovlen = iovlen; -- -+#else -+ msg.msg_iovlen = (int)iovlen; -+#endif - ret = sendmsg(*_kcapi_get_opfd(handle), &msg, (int)flags); - if (ret < 0) - ret = -errno; -@@ -542,8 +553,11 @@ ssize_t _kcapi_common_recv_data(struct kcapi_handle *handle, - msg.msg_controllen = 0; - msg.msg_flags = 0; - msg.msg_iov = iov; -+#ifdef __GLIBC__ - msg.msg_iovlen = iovlen; -- -+#else -+ msg.msg_iovlen = (int)iovlen; -+#endif - ret = recvmsg(*_kcapi_get_opfd(handle), &msg, 0); - if (ret < 0) - ret = -errno; --- -2.34.1 - diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb deleted file mode 100644 index 8ff5ddd175..0000000000 --- a/meta-oe/recipes-crypto/libkcapi/libkcapi_1.3.1.bb +++ /dev/null @@ -1,31 +0,0 @@ -SUMMARY = "Linux Kernel Crypto API User Space Interface Library" -HOMEPAGE = "http://www.chronox.de/libkcapi.html" -LICENSE = "BSD-3-Clause | GPL-2.0-only" -LIC_FILES_CHKSUM = "file://COPYING;md5=80c467906eb826339c7f09e61808ed23" - -S = "${WORKDIR}/git" -SRCREV = "2936ecd060c299157ac880650ba2c9fd94d27bb1" -SRC_URI = "git://github.com/smuellerDD/libkcapi.git;branch=master;protocol=https \ - file://0001-kcapi-kernel-if-Adjust-for-musl-msghdr-struct-compat.patch \ - " - -inherit autotools - -PACKAGECONFIG ??= "" -PACKAGECONFIG[testapp] = "--enable-kcapi-test,,,bash" -PACKAGECONFIG[apps] = "--enable-kcapi-speed --enable-kcapi-hasher --enable-kcapi-rngapp --enable-kcapi-encapp --enable-kcapi-dgstapp,,," -PACKAGECONFIG[hasher_only] = "--enable-kcapi-hasher --disable-lib-kdf --disable-lib-sym --disable-lib-aead --disable-lib-rng,,," - -do_install:append() { - # bindir contains testapp and apps. However it is always created, even - # when no binaries are installed (empty bin_PROGRAMS in Makefile.am), - rmdir --ignore-fail-on-non-empty ${D}${bindir} - - # Remove the generated binary checksum files - rm -f ${D}${bindir}/.*.hmac - rm -f ${D}${libdir}/.*.hmac -} - -CPPFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare" - -BBCLASSEXTEND = "native" diff --git a/meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb new file mode 100644 index 0000000000..3be8c76b54 --- /dev/null +++ b/meta-oe/recipes-crypto/libkcapi/libkcapi_1.4.0.bb @@ -0,0 +1,32 @@ +SUMMARY = "Linux Kernel Crypto API User Space Interface Library" +HOMEPAGE = "http://www.chronox.de/libkcapi.html" +LICENSE = "BSD-3-Clause | GPL-2.0-only" +LIC_FILES_CHKSUM = "file://COPYING;md5=a2562899bc38f1735868f0bf0c1dd1a5" + +S = "${WORKDIR}/git" +SRCREV = "1429ab42d48123cc8f73b96c69a87fb9c6d8a7c9" +SRC_URI = "git://github.com/smuellerDD/libkcapi.git;branch=master;protocol=https \ + " + +inherit autotools + +PACKAGECONFIG ??= "" +PACKAGECONFIG[testapp] = "--enable-kcapi-test,,,bash" +PACKAGECONFIG[apps] = "--enable-kcapi-speed --enable-kcapi-hasher --enable-kcapi-rngapp --enable-kcapi-encapp --enable-kcapi-dgstapp,,," +PACKAGECONFIG[hasher_only] = "--enable-kcapi-hasher --disable-lib-kdf --disable-lib-sym --disable-lib-aead --disable-lib-rng,,," + +do_install:append() { + # bindir contains testapp and apps. However it is always created, even + # when no binaries are installed (empty bin_PROGRAMS in Makefile.am), + rmdir --ignore-fail-on-non-empty ${D}${bindir} + + # Remove the generated binary checksum files + rm -f ${D}${bindir}/.*.hmac + rm -f ${D}${libdir}/.*.hmac +} + +CPPFLAGS:append:libc-musl:toolchain-clang = " -Wno-error=sign-compare" +CPPFLAGS:remove:libc-musl:toolchain-clang = "-Wno-error=sign-conversion" +CPPFLAGS:append:libc-musl = " -Wno-error=sign-conversion" + +BBCLASSEXTEND = "native" -- cgit v1.2.3-54-g00ecf