Skip to content

Commit

Permalink
Merge pull request #1090 from Mbed-TLS/mbedtls-3.5.0rc0-pr
Browse files Browse the repository at this point in the history
Mbedtls 3.5.0rc0 pr DO NOT MERGE
  • Loading branch information
minosgalanakis authored Oct 4, 2023
2 parents 3406564 + f7e81d9 commit 1ec6906
Show file tree
Hide file tree
Showing 210 changed files with 140,155 additions and 1,484 deletions.
12 changes: 2 additions & 10 deletions 3rdparty/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,10 +1,2 @@
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/mbedtls_config.h get MBEDTLS_ECDH_VARIANT_EVEREST_ENABLED RESULT_VARIABLE everest_result)
execute_process(COMMAND ${MBEDTLS_PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/../scripts/config.py -f ${CMAKE_CURRENT_SOURCE_DIR}/../include/mbedtls/mbedtls_config.h get MBEDTLS_PSA_P256M_DRIVER_ENABLED RESULT_VARIABLE p256m_result)

if(${everest_result} EQUAL 0)
add_subdirectory(everest)
endif()

if(${p256m_result} EQUAL 0)
add_subdirectory(p256-m)
endif()
add_subdirectory(everest)
add_subdirectory(p256-m)
21 changes: 18 additions & 3 deletions 3rdparty/everest/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,31 @@
add_library(everest
set(everest_target "${MBEDTLS_TARGET_PREFIX}everest")

add_library(${everest_target}
library/everest.c
library/x25519.c
library/Hacl_Curve25519_joined.c)

target_include_directories(everest
target_include_directories(${everest_target}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/include>
$<BUILD_INTERFACE:${MBEDTLS_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE include/everest
include/everest/kremlib
${MBEDTLS_DIR}/library/)

# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
# This must be duplicated from library/CMakeLists.txt because
# everest is not directly linked against any mbedtls targets
# so does not inherit the compile definitions.
if(MBEDTLS_CONFIG_FILE)
target_compile_definitions(everest
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
endif()
if(MBEDTLS_USER_CONFIG_FILE)
target_compile_definitions(everest
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}")
endif()

if(INSTALL_MBEDTLS_HEADERS)

install(DIRECTORY include/everest
Expand All @@ -21,7 +36,7 @@ if(INSTALL_MBEDTLS_HEADERS)

endif(INSTALL_MBEDTLS_HEADERS)

install(TARGETS everest
install(TARGETS ${everest_target}
EXPORT MbedTLSTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
21 changes: 18 additions & 3 deletions 3rdparty/p256-m/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,29 @@
add_library(p256m
set(p256m_target ${MBEDTLS_TARGET_PREFIX}p256m)

add_library(${p256m_target}
p256-m_driver_entrypoints.c
p256-m/p256-m.c)

target_include_directories(p256m
target_include_directories(${p256m_target}
PUBLIC $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/p256-m>
$<BUILD_INTERFACE:${MBEDTLS_DIR}/include>
$<INSTALL_INTERFACE:include>
PRIVATE ${MBEDTLS_DIR}/library/)

# Pass-through MBEDTLS_CONFIG_FILE and MBEDTLS_USER_CONFIG_FILE
# This must be duplicated from library/CMakeLists.txt because
# p256m is not directly linked against any mbedtls targets
# so does not inherit the compile definitions.
if(MBEDTLS_CONFIG_FILE)
target_compile_definitions(p256m
PUBLIC MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}")
endif()
if(MBEDTLS_USER_CONFIG_FILE)
target_compile_definitions(p256m
PUBLIC MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}")
endif()

if(INSTALL_MBEDTLS_HEADERS)

install(DIRECTORY :${CMAKE_CURRENT_SOURCE_DIR}
Expand All @@ -19,7 +34,7 @@ if(INSTALL_MBEDTLS_HEADERS)

endif(INSTALL_MBEDTLS_HEADERS)

install(TARGETS p256m
install(TARGETS ${p256m_target}
EXPORT MbedTLSTargets
DESTINATION ${CMAKE_INSTALL_LIBDIR}
PERMISSIONS OWNER_READ OWNER_WRITE GROUP_READ WORLD_READ)
2 changes: 1 addition & 1 deletion BRANCHES.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,6 @@ The following branches are currently maintained:
- [`development`](https://github.com/Mbed-TLS/mbedtls/)
- [`mbedtls-2.28`](https://github.com/Mbed-TLS/mbedtls/tree/mbedtls-2.28)
maintained until at least the end of 2024, see
<https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.3>.
<https://github.com/Mbed-TLS/mbedtls/releases/tag/v2.28.5>.

Users are urged to always use the latest version of a maintained branch.
4 changes: 2 additions & 2 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ if(CMAKE_HOST_WIN32)
# CMakeLists.txt.
option(GEN_FILES "Generate the auto-generated files as needed" OFF) # off in development
else()
option(GEN_FILES "Generate the auto-generated files as needed" ON)
option(GEN_FILES "Generate the auto-generated files as needed" OFF)
endif()

option(DISABLE_PACKAGE_CONFIG_AND_INSTALL "Disable package configuration, target export and installation" ${MBEDTLS_AS_SUBPROJECT})
Expand Down Expand Up @@ -377,7 +377,7 @@ if(NOT DISABLE_PACKAGE_CONFIG_AND_INSTALL)
write_basic_package_version_file(
"cmake/MbedTLSConfigVersion.cmake"
COMPATIBILITY SameMajorVersion
VERSION 3.4.1)
VERSION 3.5.0)

install(
FILES "${CMAKE_CURRENT_BINARY_DIR}/cmake/MbedTLSConfig.cmake"
Expand Down
Loading

0 comments on commit 1ec6906

Please sign in to comment.