From c645f59d4c37deb08074b96945df6e22cac30f0a Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Tue, 13 Aug 2019 14:58:56 +0200 Subject: [PATCH] Update to upstream version 1.1.5 --- 000-Fix-build-with-gcc-8.2.x.patch | 51 --------------- 002-Enable-testing-on-kernels-5.0.patch | 65 ------------------- 003-fix-test-case.patch | 35 ---------- ...patch => 100-workaround-cppcheck-bug.patch | 0 libkcapi.spec | 15 +++-- sources | 4 +- 6 files changed, 11 insertions(+), 159 deletions(-) delete mode 100644 000-Fix-build-with-gcc-8.2.x.patch delete mode 100644 002-Enable-testing-on-kernels-5.0.patch delete mode 100644 003-fix-test-case.patch rename 001-workaround-cppcheck-bug.patch => 100-workaround-cppcheck-bug.patch (100%) diff --git a/000-Fix-build-with-gcc-8.2.x.patch b/000-Fix-build-with-gcc-8.2.x.patch deleted file mode 100644 index 6fd575a..0000000 --- a/000-Fix-build-with-gcc-8.2.x.patch +++ /dev/null @@ -1,51 +0,0 @@ -From 52620ec798a580b2053d16a42362e9926729eb30 Mon Sep 17 00:00:00 2001 -From: Fabrice Fontaine -Date: Sun, 20 Jan 2019 20:04:13 +0100 -Subject: [PATCH] apps/kcapi-hasher.c: fix build with gcc 8.2.x - -Fixes: - - http://autobuild.buildroot.org/results/8355bc42238e885f7f11ed3d9d37fc55ebdead2b - -Signed-off-by: Fabrice Fontaine -Signed-off-by: Stephan Mueller ---- - apps/kcapi-hasher.c | 12 ++++++++---- - 1 file changed, 8 insertions(+), 4 deletions(-) - -diff --git a/apps/kcapi-hasher.c b/apps/kcapi-hasher.c -index d6be685..7172b12 100644 ---- a/apps/kcapi-hasher.c -+++ b/apps/kcapi-hasher.c -@@ -357,16 +357,20 @@ static int hasher(struct kcapi_handle *handle, const struct hash_params *params, - } - - /* -- * GCC v8.1.0 introduced -Wstringop-truncation but it is not smart enough to -- * find that cursor string will be NULL-terminated after all paste() calls and -- * warns with: -+ * GCC v8.1.0 introduced -Wstringop-truncation and GCC v8.2.0 introduced -+ * -Wstringop-overflow but it is not smart enough to find that cursor string -+ * will be NULL-terminated after all paste() calls and warns with: - * error: 'strncpy' destination unchanged after copying no bytes [-Werror=stringop-truncation] - * error: 'strncpy' output truncated before terminating nul copying 5 bytes from a string of the same length [-Werror=stringop-truncation] -+ * error: 'strncpy' specified bound depends on the length of the source argument [-Werror=stringop-overflow=] - */ - #pragma GCC diagnostic push - #if GCC_VERSION >= 80100 - #pragma GCC diagnostic ignored "-Wstringop-truncation" - #endif -+#if GCC_VERSION >= 80200 -+#pragma GCC diagnostic ignored "-Wstringop-overflow" -+#endif - static char *paste(char *dst, const char *src, size_t size) - { - strncpy(dst, src, size); -@@ -417,7 +421,7 @@ static char *get_hmac_file(const char *filename, const char *checkdir) - strncpy(cursor, "\0", 1); - return checkfile; - } --#pragma GCC diagnostic pop /* -Wstringop-truncation */ -+#pragma GCC diagnostic pop /* -Wstringop-truncation -Wstringop-overflow */ - - static int hash_files(const struct hash_params *params, - char *filenames[], uint32_t files, diff --git a/002-Enable-testing-on-kernels-5.0.patch b/002-Enable-testing-on-kernels-5.0.patch deleted file mode 100644 index 24b437c..0000000 --- a/002-Enable-testing-on-kernels-5.0.patch +++ /dev/null @@ -1,65 +0,0 @@ -From 4529c9d0583654fcdc74de09b5de5edcf6959b04 Mon Sep 17 00:00:00 2001 -From: Stephan Mueller -Date: Mon, 27 May 2019 11:33:16 +0200 -Subject: [PATCH] Enable testing on kernels >= 5.0 - -Signed-off-by: Stephan Mueller ---- - test/libtest.sh | 6 +++++- - test/test.sh | 11 ++++++++--- - 2 files changed, 13 insertions(+), 4 deletions(-) - -diff --git a/test/libtest.sh b/test/libtest.sh -index 93b2c93..5a1377b 100644 ---- a/test/libtest.sh -+++ b/test/libtest.sh -@@ -128,7 +128,11 @@ check_min_kernelver() { - major=$1 - minor=$2 - -- if [ $(uname -r | cut -d"." -f1) -ge $major ]; then -+ if [ $(uname -r | cut -d"." -f1) -gt $major ]; then -+ return 0 -+ fi -+ -+ if [ $(uname -r | cut -d"." -f1) -eq $major ]; then - if [ $(uname -r | cut -d"." -f2) -ge $minor ]; then - return 0 - fi -diff --git a/test/test.sh b/test/test.sh -index 6320ad0..96136c5 100755 ---- a/test/test.sh -+++ b/test/test.sh -@@ -907,8 +907,13 @@ kppfunc() - rfc4106_aad_iv() { - assoc=$1 - iv=$2 -+ - # New name with 4.2 -- if [ $(uname -r | cut -d"." -f1) -ge 4 ]; then -+ if [ $(uname -r | cut -d"." -f1) -gt 4 ]; then -+ assoc="${assoc}${iv}" -+ fi -+ -+ if [ $(uname -r | cut -d"." -f1) -eq 4 ]; then - if [ $(uname -r | cut -d"." -f2) -ge 2 ]; then - assoc="${assoc}${iv}" - fi -@@ -1549,7 +1554,7 @@ else - echo_deact "AEAD tests of copied AAD deactivated" - fi - --if $(check_min_kernelver 4 99); then -+if $(check_min_kernelver 5 99); then - asymfunc 4 - asymfunc 4 -s - asymfunc 4 -v -@@ -1572,7 +1577,7 @@ else - echo_deact "All asymmetric tests deactivated" - fi - --if $(check_min_kernelver 4 99); then -+if $(check_min_kernelver 5 99); then - kppfunc 13 - kppfunc 13 X -m - kppfunc 13 -v diff --git a/003-fix-test-case.patch b/003-fix-test-case.patch deleted file mode 100644 index 44521b3..0000000 --- a/003-fix-test-case.patch +++ /dev/null @@ -1,35 +0,0 @@ -From b455bb77dcf7a38bb881898efcd5122aa61e68cc Mon Sep 17 00:00:00 2001 -From: Stephan Mueller -Date: Mon, 27 May 2019 13:21:03 +0200 -Subject: [PATCH] fix test case - -- fix possible mem leak - -- fix counting of available memory - -Signed-off-by: Stephan Mueller ---- - test/kcapi-main.c | 3 ++- - 1 file changed, 2 insertions(+), 1 deletion(-) - -diff --git a/test/kcapi-main.c b/test/kcapi-main.c -index 46cce51..bce21b7 100644 ---- a/test/kcapi-main.c -+++ b/test/kcapi-main.c -@@ -282,6 +282,7 @@ static int fuzz_init_test(unsigned int size) - - if (get_random(name, size, 0)) { - printf("get_random call failed\n"); -+ free(name); - return 1; - } - -@@ -1016,7 +1017,7 @@ static int cavs_sym_stream(struct kcapi_cavs *cavs_test, uint32_t loops, - } - - outiov.iov_base = (uint8_t *)outiov.iov_base + ret; -- outiov.iov_len += ret; -+ outiov.iov_len -= ret; - outptr += ret; - } - diff --git a/001-workaround-cppcheck-bug.patch b/100-workaround-cppcheck-bug.patch similarity index 100% rename from 001-workaround-cppcheck-bug.patch rename to 100-workaround-cppcheck-bug.patch diff --git a/libkcapi.spec b/libkcapi.spec index aa40f1d..f7b7658 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -1,7 +1,7 @@ # Shared object version of libkcapi. %global vmajor 1 %global vminor 1 -%global vpatch 4 +%global vpatch 5 # Do we build the replacements packages? %bcond_with replace_coreutils @@ -97,7 +97,7 @@ bin/kcapi-hasher -n fipshmac -d "$lib_path"/fipscheck \\\ Name: libkcapi Version: %{vmajor}.%{vminor}.%{vpatch} -Release: 6%{?dist} +Release: 1%{?dist} Summary: User space interface to the Linux Kernel Crypto API License: BSD or GPLv2 @@ -105,10 +105,7 @@ URL: http://www.chronox.de/%{name}.html Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc -Patch0: %{giturl}/commit/52620ec798a5.patch#/000-Fix-build-with-gcc-8.2.x.patch -Patch1: 001-workaround-cppcheck-bug.patch -Patch2: %{giturl}/commit/4529c9d05836.patch#/002-Enable-testing-on-kernels-5.0.patch -Patch3: %{giturl}/commit/b455bb77dcf7.patch#/003-fix-test-case.patch +Patch100: 100-workaround-cppcheck-bug.patch BuildRequires: clang BuildRequires: coreutils @@ -369,6 +366,8 @@ done # which is the lowest limit needed to run the testsuite. If that limit # is not met, we do not run it. %if %{test_optmem_max} >= 20480 +# Skip the testsuite on old kernels. +%if %{lua:print(rpm.vercmp(posix.uname('%r'), '5.1'));} >= 0 # Real testsuite. pushd test ENABLE_FUZZ_TEST=1 \ @@ -376,6 +375,7 @@ NO_32BIT_TEST=1 \ ./test-invocation.sh popd %endif +%endif %ldconfig_scriptlets @@ -446,6 +446,9 @@ popd %changelog +* Tue Aug 13 2019 Ondrej Mosnáček - 1.1.5-1 +- Update to upstream version 1.1.5 + * Sat Jul 27 2019 Ondrej Mosnáček - 1.1.4-6 - Backport patch to fix test failure on aarch64 - Remove no longer needed ppc64 workaround diff --git a/sources b/sources index 650fff7..0c37ace 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libkcapi-1.1.4.tar.xz) = b07cc4435829ad73585ca79d06cd57edf6c2e68f66dceac07a72332aa9cd325b79add02fd220166ee5e07a3d7b305df0dc941bccf1310784b3b16bf50291c4f9 -SHA512 (libkcapi-1.1.4.tar.xz.asc) = 22245f4a1fa98f3ad3a21a01e464bd6fba56d8541d5825739c928e577cdb7f5b30098dcdab1086bbbf33707e2c27ebd03c2810dc0e98d27120016dd0749ef7ba +SHA512 (libkcapi-1.1.5.tar.xz) = a9cd82464310d73d79d4aa7808cfe077a7b186511a34396c0521a158198769a7b97785af6072255e2cc8dcc23f5171694811faebcf9801aeb9861d729274fbc2 +SHA512 (libkcapi-1.1.5.tar.xz.asc) = 0630fa29d9f835bd0d1fcd4a58b9d89bf8b1f576d2f1ae5e385bbbff04edd9ba4cad1bdf6132e80f4d15d86e8d8488fa0cb187fbfaa559ed6aa6ad2a15bd97ef