Skip to content

Commit 916fbc9

Browse files
committed
fix: bump openssl to latest point release
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
1 parent 8369253 commit 916fbc9

21 files changed

+838
-0
lines changed

dockerfiles/centos-7.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN yum clean all && yum update -y && yum install -y \
1414
kernel-devel \
1515
libtool \
1616
perl-IPC-Cmd \
17+
perl-Time-Piece \
1718
python3 \
1819
tar \
1920
unzip \

dockerfiles/rockylinux-8.dockerfile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ RUN dnf install -y 'dnf-command(config-manager)' && \
1414
libtool \
1515
libtirpc-devel \
1616
perl-IPC-Cmd \
17+
perl-Time-Piece \
1718
python3 \
1819
rpm-build \
1920
tar \
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
2+
index 09303c4..487ff68 100644
3+
--- a/Configurations/unix-Makefile.tmpl
4+
+++ b/Configurations/unix-Makefile.tmpl
5+
@@ -338,7 +338,7 @@ bindir={- file_name_is_absolute($bindir)
6+
? $bindir : '$(INSTALLTOP)/$(BINDIR)' -}
7+
8+
PKGCONFIGDIR=$(libdir)/pkgconfig
9+
-CMAKECONFIGDIR=$(libdir)/cmake/OpenSSL
10+
+CMAKECONFIGDIR=$(INSTALLTOP)/share/openssl
11+
12+
MANDIR=$(INSTALLTOP)/share/man
13+
DOCDIR=$(INSTALLTOP)/share/doc/$(BASENAME)
14+
diff --git a/Configurations/windows-makefile.tmpl b/Configurations/windows-makefile.tmpl
15+
index 894834c..d6d3c41 100644
16+
--- a/Configurations/windows-makefile.tmpl
17+
+++ b/Configurations/windows-makefile.tmpl
18+
@@ -254,7 +254,7 @@ MODULESDIR=$(MODULESDIR_dev)$(MODULESDIR_dir)
19+
libdir={- file_name_is_absolute($libdir)
20+
? $libdir : '$(INSTALLTOP)\$(LIBDIR)' -}
21+
22+
-CMAKECONFIGDIR=$(libdir)\cmake\OpenSSL
23+
+CMAKECONFIGDIR=$(INSTALLTOP)\share\openssl
24+
25+
##### User defined commands and flags ################################
26+
27+
diff --git a/exporters/cmake/OpenSSLConfig.cmake.in b/exporters/cmake/OpenSSLConfig.cmake.in
28+
index 766aebe..026680a 100644
29+
--- a/exporters/cmake/OpenSSLConfig.cmake.in
30+
+++ b/exporters/cmake/OpenSSLConfig.cmake.in
31+
@@ -91,8 +91,7 @@ get_filename_component(_ossl_prefix "${CMAKE_CURRENT_LIST_FILE}" PATH)
32+
{-
33+
# For each component in $OpenSSL::safe::installdata::CMAKECONFIGDIR[0] relative to
34+
# $OpenSSL::safe::installdata::PREFIX[0], have CMake figure out the parent directory.
35+
- my $d = join('/', unixify(catdir($OpenSSL::safe::installdata::LIBDIR_REL_PREFIX[0],
36+
- $OpenSSL::safe::installdata::CMAKECONFIGDIR_REL_LIBDIR[0]), 1));
37+
+ my $d = 'share/openssl';
38+
$OUT = '';
39+
if ($d ne '.') {
40+
$OUT .= 'get_filename_component(_ossl_prefix "${_ossl_prefix}" PATH)' . "\n"
41+
@@ -141,6 +140,14 @@ set(OPENSSL_APPLINK_SOURCE "${_ossl_prefix}/{- unixify($OpenSSL::safe::installda
42+
{- output_on() if $disabled{uplink}; "" -}
43+
set(OPENSSL_PROGRAM "${OPENSSL_RUNTIME_DIR}/{- platform->bin('openssl') -}")
44+
45+
+if(NOT Z_VCPKG_OPENSSL_USE_SINGLE_CONFIG)
46+
+ # Prevent loop
47+
+ set(Z_VCPKG_OPENSSL_USE_SINGLE_CONFIG "prevent-loop")
48+
+ # Chainload vcpkg's module-based multi-config target setup
49+
+ find_package(OpenSSL MODULE)
50+
+ set(Z_VCPKG_OPENSSL_USE_SINGLE_CONFIG 0)
51+
+else()
52+
+ # Use official single-config target setup
53+
# Set up the imported targets
54+
if(_ossl_use_static_libs)
55+
{- output_off() unless $no_static; "" -}
56+
@@ -240,5 +247,6 @@ set_property(TARGET OpenSSL::applink PROPERTY
57+
INTERFACE_SOURCES "${OPENSSL_APPLINK_SOURCE}")
58+
{- output_on() if $disabled{uplink}; "" -}
59+
60+
+endif()
61+
unset(_ossl_prefix)
62+
unset(_ossl_use_static_libs)
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
diff --git a/Configurations/unix-Makefile.tmpl b/Configurations/unix-Makefile.tmpl
2+
index 8ddb128..52b9ad6 100644
3+
--- a/Configurations/unix-Makefile.tmpl
4+
+++ b/Configurations/unix-Makefile.tmpl
5+
@@ -1961,7 +1961,7 @@ EOF
6+
my @objs = map { platform->obj($_) } @{$args{objs}};
7+
my $deps = join(" \\\n" . ' ' x (length($lib) + 2),
8+
fill_lines(' ', $COLUMNS - length($lib) - 2, @objs));
9+
- my $max_per_call = 500;
10+
+ my $max_per_call = ($^O eq 'msys') ? 80 : 500;
11+
my @objs_grouped;
12+
push @objs_grouped, join(" ", splice @objs, 0, $max_per_call) while @objs;
13+
my $fill_lib =
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
function(install_pc_file name pc_data)
2+
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "release")
3+
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/lib/pkgconfig/${name}.pc" @ONLY)
4+
endif()
5+
if(NOT DEFINED VCPKG_BUILD_TYPE OR VCPKG_BUILD_TYPE STREQUAL "debug")
6+
configure_file("${CMAKE_CURRENT_LIST_DIR}/openssl.pc.in" "${CURRENT_PACKAGES_DIR}/debug/lib/pkgconfig/${name}.pc" @ONLY)
7+
endif()
8+
endfunction()
9+
10+
install_pc_file(openssl [[
11+
Name: OpenSSL
12+
Description: Secure Sockets Layer and cryptography libraries and tools
13+
Requires: libssl libcrypto
14+
]])
15+
16+
install_pc_file(libssl [[
17+
Name: OpenSSL-libssl
18+
Description: Secure Sockets Layer and cryptography libraries
19+
Libs: -L"${libdir}" -llibssl
20+
Requires: libcrypto
21+
Cflags: -I"${includedir}"
22+
]])
23+
24+
install_pc_file(libcrypto [[
25+
Name: OpenSSL-libcrypto
26+
Description: OpenSSL cryptography library
27+
Libs: -L"${libdir}" -llibcrypto
28+
Libs.private: -lcrypt32 -lws2_32 -ladvapi32 -luser32
29+
Cflags: -I"${includedir}"
30+
]])
31+
32+
vcpkg_fixup_pkgconfig()

overlays/openssl/openssl.pc.in

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
prefix=${pcfiledir}/../..
2+
exec_prefix=${prefix}
3+
libdir=${exec_prefix}/lib
4+
includedir=${prefix}/include
5+
Version: @VERSION@
6+
@pc_data@

overlays/openssl/portfile.cmake

Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
if(EXISTS "${CURRENT_INSTALLED_DIR}/share/libressl/copyright"
2+
OR EXISTS "${CURRENT_INSTALLED_DIR}/share/boringssl/copyright")
3+
message(FATAL_ERROR "Can't build openssl if libressl/boringssl is installed. Please remove libressl/boringssl, and try install openssl again if you need it.")
4+
endif()
5+
6+
if(VCPKG_TARGET_IS_EMSCRIPTEN)
7+
vcpkg_check_linkage(ONLY_STATIC_LIBRARY)
8+
endif()
9+
10+
vcpkg_from_github(
11+
OUT_SOURCE_PATH SOURCE_PATH
12+
REPO openssl/openssl
13+
REF "openssl-${VERSION}"
14+
SHA512 d95cf4efa524b8c251e45e1516b943d070bd0afd42b6fa174106085e1d92a703ee565a281502723390c22921bfdfae2b6121e5dc3699747e79692767cf6cad7a
15+
PATCHES
16+
cmake-config.patch
17+
command-line-length.patch
18+
script-prefix.patch
19+
windows/install-layout.patch
20+
windows/install-pdbs.patch
21+
unix/android-cc.patch
22+
unix/move-openssldir.patch
23+
unix/no-empty-dirs.patch
24+
unix/no-static-libs-for-shared.patch
25+
)
26+
27+
vcpkg_list(SET CONFIGURE_OPTIONS
28+
enable-static-engine
29+
enable-capieng
30+
no-tests
31+
no-docs
32+
)
33+
34+
# https://github.com/openssl/openssl/blob/master/INSTALL.md#enable-ec_nistp_64_gcc_128
35+
vcpkg_cmake_get_vars(cmake_vars_file)
36+
include("${cmake_vars_file}")
37+
if(VCPKG_DETECTED_CMAKE_C_COMPILER_ID MATCHES "^(GNU|Clang|AppleClang)$"
38+
AND VCPKG_TARGET_ARCHITECTURE MATCHES "^(x64|arm64|riscv64|ppc64le)$")
39+
vcpkg_list(APPEND CONFIGURE_OPTIONS enable-ec_nistp_64_gcc_128)
40+
endif()
41+
42+
set(INSTALL_FIPS "")
43+
if("fips" IN_LIST FEATURES)
44+
vcpkg_list(APPEND INSTALL_FIPS install_fips)
45+
vcpkg_list(APPEND CONFIGURE_OPTIONS enable-fips)
46+
endif()
47+
48+
if(VCPKG_LIBRARY_LINKAGE STREQUAL "dynamic")
49+
vcpkg_list(APPEND CONFIGURE_OPTIONS shared)
50+
else()
51+
vcpkg_list(APPEND CONFIGURE_OPTIONS no-shared no-module)
52+
endif()
53+
54+
if(NOT "tools" IN_LIST FEATURES)
55+
vcpkg_list(APPEND CONFIGURE_OPTIONS no-apps)
56+
endif()
57+
58+
if("weak-ssl-ciphers" IN_LIST FEATURES)
59+
vcpkg_list(APPEND CONFIGURE_OPTIONS enable-weak-ssl-ciphers)
60+
endif()
61+
62+
if("ssl3" IN_LIST FEATURES)
63+
vcpkg_list(APPEND CONFIGURE_OPTIONS enable-ssl3)
64+
vcpkg_list(APPEND CONFIGURE_OPTIONS enable-ssl3-method)
65+
endif()
66+
67+
if(DEFINED OPENSSL_USE_NOPINSHARED)
68+
vcpkg_list(APPEND CONFIGURE_OPTIONS no-pinshared)
69+
endif()
70+
71+
if(OPENSSL_NO_AUTOLOAD_CONFIG)
72+
vcpkg_list(APPEND CONFIGURE_OPTIONS no-autoload-config)
73+
endif()
74+
75+
if(VCPKG_TARGET_IS_WINDOWS AND NOT VCPKG_TARGET_IS_MINGW)
76+
include("${CMAKE_CURRENT_LIST_DIR}/windows/portfile.cmake")
77+
include("${CMAKE_CURRENT_LIST_DIR}/install-pc-files.cmake")
78+
else()
79+
include("${CMAKE_CURRENT_LIST_DIR}/unix/portfile.cmake")
80+
endif()
81+
82+
file(INSTALL "${CMAKE_CURRENT_LIST_DIR}/usage" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}")
83+
84+
if (NOT "${VERSION}" MATCHES [[^([0-9]+)\.([0-9]+)\.([0-9]+)$]])
85+
message(FATAL_ERROR "Version regex did not match.")
86+
endif()
87+
set(OPENSSL_VERSION_MAJOR "${CMAKE_MATCH_1}")
88+
set(OPENSSL_VERSION_MINOR "${CMAKE_MATCH_2}")
89+
set(OPENSSL_VERSION_FIX "${CMAKE_MATCH_3}")
90+
configure_file("${CMAKE_CURRENT_LIST_DIR}/vcpkg-cmake-wrapper.cmake.in" "${CURRENT_PACKAGES_DIR}/share/${PORT}/vcpkg-cmake-wrapper.cmake" @ONLY)
91+
92+
vcpkg_install_copyright(FILE_LIST "${SOURCE_PATH}/LICENSE.txt")
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
diff --git a/tools/c_rehash.in b/tools/c_rehash.in
2+
index 343cdc1..e48038e 100644
3+
--- a/tools/c_rehash.in
4+
+++ b/tools/c_rehash.in
5+
@@ -12,7 +12,7 @@
6+
# and add symbolic links to their hash values.
7+
8+
my $dir = {- quotify1($config{openssldir}) -};
9+
-my $prefix = {- quotify1($config{prefix}) -};
10+
+use FindBin;
11+
12+
my $errorcount = 0;
13+
my $openssl = $ENV{OPENSSL} || "openssl";
14+
@@ -61,7 +61,7 @@ if (defined(&Cwd::getcwd)) {
15+
16+
# DOS/Win32 or Unix delimiter? Prefix our installdir, then search.
17+
my $path_delim = ($pwd =~ /^[a-z]\:/i) ? ';' : ':';
18+
-$ENV{PATH} = "$prefix/bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
19+
+$ENV{PATH} = "$FindBin::Bin" . ($ENV{PATH} ? $path_delim . $ENV{PATH} : "");
20+
21+
if (!(-f $openssl && -x $openssl)) {
22+
my $found = 0;
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
diff --git a/Configurations/15-android.conf b/Configurations/15-android.conf
2+
index 41ad922..d15e34c 100644
3+
--- a/Configurations/15-android.conf
4+
+++ b/Configurations/15-android.conf
5+
@@ -102,6 +102,7 @@
6+
my $cflags;
7+
my $cppflags;
8+
9+
+if (0) {
10+
# see if there is NDK clang on $PATH, "universal" or "standalone"
11+
if (which("clang") =~ m|^$ndk/.*/prebuilt/([^/]+)/|) {
12+
my $host=$1;
13+
@@ -158,6 +159,7 @@
14+
$sysroot =~ s|^$ndk/||;
15+
$sysroot = " --sysroot=\$($ndk_var)/$sysroot";
16+
}
17+
+}
18+
$android_ndk = {
19+
cflags => $cflags . $sysroot,
20+
cppflags => $cppflags,

overlays/openssl/unix/configure

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
#!/usr/bin/env bash
2+
3+
set -e
4+
5+
declare -a OUT_OPTIONS
6+
7+
INTERPRETER=perl
8+
9+
LAST_SEEN=
10+
COPY_OPTIONS=no
11+
for OPTION; do
12+
case "${OPTION},${COPY_OPTIONS}" in
13+
*/Configure,no)
14+
OUT_OPTIONS+=("${OPTION}")
15+
INTERPRETER="${LAST_SEEN}"
16+
COPY_OPTIONS=yes
17+
;;
18+
--prefix=*|--openssldir=*|--libdir=*|--cross-compile-prefix=*|--debug,*)
19+
OUT_OPTIONS+=("${OPTION}")
20+
;;
21+
-*|*=*)
22+
;;
23+
*,yes)
24+
OUT_OPTIONS+=("${OPTION}")
25+
;;
26+
esac
27+
LAST_SEEN="${OPTION}"
28+
done
29+
30+
set -x
31+
"${INTERPRETER}" ${OUT_OPTIONS[@]}

0 commit comments

Comments
 (0)