Skip to content

Commit 1a28c1b

Browse files
committed
Update OpenSSL to 3.5.0 in manylinux
This also changes the way how the libssh finds the OpenSSL installation to use the `OPENSSL_ROOT_DIR` variable. Based partially on the changes in ansible#719. Signed-off-by: Jakub Jelen <[email protected]>
1 parent 1e287c2 commit 1a28c1b

File tree

5 files changed

+24
-9
lines changed

5 files changed

+24
-9
lines changed

build-scripts/manylinux-container-image/Dockerfile

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,15 @@ ARG RELEASE
44
ARG LIBSSH_VERSION=0.11.1
55
MAINTAINER Python Cryptographic Authority
66
WORKDIR /root
7+
RUN \
8+
if [ $(uname -m) = "x86_64" ]; \
9+
then \
10+
if stat /etc/redhat-release 1>&2 2>/dev/null; then \
11+
yum -y install binutils perl perl-IPC-Cmd && \
12+
yum -y clean all && \
13+
rm -rf /var/cache/yum; \
14+
fi; \
15+
fi
716

817
ADD build_utils.sh /root/build_utils.sh
918
ADD install_perl.sh /root/install_perl.sh

build-scripts/manylinux-container-image/install_libssh.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,8 @@ export LDFLAGS="-pthread -ldl"
6868
# See also "/tmp/libssh-0.9.4-manylinux-build.FJUercWAg9/libssh-0.9.4/build/CMakeFiles/CMakeError.log".
6969
export PYCA_OPENSSL_PATH=/opt/pyca/cryptography/openssl
7070
export PKG_CONFIG_PATH="${STATIC_DEPS_PREFIX}/lib64/pkgconfig:${STATIC_DEPS_PREFIX}/lib/pkgconfig:${PYCA_OPENSSL_PATH}/lib/pkgconfig"
71+
# Point libssh directly to the OpenSSL directory. It can find it there
72+
export OPENSSL_ROOT_DIR="${PYCA_OPENSSL_PATH}"
7173

7274
>&2 echo
7375
>&2 echo

build-scripts/manylinux-container-image/install_openssl.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,21 +8,24 @@ MY_DIR=$(dirname "${BASH_SOURCE[0]}")
88

99
# Get build utilities
1010
source $MY_DIR/build_utils.sh
11+
12+
OPENSSL_URL="https://github.com/openssl/openssl/releases/download"
1113
source /root/openssl-version.sh
1214

13-
fetch_source "openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/"
14-
check_sha256sum "openssl-${OPENSSL_VERSION}.tar.gz" ${OPENSSL_SHA256}
15-
tar zxf openssl-${OPENSSL_VERSION}.tar.gz
15+
curl -#LO "${OPENSSL_URL}/${OPENSSL_VERSION}/${OPENSSL_VERSION}.tar.gz"
16+
check_sha256sum "${OPENSSL_VERSION}.tar.gz" ${OPENSSL_SHA256}
17+
tar zxf ${OPENSSL_VERSION}.tar.gz
1618

17-
pushd openssl-${OPENSSL_VERSION}
19+
pushd ${OPENSSL_VERSION}
20+
BUILD_FLAGS="$OPENSSL_BUILD_FLAGS"
1821
if [[ "$1" =~ '^manylinux1_.*$' ]]; then
1922
PATH=/opt/perl/bin:$PATH
2023
fi
21-
./config $OPENSSL_BUILD_FLAGS --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
24+
./config $BUILD_FLAGS --prefix=/opt/pyca/cryptography/openssl --openssldir=/opt/pyca/cryptography/openssl
2225
make depend
2326
make -j4
2427
# avoid installing the docs
2528
# https://github.com/openssl/openssl/issues/6685#issuecomment-403838728
2629
make install_sw install_ssldirs
2730
popd
28-
rm -rf openssl-${OPENSSL_VERSION}
31+
rm -rf ${OPENSSL_VERSION}
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
export OPENSSL_VERSION="1.1.1k"
2-
export OPENSSL_SHA256="892a0875b9872acd04a9fde79b1f943075d5ea162415de3047c327df33fbaee5"
1+
export OPENSSL_VERSION="openssl-3.5.0"
2+
export OPENSSL_SHA256="344d0a79f1a9b08029b0744e2cc401a43f9c90acd1044d09a530b4885a8e9fc0"
33
# We need a base set of flags because on Windows using MSVC
44
# enable-ec_nistp_64_gcc_128 doesn't work since there's no 128-bit type
5-
export OPENSSL_BUILD_FLAGS_WINDOWS="no-ssl3 no-ssl3-method no-zlib no-shared no-comp no-dynamic-engine"
5+
export OPENSSL_BUILD_FLAGS_WINDOWS="no-ssl3 no-ssl3-method no-zlib no-shared no-module no-comp no-dynamic-engine no-apps no-docs no-sm2-precomp no-atexit"
66
export OPENSSL_BUILD_FLAGS="${OPENSSL_BUILD_FLAGS_WINDOWS} enable-ec_nistp_64_gcc_128"
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Updated OpenSSL to latest version 3.5.0 in manylinux -- by :user:`Jakuje`.

0 commit comments

Comments
 (0)