From 67cc6a73aaefa12df1c81840f7a70b19b7b6a95f Mon Sep 17 00:00:00 2001 From: Ronald Cron Date: Mon, 14 Oct 2024 10:55:24 +0200 Subject: [PATCH] Use config_adjust_test_accelerators.h Use config_adjust_test_accelerators.h to adjust the configuration needed for test_psa_crypto_drivers all.sh component with PSA_CRYPTO_CONFIG enabled. Signed-off-by: Ronald Cron --- tests/scripts/components-configuration-crypto.sh | 4 +--- .../builtin/include/mbedtls/config_adjust_test_accelerators.h | 3 --- tf-psa-crypto/drivers/builtin/include/mbedtls/config_psa.h | 3 +++ 3 files changed, 4 insertions(+), 6 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 74ebb793d7..07b6fa5a37 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -2673,9 +2673,7 @@ component_test_full_static_keystore () { component_test_psa_crypto_drivers () { msg "build: full + test drivers dispatching to builtins" scripts/config.py full - scripts/config.py unset MBEDTLS_PSA_CRYPTO_CONFIG - loc_cflags="$ASAN_CFLAGS -DPSA_CRYPTO_DRIVER_TEST_ALL" - loc_cflags="${loc_cflags} '-DMBEDTLS_USER_CONFIG_FILE=\"../tests/configs/user-config-for-test.h\"'" + loc_cflags="$ASAN_CFLAGS -DPSA_CRYPTO_DRIVER_TEST -DMBEDTLS_CONFIG_ADJUST_TEST_ACCELERATORS" loc_cflags="${loc_cflags} -I../tests/include -O2" make CC=$ASAN_CC CFLAGS="${loc_cflags}" LDFLAGS="$ASAN_CFLAGS" diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h index 5f25879780..28718a08a2 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_adjust_test_accelerators.h @@ -46,7 +46,6 @@ "automatically at the right point." #endif -#if defined(PSA_CRYPTO_DRIVER_TEST_ALL) /* PSA_CRYPTO_DRIVER_TEST_ALL activates test drivers while keeping the * built-in implementations active. Normally setting MBEDTLS_PSA_ACCEL_xxx * would disable MBEDTLS_PSA_BUILTIN_xxx unless fallback is activated, but @@ -133,6 +132,4 @@ //#define MBEDTLS_PSA_ACCEL_ALG_TLS12_PSK_TO_MS //#define MBEDTLS_PSA_ACCEL_ALG_TLS12_ECJPAKE_TO_PMS -#endif /* PSA_CRYPTO_DRIVER_TEST_ALL */ - #endif /* MBEDTLS_CONFIG_ADJUST_TEST_ACCELERATORS_H */ diff --git a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_psa.h b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_psa.h index 2520a9a53d..ed45dead4f 100644 --- a/tf-psa-crypto/drivers/builtin/include/mbedtls/config_psa.h +++ b/tf-psa-crypto/drivers/builtin/include/mbedtls/config_psa.h @@ -38,7 +38,10 @@ /* If we are implementing PSA crypto ourselves, then we want to enable the * required built-ins. Otherwise, PSA features will be provided by the server. */ #include "mbedtls/config_adjust_legacy_from_psa.h" +#if defined(MBEDTLS_CONFIG_ADJUST_TEST_ACCELERATORS) +#include "mbedtls/config_adjust_test_accelerators.h" #endif +#endif /* MBEDTLS_PSA_CRYPTO_C */ #else /* MBEDTLS_PSA_CRYPTO_CONFIG */