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
|
|
|
#
|
2023-03-08 19:05:37 +01:00
|
|
|
# Copyright (c) 2023 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
|
|
|
#
|
|
|
|
|
|
|
|
|
2020-05-14 17:39:34 +02:00
|
|
|
%define libsover 20
|
|
|
|
%define libsoname %{name}%{libsover}
|
2022-11-25 15:23:58 +01:00
|
|
|
%define hmac_key orboDeJITITejsirpADONivirpUkvarP
|
2013-07-25 11:26:56 +02:00
|
|
|
Name: libgcrypt
|
2023-04-11 16:55:16 +02:00
|
|
|
Version: 1.10.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++
|
2022-02-01 14:12:14 +01:00
|
|
|
URL: https://gnupg.org/software/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
|
2021-06-15 11:30:21 +02:00
|
|
|
Source3: random.conf
|
2022-11-25 15:23:58 +01:00
|
|
|
Source4: hwf.deny
|
|
|
|
# https://gnupg.org/signature_key.asc
|
|
|
|
Source5: libgcrypt.keyring
|
2021-02-03 13:44:42 +01:00
|
|
|
Source99: libgcrypt.changes
|
2022-11-25 15:23:58 +01:00
|
|
|
Patch1: libgcrypt-1.10.0-allow_FSM_same_state.patch
|
2023-04-11 16:55:16 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1182983 gpg: out of core handler ignored in FIPS mode while typing Tab key to Auto-Completion
|
|
|
|
Patch2: libgcrypt-1.10.0-out-of-core-handler.patch
|
2023-10-19 09:34:37 +02:00
|
|
|
#PATCH-FIX-OPENSUSE Do not pull revision info from GIT when autoconf is run
|
|
|
|
Patch3: libgcrypt-nobetasuffix.patch
|
2023-04-11 16:55:16 +02:00
|
|
|
# FIPS patches:
|
2023-04-12 11:52:01 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1190700 FIPS: Provide a service-level indicator for PK
|
2023-04-11 16:55:16 +02:00
|
|
|
Patch100: libgcrypt-FIPS-SLI-pk.patch
|
2022-09-16 23:00:13 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1190700 FIPS: Check keylength in gcry_fips_indicator_kdf()
|
2023-04-11 16:55:16 +02:00
|
|
|
Patch101: libgcrypt-FIPS-SLI-kdf-leylength.patch
|
|
|
|
#PATCH-FIX-SUSE bsc#1190700 FIPS add indicators
|
|
|
|
Patch102: libgcrypt-FIPS-SLI-hash-mac.patch
|
2023-04-12 11:52:01 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1202117 jsc#SLE-24941 FIPS: Port libgcrypt to use jitterentropy
|
2023-04-11 16:55:16 +02:00
|
|
|
Patch103: libgcrypt-jitterentropy-3.4.0.patch
|
2022-09-16 23:00:13 +02:00
|
|
|
#PATCH-FIX-SUSE bsc#1202117 FIPS: Get most of the entropy from rndjent_poll
|
2023-04-11 16:55:16 +02:00
|
|
|
Patch104: libgcrypt-FIPS-rndjent_poll.patch
|
2023-10-11 09:38:30 +02:00
|
|
|
# POWER patches [jsc#PED-5088] POWER performance enhancements for cryptography
|
|
|
|
Patch200: libgcrypt-Chacha20-poly1305-Optimized-chacha20-poly1305.patch
|
|
|
|
Patch201: libgcrypt-ppc-enable-P10-assembly-with-ENABLE_FORCE_SOF.patch
|
2015-03-01 08:57:34 +01:00
|
|
|
BuildRequires: automake >= 1.14
|
2021-02-03 13:44:42 +01:00
|
|
|
BuildRequires: libgpg-error-devel >= 1.27
|
2014-04-03 14:08:53 +02:00
|
|
|
BuildRequires: libtool
|
2022-02-01 14:12:14 +01:00
|
|
|
BuildRequires: makeinfo
|
2019-08-30 22:13:27 +02:00
|
|
|
BuildRequires: pkgconfig
|
2023-03-08 19:05:37 +01:00
|
|
|
%{?suse_build_hwcaps_libs}
|
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
|
2023-05-25 12:47:22 +02:00
|
|
|
Provides: %{libsoname}-hmac = %{version}-%{release}
|
|
|
|
Obsoletes: %{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).
|
|
|
|
|
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.
|
|
|
|
|
|
|
|
%prep
|
2022-11-25 15:23:58 +01:00
|
|
|
%autosetup -p1
|
|
|
|
|
|
|
|
# Rename the internal .hmac file to include the so library version
|
|
|
|
sed -i "s/libgcrypt\.so\.hmac/\.libgcrypt\.so\.%{libsover}\.hmac/g" src/Makefile.am src/Makefile.in
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%build
|
2022-11-25 15:23:58 +01:00
|
|
|
export PUBKEYS="dsa elgamal rsa ecc"
|
|
|
|
export CIPHERS="arcfour blowfish cast5 des aes twofish serpent rfc2268 seed camellia idea salsa20 gost28147 chacha20 sm4"
|
|
|
|
export DIGESTS="crc gostr3411-94 md4 md5 rmd160 sha1 sha256 sha512 sha3 tiger whirlpool stribog blake2 sm3"
|
|
|
|
export KDFS="s2k pkdf2 scrypt"
|
|
|
|
|
2007-01-16 00:21:52 +01:00
|
|
|
autoreconf -fi
|
2022-08-01 10:35:47 +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 \
|
2022-11-25 15:23:58 +01:00
|
|
|
--with-fips-module-version="Libgcrypt version %{version}-%{release}" \
|
|
|
|
--enable-hmac-binary-check="%{hmac_key}" \
|
|
|
|
--enable-ciphers="$CIPHERS" \
|
|
|
|
--enable-pubkey-ciphers="$PUBKEYS" \
|
|
|
|
--enable-digests="$DIGESTS" \
|
|
|
|
--enable-kdfs="$KDFS" \
|
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
|
2022-11-25 15:23:58 +01:00
|
|
|
--enable-random=getentropy \
|
|
|
|
%{nil}
|
2022-02-01 14:12:14 +01:00
|
|
|
|
2020-10-24 22:30:16 +02:00
|
|
|
%make_build
|
2008-01-18 02:02:35 +01:00
|
|
|
|
|
|
|
%check
|
2023-05-25 12:47:22 +02:00
|
|
|
make -k check
|
2022-09-05 12:55:04 +02:00
|
|
|
# run the regression tests also in FIPS mode
|
2023-05-25 12:47:22 +02:00
|
|
|
LIBGCRYPT_FORCE_FIPS_MODE=1 make -k check || true
|
2022-09-05 12:55:04 +02:00
|
|
|
|
2022-11-25 15:23:58 +01:00
|
|
|
# Install the FIPS hmac file
|
|
|
|
cp src/.libgcrypt.so.%{libsover}.hmac %{buildroot}%{_libdir}/
|
2007-01-16 00:21:52 +01:00
|
|
|
|
2022-11-25 15:23:58 +01:00
|
|
|
%install
|
|
|
|
%make_install
|
|
|
|
rm %{buildroot}%{_libdir}/%{name}.la
|
|
|
|
|
2021-02-03 13:44:42 +01:00
|
|
|
# Create /etc/gcrypt directory and install random.conf
|
|
|
|
mkdir -p -m 0755 %{buildroot}%{_sysconfdir}/gcrypt
|
2021-06-15 11:30:21 +02:00
|
|
|
install -m 644 %{SOURCE3} %{buildroot}%{_sysconfdir}/gcrypt/random.conf
|
2022-11-25 15:23:58 +01:00
|
|
|
install -m 644 %{SOURCE4} %{buildroot}%{_sysconfdir}/gcrypt/hwf.deny
|
2021-02-03 13:44:42 +01:00
|
|
|
|
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}
|
2022-11-25 15:23:58 +01:00
|
|
|
%license COPYING COPYING.LIB LICENSES
|
|
|
|
%doc AUTHORS ChangeLog NEWS README THANKS TODO
|
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
|
2022-11-25 15:23:58 +01:00
|
|
|
%config(noreplace) %{_sysconfdir}/gcrypt/hwf.deny
|
|
|
|
%{_libdir}/.libgcrypt.so.*.hmac
|
2007-01-16 00:21:52 +01:00
|
|
|
|
|
|
|
%files devel
|
2022-11-25 15:23:58 +01:00
|
|
|
%license COPYING COPYING.LIB LICENSES
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_bindir}/dumpsexp
|
2022-11-25 15:23:58 +01:00
|
|
|
%{_bindir}/hmac256
|
2014-01-03 20:05:34 +01:00
|
|
|
%{_bindir}/mpicalc
|
|
|
|
%{_bindir}/%{name}-config
|
|
|
|
%{_libdir}/%{name}.so
|
2019-08-30 22:13:27 +02:00
|
|
|
%{_libdir}/pkgconfig/libgcrypt.pc
|
2022-11-25 15:23:58 +01:00
|
|
|
%{_datadir}/aclocal/%{name}.m4
|
|
|
|
%{_includedir}/gcrypt*.h
|
|
|
|
%{_infodir}/gcrypt.info*%{ext_info}*
|
|
|
|
%{_mandir}/man1/*
|
2014-09-02 19:36:56 +02:00
|
|
|
|
2007-09-13 18:48:03 +02:00
|
|
|
%changelog
|