Skip to content

Commit 2912976

Browse files
committed
Merge remote-tracking branch 'origin/main' into kong/fix.retrentrant.bugcheck.in.sesstion.resumption
2 parents 9467c26 + 9b5b9df commit 2912976

File tree

7 files changed

+175
-963
lines changed

7 files changed

+175
-963
lines changed

.github/workflows/scorecards-analysis.yml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,6 @@ jobs:
3232
with:
3333
results_file: results.sarif
3434
results_format: sarif
35-
# Read-only PAT token. To create it,
36-
# follow the steps in https://github.com/ossf/scorecard-action#pat-token-creation.
37-
repo_token: ${{ secrets.SCORECARD_READ_TOKEN }}
3835
# Publish the results to enable scorecard badges. For more details, see
3936
# https://github.com/ossf/scorecard-action#publishing-results.
4037
# For private repositories, `publish_results` will automatically be set to `false`,

CMakeLists.txt

Lines changed: 39 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,9 @@ option(QUIC_CI "CI Specific build" OFF)
111111
option(QUIC_SKIP_CI_CHECKS "Disable CI specific build checks" OFF)
112112
option(QUIC_TELEMETRY_ASSERTS "Enable telemetry asserts in release builds" OFF)
113113
option(QUIC_USE_SYSTEM_LIBCRYPTO "Use system libcrypto if quictls TLS" OFF)
114+
option(QUIC_USE_EXTERNAL_OPENSSL "Use external OpenSSL instead of building from submodules" OFF)
115+
set(QUIC_OPENSSL_INCLUDE_DIR "" CACHE PATH "Path to OpenSSL include directory")
116+
set(QUIC_OPENSSL_LIB_DIR "" CACHE PATH "Path to OpenSSL library directory")
114117
option(QUIC_HIGH_RES_TIMERS "Configure the system to use high resolution timers" OFF)
115118
option(QUIC_OFFICIAL_RELEASE "Configured the build for an official release" OFF)
116119
set(QUIC_FOLDER_PREFIX "" CACHE STRING "Optional prefix for source group folders when using an IDE generator")
@@ -759,18 +762,46 @@ endif()
759762
if(QUIC_TLS_LIB STREQUAL "quictls" OR QUIC_TLS_LIB STREQUAL "openssl")
760763
add_library(OpenSSL INTERFACE)
761764

762-
include(FetchContent)
765+
# OpenSSL versions before 3.5.0 do not expose these APIs.
766+
if(QUIC_TLS_LIB STREQUAL "quictls" AND (QUIC_USE_EXTERNAL_OPENSSL OR QUIC_OPENSSL_INCLUDE_DIR OR QUIC_OPENSSL_LIB_DIR))
767+
message(FATAL_ERROR "Manual OpenSSL selection is not supported with the 'quictls'. 'quictls' must be built from submodules to ensure static linkage with required QUIC APIs. Use 'openssl' provider for external 3.5.0+ OpenSSL.")
768+
endif()
763769

764-
FetchContent_Declare(
765-
OpenSSLQuic
766-
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules
767-
CMAKE_ARGS "-DQUIC_USE_SYSTEM_LIBCRYPTO=${QUIC_USE_SYSTEM_LIBCRYPTO}"
768-
)
769-
FetchContent_MakeAvailable(OpenSSLQuic)
770+
# Only 'openssl' provider supports external selection for now
771+
if(QUIC_TLS_LIB STREQUAL "openssl" AND (QUIC_USE_EXTERNAL_OPENSSL OR QUIC_OPENSSL_INCLUDE_DIR OR QUIC_OPENSSL_LIB_DIR))
772+
add_library(OpenSSLQuic INTERFACE)
773+
if(QUIC_OPENSSL_INCLUDE_DIR AND QUIC_OPENSSL_LIB_DIR)
774+
target_include_directories(OpenSSLQuic INTERFACE ${QUIC_OPENSSL_INCLUDE_DIR})
775+
find_library(LIB_CRYPTO NAMES crypto libcrypto PATHS ${QUIC_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
776+
if(NOT LIB_CRYPTO)
777+
message(FATAL_ERROR "libcrypto not found in ${QUIC_OPENSSL_LIB_DIR}")
778+
endif()
779+
find_library(LIB_SSL NAMES ssl libssl PATHS ${QUIC_OPENSSL_LIB_DIR} NO_DEFAULT_PATH)
780+
if(NOT LIB_SSL)
781+
message(FATAL_ERROR "libssl not found in ${QUIC_OPENSSL_LIB_DIR}")
782+
endif()
783+
target_link_libraries(OpenSSLQuic INTERFACE ${LIB_SSL} ${LIB_CRYPTO})
784+
elseif(QUIC_OPENSSL_INCLUDE_DIR OR QUIC_OPENSSL_LIB_DIR)
785+
message(FATAL_ERROR "Both QUIC_OPENSSL_INCLUDE_DIR and QUIC_OPENSSL_LIB_DIR must be set to select custom OpenSSL version.")
786+
else()
787+
find_package(OpenSSL 3.5.0 REQUIRED)
788+
target_link_libraries(OpenSSLQuic INTERFACE OpenSSL::SSL OpenSSL::Crypto)
789+
endif()
790+
add_library(MsQuic::OpenSSL ALIAS OpenSSLQuic)
791+
else()
792+
include(FetchContent)
793+
794+
FetchContent_Declare(
795+
OpenSSLQuic
796+
SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/submodules
797+
CMAKE_ARGS "-DQUIC_USE_SYSTEM_LIBCRYPTO=${QUIC_USE_SYSTEM_LIBCRYPTO}"
798+
)
799+
FetchContent_MakeAvailable(OpenSSLQuic)
800+
endif()
770801

771802
target_link_libraries(OpenSSL
772803
INTERFACE
773-
OpenSSLQuic::OpenSSLQuic
804+
MsQuic::OpenSSL
774805
)
775806
endif()
776807

0 commit comments

Comments
 (0)