Skip to content

Commit

Permalink
Close #590: MacOS OpenSSL legacy provider not loaded
Browse files Browse the repository at this point in the history
Compile-in the legacy module for windows and macos.
I compile the libraries anyway for the releases of those platforms.
  • Loading branch information
chris2511 committed Sep 30, 2024
1 parent 2f7403d commit 7b9d75b
Show file tree
Hide file tree
Showing 4 changed files with 3 additions and 20 deletions.
11 changes: 0 additions & 11 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -215,13 +215,6 @@ if(APPLE)
-always-overwrite ${APPSTORE}
COMMENT "Running macdeployqt..."
)
if (OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND cmake -E copy ${OPENSSL_ROOT_DIR}/lib/ossl-modules/legacy.dylib
$<TARGET_FILE_DIR:${PROJECT_NAME}>/../PlugIns/
COMMENT "Install OpenSSL legacy provider"
)
endif()
if (PROVISIONPROFILE)
add_custom_command(TARGET ${PROJECT_NAME} POST_BUILD
COMMAND cmake -E copy ${PROVISIONPROFILE}
Expand Down Expand Up @@ -292,10 +285,6 @@ elseif(WIN32)
${OPENSSL_ROOT_DIR}/bin/libcrypto-${OPENSSL_LIBRARY_MAJOR}-x64.dll
DESTINATION ${RUNTIME_DEST}
)
if (OPENSSL_VERSION VERSION_GREATER_EQUAL 3.0.0)
install(FILES ${OPENSSL_ROOT_DIR}/lib/ossl-modules/legacy.dll
DESTINATION ${RUNTIME_DEST})
endif()
install(CODE "execute_process(COMMAND cmake -E chdir \${CMAKE_INSTALL_PREFIX} tar cvf ${RUNTIME_DEST}.zip --format=zip -- ${RUNTIME_DEST})")
set(CMAKE_INSTALL_PREFIX ${CMAKE_BINARY_DIR})

Expand Down
3 changes: 0 additions & 3 deletions misc/dynamic.wxs.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@
<DirectoryRef Id="INSTALLDIR">
<Component Id="Clibcrypto11x64" Guid="44133d17-96b5-4aee-8a24-9c722482add5">
<File Id="libcrypto11x64.dll" Source="@OPENSSL_ROOT_DIR@/bin/libcrypto-@[email protected]" KeyPath="yes"/>
<?if @OPENSSL_LIBRARY_MAJOR@ = 3 ?>
<File Id="libcryptolegacy.dll" Source="@OPENSSL_ROOT_DIR@/lib/ossl-modules/legacy.dll"/>
<?endif?>
</Component>
<Component Id="Cvcruntime140" Guid="f0b03b2a-14f7-4631-bfe3-d4c6c9b57e1d">
<File Id="vcruntime140.dll" Source="@SYSTEM32@/vcruntime140.dll" KeyPath="yes"/>
Expand Down
7 changes: 2 additions & 5 deletions release/build-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -11,21 +11,18 @@ do_openssl()
for arch in x86_64 arm64; do
mkdir -p "${OSSL}-${arch}"
(cd ${OSSL}-${arch}
../$OSSL/Configure darwin64-${arch}-cc shared \
../$OSSL/Configure darwin64-${arch}-cc shared no-module \
--prefix="${INSTALL_DIR}" \
-mmacosx-version-min="$SDK"
make -j $JOBS build_libs && make install_sw
)
PARTS_crypto="$PARTS_crypto ${OSSL}-${arch}/libcrypto.${OSSL_MAJOR}.dylib"
PARTS_ssl="$PARTS_ssl ${OSSL}-${arch}/libssl.${OSSL_MAJOR}.dylib"
PARTS_providers="$PARTS_providers ${OSSL}-${arch}/providers/legacy.dylib"
done
rm -f "$INSTALL"/lib/libcrypto.${OSSL_MAJOR}.dylib \
"$INSTALL"/lib/libssl.${OSSL_MAJOR}.dylib \
"$INSTALL"/lib/ossl-modules/legacy.dylib
"$INSTALL"/lib/libssl.${OSSL_MAJOR}.dylib
lipo -create -output "$INSTALL_DIR"/lib/libcrypto.${OSSL_MAJOR}.dylib $PARTS_crypto
lipo -create -output "$INSTALL_DIR"/lib/libssl.${OSSL_MAJOR}.dylib $PARTS_ssl
lipo -create -output "$INSTALL_DIR"/lib/ossl-modules/legacy.dylib $PARTS_providers
}

# need to install ninja via "brew install ninja"
Expand Down
2 changes: 1 addition & 1 deletion release/build-w64.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ do_openssl() {
test -f "$OSSL".tar.gz || curl -L -O https://www.openssl.org/source/"$OSSL".tar.gz
test -d "$OSSL" || tar zxf "$OSSL".tar.gz
cd "$OSSL"
./Configure mingw64 --prefix=$INSTALL_DIR --libdir=lib
./Configure mingw64 --prefix=$INSTALL_DIR --libdir=lib no-module
make -j4
make install
}
Expand Down

0 comments on commit 7b9d75b

Please sign in to comment.