mirror of
https://github.com/SoftEtherVPN/SoftEtherVPN.git
synced 2024-08-26 06:23:00 +03:00
Merge 04912037c0
into b8fbb3e3d8
This commit is contained in:
commit
7f104d925b
6
.gitmodules
vendored
6
.gitmodules
vendored
@ -10,3 +10,9 @@
|
||||
[submodule "src/libhamcore"]
|
||||
path = src/libhamcore
|
||||
url = https://github.com/SoftEtherVPN/libhamcore.git
|
||||
[submodule "src/Mayaqua/3rdparty/oqs-provider"]
|
||||
path = src/Mayaqua/3rdparty/oqs-provider
|
||||
url = https://github.com/open-quantum-safe/oqs-provider.git
|
||||
[submodule "src/Mayaqua/3rdparty/liboqs"]
|
||||
path = src/Mayaqua/3rdparty/liboqs
|
||||
url = https://github.com/open-quantum-safe/liboqs.git
|
||||
|
2
src/Mayaqua/3rdparty/Findliboqs.cmake
vendored
Normal file
2
src/Mayaqua/3rdparty/Findliboqs.cmake
vendored
Normal file
@ -0,0 +1,2 @@
|
||||
set(oqs_FOUND TRUE)
|
||||
add_library(OQS::oqs ALIAS oqs)
|
1
src/Mayaqua/3rdparty/liboqs
vendored
Submodule
1
src/Mayaqua/3rdparty/liboqs
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 51ddd33cc04d12bd47c8639c1254714879f4cdf3
|
1
src/Mayaqua/3rdparty/oqs-provider
vendored
Submodule
1
src/Mayaqua/3rdparty/oqs-provider
vendored
Submodule
@ -0,0 +1 @@
|
||||
Subproject commit 8f37521d5e27ab4d1e0d69a4b4a5bd17927b24b9
|
@ -18,6 +18,10 @@ set_target_properties(mayaqua
|
||||
|
||||
find_package(OpenSSL REQUIRED)
|
||||
|
||||
if(OPENSSL_VERSION VERSION_LESS "3") # Disable oqsprovider when OpenSSL version < 3
|
||||
set(SKIP_OQS_PROVIDER ON)
|
||||
endif()
|
||||
|
||||
include(CheckSymbolExists)
|
||||
|
||||
set(CMAKE_REQUIRED_INCLUDES ${OPENSSL_INCLUDE_DIR})
|
||||
@ -74,6 +78,25 @@ if(WIN32)
|
||||
"ws2_32.lib"
|
||||
"WtsApi32.Lib"
|
||||
)
|
||||
|
||||
if (SKIP_OQS_PROVIDER)
|
||||
add_definitions(-DSKIP_OQS_PROVIDER)
|
||||
else()
|
||||
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
|
||||
set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.")
|
||||
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
||||
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/Mayaqua/3rdparty/")
|
||||
|
||||
add_subdirectory(3rdparty/liboqs)
|
||||
add_subdirectory(3rdparty/oqs-provider)
|
||||
|
||||
target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
|
||||
get_target_property(target_include_dirs oqsprovider INCLUDE_DIRECTORIES)
|
||||
message("Include directories for target_name: ${target_include_dirs}")
|
||||
|
||||
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
||||
endif()
|
||||
endif()
|
||||
|
||||
if(UNIX)
|
||||
@ -92,6 +115,25 @@ if(UNIX)
|
||||
$<$<BOOL:${LIB_M}>:${LIB_M}>
|
||||
$<$<BOOL:${LIB_RT}>:${LIB_RT}>
|
||||
)
|
||||
|
||||
if (SKIP_OQS_PROVIDER)
|
||||
add_definitions(-DSKIP_OQS_PROVIDER)
|
||||
else()
|
||||
set(OQS_BUILD_ONLY_LIB ON CACHE BOOL "Set liboqs to build only the library (no tests)")
|
||||
set(BUILD_TESTING OFF CACHE BOOL "By setting this to OFF, no tests or examples will be compiled.")
|
||||
set(OQS_PROVIDER_BUILD_STATIC ON CACHE BOOL "Build a static library instead of a shared library") # Build oqsprovider as a static library (defaults to shared)
|
||||
list(PREPEND CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/src/Mayaqua/3rdparty/")
|
||||
|
||||
add_subdirectory(3rdparty/liboqs)
|
||||
add_subdirectory(3rdparty/oqs-provider)
|
||||
|
||||
target_include_directories(oqsprovider PUBLIC ${CMAKE_CURRENT_BINARY_DIR}/3rdparty/liboqs/include)
|
||||
get_target_property(target_include_dirs oqsprovider INCLUDE_DIRECTORIES)
|
||||
message("Include directories for target_name: ${target_include_dirs}")
|
||||
|
||||
set_property(TARGET oqsprovider PROPERTY POSITION_INDEPENDENT_CODE ON)
|
||||
target_link_libraries(mayaqua PRIVATE oqsprovider)
|
||||
endif()
|
||||
|
||||
if (CMAKE_SYSTEM_PROCESSOR MATCHES "^(armv7l|aarch64|s390x)$" OR NOT HAVE_SYS_AUXV OR SKIP_CPU_FEATURES)
|
||||
add_definitions(-DSKIP_CPU_FEATURES)
|
||||
|
@ -40,6 +40,10 @@
|
||||
#include <openssl/x509v3.h>
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
#include <openssl/provider.h>
|
||||
// Static oqsprovider initialization function
|
||||
#ifndef SKIP_OQS_PROVIDER
|
||||
extern OSSL_provider_init_fn oqs_provider_init;
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#ifdef _MSC_VER
|
||||
@ -4003,7 +4007,13 @@ void InitCryptLibrary()
|
||||
#if OPENSSL_VERSION_NUMBER >= 0x30000000L
|
||||
ossl_provider_default = OSSL_PROVIDER_load(NULL, "legacy");
|
||||
ossl_provider_legacy = OSSL_PROVIDER_load(NULL, "default");
|
||||
ossl_provider_oqsprovider = OSSL_PROVIDER_load(NULL, "oqsprovider");
|
||||
|
||||
char *oqs_provider_name = "oqsprovider";
|
||||
#ifndef SKIP_OQS_PROVIDER
|
||||
// Registers "oqsprovider" as a provider -- necessary because oqsprovider is built in now.
|
||||
OSSL_PROVIDER_add_builtin(NULL, oqs_provider_name, oqs_provider_init);
|
||||
#endif
|
||||
ossl_provider_oqsprovider = OSSL_PROVIDER_load(NULL, oqs_provider_name);
|
||||
#endif
|
||||
|
||||
ssl_clientcert_index = SSL_get_ex_new_index(0, "struct SslClientCertInfo *", NULL, NULL, NULL);
|
||||
|
Loading…
Reference in New Issue
Block a user