51.2. openssl3-3.5.9
OpenSSL 3 runtime libraries for programs built against libssl.so.3
| Version | 3.5.9, release 1 |
| Shelf | crypto — Cryptographic libraries, PKCS#11, smartcards and TPM |
| Phase | 30_foundation (Build Foundation), 126 of 127 in build order |
| Licence | Apache-2.0 |
| Homepage | https://www.openssl.org |
| Build time | 2.5 SBU |
| Installed size | 8.4 MiB in 3 files |
| Recipe | ports/core/crypto/openssl3/kpkgbuild |
About
This is a second OpenSSL, the 3.5 long-term line, installed beside the main openssl port as a slot. It installs two libraries and its licence, libssl.so.3 and libcrypto.so.3: no headers, no libssl.so link, no pkg-config file, no openssl program and no manual pages, so no port can build against it by accident, and nothing it installs collides with a path of OpenSSL 4. It is there for code that cannot use OpenSSL 4: a binary built elsewhere against OpenSSL 3, which the loader otherwise refuses for want of libssl.so.3, and the Qt 5 ports. qt5-qtbase, qca-qt5 and mumble carry the same 3.5 tarball, generate its headers in their own builds and link these two libraries by path. Why, and the rule that keeps OpenSSL 4 out of every Qt 5 process, are in A second version beside the first.
The configuration is the openssl port’s, switch for switch, with no-module and no-tests added; that page explains the switches the two share. qt5-qtbase, qca-qt5 and mumble each pin the release in an _openssl helper of their own, so a new release here is a new release in those three recipes too, or their headers describe a different OpenSSL from the library they load.
Sources
openssl3-3.5.9.tar.gz(50.8 MiB)
sha256603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a
upstream: https://openssl.org/source/openssl-3.5.9.tar.gz
archive copy: sources-1/chat--openssl3-3.5.9.tar.gz
Dependencies
Required by (3): mumble, qca-qt5, qt5-qtbase.
Installation
From the repository root, inside the build container, this is the line kdosbuild runs for the port:
script/chroot/exec.sh bash -c 'source script/phases/30_foundation/phase.env && kpkg install openssl3'
What kpkg does
kpkg runs these steps, in this order, as root inside the chroot. The port directory is /ports/core/crypto/openssl3.
1. Verify every declared source. Each file a sha256 = line names, found in the port directory or in /var/cache/kpkg/sources, must hash to its line; a mismatch stops the build before anything is unpacked.
cd /ports/core/crypto/openssl3
echo '603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a openssl3-3.5.9.tar.gz' | sha256sum -c -
2. Unpack. The work directory is emptied and the first source is unpacked into $SRC with its top directory stripped; any later tarball lands unstripped beside it in $SRC_ROOT, and a file that is not a tarball is copied into $SRC.
SRC_ROOT=/var/cache/kpkg/work/openssl3
SRC=$SRC_ROOT/openssl3-3.5.9
PKG=$SRC_ROOT/pkg
rm -rf "$SRC_ROOT"
mkdir -p "$SRC" "$PKG"
tar --no-same-permissions --warning=no-unknown-keyword -xf openssl3-3.5.9.tar.gz -C "$SRC" --strip-components=1
Every config.guess and config.sub older than automake’s is then replaced with automake’s, so a configure script recognises the musl target.
3. Build. build.sh is sourced in a subshell under set -e, from $SRC, with name, version, release and the recipe’s helpers series and the five paths PKGNAME, PORT_SRC, SRC_ROOT, SRC and PKG set as shell variables. Its body, verbatim:
export CFLAGS="${CFLAGS/-O2/-O3}" CXXFLAGS="${CXXFLAGS/-O2/-O3}"
./config \
--prefix=/usr \
--libdir=lib \
--openssldir=/etc/ssl \
enable-ec_nistp_64_gcc_128 \
enable-camellia \
enable-seed \
enable-rfc3779 \
enable-ktls \
enable-argon2 \
no-mdc2 \
no-ec2m \
no-sm2 \
no-sm4 \
no-module \
no-tests \
shared \
threads \
zlib
make depend
make build_libs
install -Dm755 -t "$PKG/usr/lib" libcrypto.so.3 libssl.so.3
The switches, and why each is set:
export CFLAGS="${CFLAGS/-O2/-O3}"— Compile at OpenSSL’s own-O3, as the main port does.--openssldir=/etc/ssl— Read the sameopenssl.cnfand certificate store as OpenSSL 4, so a program on either library trusts the same roots.no-module— Build no loadable modules. The legacy provider, which OpenSSL 4 installs as/usr/lib/ossl-modules/legacy.so, is compiled intolibcrypto.so.3instead, so this library never loads a module built for the other version.no-tests— Build no test programs; the port runs none and installs only the libraries.build_libs— Build onlylibcryptoandlibssl, skipping theopensslprogram and the manuals, which the main port supplies.
The common switches of each build system are explained in the Flag glossary.
4. Package. kpkg removes libtool archives, the info directory index, mimeinfo.cache and every fonts.dir from $PKG, copies the source’s licence files into /usr/share/licenses/openssl3, prunes what the image does not ship, lints the tree and rolls it reproducibly:
tar --sort=name --format=gnu --numeric-owner --owner=0 --group=0 \
--mtime=@$SOURCE_DATE_EPOCH \
--use-compress-program='xz -9 -T0 --block-size=32MiB --no-adjust' \
-cf openssl3-3.5.9-1.tar.xz -C "$PKG" .
5. Adopt. kpkgadd installs the package’s files over the root, refusing a path another package owns, records the file list in /var/lib/kpkg/db/openssl3, and runs the triggers its paths call for.
Contents
Installed libraries: libcrypto.so, libssl.so.
Installed directories: /usr/share/licenses/openssl3.
Notes
series = 3.5 in the recipe keeps ports/update offering only 3.5 releases for this port, so the slot stays on the long-term line. A binary that needs a symbol added in OpenSSL 3.6 or later still fails to load against it.