Skip to content

Commit

Permalink
Merge pull request wolfSSL#7049 from lealem47/ghIssue6983
Browse files Browse the repository at this point in the history
Enable cURL and QUIC from CMake
  • Loading branch information
dgarske authored Dec 11, 2023
2 parents cb6676f + de4bd42 commit 5400128
Show file tree
Hide file tree
Showing 2 changed files with 93 additions and 6 deletions.
92 changes: 87 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -377,6 +377,83 @@ if(NOT WOLFSSL_RNG)
list(APPEND WOLFSSL_DEFINITIONS "-DWC_NO_RNG")
endif()

# QUIC
add_option(WOLFSSL_QUIC
"Enable QUIC support (default: disabled)"
"no" "yes;no")

if(WOLFSSL_QUIC)
set(WOLFSSL_ALPN "yes")
set(WOLFSSL_OPENSSLEXTRA "yes")
set(WOLFSSL_AESCTR "yes")
set(WOLFSSL_CURVE25519 "yes")
set(WOLFSSL_SNI "yes")
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_QUIC" "-DHAVE_EX_DATA")
endif()

# Curl
add_option(WOLFSSL_CURL
"Enable CURL support (default: disabled)"
"no" "yes;no")

if(WOLFSSL_CURL)
set(WOLFSSL_MD4 "yes")
set(WOLFSSL_DES3 "yes")
set(WOLFSSL_ALPN "yes")
set(WOLFSSL_OPENSSLEXTRA "yes")
set(WOLFSSL_CRL "yes")
set(WOLFSSL_OCSP "yes")
set(WOLFSSL_OCSPSTAPLING "yes")
set(WOLFSSL_OCSPSTAPLING_V2 "yes")
set(WOLFSSL_SNI "yes")
set(WOLFSSL_ALT_CERT_CHAINS "yes")
set(WOLFSSL_IP_ALT_NAME "yes")
set(WOLFSSL_SESSION_TICKET "yes")
set(WOLFSSL_WOLFSSH "yes")
list(APPEND WOLFSSL_DEFINITIONS
"-DNO_SESSION_CACHE_REF" "-DWOLFSSL_DES_ECB")
endif()

# ALPN
add_option(WOLFSSL_ALPN
"Enable ALPN support (default: disabled)"
"no" "yes;no")

if(WOLFSSL_ALPN)
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_ALPN" "-DHAVE_TLS_EXTENSIONS")
endif()

# altcertchains
add_option(WOLFSSL_ALT_CERT_CHAINS
"Enable support for Alternate certification chains (default: disabled)"
"no" "yes;no")

if(WOLFSSL_ALT_CERT_CHAINS)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_ALT_CERT_CHAINS")
endif()

# ip-alt-name
add_option(WOLFSSL_IP_ALT_NAME
"Enable support for IP alternative name (default: disabled)"
"no" "yes;no")

if(WOLFSSL_IP_ALT_NAME)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_IP_ALT_NAME")
endif()

# wolfSSH
add_option(WOLFSSL_WOLFSSH
"Enable support for wolfSSH (default: disabled)"
"no" "yes;no")

if(WOLFSSL_WOLFSSH)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_WOLFSSH")
endif()

if(WOLFSSL_WOLFSSH OR WOLFSSL_WPAS)
list(APPEND WOLFSSL_DEFINITIONS "-DWOLFSSL_PUBLIC_MP")
endif()

# TODO: - DTLS-SCTP
# - DTLS multicast
# - OpenSSH
Expand All @@ -386,14 +463,11 @@ endif()
# - wpa_supplicant
# - Fortress
# - libwebsockets
# - IP alternative name
# - Qt
# - SSL bump
# - sniffer
# - Signal
# - OpenSSL coexist
# - OpenSSL compatibility all
# - OpenSSL compatibility extra
# - Max strength

# Harden, enable Timing Resistance and Blinding by default
Expand Down Expand Up @@ -445,7 +519,6 @@ if (WOLFSSL_OPENSSLALL)
"-DWOLFSSL_ERROR_CODE_OPENSSL" "-DWOLFSSL_CERT_NAME_ALL")
endif()


# TODO: - IPv6 test apps

set(WOLFSSL_SLOW_MATH "yes")
Expand Down Expand Up @@ -529,6 +602,15 @@ if(WOLFSSL_AESGCM)
list(APPEND WOLFSSL_DEFINITIONS "-DHAVE_AESGCM")
endif()

if(WOLFSSL_QUIC)
if(NOT WOLFSSL_TLS13)
message(FATAL_ERROR "TLS 1.3 is disabled - necessary for QUIC")
endif()
if(NOT WOLFSSL_AESGCM)
message(FATAL_ERROR "AES-GCM is disabled - necessary for QUIC")
endif()
endif()

# AES-SIV
add_option("WOLFSSL_AESSIV"
"Enable wolfSSL AES-SIV support (default: disabled)"
Expand Down Expand Up @@ -1435,7 +1517,6 @@ endif()

# TODO: - TLS extensions
# - Early data handshake
# - wolfSSH options
# - SCEP
# - Secure remote password
# - Indefinite length encoded messages
Expand Down Expand Up @@ -2232,6 +2313,7 @@ if(WOLFSSL_EXAMPLES)
tests/suites.c
tests/w64wrapper.c
tests/unit.c
tests/quic.c
examples/server/server.c
examples/client/client.c)
target_include_directories(unit_test PRIVATE
Expand Down
7 changes: 6 additions & 1 deletion cmake/functions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,7 @@ function(generate_build_flags)
if(WOLFSSL_CRL_MONITOR)
set(BUILD_CRL_MONITOR "yes" PARENT_SCOPE)
endif()
set(BUILD_QUIC ${WOLFSSL_QUIC} PARENT_SCOPE)
set(BUILD_USER_RSA ${WOLFSSL_USER_RSA} PARENT_SCOPE)
set(BUILD_USER_CRYPTO ${WOLFSSL_USER_CRYPTO} PARENT_SCOPE)
set(BUILD_WNR ${WOLFSSL_WNR} PARENT_SCOPE)
Expand Down Expand Up @@ -845,7 +846,11 @@ function(generate_lib_src_list LIB_SOURCES)
if(BUILD_DTLS_COMMON)
list(APPEND LIB_SOURCES src/dtls.c)
endif()
endif()

if(BUILD_QUIC)
list(APPEND LIB_SOURCES src/quic.c)
endif()
endif()
endif()

# Corresponds to wolfcrypt/src/include.am
Expand Down

0 comments on commit 5400128

Please sign in to comment.