early-access version 2853

This commit is contained in:
pineappleEA
2022-07-23 03:01:36 +02:00
parent 1f2b5081b5
commit 1f111bb69c
8955 changed files with 418777 additions and 999 deletions

View File

@@ -0,0 +1,28 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 132f414..c7cfb5f 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -503,7 +503,7 @@ else()
endif()
install(EXPORT "${PROJECT_NAME}-targets"
- DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake/${TARGET_DIR}"
+ DESTINATION "${CMAKE_INSTALL_LIBDIR}/${PROJECT_NAME}/cmake/"
NAMESPACE AWS::
COMPONENT Development)
diff --git a/cmake/s2n-config.cmake b/cmake/s2n-config.cmake
index 09d1c3a..4e76ed6 100644
--- a/cmake/s2n-config.cmake
+++ b/cmake/s2n-config.cmake
@@ -8,9 +8,5 @@ endif()
list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
find_dependency(LibCrypto)
-if (BUILD_SHARED_LIBS)
- include(${CMAKE_CURRENT_LIST_DIR}/shared/@PROJECT_NAME@-targets.cmake)
-else()
- include(${CMAKE_CURRENT_LIST_DIR}/static/@PROJECT_NAME@-targets.cmake)
-endif()
+include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)

48
externals/vcpkg/ports/s2n/portfile.cmake vendored Executable file
View File

@@ -0,0 +1,48 @@
vcpkg_from_github(
OUT_SOURCE_PATH SOURCE_PATH
REPO aws/s2n-tls
REF 36c3dc72ab1359cf721294e1258dfdc2962f3ffc # v1.3.5
SHA512 2c9eed12e90e5fc987758635fec4a7418c20d25c724cfa391090b06bfcc4eb5925b4011d51a99e7c7ab80f535684ee3934ba4734b7966edd323bf88bc5953d7c
PATCHES
fix-cmake-target-path.patch
use-openssl-crypto.patch
remove-trycompile.patch
)
vcpkg_check_features(OUT_FEATURE_OPTIONS FEATURE_OPTIONS
FEATURES
tests BUILD_TESTING
)
set(EXTRA_ARGS)
if(VCPKG_TARGET_ARCHITECTURE STREQUAL "wasm32")
set(EXTRA_ARGS "-DS2N_NO_PQ=TRUE")
endif()
vcpkg_cmake_configure(
SOURCE_PATH "${SOURCE_PATH}"
OPTIONS
${EXTRA_ARGS}
${FEATURE_OPTIONS}
-DUNSAFE_TREAT_WARNINGS_AS_ERRORS=OFF
)
vcpkg_cmake_install()
vcpkg_copy_pdbs()
vcpkg_cmake_config_fixup(CONFIG_PATH lib/s2n/cmake)
if(BUILD_TESTING)
message(STATUS Testing)
vcpkg_cmake_build(TARGET test LOGFILE_BASE test)
endif()
file(REMOVE_RECURSE
"${CURRENT_PACKAGES_DIR}/debug/include"
"${CURRENT_PACKAGES_DIR}/debug/lib/s2n"
"${CURRENT_PACKAGES_DIR}/debug/share"
"${CURRENT_PACKAGES_DIR}/lib/s2n"
"${CURRENT_PACKAGES_DIR}/share/s2n/modules"
)
# Handle copyright
file(INSTALL "${SOURCE_PATH}/LICENSE" DESTINATION "${CURRENT_PACKAGES_DIR}/share/${PORT}" RENAME copyright)

View File

@@ -0,0 +1,36 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt (revision 86c857094a2d94fafce15a3d32abb4052e664c5c)
+++ b/CMakeLists.txt (date 1643340236796)
@@ -409,32 +409,6 @@
endif()
endif()
-# Determine if EVP_md5_sha1 is available in libcrypto
-try_compile(
- LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH
- ${CMAKE_BINARY_DIR}
- SOURCES "${CMAKE_CURRENT_LIST_DIR}/tests/features/evp_md5_sha1.c"
- LINK_LIBRARIES crypto ${OS_LIBS}
- CMAKE_FLAGS
- "-DINCLUDE_DIRECTORIES=$<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>"
-)
-if (LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH)
- target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD5_SHA1_HASH)
-endif()
-
-# Determine if EVP_MD_CTX_set_pkey_ctx is available in libcrypto
-try_compile(
- LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX
- ${CMAKE_BINARY_DIR}
- SOURCES "${CMAKE_CURRENT_LIST_DIR}/tests/features/evp_md_ctx_set_pkey_ctx.c"
- LINK_LIBRARIES crypto ${OS_LIBS}
- CMAKE_FLAGS
- "-DINCLUDE_DIRECTORIES=$<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>"
-)
-if (LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX)
- target_compile_options(${PROJECT_NAME} PUBLIC -DS2N_LIBCRYPTO_SUPPORTS_EVP_MD_CTX_SET_PKEY_CTX)
-endif()
-
if (S2N_INTERN_LIBCRYPTO)
if (NOT LibCrypto_STATIC_LIBRARY)
message(FATAL_ERROR "libcrypto interning requires a static build of libcrypto.a to be available")

View File

@@ -0,0 +1,70 @@
diff --git a/CMakeLists.txt b/CMakeLists.txt
index edbf248..2992a05 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -400,7 +400,7 @@ endif()
set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake/modules)
if (SEARCH_LIBCRYPTO)
- find_package(LibCrypto REQUIRED)
+ find_package(OpenSSL COMPONENTS Crypto REQUIRED)
else()
if (TARGET crypto)
message(STATUS "S2N found target: crypto")
@@ -465,7 +465,7 @@ if (S2N_INTERN_LIBCRYPTO)
)
endif()
else()
- target_link_libraries(${PROJECT_NAME} PUBLIC crypto)
+ target_link_libraries(${PROJECT_NAME} PUBLIC OpenSSL::Crypto)
endif()
target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m)
@@ -473,7 +473,7 @@ target_link_libraries(${PROJECT_NAME} PUBLIC ${OS_LIBS} m)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>)
target_include_directories(${PROJECT_NAME} PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/api> $<INSTALL_INTERFACE:include>)
-target_include_directories(${PROJECT_NAME} PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>)
+target_include_directories(${PROJECT_NAME} PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>)
if (BUILD_TESTING)
enable_testing()
@@ -485,7 +485,7 @@ if (BUILD_TESTING)
target_include_directories(testss2n PUBLIC tests)
target_compile_options(testss2n PRIVATE -std=gnu99)
target_link_libraries(testss2n PUBLIC ${PROJECT_NAME})
- target_include_directories(testss2n PUBLIC $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>)
+ target_include_directories(testss2n PUBLIC $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>)
if (S2N_INTERN_LIBCRYPTO)
# if libcrypto was interned, rewrite libcrypto symbols so use of internal functions will link correctly
@@ -536,13 +536,13 @@ if (BUILD_TESTING)
add_executable(s2nc "bin/s2nc.c" "bin/echo.c" "bin/https.c" "bin/common.c")
target_link_libraries(s2nc ${PROJECT_NAME})
- target_include_directories(s2nc PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>)
+ target_include_directories(s2nc PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(s2nc PRIVATE api)
target_compile_options(s2nc PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L)
add_executable(s2nd "bin/s2nd.c" "bin/echo.c" "bin/https.c" "bin/common.c")
target_link_libraries(s2nd ${PROJECT_NAME})
- target_include_directories(s2nd PRIVATE $<TARGET_PROPERTY:crypto,INTERFACE_INCLUDE_DIRECTORIES>)
+ target_include_directories(s2nd PRIVATE $<TARGET_PROPERTY:OpenSSL::Crypto,INTERFACE_INCLUDE_DIRECTORIES>)
target_include_directories(s2nd PRIVATE api)
target_compile_options(s2nd PRIVATE -std=gnu99 -D_POSIX_C_SOURCE=200112L)
diff --git a/cmake/s2n-config.cmake b/cmake/s2n-config.cmake
index 4e76ed6..f714df0 100644
--- a/cmake/s2n-config.cmake
+++ b/cmake/s2n-config.cmake
@@ -5,8 +5,7 @@ if (NOT MSVC)
find_package(Threads REQUIRED)
endif()
-list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_LIST_DIR}/modules")
-find_dependency(LibCrypto)
+find_dependency(OpenSSL COMPONENTS Crypto)
include(${CMAKE_CURRENT_LIST_DIR}/@CMAKE_PROJECT_NAME@-targets.cmake)

23
externals/vcpkg/ports/s2n/vcpkg.json vendored Executable file
View File

@@ -0,0 +1,23 @@
{
"name": "s2n",
"version": "1.3.5",
"description": "C99 implementation of the TLS/SSL protocols.",
"homepage": "https://github.com/aws/s2n-tls",
"supports": "!uwp & !windows",
"dependencies": [
"openssl",
{
"name": "vcpkg-cmake",
"host": true
},
{
"name": "vcpkg-cmake-config",
"host": true
}
],
"features": {
"tests": {
"description": "Build and run the tests"
}
}
}