2007-01-16 00:21:52 +01:00
|
|
|
#
|
2011-10-02 20:44:43 +02:00
|
|
|
# spec file for package libgcrypt
|
2007-01-16 00:21:52 +01:00
|
|
|
#
|
2021-02-03 13:44:42 +01:00
|
|
|
# Copyright (c) 2021 SUSE LLC
|
2007-01-16 00:21:52 +01:00
|
|
|
#
|
2008-11-02 15:42:29 +01:00
|
|
|
# All modifications and additions to the file contributed by third parties
|
|
|
|
# remain the property of their copyright owners, unless otherwise agreed
|
|
|
|
# upon. The license for this file, and modifications and additions to the
|
|
|
|
# file, is the same license as for the pristine package itself (unless the
|
|
|
|
# license for the pristine package is not an Open Source License, in which
|
|
|
|
# case the license is the MIT License). An "Open Source License" is a
|
|
|
|
# license that conforms to the Open Source Definition (Version 1.9)
|
|
|
|
# published by the Open Source Initiative.
|
|
|
|
|
2018-11-26 18:27:31 +01:00
|
|
|
# Please submit bugfixes or comments via https://bugs.opensuse.org/
|
2007-01-16 00:21:52 +01:00
|
|
|
#
|
|
|
|
|
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%define build_hmac256 1
|
|
|
|
%define separate_hmac256_binary 0
|
2020-05-14 17:39:34 +02:00
|
|
|
%define libsover 20
|
|
|
|
%define libsoname %{name}%{libsover}
|
2014-09-22 22:11:21 +02:00
|
|
|
%define cavs_dir %{_libexecdir}/%{name}/cavs
|
2013-07-25 11:26:56 +02:00
|
|
|
Name: libgcrypt
|
2021-02-17 11:20:09 +01:00
|
|
|
Version: 1.9.2
|
2012-02-12 17:27:21 +01:00
|
|
|
Release: 0
|
2007-01-16 00:21:52 +01:00
|
|
|
Summary: The GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.1-or-later AND GPL-3.0-or-later
|
2007-01-16 00:21:52 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2019-08-30 22:13:27 +02:00
|
|
|
URL: https://directory.fsf.org/wiki/Libgcrypt
|
2020-07-07 11:36:56 +02:00
|
|
|
Source: https://gnupg.org/ftp/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2
|
|
|
|
Source1: https://gnupg.org/ftp/gcrypt/libgcrypt/%{name}-%{version}.tar.bz2.sig
|
2010-01-14 15:27:35 +01:00
|
|
|
Source2: baselibs.conf
|
2015-03-01 08:57:34 +01:00
|
|
|
# https://www.gnupg.org/signature_key.en.html
|
2021-02-03 13:44:42 +01:00
|
|
|
Source4: libgcrypt.keyring
|
2014-09-02 19:36:56 +02:00
|
|
|
# cavs test framework
|
|
|
|
Source5: cavs-test.sh
|
|
|
|
Source6: cavs_driver.pl
|
2021-02-03 13:44:42 +01:00
|
|
|
Source7: random.conf
|
|
|
|
Source99: libgcrypt.changes
|
|
|
|
Patch1: libgcrypt-1.4.1-rijndael_no_strict_aliasing.patch
|
|
|
|
Patch2: libgcrypt-sparcv9.diff
|
2013-07-25 11:26:56 +02:00
|
|
|
#PATCH-FIX-SUSE: N/A
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch3: libgcrypt-1.5.0-LIBGCRYPT_FORCE_FIPS_MODE-env.diff
|
|
|
|
Patch4: libgcrypt-1.6.1-use-fipscheck.patch
|
|
|
|
Patch5: libgcrypt-1.6.1-fips-cavs.patch
|
|
|
|
Patch6: libgcrypt-fix-rng.patch
|
2014-09-22 22:11:21 +02:00
|
|
|
#PATCH-FIX-SUSE add FIPS CAVS test app for DRBG
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch7: drbg_test.patch
|
2018-03-29 11:57:58 +02:00
|
|
|
#PATCH-FIX-UPSTREAM bsc#1064455 fipsdrv patch to enable --algo for dsa-sign
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch8: libgcrypt-fipsdrv-enable-algo-for-dsa-sign.patch
|
2018-03-29 11:57:58 +02:00
|
|
|
#PATCH-FIX-UPSTREAM bsc#1064455 fipsdrv patch to enable --algo for dsa-verify
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch9: libgcrypt-fipsdrv-enable-algo-for-dsa-verify.patch
|
|
|
|
Patch10: libgcrypt-1.8.3-fips-ctor.patch
|
|
|
|
Patch11: libgcrypt-1.8.4-use_xfree.patch
|
|
|
|
Patch12: libgcrypt-1.8.4-allow_FSM_same_state.patch
|
|
|
|
Patch13: libgcrypt-1.8.4-getrandom.patch
|
|
|
|
Patch14: libgcrypt-1.8.4-fips_ctor_skip_integrity_check.patch
|
2020-01-24 13:13:28 +01:00
|
|
|
#PATCH-FIX-SUSE Fix test in FIPS mode
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch15: libgcrypt-dsa-rfc6979-test-fix.patch
|
|
|
|
Patch16: libgcrypt-fix-tests-fipsmode.patch
|
2020-01-24 13:13:28 +01:00
|
|
|
#PATCH-FIX-SUSE bsc#1155337 FIPS: RSA/DSA/ECDSA are missing hashing operation
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch17: libgcrypt-FIPS-RSA-DSA-ECDSA-hashing-operation.patch
|
2020-01-24 13:13:28 +01:00
|
|
|
#PATCH-FIX-SUSE bsc#1161220 FIPS: libgcrypt RSA siggen/keygen: 4k not supported
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch18: libgcrypt-1.8.4-fips-keygen.patch
|
2020-05-14 17:39:34 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1164950 Run self-tests from the constructor
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch19: libgcrypt-invoke-global_init-from-constructor.patch
|
2020-05-14 17:39:34 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1164950 Restore the self-tests from the constructor
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch20: libgcrypt-Restore-self-tests-from-constructor.patch
|
|
|
|
Patch21: libgcrypt-FIPS-GMAC_AES-benckmark.patch
|
|
|
|
Patch22: libgcrypt-global_init-constructor.patch
|
|
|
|
Patch23: libgcrypt-random_selftests-testentropy.patch
|
|
|
|
Patch24: libgcrypt-rsa-no-blinding.patch
|
|
|
|
Patch25: libgcrypt-ecc-ecdsa-no-blinding.patch
|
2020-05-14 17:39:34 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1165539 FIPS: Use the new signature operation in PCT
|
2021-02-03 13:44:42 +01:00
|
|
|
Patch26: libgcrypt-PCT-RSA.patch
|
|
|
|
Patch27: libgcrypt-PCT-DSA.patch
|
|
|
|
Patch28: libgcrypt-PCT-ECC.patch
|
|
|
|
Patch29: libgcrypt-fips_selftest_trigger_file.patch
|
2015-03-01 08:57:34 +01:00
|
|
|
BuildRequires: automake >= 1.14
|
2016-05-16 16:41:28 +02:00
|
|
|
BuildRequires: fipscheck
|
2021-02-03 13:44:42 +01:00
|
|
|
BuildRequires: libgpg-error-devel >= 1.27
|
2014-04-03 14:08:53 +02:00
|
|
|
BuildRequires: libtool
|
2019-08-30 22:13:27 +02:00
|
|
|
BuildRequires: pkgconfig
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%description
|
2013-03-19 10:04:38 +01:00
|
|
|
Libgcrypt is a general purpose library of cryptographic building
|
|
|
|
blocks. It is originally based on code used by GnuPG. It does not
|
|
|
|
provide any implementation of OpenPGP or other protocols. Thorough
|
|
|
|
understanding of applied cryptography is required to use Libgcrypt.
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%package -n %{libsoname}
|
2008-01-18 02:02:35 +01:00
|
|
|
Summary: The GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
2017-07-25 08:30:55 +02:00
|
|
|
Group: System/Libraries
|
2018-05-02 17:35:24 +02:00
|
|
|
Suggests: %{libsoname}-hmac = %{version}-%{release}
|
2008-01-18 02:02:35 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%description -n %{libsoname}
|
2008-01-18 02:02:35 +01:00
|
|
|
Libgcrypt is a general purpose crypto library based on the code used in
|
|
|
|
GnuPG (alpha version).
|
|
|
|
|
2014-08-13 15:20:08 +02:00
|
|
|
%package -n %{libsoname}-hmac
|
|
|
|
Summary: HMAC checksums for the GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
2017-07-25 08:30:55 +02:00
|
|
|
Group: System/Libraries
|
2016-05-16 18:03:22 +02:00
|
|
|
Requires: %{libsoname} = %{version}-%{release}
|
2014-08-13 15:20:08 +02:00
|
|
|
|
|
|
|
%description -n %{libsoname}-hmac
|
|
|
|
Libgcrypt is a general purpose crypto library based on the code used in
|
|
|
|
GnuPG (alpha version). This package contains the HMAC checksum files
|
|
|
|
for integrity checking the library, as required by FIPS 140-2.
|
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
%package devel
|
|
|
|
Summary: The GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GFDL-1.1-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
|
2007-01-16 00:21:52 +01:00
|
|
|
Group: Development/Libraries/C and C++
|
2012-06-13 09:19:23 +02:00
|
|
|
Requires: %{libsoname} = %{version}
|
2012-03-23 12:47:53 +01:00
|
|
|
Requires: glibc-devel
|
2021-02-03 13:44:42 +01:00
|
|
|
Requires: libgpg-error-devel >= 1.27
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%description devel
|
2013-03-19 10:04:38 +01:00
|
|
|
Libgcrypt is a general purpose library of cryptographic building
|
|
|
|
blocks. It is originally based on code used by GnuPG. It does not
|
|
|
|
provide any implementation of OpenPGP or other protocols. Thorough
|
|
|
|
understanding of applied cryptography is required to use Libgcrypt.
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
This package contains needed files to compile and link against the
|
|
|
|
library.
|
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
%package cavs
|
|
|
|
Summary: The GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GFDL-1.1-only AND GPL-2.0-or-later AND LGPL-2.1-or-later AND MIT
|
2014-09-02 19:36:56 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
|
|
|
Requires: %{libsoname} = %{version}
|
|
|
|
Requires: %{libsoname}-hmac
|
|
|
|
|
|
|
|
%description cavs
|
|
|
|
CAVS testing framework for libgcrypt
|
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?separate_hmac256_binary}
|
|
|
|
%package hmac256
|
|
|
|
Summary: The GNU Crypto Library
|
2018-06-13 13:32:30 +02:00
|
|
|
License: GPL-2.0-or-later AND LGPL-2.1-or-later
|
2013-07-25 11:26:56 +02:00
|
|
|
Group: Development/Libraries/C and C++
|
2014-04-03 14:08:53 +02:00
|
|
|
Requires: %{libsoname} = %{version}
|
2021-02-03 13:44:42 +01:00
|
|
|
Requires: libgpg-error-devel >= 1.27
|
2013-07-25 11:26:56 +02:00
|
|
|
|
|
|
|
%description hmac256
|
|
|
|
Libgcrypt is a general purpose library of cryptographic building
|
|
|
|
blocks. It is originally based on code used by GnuPG. It does not
|
|
|
|
provide any implementation of OpenPGP or other protocols. Thorough
|
|
|
|
understanding of applied cryptography is required to use Libgcrypt.
|
|
|
|
|
2021-02-03 13:44:42 +01:00
|
|
|
%endif
|
2013-07-25 11:26:56 +02:00
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
%prep
|
2014-04-03 14:08:53 +02:00
|
|
|
%setup -q
|
2019-03-25 19:52:00 +01:00
|
|
|
%autopatch -p1
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%build
|
2013-07-25 11:26:56 +02:00
|
|
|
echo building with build_hmac256 set to %{build_hmac256}
|
2007-01-16 00:21:52 +01:00
|
|
|
autoreconf -fi
|
2016-08-22 11:21:16 +02:00
|
|
|
date=$(date -u +%{Y}-%{m}-%{dT}%{H}:%{M}+0000 -r %{SOURCE99})
|
2015-02-06 19:56:02 +01:00
|
|
|
sed -e "s,BUILD_TIMESTAMP=.*,BUILD_TIMESTAMP=$date," -i configure
|
2014-04-03 14:08:53 +02:00
|
|
|
export CFLAGS="%{optflags} $(getconf LFS_CFLAGS)"
|
2017-07-25 08:30:55 +02:00
|
|
|
%configure \
|
2014-04-03 14:08:53 +02:00
|
|
|
--enable-noexecstack \
|
|
|
|
--disable-static \
|
2014-01-30 14:30:05 +01:00
|
|
|
--enable-m-guard \
|
2014-04-03 14:08:53 +02:00
|
|
|
%ifarch %{sparc}
|
|
|
|
--disable-asm \
|
2010-01-14 15:27:35 +01:00
|
|
|
%endif
|
2014-01-30 14:30:05 +01:00
|
|
|
--enable-hmac-binary-check \
|
|
|
|
--enable-random=linux
|
2020-10-24 22:30:16 +02:00
|
|
|
%make_build
|
2008-01-18 02:02:35 +01:00
|
|
|
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?build_hmac256}
|
|
|
|
# this is a hack that re-defines the __os_install_post macro
|
|
|
|
# for a simple reason: the macro strips the binaries and thereby
|
|
|
|
# invalidates a HMAC that may have been created earlier.
|
|
|
|
# solution: create the hashes _after_ the macro runs.
|
|
|
|
#
|
2019-06-25 14:49:02 +02:00
|
|
|
# this shows up earlier because otherwise the %%expand of
|
2013-07-25 11:26:56 +02:00
|
|
|
# the macro is too late.
|
|
|
|
%{expand:%%global __os_install_post {%__os_install_post
|
2014-03-31 09:35:35 +02:00
|
|
|
fipshmac %{buildroot}/%{_bindir}/hmac256
|
|
|
|
fipshmac %{buildroot}/%{_libdir}/*.so.??
|
2013-07-25 11:26:56 +02:00
|
|
|
}}
|
|
|
|
%endif
|
|
|
|
|
2008-01-18 02:02:35 +01:00
|
|
|
%check
|
2014-03-31 09:35:35 +02:00
|
|
|
fipshmac src/.libs/libgcrypt.so.??
|
2020-10-24 22:30:16 +02:00
|
|
|
%make_build check
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%install
|
2017-07-24 10:15:56 +02:00
|
|
|
%make_install
|
2012-06-13 09:19:23 +02:00
|
|
|
rm %{buildroot}%{_libdir}/%{name}.la
|
2014-09-22 22:11:21 +02:00
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
# cavs
|
2014-09-22 22:11:21 +02:00
|
|
|
install -m 0755 -d %{buildroot}%{cavs_dir}
|
|
|
|
install -m 0755 %{SOURCE5} %{buildroot}%{cavs_dir}
|
|
|
|
install -m 0755 %{SOURCE6} %{buildroot}%{cavs_dir}
|
|
|
|
|
|
|
|
mv %{buildroot}%{_bindir}/fipsdrv %{buildroot}%{cavs_dir}
|
|
|
|
mv %{buildroot}%{_bindir}/drbg_test %{buildroot}%{cavs_dir}
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2020-05-14 17:39:34 +02:00
|
|
|
# create the FIPS "module is complete" trigger file
|
|
|
|
%if 0%{?build_hmac256}
|
|
|
|
touch %{buildroot}/%{_libdir}/.%{name}.so.%{libsover}.fips
|
|
|
|
%endif
|
|
|
|
|
2021-02-03 13:44:42 +01:00
|
|
|
# Create /etc/gcrypt directory and install random.conf
|
|
|
|
mkdir -p -m 0755 %{buildroot}%{_sysconfdir}/gcrypt
|
|
|
|
install -m 644 %{SOURCE7} %{buildroot}%{_sysconfdir}/gcrypt/random.conf
|
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%post -n %{libsoname} -p /sbin/ldconfig
|
|
|
|
%postun -n %{libsoname} -p /sbin/ldconfig
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2012-06-13 09:19:23 +02:00
|
|
|
%files -n %{libsoname}
|
2018-02-26 10:33:50 +01:00
|
|
|
%license COPYING.LIB
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_libdir}/%{name}.so.*
|
2021-02-03 13:44:42 +01:00
|
|
|
%dir %{_sysconfdir}/gcrypt
|
|
|
|
%config(noreplace) %{_sysconfdir}/gcrypt/random.conf
|
2020-05-14 17:39:34 +02:00
|
|
|
%if 0%{?build_hmac256}
|
|
|
|
%{_libdir}/.libgcrypt.so.*.hmac
|
2021-02-03 13:44:42 +01:00
|
|
|
%endif
|
2014-08-13 15:20:08 +02:00
|
|
|
|
|
|
|
%files -n %{libsoname}-hmac
|
2013-07-25 11:26:56 +02:00
|
|
|
%if 0%{?build_hmac256}
|
2020-05-14 17:39:34 +02:00
|
|
|
%{_libdir}/.libgcrypt.so.*.fips
|
2021-02-03 13:44:42 +01:00
|
|
|
%endif
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%files devel
|
2018-02-26 10:33:50 +01:00
|
|
|
%license COPYING COPYING.LIB
|
|
|
|
%doc AUTHORS ChangeLog NEWS README THANKS TODO
|
2018-06-13 13:32:30 +02:00
|
|
|
%{_infodir}/gcrypt.info*%{ext_info}
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_bindir}/dumpsexp
|
|
|
|
%{_bindir}/mpicalc
|
|
|
|
%{_bindir}/%{name}-config
|
|
|
|
%{_libdir}/%{name}.so
|
|
|
|
%{_includedir}/gcrypt*.h
|
|
|
|
%{_datadir}/aclocal/%{name}.m4
|
2019-08-30 22:13:27 +02:00
|
|
|
%{_libdir}/pkgconfig/libgcrypt.pc
|
2014-01-03 20:05:08 +01:00
|
|
|
|
2014-01-03 20:05:34 +01:00
|
|
|
%if 0%{?separate_hmac256_binary}
|
2013-07-25 11:26:56 +02:00
|
|
|
%files hmac256
|
2021-02-03 13:44:42 +01:00
|
|
|
%endif
|
2013-07-25 11:26:56 +02:00
|
|
|
%{_bindir}/hmac256
|
|
|
|
%{_bindir}/.hmac256.hmac
|
2014-01-03 20:05:34 +01:00
|
|
|
%doc %{_mandir}/man1/hmac256.1*
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2014-09-02 19:36:56 +02:00
|
|
|
%files cavs
|
|
|
|
%{_libexecdir}/%{name}
|
|
|
|
|
2007-09-13 18:48:03 +02:00
|
|
|
%changelog
|