From bb0939a38804754061effd3a7c5997a06e583457 Mon Sep 17 00:00:00 2001 From: Sahana Prasad Date: Apr 23 2020 13:44:44 +0000 Subject: Merge #10 `Add . prefix to files created by fipshmac if -d option is not specified` --- diff --git a/110-fipshmac-compat.patch b/110-fipshmac-compat.patch new file mode 100644 index 0000000..42502f6 --- /dev/null +++ b/110-fipshmac-compat.patch @@ -0,0 +1,30 @@ +diff -up libkcapi-1.1.5/apps/kcapi-hasher.c.fipshmac-compat libkcapi-1.1.5/apps/kcapi-hasher.c +--- libkcapi-1.1.5/apps/kcapi-hasher.c.fipshmac-compat 2019-01-23 07:14:51.000000000 +0100 ++++ libkcapi-1.1.5/apps/kcapi-hasher.c 2020-04-23 14:37:59.518173594 +0200 +@@ -386,10 +386,16 @@ static char *paste(char *dst, const char + static char *get_hmac_file(const char *filename, const char *checkdir) + { + size_t i, filelen, pathlen, namelen, basenamestart = 0; +- size_t prefixlen = strlen(CHECK_PREFIX); ++ const char *check_prefix = CHECK_PREFIX; ++ size_t prefixlen = strlen(check_prefix); + size_t suffixlen = strlen(CHECK_SUFFIX); + char *cursor, *checkfile = NULL; + ++ if (prefixlen == 0 && checkdir == NULL) { ++ check_prefix = "."; ++ prefixlen = 1; ++ } ++ + filelen = strlen(filename); + if (filelen > 4096) { + fprintf(stderr, "File too long\n"); +@@ -415,7 +421,7 @@ static char *get_hmac_file(const char *f + } else if (pathlen > 0) + cursor = paste(cursor, filename, pathlen); + +- cursor = paste(cursor, CHECK_PREFIX, prefixlen); ++ cursor = paste(cursor, check_prefix, prefixlen); + cursor = paste(cursor, filename + basenamestart, namelen); + cursor = paste(cursor, "."CHECK_SUFFIX, 1 + suffixlen); + strncpy(cursor, "\0", 1); diff --git a/libkcapi.spec b/libkcapi.spec index e215942..57613bf 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -101,7 +101,7 @@ bin/kcapi-hasher -n fipshmac -d "$lib_path"/fipscheck \\\ Name: libkcapi Version: %{vmajor}.%{vminor}.%{vpatch} -Release: 3%{?dist} +Release: 4%{?dist} Summary: User space interface to the Linux Kernel Crypto API License: BSD or GPLv2 @@ -110,6 +110,7 @@ Source0: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz Source1: http://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc Patch100: 100-workaround-cppcheck-bug.patch +Patch110: 110-fipshmac-compat.patch BuildRequires: clang BuildRequires: coreutils @@ -453,6 +454,9 @@ popd %changelog +* Thu Apr 23 2020 Tomáš Mráz - 1.1.5-4 +- Add . prefix to files created by fipshmac if -d option is not specified + * Wed Apr 22 2020 Sahana Prasad - 1.1.5-3 - Disables kcapi-enc tests until the kernel bug bz 1826022 is fixed. - Produce also the fipscheck replacement package