Skip to content

Commit

Permalink
modules: mbedtls: Use TF-M PSA API headers
Browse files Browse the repository at this point in the history
Use TF-M PSA API headers when compiling with TF-M enabled.

Fixes: zephyrproject-rtos#43249

Signed-off-by: Joakim Andersson <joakim.andersson@nordicsemi.no>
Signed-off-by: Markus Swarowsky <markus.swarowsky@nordicsemi.no>
  • Loading branch information
Joakim Andersson authored and mswarowsky committed Jan 10, 2024
1 parent 57b195c commit 5b63acf
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions modules/mbedtls/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,12 @@ zephyr_interface_library_named(mbedTLS)
MBEDTLS_CONFIG_FILE="${CONFIG_MBEDTLS_CFG_FILE}"
)

if (CONFIG_BUILD_WITH_TFM)
target_include_directories(mbedTLS INTERFACE
$<TARGET_PROPERTY:tfm,TFM_BINARY_DIR>/api_ns/interface/include
)
endif()

# Add regular includes
target_include_directories(mbedTLS INTERFACE
${ZEPHYR_CURRENT_MODULE_DIR}/include
Expand Down Expand Up @@ -107,7 +113,7 @@ zephyr_interface_library_named(mbedTLS)

zephyr_library_named(mbedTLSCrypto)

if (CONFIG_MBEDTLS_PSA_CRYPTO_C)
if (CONFIG_MBEDTLS_PSA_CRYPTO_C AND NOT CONFIG_BUILD_WITH_TFM)
list(APPEND crypto_source
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_aead.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_cipher.c
Expand All @@ -119,11 +125,6 @@ zephyr_interface_library_named(mbedTLS)
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_se.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_storage.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_its_file.c
)
endif()

if (NOT CONFIG_BUILD_WITH_TFM)
list(APPEND crypto_source
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_client.c
${ZEPHYR_CURRENT_MODULE_DIR}/library/psa_crypto_slot_management.c
Expand Down

0 comments on commit 5b63acf

Please sign in to comment.