summaryrefslogtreecommitdiff
path: root/dev-libs/openssl
diff options
context:
space:
mode:
Diffstat (limited to 'dev-libs/openssl')
-rw-r--r--dev-libs/openssl/Manifest4
-rw-r--r--dev-libs/openssl/files/gentoo.config-1.0.4 (renamed from dev-libs/openssl/files/gentoo.config-1.0.2)19
-rw-r--r--dev-libs/openssl/files/openssl-3.0.5-test-memcmp.patch22
-rw-r--r--dev-libs/openssl/openssl-3.1.1.ebuild (renamed from dev-libs/openssl/openssl-3.0.5-r1.ebuild)175
4 files changed, 72 insertions, 148 deletions
diff --git a/dev-libs/openssl/Manifest b/dev-libs/openssl/Manifest
index 14cd35d..a86d270 100644
--- a/dev-libs/openssl/Manifest
+++ b/dev-libs/openssl/Manifest
@@ -1,2 +1,2 @@
-DIST openssl-3.0.5.tar.gz 15074407 BLAKE2B 7bf89e042417c003ef02a8bb1278590a52ce4a3d50f66795c66b750f90248840edb0d3352811caaaaff708c7e65b77384142e316916a6c311f1d2b4747f44816 SHA512 782b0df3d0252468aa696bd74a3b661810499819c0df849aa9698ba0e06a845820dc856aac650fced4be234f1271e576d4317ac3ab1406cf0ffe087d695d20fe
-DIST openssl-3.0.5.tar.gz.asc 862 BLAKE2B 24f1839227be7acec45eb6b748cea7be0b5e66b5cf745814861f7290670733936bf1af2c1dc9357439b31a2ca28f418880d63726d4be6fa994902ac95b51e401 SHA512 516da9ef291601400576adaba7271854af3caa23dc1d70116004360f580e4c28fe61d51e86477d341e4c5bf0ca5f98db8264581ed6cc2c8df124da83ad3e40be
+DIST openssl-3.1.1.tar.gz 15544757 BLAKE2B 094f7e28f16de6528016fcd21df1d7382b0dbdcd80ec469d37add9c37f638c059dda3ffb4415eba890a33d146ddc9016bcc7192df101c73be5e70faf6e3b1097 SHA512 8ba9dd6ab87451e126c19cc106ccd1643ca48667d6c37504d0ab98205fbccf855fd0db54474b4113c4c3a15215a4ef77a039fb897a69f71bcab2054b2effd1d9
+DIST openssl-3.1.1.tar.gz.asc 833 BLAKE2B 5a2a9aeb475b843862e133d53bc5bb3c8e12e8e03b1e2da41d0eaa0eade1ae03c4318ad1f5c490c5e1ed7e6ac6275a6d7c881d99993911722b043b15d1622b25 SHA512 83349020c67e5b956f3ef37604a03a1970ea393f862691f5fd5d85930c01e559e25db17d397d8fd230c3862a8b2fba2d5c7df883d56d7472f4c01dab3a661cb2
diff --git a/dev-libs/openssl/files/gentoo.config-1.0.2 b/dev-libs/openssl/files/gentoo.config-1.0.4
index 68d7d0a..79f6331 100644
--- a/dev-libs/openssl/files/gentoo.config-1.0.2
+++ b/dev-libs/openssl/files/gentoo.config-1.0.4
@@ -77,7 +77,9 @@ fi
# Detect target arch
machine=""
+submachine=""
chost_machine=${CHOST%%-*}
+[[ ${CC} == *clang* ]] && submachine="-clang"
case ${system} in
linux)
case ${chost_machine}:${ABI} in
@@ -95,17 +97,22 @@ linux)
# hppa64*) machine=parisc64;;
hppa*) machine="generic32 -DB_ENDIAN";;
i[0-9]86*|\
- x86_64*:x86) machine=elf;;
+ x86_64*:x86) machine=x86${submachine};;
ia64*) machine=ia64;;
- m68*) machine="generic32 -DB_ENDIAN";;
- mips*el*) machine="generic32 -DL_ENDIAN";;
- mips*) machine="generic32 -DB_ENDIAN";;
+ loongarch64*) machine="loongarch64 -DL_ENDIAN" system=linux64;;
+ m68*) machine="latomic -DB_ENDIAN";;
+ mips*el*:o32) machine="mips32 -DL_ENDIAN";;
+ mips*:o32) machine="mips32 -DB_ENDIAN";;
+ mips*el*:n32) machine="mips64 -DL_ENDIAN";;
+ mips*:n32) machine="mips64 -DB_ENDIAN";;
+ mips*el*:n64) machine="mips64 -DL_ENDIAN" system=linux64;;
+ mips*:n64) machine="mips64 -DB_ENDIAN" system=linux64;;
powerpc64*le*)machine=ppc64le;;
powerpc64*) machine=ppc64;;
powerpc*le*) machine="generic32 -DL_ENDIAN";;
powerpc*) machine=ppc;;
riscv32*) machine="generic32 -DL_ENDIAN";;
- riscv64*) machine="generic64 -DL_ENDIAN";;
+ riscv64*) machine="riscv64 -DL_ENDIAN" system=linux64;;
# sh64*) machine=elf;;
sh*b*) machine="generic32 -DB_ENDIAN";;
sh*) machine="generic32 -DL_ENDIAN";;
@@ -120,7 +127,7 @@ linux)
s390x*) machine=s390x system=linux64;;
s390*) machine="generic32 -DB_ENDIAN";;
x86_64*:x32) machine=x32;;
- x86_64*) machine=x86_64;;
+ x86_64*) machine=x86_64${submachine};;
esac
;;
BSD)
diff --git a/dev-libs/openssl/files/openssl-3.0.5-test-memcmp.patch b/dev-libs/openssl/files/openssl-3.0.5-test-memcmp.patch
deleted file mode 100644
index 8fa0387..0000000
--- a/dev-libs/openssl/files/openssl-3.0.5-test-memcmp.patch
+++ /dev/null
@@ -1,22 +0,0 @@
-From 7f58de577c05ae0bbd20eee9b2971cfa1cd062c8 Mon Sep 17 00:00:00 2001
-From: Gregor Jasny <gjasny@googlemail.com>
-Date: Tue, 5 Jul 2022 12:57:06 +0200
-Subject: [PATCH] Add missing header for memcmp
-
-CLA: trivial
----
- test/v3ext.c | 1 +
- 1 file changed, 1 insertion(+)
-
-diff --git a/test/v3ext.c b/test/v3ext.c
-index 926f3884b138..a8ab64b2714b 100644
---- a/test/v3ext.c
-+++ b/test/v3ext.c
-@@ -8,6 +8,7 @@
- */
-
- #include <stdio.h>
-+#include <string.h>
- #include <openssl/x509.h>
- #include <openssl/x509v3.h>
- #include <openssl/pem.h>
diff --git a/dev-libs/openssl/openssl-3.0.5-r1.ebuild b/dev-libs/openssl/openssl-3.1.1.ebuild
index 5aa7087..d391173 100644
--- a/dev-libs/openssl/openssl-3.0.5-r1.ebuild
+++ b/dev-libs/openssl/openssl-3.1.1.ebuild
@@ -1,7 +1,7 @@
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
# Distributed under the terms of the GNU General Public License v2
-EAPI=7
+EAPI=8
VERIFY_SIG_OPENPGP_KEY_PATH="${BROOT}"/usr/share/openpgp-keys/openssl.org.asc
inherit edo flag-o-matic linux-info toolchain-funcs multilib-minimal multiprocessing verify-sig
@@ -16,20 +16,22 @@ if [[ ${PV} == 9999 ]] ; then
inherit git-r3
else
- SRC_URI="mirror://openssl/source/${MY_P}.tar.gz
- verify-sig? ( mirror://openssl/source/${MY_P}.tar.gz.asc )"
- KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86 ~x86-linux"
+ SRC_URI="
+ mirror://openssl/source/${MY_P}.tar.gz
+ verify-sig? ( mirror://openssl/source/${MY_P}.tar.gz.asc )
+ "
+ #KEYWORDS="~alpha ~amd64 ~arm ~arm64 ~hppa ~ia64 ~loong ~m68k ~mips ~ppc ~ppc64 ~riscv ~s390 ~sparc ~x86"
fi
S="${WORKDIR}"/${MY_P}
LICENSE="Apache-2.0"
-SLOT="0/3" # .so version of libssl/libcrypto
+SLOT="0/$(ver_cut 1)" # .so version of libssl/libcrypto
IUSE="+asm cpu_flags_x86_sse2 fips ktls rfc3779 sctp static-libs test tls-compression vanilla verify-sig weak-ssl-ciphers"
RESTRICT="!test? ( test )"
COMMON_DEPEND="
- >=app-misc/c_rehash-1.7-r1
+ !<net-misc/openssh-9.2_p1-r3
tls-compression? ( >=sys-libs/zlib-1.2.8-r1[static-libs(+)?,${MULTILIB_USEDEP}] )
"
BDEPEND="
@@ -40,7 +42,7 @@ BDEPEND="
sys-devel/bc
sys-process/procps
)
- verify-sig? ( sec-keys/openpgp-keys-openssl )"
+ verify-sig? ( >=sec-keys/openpgp-keys-openssl-20230207 )"
DEPEND="${COMMON_DEPEND}"
RDEPEND="${COMMON_DEPEND}"
@@ -50,10 +52,6 @@ MULTILIB_WRAPPED_HEADERS=(
/usr/include/openssl/configuration.h
)
-PATCHES=(
- "${FILESDIR}"/${P}-test-memcmp.patch
-)
-
pkg_setup() {
if use ktls ; then
if kernel_is -lt 4 18 ; then
@@ -62,6 +60,7 @@ pkg_setup() {
CONFIG_CHECK="~TLS ~TLS_DEVICE"
ERROR_TLS="You will be unable to offload TLS to kernel because CONFIG_TLS is not set!"
ERROR_TLS_DEVICE="You will be unable to offload TLS to kernel because CONFIG_TLS_DEVICE is not set!"
+ use test && CONFIG_CHECK+=" ~CRYPTO_USER_API_SKCIPHER"
linux-info_pkg_setup
fi
@@ -91,13 +90,6 @@ src_unpack() {
}
src_prepare() {
- # Allow openssl to be cross-compiled
- cp "${FILESDIR}"/gentoo.config-1.0.2 gentoo.config || die
- chmod a+rx gentoo.config || die
-
- # Keep this in sync with app-misc/c_rehash
- SSL_CNF_DIR="/etc/ssl"
-
# Make sure we only ever touch Makefile.org and avoid patching a file
# that gets blown away anyways by the Configure script in src_configure
rm -f Makefile
@@ -115,18 +107,13 @@ src_prepare() {
rm test/recipes/80-test_ssl_new.t || die
fi
- # - Make sure the man pages are suffixed (bug #302165)
- # - Don't bother building man pages if they're disabled
- # - Make DOCDIR Gentoo compliant
- sed -i \
- -e '/^MANSUFFIX/s:=.*:=ssl:' \
- -e '/^MAKEDEPPROG/s:=.*:=$(CC):' \
- -e $(has noman FEATURES \
- && echo '/^install:/s:install_docs::' \
- || echo '/^MANDIR=/s:=.*:='${EPREFIX}'/usr/share/man:') \
- -e "/^DOCDIR/s@\$(BASENAME)@&-${PVR}@" \
- Configurations/unix-Makefile.tmpl \
- || die
+ # Test fails depending on kernel configuration, bug #699134
+ rm test/recipes/30-test_afalg.t || die
+}
+
+src_configure() {
+ # Keep this in sync with app-misc/c_rehash
+ SSL_CNF_DIR="/etc/ssl"
# Quiet out unknown driver argument warnings since openssl
# doesn't have well-split CFLAGS and we're making it even worse
@@ -139,32 +126,17 @@ src_prepare() {
# it's still relevant:
# - https://github.com/llvm/llvm-project/issues/55255
# - https://github.com/openssl/openssl/issues/18225
+ # - https://github.com/openssl/openssl/issues/18663#issuecomment-1181478057
# Don't remove the no strict aliasing bits below!
filter-flags -fstrict-aliasing
append-flags -fno-strict-aliasing
+ # The OpenSSL developers don't test with LTO right now, it leads to various
+ # warnings/errors (which may or may not be false positives), it's considered
+ # unsupported, and it's not tested in CI: https://github.com/openssl/openssl/issues/18663.
+ filter-lto
append-flags $(test-flags-CC -Wa,--noexecstack)
- # Prefixify Configure shebang (bug #141906)
- sed \
- -e "1s,/usr/bin/env,${BROOT}&," \
- -i Configure || die
-
- # Remove test target when FEATURES=test isn't set
- if ! use test ; then
- sed \
- -e '/^$config{dirs}/s@ "test",@@' \
- -i Configure || die
- fi
-
- # The config script does stupid stuff to prompt the user. Kill it.
- sed -i '/stty -icanon min 0 time 50; read waste/d' config || die
- ./config --test-sanity || die "I AM NOT SANE"
-
- multilib_copy_sources
-}
-
-multilib_src_configure() {
# bug #197996
unset APPS
# bug #312551
@@ -174,14 +146,16 @@ multilib_src_configure() {
tc-export AR CC CXX RANLIB RC
+ multilib-minimal_src_configure
+}
+
+multilib_src_configure() {
use_ssl() { usex $1 "enable-${2:-$1}" "no-${2:-$1}" " ${*:3}" ; }
local krb5=$(has_version app-crypt/mit-krb5 && echo "MIT" || echo "Heimdal")
- local sslout=$(./gentoo.config)
+ local sslout=$(bash "${FILESDIR}/gentoo.config-1.0.4")
einfo "Using configuration: ${sslout:-(openssl knows best)}"
- local config="Configure"
- [[ -z ${sslout} ]] && config="config"
# https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-and-disable-features
local myeconfargs=(
@@ -194,7 +168,7 @@ multilib_src_configure() {
enable-sm2
enable-srp
$(use elibc_musl && echo "no-async")
- $(use amd64 && echo "enable-ec_nistp_64_gcc_128")
+ enable-ec_nistp_64_gcc_128
enable-idea
enable-mdc2
$(use fips && echo "enable-fips")
@@ -214,36 +188,15 @@ multilib_src_configure() {
threads
)
- CFLAGS= LDFLAGS= edo ./${config} "${myeconfargs[@]}"
-
- # Clean out hardcoded flags that openssl uses
- local DEFAULT_CFLAGS=$(grep ^CFLAGS= Makefile | LC_ALL=C sed \
- -e 's:^CFLAGS=::' \
- -e 's:\(^\| \)-fomit-frame-pointer::g' \
- -e 's:\(^\| \)-O[^ ]*::g' \
- -e 's:\(^\| \)-march=[^ ]*::g' \
- -e 's:\(^\| \)-mcpu=[^ ]*::g' \
- -e 's:\(^\| \)-m[^ ]*::g' \
- -e 's:^ *::' \
- -e 's: *$::' \
- -e 's: \+: :g' \
- -e 's:\\:\\\\:g'
- )
-
- # Now insert clean default flags with user flags
- sed -i \
- -e "/^CFLAGS=/s|=.*|=${DEFAULT_CFLAGS} ${CFLAGS}|" \
- -e "/^LDFLAGS=/s|=[[:space:]]*$|=${LDFLAGS}|" \
- Makefile \
- || die
+ edo perl "${S}/Configure" "${myeconfargs[@]}"
}
multilib_src_compile() {
- # depend is needed to use $confopts; it also doesn't matter
- # that it's -j1 as the code itself serializes subdirs
- emake -j1 depend
+ emake build_sw
- emake all
+ if multilib_is_native_abi; then
+ emake build_docs
+ fi
}
multilib_src_test() {
@@ -253,10 +206,17 @@ multilib_src_test() {
}
multilib_src_install() {
- # We need to create ${ED}/usr on our own to avoid a race condition (bug #665130)
- dodir /usr
+ emake DESTDIR="${D}" install_sw
+ if use fips; then
+ emake DESTDIR="${D}" install_fips
+ # Regen this in pkg_preinst, bug 900625
+ rm "${ED}${SSL_CNF_DIR}"/fipsmodule.cnf || die
+ fi
- emake DESTDIR="${D}" install
+ if multilib_is_native_abi; then
+ emake DESTDIR="${D}" install_ssldirs
+ emake DESTDIR="${D}" DOCDIR='$(INSTALLTOP)'/share/doc/${PF} install_docs
+ fi
# This is crappy in that the static archives are still built even
# when USE=static-libs. But this is due to a failing in the openssl
@@ -278,38 +238,6 @@ multilib_src_install_all() {
# Create the certs directory
keepdir ${SSL_CNF_DIR}/certs
- # Namespace openssl programs to prevent conflicts with other man pages
- cd "${ED}"/usr/share/man || die
- local m d s
- for m in $(find . -type f | xargs grep -L '#include') ; do
- d=${m%/*}
- d=${d#./}
- m=${m##*/}
-
- [[ ${m} == openssl.1* ]] && continue
-
- [[ -n $(find -L ${d} -type l) ]] && die "erp, broken links already!"
-
- mv ${d}/{,ssl-}${m} || die
-
- # Fix up references to renamed man pages
- sed -i '/^[.]SH "SEE ALSO"/,/^[.]/s:\([^(, ]*(1)\):ssl-\1:g' ${d}/ssl-${m} || die
- ln -s ssl-${m} ${d}/openssl-${m} || die
-
- # Locate any symlinks that point to this man page
- # We assume that any broken links are due to the above renaming
- for s in $(find -L ${d} -type l) ; do
- s=${s##*/}
-
- rm -f ${d}/${s}
-
- # We don't want to "|| die" here
- ln -s ssl-${m} ${d}/ssl-${s}
- ln -s ssl-${s} ${d}/openssl-${s}
- done
- done
- [[ -n $(find -L ${d} -type l) ]] && die "broken manpage links found :("
-
# bug #254521
dodir /etc/sandbox.d
echo 'SANDBOX_PREDICT="/dev/crypto"' > "${ED}"/etc/sandbox.d/10openssl
@@ -318,8 +246,19 @@ multilib_src_install_all() {
keepdir ${SSL_CNF_DIR}/private
}
+pkg_preinst() {
+ if use fips; then
+ # Regen fipsmodule.cnf, bug 900625
+ ebegin "Running openssl fipsinstall"
+ "${ED}/usr/bin/openssl" fipsinstall -quiet \
+ -out "${ED}${SSL_CNF_DIR}/fipsmodule.cnf" \
+ -module "${ED}/usr/$(get_libdir)/ossl-modules/fips.so"
+ eend $?
+ fi
+}
+
pkg_postinst() {
- ebegin "Running 'c_rehash ${EROOT}${SSL_CNF_DIR}/certs/' to rebuild hashes (bug #333069)"
- c_rehash "${EROOT}${SSL_CNF_DIR}/certs" >/dev/null
+ ebegin "Running 'openssl rehash ${EROOT}${SSL_CNF_DIR}/certs' to rebuild hashes (bug #333069)"
+ openssl rehash "${EROOT}${SSL_CNF_DIR}/certs"
eend $?
}