From fc058c79748be82bd02127d91a63031983b8f673 Mon Sep 17 00:00:00 2001 From: Anderson Toshiyuki Sasaki Date: Fri, 15 Feb 2019 13:11:18 +0100 Subject: [PATCH] Create HMAC checksum for FIPS integrity self tests Resolves: rhbz#1677600 --- gmp.spec | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/gmp.spec b/gmp.spec index acb2e96..3126dff 100644 --- a/gmp.spec +++ b/gmp.spec @@ -6,7 +6,7 @@ Summary: A GNU arbitrary precision library Name: gmp Version: 6.1.2 -Release: 9%{?dist} +Release: 10%{?dist} Epoch: 1 URL: http://gmplib.org/ Source0: ftp://ftp.gmplib.org/pub/gmp-%{version}/gmp-%{version}.tar.bz2 @@ -21,6 +21,11 @@ BuildRequires: gcc-c++ BuildRequires: git #autoreconf on arm needs: BuildRequires: perl-Carp +# Generate the .hmac checksum unless --without fips is used +%bcond_without fips +%if %{with fips} +BuildRequires: fipscheck +%endif %description The gmp package contains GNU MP, a library for arbitrary precision @@ -91,6 +96,18 @@ sed -e 's|^hardcode_libdir_flag_spec=.*|hardcode_libdir_flag_spec=""|g' \ export LD_LIBRARY_PATH=`pwd`/.libs make %{?_smp_mflags} +%if %{with fips} +%define __spec_install_post \ + %{?__debug_package:%{__debug_install_post}} \ + %{__arch_install_post} \ + %{__os_install_post} \ + fipshmac -d $RPM_BUILD_ROOT%{_libdir} $RPM_BUILD_ROOT%{_libdir}/libgmp.so.10.* \ + file=`basename $RPM_BUILD_ROOT%{_libdir}/libgmp.so.10.*.hmac` && \ + mv $RPM_BUILD_ROOT%{_libdir}/$file $RPM_BUILD_ROOT%{_libdir}/.$file && \ + ln -s .$file $RPM_BUILD_ROOT%{_libdir}/.libgmp.so.10.hmac +%{nil} +%endif + %install export LD_LIBRARY_PATH=`pwd`/.libs make install DESTDIR=$RPM_BUILD_ROOT @@ -139,6 +156,9 @@ make %{?_smp_mflags} check %license COPYING COPYING.LESSERv3 COPYINGv2 COPYINGv3 %doc NEWS README %{_libdir}/libgmp.so.* +%if %{with fips} +%{_libdir}/.libgmp.so.*.hmac +%endif %files c++ %{_libdir}/libgmpxx.so.* @@ -154,6 +174,9 @@ make %{?_smp_mflags} check %{_libdir}/libgmpxx.a %changelog +* Fri Feb 15 2019 Anderson Toshiyuki Sasaki - 1:6.1.2-10 +- Create HMAC checksum for FIPS integrity self tests + * Thu Jan 31 2019 Fedora Release Engineering - 1:6.1.2-9 - Rebuilt for https://fedoraproject.org/wiki/Fedora_30_Mass_Rebuild