MbedTLS configuration rework
Instead of using config.py to modify the original MbedTLS configuration
file and then extending it with user settings, pass a custom file
which will be used instead of the default file being appended to it.
Also add a stub trng implementation, which results in error if called,
because in case of internal crypto configuration of smmgw SP, trng
shall not be used for X509 related tasks.
libmbedx509.h has been renamed to crypto_provider_x509.h
x509_only.h has been renamed to internal_crypto_smmgw.h
Signed-off-by: Gabor Toth <gabor.toth2@arm.com>
Change-Id: I6831f221d63b64422a28ab75d0faf97771dd5773
diff --git a/deployments/crypto/crypto.cmake b/deployments/crypto/crypto.cmake
index 963dde5..9dad507 100644
--- a/deployments/crypto/crypto.cmake
+++ b/deployments/crypto/crypto.cmake
@@ -47,7 +47,7 @@
protobuf_generate_all(TGT "crypto" NAMESPACE "protobuf" BASE_DIR "${TS_ROOT}/protocols")
# Mbed TLS provides libmbedcrypto
-set(MBEDTLS_USER_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/libmbedx509.h"
+set(MBEDTLS_CONFIG_FILE "${TS_ROOT}/external/MbedTLS/config/crypto_provider_x509.h"
CACHE STRING "Configuration file for Mbed TLS" FORCE)
include(${TS_ROOT}/external/MbedTLS/MbedTLS.cmake)
target_link_libraries(crypto PRIVATE MbedTLS::mbedcrypto)
@@ -56,7 +56,7 @@
# Provide the config path to mbedtls
target_compile_definitions(crypto
PRIVATE
- MBEDTLS_USER_CONFIG_FILE="${MBEDTLS_USER_CONFIG_FILE}"
+ MBEDTLS_CONFIG_FILE="${MBEDTLS_CONFIG_FILE}"
)
#################################################################