Files
libcoap/cmake/FindwolfSSL.cmake
T
Jon Shallow e3a662a934 wolfSSL: Set up initial port
Includes some porting ideas from qursa-uc3m libcoap-wolfssl work.

Some common ASN1 code moved from coap_gnutls.c to coap_asn1.c to support RPK.

WolfSSL build
$ ./configure --enable-all --enable-dtls13 CFLAGS="-DBUILD_TLS_PSK_WITH_AES_128_CCM -DHAVE_RPK"

Interoperability requirements

DTLS1.3 downgrade requires
https://github.com/eclipse/tinydtls/pull/230
https://github.com/wolfSSL/wolfssl/pull/7367

TLS1.3 downgrade requires
https://github.com/wolfSSL/wolfssl/pull/7367

(D)TLS1.2 use of RPK requires
https://github.com/wolfSSL/wolfssl/pull/7375

MbedTLS using TLS_ECDHE_PSK_WITH_CHACHA20_POLY1305_SHA256 requires
https://github.com/wolfSSL/wolfssl/pull/7132

GnuTLS using PSK and TLS1.3 requires
https://github.com/wolfSSL/wolfssl/pull/7407
2024-04-16 11:03:24 +01:00

86 lines
1.9 KiB
CMake

# FindWolfSSL.cmake
# -----------------
#
# Find the wolfSSL library.
#
# Imported Targets
# ^^^^^^^^^^^^^^^^
#
# This module defines the following :prop_tgt:`IMPORTED` targets:
#
# ``wolfssl``
# The wolfSSL library, if found.
#
# Result Variables
# ^^^^^^^^^^^^^^^^
#
# This module will set the following variables in your project:
#
# ``wolfSSL_FOUND``
# System has the wolfSSL library.
# ``WOLFSSL_INCLUDE_DIR``
# The wolfSSL include directory.
# ``WOLFSSL_LIBRARIES``
# All wolfSSL libraries.
#
# Hints
# ^^^^^
#
# Set ``WOLFSSL_ROOT_DIR`` to the root directory of a wolfSSL installation.
if(WOLFSSL_ROOT_DIR)
set(_WOLFSSL_EXTRA_FIND_ARGS "NO_CMAKE_FIND_ROOT_PATH")
endif()
find_path(
WOLFSSL_INCLUDE_DIR
NAMES wolfssl/ssl.h
PATH_SUFFIXES include
HINTS ${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${WOLFSSL_ROOT_DIR}
${_WOLFSSL_EXTRA_FIND_ARGS})
find_library(
WOLFSSL_LIBRARIES
NAMES wolfssl
PATH_SUFFIXES lib
HINTS ${PROJECT_SOURCE_DIR}
${CMAKE_CURRENT_BINARY_DIR}
${WOLFSSL_ROOT_DIR}
${_WOLFSSL_EXTRA_FIND_ARGS})
if(WOLFSSL_LIBRARIES)
set(wolfSSL_FOUND TRUE)
else()
set(wolfSSL_FOUND FALSE)
if(wolfSSL_FIND_REQUIRED)
message(FATAL_ERROR "wolfSSL could not be found")
endif()
endif()
include(FindPackageHandleStandardArgs)
find_package_handle_standard_args(
wolfSSL
FOUND_VAR
wolfSSL_FOUND
REQUIRED_VARS
WOLFSSL_INCLUDE_DIR
WOLFSSL_LIBRARIES
VERSION_VAR)
if(NOT TARGET wolfssl)
add_library(
wolfssl
UNKNOWN
IMPORTED)
set_target_properties(
wolfssl
PROPERTIES INTERFACE_INCLUDE_DIRECTORIES "${WOLFSSL_INCLUDE_DIR}"
IMPORTED_LINK_INTERFACE_LANGUAGES "C"
IMPORTED_LOCATION "${WOLFSSL_LIBRARIES}")
endif()
message(STATUS "WOLFSSL_INCLUDE_DIR: ${WOLFSSL_INCLUDE_DIR}")
message(STATUS "WOLFSSL_LIBRARIES: ${WOLFSSL_LIBRARIES}")
message(STATUS "WOLFSSL_ROOT_DIR: ${WOLFSSL_ROOT_DIR}")