Newer
Older
# Contributor: Ariadne Conill <ariadne@dereferenced.org>
# Contributor: Timo Teras <timo.teras@iki.fi>
# Maintainer: Ariadne Conill <ariadne@dereferenced.org>
pkgdesc="Toolkit for Transport Layer Security (TLS)"
makedepends_host="linux-headers"
makedepends="$makedepends_host $makedepends_build"
subpackages="$pkgname-dbg $pkgname-libs-static $pkgname-dev $pkgname-doc
libcrypto$_abiver:_libcrypto libssl$_abiver:_libssl"
source="https://www.openssl.org/source/openssl-$pkgver.tar.gz
man-section.patch
"
# secfixes:
# 3.0.8-r0:
# - CVE-2022-4203
# - CVE-2022-4304
# - CVE-2022-4450
# - CVE-2023-0215
# - CVE-2023-0216
# - CVE-2023-0217
# - CVE-2023-0286
# - CVE-2023-0401
# 3.0.7-r0:
# - CVE-2022-3786
# - CVE-2022-3602
# 3.0.3-r0:
# - CVE-2022-1343
# - CVE-2022-1434
# - CVE-2022-1473
# 1.1.1l-r0:
# - CVE-2021-3711
# - CVE-2021-3712
# 1.1.1k-r0:
# - CVE-2021-3449
# - CVE-2021-3450
# 1.1.1j-r0:
# - CVE-2021-23841
# - CVE-2021-23840
# - CVE-2021-23839
# 1.1.1d-r1:
# - CVE-2019-1547
# - CVE-2019-1549
# - CVE-2019-1563
# 1.1.1b-r1:
# - CVE-2019-1543
# - CVE-2018-0734
# - CVE-2018-0735
# 0:
# - CVE-2022-1292
# - CVE-2022-2068
build() {
local _target _optflags
# openssl will prepend crosscompile always core CC et al
CC=${CC#"$CROSS_COMPILE"}
CXX=${CXX#"$CROSS_COMPILE"}
CPP=${CPP#"$CROSS_COMPILE"}
# determine target OS for openssl
case "$CARCH" in
aarch64*) _target="linux-aarch64" ;;
arm*) _target="linux-armv4" ;;
mips64*) _target="linux64-mips64" ;;
# explicit _optflags is needed to prevent automatic -mips3 addition
mips*) _target="linux-mips32"; _optflags="-mips32" ;;
ppc64) _target="linux-ppc64" ;;
ppc64le) _target="linux-ppc64le" ;;
x86_64) _target="linux-x86_64"; _optflags="enable-ec_nistp_64_gcc_128" ;;
riscv64) _target="linux-generic64";;
*) msg "Unable to determine architecture from (CARCH=$CARCH)" ; return 1 ;;
esac
# Configure assumes --options are for it, so can't use
# gcc's --sysroot fake this by overriding CC
[ -n "$CBUILDROOT" ] && CC="$CC --sysroot=$CBUILDROOT"
# when cross building do not enable threads as libatomic is not avaiable
if [ "$CBUILD" != "$CHOST" ]; then
case $CARCH in
riscv64) _optflags="$_optflags no-threads";;
esac
fi
perl ./Configure \
$_target \
--prefix=/usr \
shared \
no-zlib \
no-async \
no-comp \
no-idea \
no-mdc2 \
no-rc5 \
no-ec2m \
no-ssl3 \
no-seed \
$_optflags \
$CPPFLAGS \
$CFLAGS \
$LDFLAGS -Wa,--noexecstack
# dump configuration into logs
perl configdata.pm --dump
make
}
check() {
# AFALG tests have a sporadic test failure, just delete the broken
# test for now.
rm -f test/recipes/30-test_afalg.t
make test
}
package() {
depends="libssl$_abiver=$pkgver-r$pkgrel libcrypto$_abiver=$pkgver-r$pkgrel"
provides="openssl3=$pkgver-r$pkgrel"
replaces="openssl3"
make DESTDIR="$pkgdir" install
# remove the script c_rehash
rm "$pkgdir"/usr/bin/c_rehash
dev() {
provides="openssl3-dev=$pkgver-r$pkgrel"
replaces="openssl3-dev"
default_dev
}
pkgdesc="Crypto library from openssl"
mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib
mv "$pkgdir"/etc "$subpkgdir"/
for i in "$pkgdir"/usr/lib/libcrypto*; do
mv $i "$subpkgdir"/lib/
ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/}
done
mv "$pkgdir"/usr/lib/engines-$_abiver "$subpkgdir"/usr/lib/
mv "$pkgdir"/usr/lib/ossl-modules "$subpkgdir"/usr/lib/
pkgdesc="SSL shared libraries"
mkdir -p "$subpkgdir"/lib "$subpkgdir"/usr/lib
for i in "$pkgdir"/usr/lib/libssl*; do
mv $i "$subpkgdir"/lib/
ln -s ../../lib/${i##*/} "$subpkgdir"/usr/lib/${i##*/}
done
}
9f41113e5537aee4c3f92711ff85fa12da080363fef0c8b8b34e5b3fc608473c6e4cadd9d8c78f2fcbe97462e51f26a0bb6781656a69ad40226e68af2cf2c762 openssl-3.1.2.tar.gz
8c44e990fe8a820f649631b9f81cf28225b7516065169a7f68e2dd7c067b30df9b2c6cb88fa826afbc9fcdaf156360aabf7c498d2d9ed452968815b12b004809 man-section.patch