Ver Fonte

Upgrade OpenSSL to 1.1.1m for Windows, Mac, Android and iOS (#102)

* Update the OpenSSL library for Android, iOS and Mac

Signed-off-by: Junbo Liang <[email protected]>
Junbo Liang há 3 anos atrás
pai
commit
2eb975f2ef

+ 51 - 15
package-system/OpenSSL/FindOpenSSL.cmake.template

@@ -6,29 +6,65 @@
 #
 #
 
-set(TARGET_WITH_NAMESPACE "3rdParty::OpenSSL")
-if (TARGET $${TARGET_WITH_NAMESPACE})
+set(OPENSSL_O3DE_NAMESPACE "3rdParty::OpenSSL")
+if (TARGET $${OPENSSL_O3DE_NAMESPACE})
     return()
 endif()
 
+set(SSL_TARGETNAME "OpenSSL::SSL")
+set(CRYPTO_TARGETNAME "OpenSSL::Crypto")
+
+# we're trying to be a drop-in replacement for the FindOpenSSL.cmake that is shipped
+# with CMake itself, so we set the same variables with the same uppercase for compatibility
+# for questions about these variables, see https://cmake.org/cmake/help/latest/module/FindOpenSSL.html
+set(OPENSSL_FOUND True)
 set(OPENSSL_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/OpenSSL/include)
-set(OPENSSL_LIBS_DIR $${CMAKE_CURRENT_LIST_DIR}/OpenSSL/$$<$$<CONFIG:debug>:debug/>lib)
+# c-only packages can be released containing only Release executables
+set(OPENSSL_LIBS_DIR $${CMAKE_CURRENT_LIST_DIR}/OpenSSL/lib)
+set(OPENSSL_CRYPTO_LIBRARY $${OPENSSL_LIBS_DIR}/libcrypto$${CMAKE_STATIC_LIBRARY_SUFFIX})
+set(OPENSSL_CRYPTO_LIBRARIES
+    $${OPENSSL_CRYPTO_LIBRARY}
+    ${CRYPTO_LIBRARY_DEPENDENCIES})
+set(OPENSSL_SSL_LIBRARY $${OPENSSL_LIBS_DIR}/libssl$${CMAKE_STATIC_LIBRARY_SUFFIX})
+set(OPENSSL_SSL_LIBRARIES 
+    $${OPENSSL_SSL_LIBRARY}
+    $${OPENSSL_CRYPTO_LIBRARIES})
+set(OPENSSL_LIBRARIES $${OPENSSL_SSL_LIBRARIES})
+set(OPENSSL_VERSION "1.1.1m")
 
-set(OPENSSL_COMPILE_DEFINITIONS
-    OPENSSL_ENABLED
-${CUSTOM_ADDITIONAL_COMPILE_DEFINITIONS})
+add_library($${CRYPTO_TARGETNAME} STATIC IMPORTED GLOBAL)
+set_target_properties($${CRYPTO_TARGETNAME} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+set_target_properties($${CRYPTO_TARGETNAME} PROPERTIES IMPORTED_LOCATION "$${OPENSSL_CRYPTO_LIBRARY}")
 
-set(OPENSSL_LIBRARY
-    "$${OPENSSL_LIBS_DIR}/libssl$${CMAKE_STATIC_LIBRARY_SUFFIX}"
-    "$${OPENSSL_LIBS_DIR}/libcrypto$${CMAKE_STATIC_LIBRARY_SUFFIX}"
-${CUSTOM_ADDITIONAL_LIBRARIES})
+# anyone who links to the CRYPTO target also links to its dependencies:
+target_link_libraries($${CRYPTO_TARGETNAME} INTERFACE ${CRYPTO_LIBRARY_DEPENDENCIES})
 
-add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
+add_library($${SSL_TARGETNAME} STATIC IMPORTED GLOBAL)
+set_target_properties($${SSL_TARGETNAME} PROPERTIES IMPORTED_LINK_INTERFACE_LANGUAGES "C")
+set_target_properties($${SSL_TARGETNAME} PROPERTIES IMPORTED_LOCATION "$${OPENSSL_SSL_LIBRARY}")
 
-ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_INCLUDE_DIR})
+# anyone who links to the SSL target also links to CRYPTO since SSL depends on CRYPTO:
+target_link_libraries($${SSL_TARGETNAME} INTERFACE $${CRYPTO_TARGETNAME})
 
-target_link_libraries($${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_LIBRARY})
+# cmake < 3.21 and visual studio < 16.10 don't properly implement SYSTEM includes
+# so we use O3DEs patched implementation if it is available and fallback to default if not.
+# this is futureproof so that when O3DE no longer needs to define this and CMake's system 
+# works without fixes, O3DE can erase this implementation and this script will still function.
+if (COMMAND ly_target_include_system_directories)
+    ly_target_include_system_directories(TARGET $${SSL_TARGETNAME} INTERFACE $${OPENSSL_INCLUDE_DIR})
+    ly_target_include_system_directories(TARGET $${CRYPTO_TARGETNAME} INTERFACE $${OPENSSL_INCLUDE_DIR})
+else()
+    target_include_directories($${SSL_TARGETNAME} SYSTEM INTERFACE $${OPENSSL_INCLUDE_DIR})
+    target_include_directories($${CRYPTO_TARGETNAME} SYSTEM INTERFACE $${OPENSSL_INCLUDE_DIR})
+endif()
 
-target_compile_definitions($${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_COMPILE_DEFINITIONS})
+# alias the O3DE name to the official name:
+add_library($${OPENSSL_O3DE_NAMESPACE} ALIAS $${SSL_TARGETNAME})
 
-set(OPENSSL_FOUND TRUE)
+# if we're not in O3DE, it's also extremely helpful to show a message to logs that indicate that this
+# library was successfully picked up, as opposed to the system one.
+# A good way to know if you're in O3DE or not is that O3DE sets various cache variables before 
+# calling find_package, specifically, LY_VERSION_ENGINE_NAME is always set very early:
+if (NOT LY_VERSION_ENGINE_NAME)
+    message(STATUS "Using O3DE's OpenSSL ($${OPENSSL_VERSION}) from $${CMAKE_CURRENT_LIST_DIR}")
+endif()

+ 0 - 48
package-system/OpenSSL/FindOpenSSL_linux.cmake.template

@@ -1,48 +0,0 @@
-#
-# Copyright (c) Contributors to the Open 3D Engine Project.
-# For complete copyright and license terms please see the LICENSE at the root of this distribution.
-# 
-# SPDX-License-Identifier: Apache-2.0 OR MIT
-#
-#
-
-set(TARGET_WITH_NAMESPACE "3rdParty::OpenSSL")
-if (TARGET $${TARGET_WITH_NAMESPACE})
-    return()
-endif()
-
-set(OPENSSL_INCLUDE_DIR $${CMAKE_CURRENT_LIST_DIR}/OpenSSL/include)
-set(OPENSSL_LIBS_DIR $${CMAKE_CURRENT_LIST_DIR}/OpenSSL/$$<$$<CONFIG:debug>:debug/>lib)
-
-set(OPENSSL_COMPILE_DEFINITIONS
-    OPENSSL_ENABLED
-${CUSTOM_ADDITIONAL_COMPILE_DEFINITIONS})
-
-set(OPENSSL_LIBRARIES
-    "$${OPENSSL_LIBS_DIR}/libssl$${CMAKE_SHARED_LIBRARY_SUFFIX}"
-    "$${OPENSSL_LIBS_DIR}/libcrypto$${CMAKE_SHARED_LIBRARY_SUFFIX}"
-${CUSTOM_ADDITIONAL_LIBRARIES})
-
-find_package(Threads REQUIRED)
-list(APPEND OPENSSL_LIBRARIES $${CMAKE_THREAD_LIBS_INIT})
-
-add_library($${TARGET_WITH_NAMESPACE} INTERFACE IMPORTED GLOBAL)
-
-ly_target_include_system_directories(TARGET $${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_INCLUDE_DIR})
-
-target_link_libraries($${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_LIBRARIES} Threads::Threads)
-
-target_compile_definitions($${TARGET_WITH_NAMESPACE} INTERFACE $${OPENSSL_COMPILE_DEFINITIONS})
-
-set(OPENSSL_FOUND TRUE)
-
-set(OPENSSL_RUNTIME_DEPENDENCIES
-    "$${OPENSSL_LIBS_DIR}/libssl$${CMAKE_SHARED_LIBRARY_SUFFIX}"
-    "$${OPENSSL_LIBS_DIR}/libcrypto$${CMAKE_SHARED_LIBRARY_SUFFIX}"
-    "$${OPENSSL_LIBS_DIR}/libssl$${CMAKE_SHARED_LIBRARY_SUFFIX}.1.1"
-    "$${OPENSSL_LIBS_DIR}/libcrypto$${CMAKE_SHARED_LIBRARY_SUFFIX}.1.1"
-)
-ly_add_target_files(
-    TARGETS "$${TARGET_WITH_NAMESPACE}"
-    FILES "$${OPENSSL_RUNTIME_DEPENDENCIES}"
-)

+ 8 - 13
package-system/OpenSSL/build_package_image.py

@@ -22,7 +22,7 @@ def main():
     parser.add_argument(
         '--platform-name',
         dest='platformName',
-        choices=['windows', 'android', 'mac', 'ios', 'linux'],
+        choices=['windows', 'android', 'mac', 'ios'],
         default=VcpkgBuilder.defaultPackagePlatformName(),
     )
     args = parser.parse_args()
@@ -30,17 +30,14 @@ def main():
     packageSystemDir = Path(__file__).resolve().parents[1]
     opensslPackageSourceDir = packageSystemDir / 'OpenSSL'
     outputDir = packageSystemDir / f'OpenSSL-{args.platformName}'
-    opensslPatch = opensslPackageSourceDir / 'set_openssl_port_to_1_1_1_b.patch'
+    opensslPatch = opensslPackageSourceDir / 'set_openssl_port_to_1_1_1_m.patch'
 
     enableStdioOnIOS = opensslPackageSourceDir / 'enable-stdio-on-iOS.patch'
 
-    cmakeFindFile = opensslPackageSourceDir / f'FindOpenSSL_{args.platformName}.cmake.template'
-    if not cmakeFindFile.exists():
-        cmakeFindFile = opensslPackageSourceDir / 'FindOpenSSL.cmake.template'
+    cmakeFindFile = opensslPackageSourceDir / 'FindOpenSSL.cmake.template'
     cmakeFindFileTemplate = cmakeFindFile.open().read()
 
     useStaticLibsForPlatform = {
-        'linux': False,
         'android': True,
         'mac': True,
         'ios': True,
@@ -50,7 +47,7 @@ def main():
     with TemporaryDirectory() as tempdir:
         tempdir = Path(tempdir)
         builder = VcpkgBuilder(packageName='OpenSSL', portName='openssl', vcpkgDir=tempdir, targetPlatform=args.platformName, static=useStaticLibsForPlatform[args.platformName])
-        builder.cloneVcpkg('f44fb85b341b8f58815b95c84d8488126b251570')
+        builder.cloneVcpkg('b86c0c35b88e2bf3557ff49dc831689c2f085090')
         builder.bootstrap()
         builder.patch(opensslPatch)
         builder.patch(enableStdioOnIOS)
@@ -64,23 +61,21 @@ def main():
         builder.writePackageInfoFile(
             outputDir,
             settings={
-                'PackageName': f'OpenSSL-1.1.1b-rev2-{args.platformName}',
+                'PackageName': f'OpenSSL-1.1.1m-rev1-{args.platformName}',
                 'URL': 'https://github.com/openssl/openssl',
                 'License': 'OpenSSL',
                 'LicenseFile': 'OpenSSL/LICENSE'
             },
         )
 
-        extraLibs = []
-        compileDefs = []
+        crypto_library_dependencies = ''
         if args.platformName == 'windows':
-            extraLibs.append('crypt32.lib')
+            crypto_library_dependencies = 'crypt32.lib ws2_32.lib'
         builder.writeCMakeFindFile(
             outputDir,
             template=cmakeFindFileTemplate,
             templateEnv={
-                'CUSTOM_ADDITIONAL_LIBRARIES':extraLibs,
-                'CUSTOM_ADDITIONAL_COMPILE_DEFINITIONS':compileDefs,
+                'CRYPTO_LIBRARY_DEPENDENCIES':crypto_library_dependencies
             },
         )
 

+ 4 - 4
package-system/OpenSSL/enable-stdio-on-iOS.patch

@@ -1,5 +1,5 @@
-From 994b564a93e21d37b2d470dbc3773855184804e6 Mon Sep 17 00:00:00 2001
-Date: Tue, 20 Apr 2021 18:15:26 -0700
+From 3176985bc5136e5b7658ab22d85e406c5da4bd82 Mon Sep 17 00:00:00 2001
+Date: Fri, 11 Mar 2022 13:25:09 -0800
 Subject: [PATCH] Enable stdio on iOS
 
 ---
@@ -7,7 +7,7 @@ Subject: [PATCH] Enable stdio on iOS
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 diff --git a/ports/openssl/unix/CMakeLists.txt b/ports/openssl/unix/CMakeLists.txt
-index 14633c9..2c73753 100644
+index 7bf45e27b..8cdb65fc3 100644
 --- a/ports/openssl/unix/CMakeLists.txt
 +++ b/ports/openssl/unix/CMakeLists.txt
 @@ -23,7 +23,7 @@ elseif(CMAKE_SYSTEM_NAME STREQUAL "iOS")
@@ -20,5 +20,5 @@ index 14633c9..2c73753 100644
      if(VCPKG_TARGET_ARCHITECTURE MATCHES "arm64")
          set(PLATFORM darwin64-arm64-cc)
 -- 
-2.30.1
+2.34.0.windows.1
 

+ 0 - 70
package-system/OpenSSL/set_openssl_port_to_1_1_1_b.patch

@@ -1,70 +0,0 @@
-From 66c310b442ac237b4b7e8b733eea83e94621809f Mon Sep 17 00:00:00 2001
-Date: Thu, 15 Apr 2021 09:02:46 -0700
-Subject: [PATCH] Set OpenSSL version to 1.1.1b
-
----
- ports/openssl-unix/CONTROL    | 4 ++--
- ports/openssl-windows/CONTROL | 4 ++--
- ports/openssl/CONTROL         | 2 +-
- ports/openssl/portfile.cmake  | 4 ++--
- 4 files changed, 7 insertions(+), 7 deletions(-)
-
-diff --git a/ports/openssl-unix/CONTROL b/ports/openssl-unix/CONTROL
-index 02553017b..e899c7782 100644
---- a/ports/openssl-unix/CONTROL
-+++ b/ports/openssl-unix/CONTROL
-@@ -1,6 +1,6 @@
- Source: openssl-unix
--Version: 1.1.1h
-+Version: 1.1.1b
- Port-Version: 1
- Description: Deprecated OpenSSL port
- Supports: !(windows|uwp)
--Build-Depends: openssl
-\ No newline at end of file
-+Build-Depends: openssl
-diff --git a/ports/openssl-windows/CONTROL b/ports/openssl-windows/CONTROL
-index 0dd8bc462..ee58c9308 100644
---- a/ports/openssl-windows/CONTROL
-+++ b/ports/openssl-windows/CONTROL
-@@ -1,6 +1,6 @@
- Source: openssl-windows
--Version: 1.1.1h
-+Version: 1.1.1b
- Port-Version: 1
- Description: Deprecated OpenSSL port
- Supports: windows
--Build-Depends: openssl
-\ No newline at end of file
-+Build-Depends: openssl
-diff --git a/ports/openssl/CONTROL b/ports/openssl/CONTROL
-index df1c9ced4..c8c7ec9f2 100644
---- a/ports/openssl/CONTROL
-+++ b/ports/openssl/CONTROL
-@@ -1,4 +1,4 @@
- Source: openssl
--Version: 1.1.1j
-+Version: 1.1.1b
- Homepage: https://www.openssl.org
- Description: OpenSSL is an open source project that provides a robust, commercial-grade, and full-featured toolkit for the Transport Layer Security (TLS) and Secure Sockets Layer (SSL) protocols. It is also a general-purpose cryptography library.
-diff --git a/ports/openssl/portfile.cmake b/ports/openssl/portfile.cmake
-index cd7884f17..2ca37f60a 100644
---- a/ports/openssl/portfile.cmake
-+++ b/ports/openssl/portfile.cmake
-@@ -2,11 +2,11 @@ if(EXISTS "${CURRENT_INSTALLED_DIR}/include/openssl/ssl.h")
-   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.")
- endif()
- 
--set(OPENSSL_VERSION 1.1.1j)
-+set(OPENSSL_VERSION 1.1.1b)
- vcpkg_download_distfile(ARCHIVE
-     URLS "https://www.openssl.org/source/openssl-${OPENSSL_VERSION}.tar.gz" "https://www.openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz"
-     FILENAME "openssl-${OPENSSL_VERSION}.tar.gz"
--    SHA512 51e44995663b5258b0018bdc1e2b0e7e8e0cce111138ca1f80514456af920fce4e409a411ce117c0f3eb9190ac3e47c53a43f39b06acd35b7494e2bec4a607d5
-+    SHA512 b54025fbb4fe264466f3b0d762aad4be45bd23cd48bdb26d901d4c41a40bfd776177e02230995ab181a695435039dbad313f4b9a563239a70807a2e19ecf045d
- )
- 
- vcpkg_find_acquire_program(PERL)
--- 
-2.31.0.windows.1
-

+ 36 - 0
package-system/OpenSSL/set_openssl_port_to_1_1_1_m.patch

@@ -0,0 +1,36 @@
+From 4fdbcfd46b65c2199e77b88f2478cf21ca19ee3c Mon Sep 17 00:00:00 2001
+Date: Fri, 11 Mar 2022 13:18:47 -0800
+Subject: [PATCH] Set OpenSSL version to 1.1.1m
+
+---
+ ports/openssl-unix/vcpkg.json    | 2 +-
+ ports/openssl-windows/vcpkg.json | 2 +-
+ 2 files changed, 2 insertions(+), 2 deletions(-)
+
+diff --git a/ports/openssl-unix/vcpkg.json b/ports/openssl-unix/vcpkg.json
+index 16ac635a7..e0694795f 100644
+--- a/ports/openssl-unix/vcpkg.json
++++ b/ports/openssl-unix/vcpkg.json
+@@ -1,6 +1,6 @@
+ {
+   "name": "openssl-unix",
+-  "version-string": "1.1.1h",
++  "version-string": "1.1.1m",
+   "port-version": 2,
+   "description": "Deprecated OpenSSL port",
+   "supports": "!(windows | uwp)",
+diff --git a/ports/openssl-windows/vcpkg.json b/ports/openssl-windows/vcpkg.json
+index 069235b15..be53ad5c2 100644
+--- a/ports/openssl-windows/vcpkg.json
++++ b/ports/openssl-windows/vcpkg.json
+@@ -1,6 +1,6 @@
+ {
+   "name": "openssl-windows",
+-  "version-string": "1.1.1h",
++  "version-string": "1.1.1m",
+   "port-version": 2,
+   "description": "Deprecated OpenSSL port",
+   "supports": "windows",
+-- 
+2.34.0.windows.1
+

+ 19 - 0
package-system/OpenSSL/test/CMakeLists.txt

@@ -0,0 +1,19 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+# 
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+cmake_minimum_required(VERSION 3.20)
+
+PROJECT(test_OpenSSL VERSION 1.0 LANGUAGES C)
+
+find_package(OpenSSL)
+
+add_executable(test_OpenSSL test_OpenSSL.c)
+
+# note that we use 3rdParty::OpenSSL here.  This will ONLY work 
+# if the O3DE version of OpenSSL is used, which is what we are testing for.
+target_link_libraries(test_OpenSSL PRIVATE 3rdParty::OpenSSL)

+ 35 - 0
package-system/OpenSSL/test/test_OpenSSL.c

@@ -0,0 +1,35 @@
+/*
+ Copyright (c) Contributors to the Open 3D Engine Project.
+ For complete copyright and license terms please see the LICENSE at the root of this distribution.
+
+ SPDX-License-Identifier: Apache-2.0 OR MIT
+*/
+
+#include <stdio.h>
+#include <string.h>
+
+// this is just a super basic include and compile and link test
+// it doesn't exercise the library much, but if this compiles and links
+// its likely that further testing needs to be done in a real full project
+// rather than artificially
+
+// test whether a header is found
+#include <openssl/ssl.h>
+
+int main()
+{
+    if (OPENSSL_init_ssl(0, NULL) == 0)
+    {
+        printf("FAILURE! OPENSSL failed call to OPENSSL_init_ssl!\n");
+        return 1;
+    }
+
+    if (strcmp(OPENSSL_VERSION_TEXT, "OpenSSL 1.1.1m  14 Dec 2021") != 0)
+    {
+        printf("FAILURE! OpenSSL OPENSSL_VERSION_TEXT returned invalid text (%s)!\n", OPENSSL_VERSION_TEXT);
+        return 1;
+    }
+
+    printf("Success: All is ok!\n");
+    return 0;
+}

+ 27 - 0
package-system/OpenSSL/test_OpenSSL_android.cmd

@@ -0,0 +1,27 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+
+rmdir /S /Q  temp\build_test
+mkdir temp\build_test
+
+@rem CMAKE demands forward slashes but PACKAGE_ROOT is in native path:
+set "PACKAGE_ROOT=%PACKAGE_ROOT:\=/%"
+set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%"
+
+cmake -S test -B temp/build_test ^
+    -G Ninja ^
+    -DCMAKE_BUILD_TYPE=Release ^
+    -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Android/Toolchain_android.cmake ^
+    -DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" || exit /b 1
+
+cmake --build temp/build_test --parallel || exit /b 1
+
+@rem we can't actually run this - its an android binary.  But at least the above
+@rem makes sure it links and that our OpenSSL script is working.
+
+exit /b 0

+ 23 - 0
package-system/OpenSSL/test_OpenSSL_ios.sh

@@ -0,0 +1,23 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+rm -rf temp/build_test
+mkdir temp/build_test
+
+cmake -S test -B temp/build_test -G Xcode \
+    -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/iOS/Toolchain_ios.cmake \
+    -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_REQUIRED=false \
+    -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED=false \
+    -DCMAKE_MODULE_PATH="$DOWNLOADED_PACKAGE_FOLDERS;$PACKAGE_ROOT" || exit 1
+
+cmake --build temp/build_test --parallel --config Release || exit 1
+
+# we can't actually run it on ios, that'd require an emulator or device as well as
+# cert / signing - but we can at least make sure it compiles and links!
+
+exit 0

+ 18 - 0
package-system/OpenSSL/test_OpenSSL_mac.sh

@@ -0,0 +1,18 @@
+#
+# Copyright (c) Contributors to the Open 3D Engine Project.
+# For complete copyright and license terms please see the LICENSE at the root of this distribution.
+#
+# SPDX-License-Identifier: Apache-2.0 OR MIT
+#
+#
+
+rm -rf temp/build_test
+mkdir temp/build_test
+
+cmake -S test -B temp/build_test -G Xcode -DCMAKE_TOOLCHAIN_FILE=../../../../Scripts/cmake/Platform/Mac/Toolchain_mac.cmake -DCMAKE_MODULE_PATH="$DOWNLOADED_PACKAGE_FOLDERS;$PACKAGE_ROOT" || exit 1
+
+cmake --build temp/build_test --parallel --config Release || exit 1
+
+temp/build_test/Release/test_OpenSSL || exit 1
+
+exit 0

+ 25 - 0
package-system/OpenSSL/test_OpenSSL_windows.cmd

@@ -0,0 +1,25 @@
+@rem #
+@rem # Copyright (c) Contributors to the Open 3D Engine Project.
+@rem # For complete copyright and license terms please see the LICENSE at the root of this distribution.
+@rem # 
+@rem # SPDX-License-Identifier: Apache-2.0 OR MIT
+@rem #
+@rem #
+
+rmdir /S /Q  temp\build_test
+mkdir temp\build_test
+
+@rem CMAKE demands forward slashes but PACKAGE_ROOT is in native path:
+set "PACKAGE_ROOT=%PACKAGE_ROOT:\=/%"
+set "DOWNLOADED_PACKAGE_FOLDERS=%DOWNLOADED_PACKAGE_FOLDERS:\=/%"
+
+cmake -S test -B temp/build_test ^
+    -DCMAKE_MODULE_PATH="%DOWNLOADED_PACKAGE_FOLDERS%;%PACKAGE_ROOT%" || exit /b 1
+
+cmake --build temp/build_test --parallel --config Release || exit /b 1
+temp\build_test\Release\test_OpenSSL.exe || exit /b 1
+
+cmake --build temp/build_test --parallel --config Debug || exit /b 1
+temp\build_test\Debug\test_OpenSSL.exe || exit /b 1
+
+exit /b 0

+ 4 - 4
package_build_list_host_darwin.json

@@ -22,8 +22,8 @@
         "libsamplerate-0.2.1-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Mac --package-root ../../package-system --clean",
         "libsamplerate-0.2.1-rev2-ios": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name iOS --package-root ../../package-system --clean",
         "OpenMesh-8.1-rev3-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Mac --package-root ../../package-system --clean",
-        "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL/build_package_image.py",
-        "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL/build_package_image.py --platform ios",
+        "OpenSSL-1.1.1m-rev1-mac": "package-system/OpenSSL/build_package_image.py",
+        "OpenSSL-1.1.1m-rev1-ios": "package-system/OpenSSL/build_package_image.py --platform ios",
         "OpenEXR-3.1.3-rev2-mac": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Mac --package-root ../../package-system --clean",
         "PhysX-4.1.2.29882248-rev5-mac": "package-system/PhysX/build_package_image.py --platform mac",
         "PhysX-4.1.2.29882248-rev5-ios": "package-system/PhysX/build_package_image.py --platform ios",
@@ -70,8 +70,8 @@
         "libsamplerate-0.2.1-rev2-mac": "package-system/libsamplerate-mac",
         "libsamplerate-0.2.1-rev2-ios": "package-system/libsamplerate-ios",
         "OpenMesh-8.1-rev3-mac": "package-system/OpenMesh-mac",
-        "OpenSSL-1.1.1b-rev2-mac": "package-system/OpenSSL-mac",
-        "OpenSSL-1.1.1b-rev2-ios": "package-system/OpenSSL-ios",
+        "OpenSSL-1.1.1m-rev1-mac": "package-system/OpenSSL-mac",
+        "OpenSSL-1.1.1m-rev1-ios": "package-system/OpenSSL-ios",
         "OpenEXR-3.1.3-rev2-mac": "package-system/OpenEXR-mac",
         "tiff-4.2.0.15-rev3-mac": "package-system/tiff-mac",
         "tiff-4.2.0.15-rev3-ios": "package-system/tiff-ios",

+ 0 - 2
package_build_list_host_linux.json

@@ -17,7 +17,6 @@
         "libsamplerate-0.2.1-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libsamplerate --platform-name Linux --package-root ../../package-system --clean",
         "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp/get_and_build_mcpp.py mcpp-2.7.2_az.1-rev1",
         "OpenMesh-8.1-rev3-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Linux --package-root ../../package-system --clean",
-        "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL/build_package_image.py",
         "pyside2-5.15.2-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/pyside2-qt --platform-name Linux --package-root ../../package-system --clean",
         "OpenEXR-3.1.3-rev2-linux": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Linux --package-root ../../package-system --clean",
         "PhysX-4.1.2.29882248-rev5-linux": "package-system/PhysX/build_package_image.py --platform-name linux",
@@ -52,7 +51,6 @@
         "libsamplerate-0.2.1-rev2-linux": "package-system/libsamplerate-linux",
         "mcpp-2.7.2_az.1-rev1-linux": "package-system/mcpp-linux",
         "OpenMesh-8.1-rev3-linux": "package-system/OpenMesh-linux",
-        "OpenSSL-1.1.1b-rev2-linux": "package-system/OpenSSL-linux",
         "pyside2-5.15.2-rev2-linux": "package-system/pyside2-linux",
         "OpenEXR-3.1.3-rev2-linux": "package-system/OpenEXR-linux",
         "SPIRVCross-2021.04.29-rev1-linux": "package-system/SPIRVCross-linux",

+ 4 - 4
package_build_list_host_windows.json

@@ -36,8 +36,8 @@
         "NvCloth-v1.1.6-4-gd243404-pr58-rev1-android": "package-system/NvCloth/build_package_image.py --platform-name android",
         "OpenEXR-3.1.3-rev2-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenEXR --platform-name Windows --package-root ../../package-system --clean",
         "OpenMesh-8.1-rev3-windows": "Scripts/extras/pull_and_build_from_git.py ../../package-system/OpenMesh --platform-name Windows --package-root ../../package-system --clean",
-        "OpenSSL-1.1.1b-rev1-android": "package-system/OpenSSL/build_package_image.py --platform-name android",
-        "OpenSSL-1.1.1b-rev2-windows": "package-system/OpenSSL/build_package_image.py",
+        "OpenSSL-1.1.1m-rev1-android": "package-system/OpenSSL/build_package_image.py --platform-name android",
+        "OpenSSL-1.1.1m-rev1-windows": "package-system/OpenSSL/build_package_image.py",
         "PhysX-4.1.2.29882248-rev5-android": "package-system/PhysX/build_package_image.py --platform android",
         "PhysX-4.1.2.29882248-rev5-windows": "package-system/PhysX/build_package_image.py --platform windows",
         "png-1.6.37-rev2-android": "Scripts/extras/pull_and_build_from_git.py ../../package-system/libpng --platform-name Android --package-root ../../package-system/libpng/temp --clean",
@@ -99,8 +99,8 @@
     "OpenEXR-3.1.3-rev2-windows": "package-system/OpenEXR-windows",
     "openimageio-2.1.16.0-rev2-windows": "package-system/openimageio-windows",
     "OpenMesh-8.1-rev3-windows": "package-system/OpenMesh-windows",
-    "OpenSSL-1.1.1b-rev1-android": "package-system/OpenSSL-android",
-    "OpenSSL-1.1.1b-rev2-windows": "package-system/OpenSSL-windows",
+    "OpenSSL-1.1.1m-rev1-android": "package-system/OpenSSL-android",
+    "OpenSSL-1.1.1m-rev1-windows": "package-system/OpenSSL-windows",
     "PhysX-4.1.2.29882248-rev5-android": "package-system/PhysX-android",
     "PhysX-4.1.2.29882248-rev5-windows": "package-system/PhysX-windows",
     "png-1.6.37-rev2-android": "package-system/libpng/temp/png-android",