From c3c3d074ac535aaeb6b91e688519ea608ee429a4 Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Thu, 25 Aug 2022 20:23:56 +0200 Subject: [PATCH 01/17] Add a patch to fix tests with kernels 6.0+ Signed-off-by: Ondrej Mosnacek --- 001-tests-kernel-version.patch | 40 ++++++++++++++++++++++++++++++++++ libkcapi.spec | 2 ++ 2 files changed, 42 insertions(+) create mode 100644 001-tests-kernel-version.patch diff --git a/001-tests-kernel-version.patch b/001-tests-kernel-version.patch new file mode 100644 index 0000000..aa21536 --- /dev/null +++ b/001-tests-kernel-version.patch @@ -0,0 +1,40 @@ +From c2af62dcc7a287f3c14f6aaec5724401c1ea470a Mon Sep 17 00:00:00 2001 +From: Ondrej Mosnacek +Date: Mon, 15 Aug 2022 10:19:50 +0200 +Subject: [PATCH] tests: fix overly-optimistic kernel version checks + +The mainline kernel is now at version 6.0 so these >= 5.99 checks are +now incorrectly enabling tests that don't work. Instead of bumping the +imaginary version and face the same problem again in a couple years, +replace the checks with 'false' and a TODO comment. + +Signed-off-by: Ondrej Mosnacek +Signed-off-by: Stephan Mueller +--- + test/test.sh | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +diff --git a/test/test.sh b/test/test.sh +index 1d9be73..a75b802 100755 +--- a/test/test.sh ++++ b/test/test.sh +@@ -1560,7 +1560,8 @@ else + echo_deact "AEAD tests of copied AAD deactivated" + fi + +-if $(check_min_kernelver 5 99); then ++# TODO add version check when supported upstream ++if false; then + asymfunc 4 + asymfunc 4 -s + asymfunc 4 -v +@@ -1583,7 +1584,8 @@ else + echo_deact "All asymmetric tests deactivated" + fi + +-if $(check_min_kernelver 5 99); then ++# TODO add version check when supported upstream ++if false; then + kppfunc 13 + kppfunc 13 X -m + kppfunc 13 -v diff --git a/libkcapi.spec b/libkcapi.spec index 80f6921..0a6779c 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -133,6 +133,8 @@ Source1: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc Source2: sha512hmac-openssl.sh Source3: fipshmac-openssl.sh +Patch: %{giturl}/commit/c2af62dcc7a2.patch#/001-tests-kernel-version.patch + BuildRequires: bash BuildRequires: coreutils BuildRequires: gcc From 205a7d5c3f96d697c50a15531ea455330b1546a4 Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Sun, 14 Aug 2022 13:26:18 +0200 Subject: [PATCH 02/17] Convert tests to TMT Ditch the legacy STR format in favor of TMT/FMF. Signed-off-by: Ondrej Mosnacek --- .fmf/version | 1 + plans/ci.fmf | 5 ++ tests/fipscheck-smoke-test/Makefile | 71 --------------------------- tests/fipscheck-smoke-test/PURPOSE | 3 -- tests/fipscheck-smoke-test/main.fmf | 17 +++++++ tests/fipscheck-smoke-test/runtest.sh | 3 +- tests/main.fmf | 29 +++++++++++ tests/tests.yml | 45 ----------------- 8 files changed, 53 insertions(+), 121 deletions(-) create mode 100644 .fmf/version create mode 100644 plans/ci.fmf delete mode 100644 tests/fipscheck-smoke-test/Makefile delete mode 100644 tests/fipscheck-smoke-test/PURPOSE create mode 100644 tests/fipscheck-smoke-test/main.fmf create mode 100644 tests/main.fmf delete mode 100644 tests/tests.yml diff --git a/.fmf/version b/.fmf/version new file mode 100644 index 0000000..d00491f --- /dev/null +++ b/.fmf/version @@ -0,0 +1 @@ +1 diff --git a/plans/ci.fmf b/plans/ci.fmf new file mode 100644 index 0000000..d3cd36f --- /dev/null +++ b/plans/ci.fmf @@ -0,0 +1,5 @@ +summary: Run CI tests +discover: + how: fmf +execute: + how: tmt diff --git a/tests/fipscheck-smoke-test/Makefile b/tests/fipscheck-smoke-test/Makefile deleted file mode 100644 index 0e0dda3..0000000 --- a/tests/fipscheck-smoke-test/Makefile +++ /dev/null @@ -1,71 +0,0 @@ -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Makefile of /CoreOS/libgcrypt/smoke-test -# Description: Test calls upstream test suite. -# Author: Ondrej Moris -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -export TEST=/CoreOS/libgcrypt/smoke-test -export TESTVERSION=1.0 - -BUILT_FILES= - -FILES=$(METADATA) runtest.sh Makefile PURPOSE - -.PHONY: all install download clean - -run: $(FILES) build - ./runtest.sh - -build: $(BUILT_FILES) - chmod a+x runtest.sh - -clean: - rm -f *~ $(BUILT_FILES) - - -include /usr/share/rhts/lib/rhts-make.include - -$(METADATA): Makefile - @echo "Owner: Ondrej Moris " > $(METADATA) - @echo "Name: $(TEST)" >> $(METADATA) - @echo "TestVersion: $(TESTVERSION)" >> $(METADATA) - @echo "Path: $(TEST_DIR)" >> $(METADATA) - @echo "Description: Test calls upstream test suite." >> $(METADATA) - @echo "Type: Sanity" >> $(METADATA) - @echo "TestTime: 15m" >> $(METADATA) - @echo "RunFor: libgcrypt" >> $(METADATA) - @echo "Requires: libgcrypt" >> $(METADATA) - @echo "Requires: nfs-utils" >> $(METADATA) - @echo "Requires: rpm-build" >> $(METADATA) - @echo "Requires: gawk" >> $(METADATA) - @echo "Requires: gcc-c++ fipscheck" >> $(METADATA) - @echo "Requires: libgpg-error-devel wget" >> $(METADATA) - @echo "Requires: pkgconfig texinfo libselinux-utils" >> $(METADATA) - @echo "Releases: -RHEL3 -RHEL4" >> $(METADATA) - @echo "Priority: Normal" >> $(METADATA) - @echo "Architectures: i386 x86_64 s390x ia64" >> $(METADATA) - @echo "License: GPLv2" >> $(METADATA) - @echo "Confidential: no" >> $(METADATA) - @echo "Destructive: no" >> $(METADATA) - - rhts-lint $(METADATA) diff --git a/tests/fipscheck-smoke-test/PURPOSE b/tests/fipscheck-smoke-test/PURPOSE deleted file mode 100644 index 5df6ca9..0000000 --- a/tests/fipscheck-smoke-test/PURPOSE +++ /dev/null @@ -1,3 +0,0 @@ -PURPOSE of /CoreOS/libgcrypt/Sanity/smoke-test -Description: Test calls upstream test suite. -Author: Ondrej Moris diff --git a/tests/fipscheck-smoke-test/main.fmf b/tests/fipscheck-smoke-test/main.fmf new file mode 100644 index 0000000..a81cae2 --- /dev/null +++ b/tests/fipscheck-smoke-test/main.fmf @@ -0,0 +1,17 @@ +summary: Fipscheck smoke test +framework: beakerlib +test: ./runtest.sh +require: +- fipscheck +- gawk +- gcc-c++ +- libgcrypt +- libgpg-error-devel +- libselinux-utils +- libtool +- nfs-utils +- pkgconfig +- rpm-build +- texinfo +- wget +tier: 2 diff --git a/tests/fipscheck-smoke-test/runtest.sh b/tests/fipscheck-smoke-test/runtest.sh index dd1803d..6f9bbab 100755 --- a/tests/fipscheck-smoke-test/runtest.sh +++ b/tests/fipscheck-smoke-test/runtest.sh @@ -26,8 +26,7 @@ # # ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# Include rhts environment -#. /usr/bin/rhts-environment.sh +# Include beakerlib environment . /usr/share/beakerlib/beakerlib.sh PACKAGE="libgcrypt" diff --git a/tests/main.fmf b/tests/main.fmf new file mode 100644 index 0000000..4b6064e --- /dev/null +++ b/tests/main.fmf @@ -0,0 +1,29 @@ +component: libkcapi +contact: Ondrej Mosnacek + +/upstream: + require: [libkcapi-tests] + tier: 1 + + /basic: + summary: Basic functionality + test: /usr/libexec/libkcapi/test.sh + /encrypt: + summary: Encryption/decryption + test: /usr/libexec/libkcapi/kcapi-enc-test.sh + /encrypt-large: + summary: Encryption/decryption of large data + test: /usr/libexec/libkcapi/kcapi-enc-test-large.sh + /digest: + summary: Message digest + test: /usr/libexec/libkcapi/kcapi-dgst-test.sh + /digest-convenience: + summary: Message digest convenience functions + test: /usr/libexec/libkcapi/kcapi-convenience.sh + /hasher: + summary: Checksum helpers + test: /usr/libexec/libkcapi/hasher-test.sh + /fuzz-test: + summary: Fuzz test + test: /usr/libexec/libkcapi/kcapi-fuzz-test.sh + duration: 2h diff --git a/tests/tests.yml b/tests/tests.yml deleted file mode 100644 index 1a0db89..0000000 --- a/tests/tests.yml +++ /dev/null @@ -1,45 +0,0 @@ -- hosts: localhost - tags: - - classic - - container - roles: - - role: standard-test-basic - required_packages: - - libkcapi-tests - tests: - - upstream-basic-test: - run: /usr/libexec/libkcapi/test.sh - - upstream-enc-test: - run: /usr/libexec/libkcapi/kcapi-enc-test.sh - - upstream-enc-test-large: - run: /usr/libexec/libkcapi/kcapi-enc-test-large.sh - - upstream-dgst-test: - run: /usr/libexec/libkcapi/kcapi-dgst-test.sh - - upstream-hasher-test: - run: /usr/libexec/libkcapi/hasher-test.sh - - upstream-convenience-test: - run: /usr/libexec/libkcapi/kcapi-convenience.sh - - upstream-fuzz-test: - run: /usr/libexec/libkcapi/kcapi-fuzz-test.sh - -- hosts: localhost - tags: - - classic - - container - roles: - - role: standard-test-beakerlib - required_packages: - - fipscheck - - gawk - - gcc-c++ - - libgcrypt - - libgpg-error-devel - - libselinux-utils - - libtool - - nfs-utils - - pkgconfig - - rpm-build - - texinfo - - wget - tests: - - fipscheck-smoke-test From 04ba39d474f52879b2d135f5ca15be93b3b05115 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 19 Jan 2023 16:40:28 +0000 Subject: [PATCH 03/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild Signed-off-by: Fedora Release Engineering From e0f0f65d7851cfeaedacb21a0e1dcd7374a72ad1 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 20 Jul 2023 11:15:09 +0000 Subject: [PATCH 04/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild Signed-off-by: Fedora Release Engineering From 358a5759e843499bd47d5bb5954e7b705598235c Mon Sep 17 00:00:00 2001 From: Yaakov Selkowitz Date: Fri, 28 Jul 2023 15:09:48 -0400 Subject: [PATCH 05/17] Fix build with cppcheck-2.11 String literal concatenation raises syntaxError with cppcheck-2.11, which is a regression: https://trac.cppcheck.net/ticket/11830 --- libkcapi.spec | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libkcapi.spec b/libkcapi.spec index 0a6779c..4d0e210 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -418,7 +418,9 @@ done %make_build scan %endif %if %{with cppcheck} -%make_build cppcheck +# string literal concatenation raises syntaxError with cppcheck-2.11 +# https://trac.cppcheck.net/ticket/11830 +%make_build cppcheck CPPCHECK="cppcheck -UCHECK_DIR" %endif %if %{with test} From 8ccb7646224af41e382bcef72b769a7cff048217 Mon Sep 17 00:00:00 2001 From: Zoltan Fridrich Date: Wed, 30 Aug 2023 16:51:19 +0200 Subject: [PATCH 06/17] Migrate to SPDX license Signed-off-by: Zoltan Fridrich --- libkcapi.spec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libkcapi.spec b/libkcapi.spec index 4d0e210..700f0c3 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -126,7 +126,7 @@ Version: %{vmajor}.%{vminor}.%{vpatch} Release: %autorelease Summary: User space interface to the Linux Kernel Crypto API -License: BSD or GPLv2 +License: BSD-3-Clause OR GPL-2.0-only URL: https://www.chronox.de/%{name}.html Source0: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz Source1: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc From e12f61b6c3e5cb6371d7ccfd0cbb5d974e0edf18 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Sun, 21 Jan 2024 04:26:50 +0000 Subject: [PATCH 07/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From b5d3571bcb3dd931d515a64fbc5fef328037e4fe Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 25 Jan 2024 02:37:46 +0000 Subject: [PATCH 08/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_40_Mass_Rebuild From 57a3a10c995979321286a620faf9784cb3a71a1e Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 18 Jul 2024 14:13:54 +0000 Subject: [PATCH 09/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_41_Mass_Rebuild From f96f2e26b1133829e79b84582069fa879c7d1209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Wed, 31 Jul 2024 14:40:09 +0200 Subject: [PATCH 10/17] Fix upstream URLs (fedora#2291348) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Ondrej Mosnáček --- libkcapi.spec | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libkcapi.spec b/libkcapi.spec index 700f0c3..ee60885 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -127,9 +127,9 @@ Release: %autorelease Summary: User space interface to the Linux Kernel Crypto API License: BSD-3-Clause OR GPL-2.0-only -URL: https://www.chronox.de/%{name}.html -Source0: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz -Source1: https://www.chronox.de/%{name}/%{name}-%{version}.tar.xz.asc +URL: https://www.chronox.de/%{name}/ +Source0: https://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz +Source1: https://www.chronox.de/%{name}/releases/%{version}/%{name}-%{version}.tar.xz.asc Source2: sha512hmac-openssl.sh Source3: fipshmac-openssl.sh From 706c546f2781fed6c0d3a4d59e12b004b228b562 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Wed, 31 Jul 2024 12:48:44 +0200 Subject: [PATCH 11/17] Fix cppcheck failure (fedora#2300902) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Suggested-by: Zoltán Fridrich Signed-off-by: Ondrej Mosnáček --- libkcapi.spec | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libkcapi.spec b/libkcapi.spec index ee60885..c215181 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -418,9 +418,11 @@ done %make_build scan %endif %if %{with cppcheck} -# string literal concatenation raises syntaxError with cppcheck-2.11 -# https://trac.cppcheck.net/ticket/11830 -%make_build cppcheck CPPCHECK="cppcheck -UCHECK_DIR" +# -UCHECK_DIR: string literal concatenation raises syntaxError +# with cppcheck-2.11 (https://trac.cppcheck.net/ticket/11830) +# --check-level=exhaustive: otherwise it emits warnings that get +# treated like errors +%make_build cppcheck CPPCHECK="cppcheck --check-level=exhaustive -UCHECK_DIR" %endif %if %{with test} From 86530d6b925d8ea0c92ead28b19a0f1be2c1a261 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Sat, 13 Jan 2024 15:05:28 +0100 Subject: [PATCH 12/17] Update to version 1.5.0 (fedora#2257976) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Also adjust handling of binaries to account of upstream moving things around. Signed-off-by: Ondrej Mosnáček --- 001-tests-kernel-version.patch | 40 -------------- libkcapi.spec | 98 +++++++++++++++++++--------------- sources | 4 +- 3 files changed, 58 insertions(+), 84 deletions(-) delete mode 100644 001-tests-kernel-version.patch diff --git a/001-tests-kernel-version.patch b/001-tests-kernel-version.patch deleted file mode 100644 index aa21536..0000000 --- a/001-tests-kernel-version.patch +++ /dev/null @@ -1,40 +0,0 @@ -From c2af62dcc7a287f3c14f6aaec5724401c1ea470a Mon Sep 17 00:00:00 2001 -From: Ondrej Mosnacek -Date: Mon, 15 Aug 2022 10:19:50 +0200 -Subject: [PATCH] tests: fix overly-optimistic kernel version checks - -The mainline kernel is now at version 6.0 so these >= 5.99 checks are -now incorrectly enabling tests that don't work. Instead of bumping the -imaginary version and face the same problem again in a couple years, -replace the checks with 'false' and a TODO comment. - -Signed-off-by: Ondrej Mosnacek -Signed-off-by: Stephan Mueller ---- - test/test.sh | 6 ++++-- - 1 file changed, 4 insertions(+), 2 deletions(-) - -diff --git a/test/test.sh b/test/test.sh -index 1d9be73..a75b802 100755 ---- a/test/test.sh -+++ b/test/test.sh -@@ -1560,7 +1560,8 @@ else - echo_deact "AEAD tests of copied AAD deactivated" - fi - --if $(check_min_kernelver 5 99); then -+# TODO add version check when supported upstream -+if false; then - asymfunc 4 - asymfunc 4 -s - asymfunc 4 -v -@@ -1583,7 +1584,8 @@ else - echo_deact "All asymmetric tests deactivated" - fi - --if $(check_min_kernelver 5 99); then -+# TODO add version check when supported upstream -+if false; then - kppfunc 13 - kppfunc 13 X -m - kppfunc 13 -v diff --git a/libkcapi.spec b/libkcapi.spec index c215181..bb1ebd0 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -1,6 +1,6 @@ # Shared object version of libkcapi. %global vmajor 1 -%global vminor 4 +%global vminor 5 %global vpatch 0 # Do we build the replacements packages? @@ -84,8 +84,9 @@ %global hmaccalc_evr 0.9.14-10%{?dist} %endif +%global apps_coreutils sha1sum sha224sum sha256sum sha384sum sha512sum md5sum sm3sum %global apps_hmaccalc sha1hmac sha224hmac sha256hmac sha384hmac sha512hmac sm3hmac -%global apps_fipscheck sha1sum sha224sum sha256sum sha384sum sha512sum md5sum sm3sum fipscheck fipshmac +%global apps_fipscheck fipscheck fipshmac # On old kernels use mock hashers implemented via openssl %if %{lua:print(rpm.vercmp(posix.uname('%r'), '3.19'));} >= 0 @@ -96,8 +97,8 @@ %global fipshmac bash %{SOURCE3} %endif -# Add generation of HMAC checksums of the final stripped -# binaries. %%define with lazy globbing is used here +# Add generation of HMAC checksum of the final stripped +# binary. %%define with lazy globbing is used here # intentionally, because using %%global does not work. %define __spec_install_post \ %{?__debug_package:%{__debug_install_post}} \ @@ -105,20 +106,12 @@ %{__os_install_post} \ bin_path=%{buildroot}%{_bindir} \ lib_path=%{buildroot}/%{_lib} \ -for app in %{apps_hmaccalc}; do \ - test -e "$bin_path"/$app || continue \ - { %sha512hmac "$bin_path"/$app || exit 1; } \\\ - | cut -f 1 -d ' ' >"$lib_path"/hmaccalc/$app.hmac \ -done \ -for app in %{apps_fipscheck}; do \ - test -e "$bin_path"/$app || continue \ - %fipshmac -d "$lib_path"/fipscheck "$bin_path"/$app || exit 1 \ -done \ -%{_bindir}/hardlink -cfv %{buildroot}%{_bindir} \ -%fipshmac -d "$lib_path"/fipscheck \\\ - "$lib_path"/libkcapi.so.%{version} || exit 1 \ +{ %sha512hmac "$bin_path"/kcapi-hasher || exit 1; } | \\\ + cut -f 1 -d ' ' >"$lib_path"/hmaccalc/kcapi-hasher.hmac \ +{ %sha512hmac "$lib_path"/libkcapi.so.%{version} || exit 1; } | \\\ + cut -f 1 -d ' ' >"$lib_path"/hmaccalc/libkcapi.so.%{version}.hmac \ %{__ln_s} libkcapi.so.%{version}.hmac \\\ - "$lib_path"/fipscheck/libkcapi.so.%{vmajor}.hmac \ + "$lib_path"/hmaccalc/libkcapi.so.%{vmajor}.hmac \ %{nil} Name: libkcapi @@ -133,8 +126,6 @@ Source1: https://www.chronox.de/%{name}/releases/%{version}/%{name}-%{ver Source2: sha512hmac-openssl.sh Source3: fipshmac-openssl.sh -Patch: %{giturl}/commit/c2af62dcc7a2.patch#/001-tests-kernel-version.patch - BuildRequires: bash BuildRequires: coreutils BuildRequires: gcc @@ -199,10 +190,18 @@ User documentation for %{name}. %endif +%package hasher +Summary: Common %{name} hashing application +Requires: %{name}%{?_isa} == %{version}-%{release} + +%description hasher +Provides The kcapi-hasher binary used by other %{name} subpackages. + + %if %{with replace_coreutils} %package checksum Summary: Drop-in replacement for *sum utils provided by the %{name} package -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}-hasher%{?_isa} == %{version}-%{release} Requires: coreutils%{?_isa} >= %{coreutils_evr} @@ -218,7 +217,7 @@ coreutils) using %{name}. %if %{with replace_fipscheck} %package fipscheck Summary: Drop-in replacements for fipscheck/fipshmac provided by the %{name} package -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}-hasher%{?_isa} == %{version}-%{release} Obsoletes: fipscheck <= %{fipscheck_evr} @@ -234,7 +233,7 @@ package fipscheck) using %{name}. %if %{with replace_hmaccalc} %package hmaccalc Summary: Drop-in replacements for hmaccalc provided by the %{name} package -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}-hasher%{?_isa} == %{version}-%{release} Obsoletes: hmaccalc <= %{hmaccalc_evr} @@ -259,7 +258,8 @@ is highly discouraged. %package tools Summary: Utility applications for the %{name} package -Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}%{?_isa} == %{version}-%{release} +Requires: %{name}-hasher%{?_isa} == %{version}-%{release} %description tools Utility applications that are provided with %{name}. This includes @@ -290,6 +290,10 @@ Auxiliary scripts for testing %{name}. %prep %autosetup -p 1 -S git +# Work around https://bugzilla.redhat.com/show_bug.cgi?id=2258240 +sed -i -e 's|XML V45|XML V4.1.2|' -e 's|/xml/4\.5/|/xml/4.1.2/|' \ + lib/doc/libkcapi.tmpl + %if %{with_sysctl_tweak} %{__cat} << EOF > README.%{distroname_ext} This package increases the default limit of the ancillary buffer size @@ -373,20 +377,22 @@ EOF %endif # Install replacement tools, if enabled. -%if !%{with replace_coreutils} -%{__rm} -f \ - %{buildroot}%{_bindir}/md5sum \ - %{buildroot}%{_bindir}/sha*sum \ - %{buildroot}%{_bindir}/sm*sum +%if %{with replace_coreutils} +for app in %apps_coreutils; do + %{__ln_s} ../libexec/libkcapi/$app %{buildroot}%{_bindir}/$app +done %endif -%if !%{with replace_fipscheck} -%{__rm} -f %{buildroot}%{_bindir}/fips* +%if %{with replace_fipscheck} +for app in %apps_fipscheck; do + %{__ln_s} ../libexec/libkcapi/$app %{buildroot}%{_bindir}/$app +done %endif -%if !%{with replace_hmaccalc} -%{__rm} -f %{buildroot}%{_bindir}/sha*hmac -%{__rm} -f %{buildroot}%{_bindir}/sm*hmac +%if %{with replace_hmaccalc} +for app in %apps_hmaccalc; do + %{__ln_s} ../libexec/libkcapi/$app %{buildroot}%{_bindir}/$app +done %endif # We don't ship autocrap dumplings. @@ -454,8 +460,8 @@ popd %license COPYING* /%{_lib}/%{name}.so.%{vmajor} /%{_lib}/%{name}.so.%{version} -/%{_lib}/fipscheck/%{name}.so.%{vmajor}.hmac -/%{_lib}/fipscheck/%{name}.so.%{version}.hmac +/%{_lib}/hmaccalc/%{name}.so.%{vmajor}.hmac +/%{_lib}/hmaccalc/%{name}.so.%{version}.hmac %if %{with_sysctl_tweak} %doc %{_pkgdocdir}/README.%{distroname_ext} %{_sysctldir}/%{sysctl_prio}-%{name}-optmem_max.conf @@ -479,28 +485,33 @@ popd %endif +%files hasher +%{_bindir}/kcapi-hasher +%{_libexecdir}/%{name}/md5sum +%{_libexecdir}/%{name}/sha*sum +%{_libexecdir}/%{name}/sm*sum +%{_libexecdir}/%{name}/fips* +%{_libexecdir}/%{name}/sha*hmac +%{_libexecdir}/%{name}/sm*hmac +/%{_lib}/hmaccalc/kcapi-hasher.hmac + + %if %{with replace_coreutils} %files checksum %{_bindir}/md5sum %{_bindir}/sha*sum %{_bindir}/sm*sum -/%{_lib}/fipscheck/md5sum.hmac -/%{_lib}/fipscheck/sha*sum.hmac -/%{_lib}/fipscheck/sm*sum.hmac %endif %if %{with replace_fipscheck} %files fipscheck %{_bindir}/fips* -/%{_lib}/fipscheck/fips*.hmac %endif %if %{with replace_hmaccalc} %files hmaccalc %{_bindir}/sha*hmac %{_bindir}/sm*hmac -/%{_lib}/hmaccalc/sha*hmac.hmac -/%{_lib}/hmaccalc/sm*hmac.hmac %endif @@ -515,7 +526,10 @@ popd %if %{with test_package} %files tests -%{_libexecdir}/%{name}/* +%{_libexecdir}/%{name}/kcapi +%{_libexecdir}/%{name}/kcapi-convenience +%{_libexecdir}/%{name}/kcapi-enc-test-large +%{_libexecdir}/%{name}/*.sh %endif diff --git a/sources b/sources index 7e8a98f..0f7842a 100644 --- a/sources +++ b/sources @@ -1,2 +1,2 @@ -SHA512 (libkcapi-1.4.0.tar.xz) = fa3df1fe22eba32585de5df044f907d3ad189c33f5704fe29b0fdeda92e772ef077055b80e17bc1646a8cdedaf4f195aadf0b133f493597f0f7657b04ea93a99 -SHA512 (libkcapi-1.4.0.tar.xz.asc) = a41303cba88b214c82537bb5de2584a72a239670318753ba6873a2c3ebe3b56ffd381fdf7ae266aa21857e850bebdfbfdec487c98655ddbc2b9a0ba0d4f383ca +SHA512 (libkcapi-1.5.0.tar.xz) = db156ee94fc63815a31876ab072aca72a806b26961c43f2caf8495c53b95484de71cd3be84dc9e5c9560e9ee704979be059ff6c102b4893d6bbdf9a8a69a667a +SHA512 (libkcapi-1.5.0.tar.xz.asc) = 69cfb6bf98f89c503e7fda07a54eddb9fcc2dafe418f1bc1216c051565c214a6caab83495c19b650a5c6e46e22080f8df4dd2152ab364993ed5badd256495159 From b5b79c5c2b2e81f7a58fdbb71f6e6ead771cb266 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Mon, 5 Aug 2024 14:08:07 +0200 Subject: [PATCH 13/17] Remove fipscheck-smoke-test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This test doesn't seem to work any more. Long term it would be better to replace it with more meaningful tests, but for now let's just remove it. [skip changelog] Signed-off-by: Ondrej Mosnáček --- tests/fipscheck-smoke-test/main.fmf | 17 ------- tests/fipscheck-smoke-test/runtest.sh | 70 --------------------------- 2 files changed, 87 deletions(-) delete mode 100644 tests/fipscheck-smoke-test/main.fmf delete mode 100755 tests/fipscheck-smoke-test/runtest.sh diff --git a/tests/fipscheck-smoke-test/main.fmf b/tests/fipscheck-smoke-test/main.fmf deleted file mode 100644 index a81cae2..0000000 --- a/tests/fipscheck-smoke-test/main.fmf +++ /dev/null @@ -1,17 +0,0 @@ -summary: Fipscheck smoke test -framework: beakerlib -test: ./runtest.sh -require: -- fipscheck -- gawk -- gcc-c++ -- libgcrypt -- libgpg-error-devel -- libselinux-utils -- libtool -- nfs-utils -- pkgconfig -- rpm-build -- texinfo -- wget -tier: 2 diff --git a/tests/fipscheck-smoke-test/runtest.sh b/tests/fipscheck-smoke-test/runtest.sh deleted file mode 100755 index 6f9bbab..0000000 --- a/tests/fipscheck-smoke-test/runtest.sh +++ /dev/null @@ -1,70 +0,0 @@ -#!/bin/bash -# vim: dict=/usr/share/beakerlib/dictionary.vim cpt=.,w,b,u,t,i,k -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# runtest.sh of /CoreOS/libgcrypt/smoke-test -# Description: Test calls upstream test suite. -# Author: Ondrej Moris -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -# -# Copyright (c) 2010 Red Hat, Inc. All rights reserved. -# -# This copyrighted material is made available to anyone wishing -# to use, modify, copy, or redistribute it subject to the terms -# and conditions of the GNU General Public License version 2. -# -# This program is distributed in the hope that it will be -# useful, but WITHOUT ANY WARRANTY; without even the implied -# warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR -# PURPOSE. See the GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public -# License along with this program; if not, write to the Free -# Software Foundation, Inc., 51 Franklin Street, Fifth Floor, -# Boston, MA 02110-1301, USA. -# -# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ - -# Include beakerlib environment -. /usr/share/beakerlib/beakerlib.sh - -PACKAGE="libgcrypt" - -rlJournalStart - - rlPhaseStartSetup - TmpDir=`mktemp -d` - rlAssertRpm $PACKAGE - rlFileBackup --clean "/etc/gcrypt/fips_enabled" - rlRun "pushd $TmpDir" 0 - rlFetchSrcForInstalled $PACKAGE - rlRun "rpm -ihv `ls *.rpm`" 0 - if grep '1' /proc/sys/crypto/fips_enabled; then - rlRun "echo '1' > /etc/gcrypt/fips_enabled" 0 - fi - rlPhaseEnd - - rlPhaseStartTest - TOPDIR=`rpm --eval %_topdir` - rlRun "pushd $TOPDIR" 0 - rlRun "rm -rf BUILD/libgcrypt-*" 0-255 - rlRun "rpmbuild -vv -bc SPECS/libgcrypt.spec" 0 - rlRun "pushd BUILD/libgcrypt-*" 0 - rlRun "fipshmac src/.libs/libgcrypt.so.??" 0 - rlRun "make check > $TmpDir/make_check.out" 0 - rlRun "popd" 0 - rlRun "popd" 0 - rlRun "grep \"All [0-9]\+ tests passed\" $TmpDir/make_check.out" 0 \ - "All tests passed" - rlRun "cat $TmpDir/make_check.out" 0 - rlPhaseEnd - - rlPhaseStartCleanup - rlRun "popd" 0 - rlRun "rm -r $TmpDir" 0 - rlFileRestore - rlPhaseEnd - -rlJournalPrintText -rlJournalEnd From be04c759526171b26fe68e81fba5c8a3f3984fb3 Mon Sep 17 00:00:00 2001 From: Simo Sorce Date: Thu, 15 Jul 2021 06:44:20 -0400 Subject: [PATCH 14/17] Use _libdir as recommended by guidelines MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Simo Sorce [omos: rebased] Signed-off-by: Ondrej Mosnáček --- libkcapi.spec | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/libkcapi.spec b/libkcapi.spec index bb1ebd0..9e7f58b 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -105,7 +105,7 @@ %{__arch_install_post} \ %{__os_install_post} \ bin_path=%{buildroot}%{_bindir} \ -lib_path=%{buildroot}/%{_lib} \ +lib_path=%{buildroot}%{_libdir} \ { %sha512hmac "$bin_path"/kcapi-hasher || exit 1; } | \\\ cut -f 1 -d ' ' >"$lib_path"/hmaccalc/kcapi-hasher.hmac \ { %sha512hmac "$lib_path"/libkcapi.so.%{version} || exit 1; } | \\\ @@ -333,7 +333,7 @@ EOF %build %configure \ - --libdir=/%{_lib} \ + --libdir=%{_libdir} \ --disable-silent-rules \ --enable-kcapi-encapp \ --enable-kcapi-dgstapp \ @@ -344,7 +344,7 @@ EOF --enable-shared \ --enable-static \ --enable-sum-prefix= \ - --enable-sum-dir=/%{_lib} \ + --enable-sum-dir=%{_libdir} \ --with-pkgconfigdir=%{_libdir}/pkgconfig %if %{with doc} %make_build all doc @@ -458,10 +458,10 @@ popd %doc %dir %{_pkgdocdir} %doc %{_pkgdocdir}/README.md %license COPYING* -/%{_lib}/%{name}.so.%{vmajor} -/%{_lib}/%{name}.so.%{version} -/%{_lib}/hmaccalc/%{name}.so.%{vmajor}.hmac -/%{_lib}/hmaccalc/%{name}.so.%{version}.hmac +%{_libdir}/%{name}.so.%{vmajor} +%{_libdir}/%{name}.so.%{version} +%{_libdir}/hmaccalc/%{name}.so.%{vmajor}.hmac +%{_libdir}/hmaccalc/%{name}.so.%{version}.hmac %if %{with_sysctl_tweak} %doc %{_pkgdocdir}/README.%{distroname_ext} %{_sysctldir}/%{sysctl_prio}-%{name}-optmem_max.conf @@ -473,7 +473,7 @@ popd %doc %{_pkgdocdir}/TODO %{_includedir}/kcapi.h %{_mandir}/man3/kcapi_*.3.* -/%{_lib}/%{name}.so +%{_libdir}/%{name}.so %{_libdir}/pkgconfig/%{name}.pc @@ -493,7 +493,7 @@ popd %{_libexecdir}/%{name}/fips* %{_libexecdir}/%{name}/sha*hmac %{_libexecdir}/%{name}/sm*hmac -/%{_lib}/hmaccalc/kcapi-hasher.hmac +%{_libdir}/hmaccalc/kcapi-hasher.hmac %if %{with replace_coreutils} @@ -516,7 +516,7 @@ popd %files static -/%{_lib}/%{name}.a +%{_libdir}/%{name}.a %files tools From 406ea0357f8d19527b827de7b08e37ec366aabc6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ondrej=20Mosn=C3=A1=C4=8Dek?= Date: Mon, 19 Aug 2024 18:39:20 +0200 Subject: [PATCH 15/17] Do not ship duplicate kcapi-hasher in libkcapi-tools MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Ship kcapi-hasher manpage in libkcapi-hasher Signed-off-by: Ondrej Mosnáček --- libkcapi.spec | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/libkcapi.spec b/libkcapi.spec index 9e7f58b..9338486 100644 --- a/libkcapi.spec +++ b/libkcapi.spec @@ -494,6 +494,7 @@ popd %{_libexecdir}/%{name}/sha*hmac %{_libexecdir}/%{name}/sm*hmac %{_libdir}/hmaccalc/kcapi-hasher.hmac +%{_mandir}/man1/kcapi-hasher.1.* %if %{with replace_coreutils} @@ -520,8 +521,16 @@ popd %files tools -%{_bindir}/kcapi* -%{_mandir}/man1/kcapi*.1.* +%{_bindir}/kcapi +%{_bindir}/kcapi-convenience +%{_bindir}/kcapi-dgst +%{_bindir}/kcapi-enc +%{_bindir}/kcapi-enc-test-large +%{_bindir}/kcapi-rng +%{_bindir}/kcapi-speed +%{_mandir}/man1/kcapi-dgst.1.* +%{_mandir}/man1/kcapi-enc.1.* +%{_mandir}/man1/kcapi-rng.1.* %if %{with test_package} From e1808a2fa96e7bb86cb38ba016685be608dbc616 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Fri, 17 Jan 2025 11:39:04 +0000 Subject: [PATCH 16/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_42_Mass_Rebuild From 9e4e0a064d581efc5ad80d4c10bf1ff5520b6697 Mon Sep 17 00:00:00 2001 From: Fedora Release Engineering Date: Thu, 24 Jul 2025 19:51:53 +0000 Subject: [PATCH 17/17] Rebuilt for https://fedoraproject.org/wiki/Fedora_43_Mass_Rebuild