Blame SPECS/compat-openssl11.spec

9b88be
# For the curious:
9b88be
# 0.9.5a soversion = 0
9b88be
# 0.9.6  soversion = 1
9b88be
# 0.9.6a soversion = 2
9b88be
# 0.9.6c soversion = 3
9b88be
# 0.9.7a soversion = 4
9b88be
# 0.9.7ef soversion = 5
9b88be
# 0.9.8ab soversion = 6
9b88be
# 0.9.8g soversion = 7
9b88be
# 0.9.8jk + EAP-FAST soversion = 8
9b88be
# 1.0.0 soversion = 10
9b88be
# 1.1.0 soversion = 1.1 (same as upstream although presence of some symbols
9b88be
#                        depends on build configuration options)
9b88be
%define soversion 1.1
9b88be
9b88be
# Arches on which we need to prevent arch conflicts on opensslconf.h, must
9b88be
# also be handled in opensslconf-new.h.
9b88be
%define multilib_arches %{ix86} ia64 %{mips} ppc ppc64 s390 s390x sparcv9 sparc64 x86_64
9b88be
9b88be
%global _performance_build 1
9b88be
9b88be
Summary: Utilities from the general purpose cryptography library with TLS implementation
9b88be
Name: compat-openssl11
9b88be
Version: 1.1.1k
34148c
Release: 4%{?dist}
9b88be
Epoch: 1
9b88be
# We have to remove certain patented algorithms from the openssl source
9b88be
# tarball with the hobble-openssl script which is included below.
9b88be
# The original openssl upstream tarball cannot be shipped in the .src.rpm.
9b88be
Source: openssl-%{version}-hobbled.tar.xz
9b88be
Source1: hobble-openssl
9b88be
Source2: Makefile.certificate
9b88be
Source6: make-dummy-cert
9b88be
Source7: renew-dummy-cert
9b88be
Source12: ec_curve.c
9b88be
Source13: ectest.c
9b88be
# Build changes
9b88be
Patch1: openssl-1.1.1-build.patch
9b88be
Patch2: openssl-1.1.1-defaults.patch
9b88be
Patch3: openssl-1.1.1-no-html.patch
9b88be
Patch4: openssl-1.1.1-man-rename.patch
9b88be
9b88be
# Functionality changes
9b88be
Patch31: openssl-1.1.1-conf-paths.patch
9b88be
Patch32: openssl-1.1.1-version-add-engines.patch
9b88be
Patch33: openssl-1.1.1-apps-dgst.patch
9b88be
Patch36: openssl-1.1.1-no-brainpool.patch
9b88be
Patch37: openssl-1.1.1-ec-curves.patch
9b88be
Patch38: openssl-1.1.1-no-weak-verify.patch
9b88be
Patch40: openssl-1.1.1-disable-ssl3.patch
9b88be
Patch41: openssl-1.1.1-system-cipherlist.patch
9b88be
Patch42: openssl-1.1.1-fips.patch
9b88be
Patch45: openssl-1.1.1-weak-ciphers.patch
9b88be
Patch46: openssl-1.1.1-seclevel.patch
9b88be
Patch47: openssl-1.1.1-ts-sha256-default.patch
9b88be
Patch48: openssl-1.1.1-fips-post-rand.patch
9b88be
Patch49: openssl-1.1.1-evp-kdf.patch
9b88be
Patch50: openssl-1.1.1-ssh-kdf.patch
9b88be
Patch51: openssl-1.1.1-intel-cet.patch
9b88be
Patch60: openssl-1.1.1-krb5-kdf.patch
9b88be
Patch61: openssl-1.1.1-edk2-build.patch
9b88be
Patch62: openssl-1.1.1-fips-curves.patch
9b88be
Patch65: openssl-1.1.1-fips-drbg-selftest.patch
9b88be
Patch66: openssl-1.1.1-fips-dh.patch
9b88be
Patch67: openssl-1.1.1-kdf-selftest.patch
9b88be
Patch69: openssl-1.1.1-alpn-cb.patch
9b88be
Patch70: openssl-1.1.1-rewire-fips-drbg.patch
9b88be
Patch71: openssl-1.1.1-new-config-file.patch
34148c
# This modifies code that was patched before, but removing all FIPS patches
34148c
# comes with a much greater risk of introducing regressions.
34148c
Patch72: openssl-1.1.1-disable-fips.patch
34148c
9b88be
# Backported fixes including security fixes
9b88be
Patch52: openssl-1.1.1-s390x-update.patch
9b88be
Patch53: openssl-1.1.1-fips-crng-test.patch
9b88be
Patch55: openssl-1.1.1-arm-update.patch
9b88be
Patch56: openssl-1.1.1-s390x-ecc.patch
34148c
Patch73: openssl-1.1.1-cve-2022-0778.patch
9b88be
9b88be
License: OpenSSL and ASL 2.0
9b88be
URL: http://www.openssl.org/
9b88be
BuildRequires: make
9b88be
BuildRequires: gcc
9b88be
BuildRequires: coreutils, perl-interpreter, sed, zlib-devel, /usr/bin/cmp
9b88be
BuildRequires: lksctp-tools-devel
9b88be
BuildRequires: /usr/bin/rename
9b88be
BuildRequires: /usr/bin/pod2man
9b88be
BuildRequires: /usr/sbin/sysctl
9b88be
BuildRequires: perl(Test::Harness), perl(Test::More), perl(Math::BigInt)
9b88be
BuildRequires: perl(Module::Load::Conditional), perl(File::Temp)
9b88be
BuildRequires: perl(Time::HiRes)
9b88be
BuildRequires: perl(FindBin), perl(lib), perl(File::Compare), perl(File::Copy)
9b88be
Requires: coreutils, crypto-policies
9b88be
Conflicts: openssl < 1:3.0, openssl-libs < 1:3.0
9b88be
9b88be
%description
9b88be
The OpenSSL toolkit provides support for secure communications between
9b88be
machines. This version of OpenSSL package contains only the libraries
9b88be
from the 1.1.1 version and is provided for compatibility with previous
9b88be
releases.
9b88be
9b88be
%prep
9b88be
%setup -q -n openssl-%{version}
9b88be
9b88be
# The hobble_openssl is called here redundantly, just to be sure.
9b88be
# The tarball has already the sources removed.
9b88be
%{SOURCE1} > /dev/null
9b88be
9b88be
cp %{SOURCE12} crypto/ec/
9b88be
cp %{SOURCE13} test/
9b88be
9b88be
%patch1 -p1 -b .build   %{?_rawbuild}
9b88be
%patch2 -p1 -b .defaults
9b88be
%patch3 -p1 -b .no-html  %{?_rawbuild}
9b88be
%patch4 -p1 -b .man-rename
9b88be
9b88be
%patch31 -p1 -b .conf-paths
9b88be
%patch32 -p1 -b .version-add-engines
9b88be
%patch33 -p1 -b .dgst
9b88be
%patch36 -p1 -b .no-brainpool
9b88be
%patch37 -p1 -b .curves
9b88be
%patch38 -p1 -b .no-weak-verify
9b88be
%patch40 -p1 -b .disable-ssl3
9b88be
%patch41 -p1 -b .system-cipherlist
9b88be
%patch42 -p1 -b .fips
9b88be
%patch45 -p1 -b .weak-ciphers
9b88be
%patch46 -p1 -b .seclevel
9b88be
%patch47 -p1 -b .ts-sha256-default
9b88be
%patch48 -p1 -b .fips-post-rand
9b88be
%patch49 -p1 -b .evp-kdf
9b88be
%patch50 -p1 -b .ssh-kdf
9b88be
%patch51 -p1 -b .intel-cet
9b88be
%patch52 -p1 -b .s390x-update
9b88be
%patch53 -p1 -b .crng-test
9b88be
%patch55 -p1 -b .arm-update
9b88be
%patch56 -p1 -b .s390x-ecc
9b88be
%patch60 -p1 -b .krb5-kdf
9b88be
%patch61 -p1 -b .edk2-build
9b88be
%patch62 -p1 -b .fips-curves
9b88be
%patch65 -p1 -b .drbg-selftest
9b88be
%patch66 -p1 -b .fips-dh
9b88be
%patch67 -p1 -b .kdf-selftest
9b88be
%patch69 -p1 -b .alpn-cb
9b88be
%patch70 -p1 -b .rewire-fips-drbg
9b88be
%patch71 -p1 -b .conf-new
34148c
%patch72 -p1 -b .disable-fips
34148c
%patch73 -p1 -b .cve-2022-0778
9b88be
9b88be
cp apps/openssl.cnf apps/openssl11.cnf
9b88be
9b88be
%build
9b88be
# Figure out which flags we want to use.
9b88be
# default
9b88be
sslarch=%{_os}-%{_target_cpu}
9b88be
%ifarch %ix86
9b88be
sslarch=linux-elf
9b88be
if ! echo %{_target} | grep -q i686 ; then
9b88be
	sslflags="no-asm 386"
9b88be
fi
9b88be
%endif
9b88be
%ifarch x86_64
9b88be
sslflags=enable-ec_nistp_64_gcc_128
9b88be
%endif
9b88be
%ifarch sparcv9
9b88be
sslarch=linux-sparcv9
9b88be
sslflags=no-asm
9b88be
%endif
9b88be
%ifarch sparc64
9b88be
sslarch=linux64-sparcv9
9b88be
sslflags=no-asm
9b88be
%endif
9b88be
%ifarch alpha alphaev56 alphaev6 alphaev67
9b88be
sslarch=linux-alpha-gcc
9b88be
%endif
9b88be
%ifarch s390 sh3eb sh4eb
9b88be
sslarch="linux-generic32 -DB_ENDIAN"
9b88be
%endif
9b88be
%ifarch s390x
9b88be
sslarch="linux64-s390x"
9b88be
%endif
9b88be
%ifarch %{arm}
9b88be
sslarch=linux-armv4
9b88be
%endif
9b88be
%ifarch aarch64
9b88be
sslarch=linux-aarch64
9b88be
sslflags=enable-ec_nistp_64_gcc_128
9b88be
%endif
9b88be
%ifarch sh3 sh4
9b88be
sslarch=linux-generic32
9b88be
%endif
9b88be
%ifarch ppc64 ppc64p7
9b88be
sslarch=linux-ppc64
9b88be
%endif
9b88be
%ifarch ppc64le
9b88be
sslarch="linux-ppc64le"
9b88be
sslflags=enable-ec_nistp_64_gcc_128
9b88be
%endif
9b88be
%ifarch mips mipsel
9b88be
sslarch="linux-mips32 -mips32r2"
9b88be
%endif
9b88be
%ifarch mips64 mips64el
9b88be
sslarch="linux64-mips64 -mips64r2"
9b88be
%endif
9b88be
%ifarch mips64el
9b88be
sslflags=enable-ec_nistp_64_gcc_128
9b88be
%endif
9b88be
%ifarch riscv64
9b88be
sslarch=linux-generic64
9b88be
%endif
9b88be
9b88be
# Add -Wa,--noexecstack here so that libcrypto's assembler modules will be
9b88be
# marked as not requiring an executable stack.
9b88be
# Also add -DPURIFY to make using valgrind with openssl easier as we do not
9b88be
# want to depend on the uninitialized memory as a source of entropy anyway.
9b88be
RPM_OPT_FLAGS="$RPM_OPT_FLAGS -Wa,--noexecstack -Wa,--generate-missing-build-notes=yes -DPURIFY $RPM_LD_FLAGS"
9b88be
9b88be
export HASHBANGPERL=/usr/bin/perl
9b88be
9b88be
# ia64, x86_64, ppc are OK by default
9b88be
# Configure the build tree.  Override OpenSSL defaults with known-good defaults
9b88be
# usable on all platforms.  The Configure script already knows to use -fPIC and
9b88be
# RPM_OPT_FLAGS, so we can skip specifiying them here.
9b88be
./Configure \
9b88be
	--prefix=%{_prefix} --openssldir=%{_sysconfdir}/pki/tls ${sslflags} \
9b88be
	--system-ciphers-file=%{_sysconfdir}/crypto-policies/back-ends/openssl.config \
9b88be
	zlib enable-camellia enable-seed enable-rfc3779 enable-sctp \
9b88be
	enable-cms enable-md2 enable-rc5 enable-ssl3 enable-ssl3-method \
9b88be
	enable-weak-ssl-ciphers \
9b88be
	no-mdc2 no-ec2m no-sm2 no-sm4 \
9b88be
	shared  ${sslarch} $RPM_OPT_FLAGS '-DDEVRANDOM="\"/dev/urandom\""'
9b88be
9b88be
# Do not run this in a production package the FIPS symbols must be patched-in
9b88be
#util/mkdef.pl crypto update
9b88be
9b88be
make all
9b88be
9b88be
# Clean up the .pc files
9b88be
for i in libcrypto.pc libssl.pc openssl.pc ; do
9b88be
  sed -i '/^Libs.private:/{s/-L[^ ]* //;s/-Wl[^ ]* //}' $i
9b88be
done
9b88be
9b88be
%check
9b88be
# Verify that what was compiled actually works.
9b88be
9b88be
cp apps/openssl.cnf apps/openssl11.cnf
9b88be
9b88be
# Hack - either enable SCTP AUTH chunks in kernel or disable sctp for check
9b88be
(sysctl net.sctp.addip_enable=1 && sysctl net.sctp.auth_enable=1) || \
9b88be
(echo 'Failed to enable SCTP AUTH chunks, disabling SCTP for tests...' &&
9b88be
 sed '/"zlib-dynamic" => "default",/a\ \ "sctp" => "default",' configdata.pm > configdata.pm.new && \
9b88be
 touch -r configdata.pm configdata.pm.new && \
9b88be
 mv -f configdata.pm.new configdata.pm)
9b88be
9b88be
# We must revert patch31 before tests otherwise they will fail
9b88be
patch -p1 -R < %{PATCH31}
9b88be
9b88be
OPENSSL_ENABLE_MD5_VERIFY=
9b88be
export OPENSSL_ENABLE_MD5_VERIFY
9b88be
OPENSSL_SYSTEM_CIPHERS_OVERRIDE=xyz_nonexistent_file
9b88be
export OPENSSL_SYSTEM_CIPHERS_OVERRIDE
9b88be
make test
9b88be
9b88be
%define __provides_exclude_from %{_libdir}/openssl
9b88be
9b88be
%install
9b88be
[ "$RPM_BUILD_ROOT" != "/" ] && rm -rf $RPM_BUILD_ROOT
9b88be
# Install OpenSSL.
9b88be
install -d $RPM_BUILD_ROOT{%{_bindir},%{_includedir},%{_libdir},%{_mandir},%{_libdir}/openssl,%{_pkgdocdir}}
9b88be
%make_install
9b88be
rename so.%{soversion} so.%{version} $RPM_BUILD_ROOT%{_libdir}/*.so.%{soversion}
9b88be
for lib in $RPM_BUILD_ROOT%{_libdir}/*.so.%{version} ; do
9b88be
	chmod 755 ${lib}
9b88be
	ln -s -f `basename ${lib}` $RPM_BUILD_ROOT%{_libdir}/`basename ${lib} .%{version}`.%{soversion}
9b88be
done
9b88be
9b88be
# Delete static library
9b88be
rm -f $RPM_BUILD_ROOT%{_libdir}/*.a || :
9b88be
9b88be
# Delete non-devel man pages in the compat package
9b88be
rm -rf $RPM_BUILD_ROOT%{_mandir}/man[157]*
9b88be
9b88be
# Delete configuration files
9b88be
rm -rf  $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/*
9b88be
9b88be
# Remove binaries
9b88be
rm -rf $RPM_BUILD_ROOT/%{_bindir}
9b88be
9b88be
# Remove useless capi engine
9b88be
rm -f $RPM_BUILD_ROOT/%{_libdir}/engines-1.1/capi.so
9b88be
9b88be
# Delete devel files
9b88be
rm -rf $RPM_BUILD_ROOT%{_includedir}/openssl
9b88be
rm -rf $RPM_BUILD_ROOT%{_mandir}/man3*
9b88be
rm -rf $RPM_BUILD_ROOT%{_libdir}/*.so
9b88be
rm -rf $RPM_BUILD_ROOT%{_libdir}/pkgconfig
9b88be
9b88be
# Install compat config file
9b88be
install -m 644 apps/openssl11.cnf $RPM_BUILD_ROOT%{_sysconfdir}/pki/tls/openssl11.cnf
9b88be
9b88be
%files
9b88be
%license LICENSE
9b88be
%doc FAQ NEWS README
9b88be
%attr(0755,root,root) %{_libdir}/libcrypto.so.%{version}
9b88be
%attr(0755,root,root) %{_libdir}/libcrypto.so.%{soversion}
9b88be
%attr(0755,root,root) %{_libdir}/libssl.so.%{version}
9b88be
%attr(0755,root,root) %{_libdir}/libssl.so.%{soversion}
9b88be
%attr(0755,root,root) %{_libdir}/engines-%{soversion}
9b88be
%config(noreplace) %{_sysconfdir}/pki/tls/openssl11.cnf
9b88be
9b88be
%dir %{_sysconfdir}/pki/tls
9b88be
%attr(0644,root,root) %{_sysconfdir}/pki/tls/openssl11.cnf
9b88be
9b88be
%ldconfig_scriptlets
9b88be
9b88be
%changelog
34148c
* Mon May 30 2022 Clemens Lang <cllang@redhat.com> - 1:1.1.1k-4
34148c
- Fixes CVE-2022-0778 openssl: Infinite loop in BN_mod_sqrt() reachable when parsing certificates
34148c
  Resolves: rhbz#2063147
34148c
- Disable FIPS mode; it does not work and will not be certified
34148c
  Resolves: rhbz#2091968
34148c
34148c
* Tue Oct 05 2021 Sahana Prasad <sahana@redhat.com> - 1:1.1.1k-3
9b88be
- updates OPENSSL_CONF to openssl11.cnf.
9b3742
- Related: rhbz#1947584, rhbz#2003123
9b88be
9b88be
* Mon Aug 16 2021 Sahana Prasad <sahana@redhat.com> - 1:1.1.1k-2
9b88be
- Remove support for building FIPS mode binaries for the
9b88be
  compat libraries
9b88be
- Ships openssl11.cnf as the configuration file.
9b88be
- Resolves: rhbz#1993795
9b88be
- Related: rhbz#1947584
9b88be
9b88be
* Thu Apr 08 2021 Sahana Prasad <sahana@redhat.com> - 1:1.1.1k-1
9b88be
- Repackage old openssl 1.1.1k package into compat-openssl11
9b88be
  Resolves: bz#1947584