diff --git a/subsys/CMakeLists.txt b/subsys/CMakeLists.txt index 80023be74eea..8a07e0d1ca4e 100644 --- a/subsys/CMakeLists.txt +++ b/subsys/CMakeLists.txt @@ -21,7 +21,10 @@ if(NOT SYSBUILD) endif() endif() -add_subdirectory_ifdef(CONFIG_NRF_SECURITY nrf_security) +if(CONFIG_NRF_SECURITY OR CONFIG_PSA_SSF_CRYPTO_CLIENT) +add_subdirectory(nrf_security) +endif() + add_subdirectory_ifdef(CONFIG_TRUSTED_STORAGE trusted_storage) add_subdirectory(net) diff --git a/subsys/nrf_security/CMakeLists.txt b/subsys/nrf_security/CMakeLists.txt index a4c2e0df0188..b027e759d4c0 100644 --- a/subsys/nrf_security/CMakeLists.txt +++ b/subsys/nrf_security/CMakeLists.txt @@ -102,8 +102,29 @@ endif() set(CONFIG_MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG True) +if(CONFIG_PSA_SSF_CRYPTO_CLIENT AND NOT CONFIG_NRF_SECURITY) + zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CONFIG) + zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CLIENT) + zephyr_compile_definitions(MBEDTLS_PSA_CRYPTO_CONFIG_FILE="ssf_crypto_config_empty.h") + zephyr_compile_definitions(MBEDTLS_CONFIG_FILE="ssf_crypto_config_empty.h") + + zephyr_include_directories( + ${NRF_SECURITY_ROOT}/include + # Oberon PSA headers + ${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}/include + ${ZEPHYR_OBERON_PSA_CRYPTO_MODULE_DIR}/library + # Mbed TLS (mbedcrypto) PSA headers + ${ARM_MBEDTLS_PATH}/include + ${ARM_MBEDTLS_PATH}/library + ) + + zephyr_sources(${CMAKE_CURRENT_LIST_DIR}/src/ssf_secdom/ssf_crypto.c) + +else() + # Finally adding the crypto lib add_subdirectory(${NRFXLIB_DIR}/crypto crypto_copy) # Add mbed TLS Libraries add_subdirectory(src) +endif() diff --git a/subsys/nrf_security/include/ssf_crypto_config_empty.h b/subsys/nrf_security/include/ssf_crypto_config_empty.h new file mode 100644 index 000000000000..e69de29bb2d1