From ea5de2b40d8043d1d7a8f3daf47aea1cd29d430a Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Thu, 19 Sep 2024 18:41:55 +0200 Subject: [PATCH] Simplify psa-crypto components that come from test-ref-configs In the components migrated from test-ref-configs.pl, we don't need to activate PSA: it's always on. Also, since there is no "_legacy" component to contrast with, drop "_psa" from the component names. Signed-off-by: Gilles Peskine --- .../components-configuration-crypto.sh | 8 ++-- tests/scripts/components-configuration-tls.sh | 48 ++++++++----------- 2 files changed, 23 insertions(+), 33 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 3da9788f04..6330431a86 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -408,11 +408,9 @@ component_test_full_no_ccm_star_no_tag () { make test } -component_test_config_symmetric_only_psa () { - msg "build: configs/config-symmetric-only.h + USE_PSA_CRYPTO" +component_test_config_symmetric_only () { + msg "build: configs/config-symmetric-only.h" cp configs/config-symmetric-only.h "$CONFIG_H" - scripts/config.py set MBEDTLS_PSA_CRYPTO_C - scripts/config.py set MBEDTLS_USE_PSA_CRYPTO # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake # want to re-generate generated files that depend on it, quite correctly. # However this doesn't work as the generation script expects a specific @@ -425,7 +423,7 @@ component_test_config_symmetric_only_psa () { CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . make - msg "test: configs/config-symmetric-only.h + USE_PSA_CRYPTO - unit tests" + msg "test: configs/config-symmetric-only.h - unit tests" make test } diff --git a/tests/scripts/components-configuration-tls.sh b/tests/scripts/components-configuration-tls.sh index 0e77f9632f..e1d33ad242 100644 --- a/tests/scripts/components-configuration-tls.sh +++ b/tests/scripts/components-configuration-tls.sh @@ -9,11 +9,9 @@ #### Configuration Testing - TLS ################################################################ -component_test_config_suite_b_psa () { - msg "build: configs/config-suite-b.h + USE_PSA_CRYPTO" +component_test_config_suite_b () { + msg "build: configs/config-suite-b.h" cp configs/config-suite-b.h "$CONFIG_H" - scripts/config.py set MBEDTLS_PSA_CRYPTO_C - scripts/config.py set MBEDTLS_USE_PSA_CRYPTO # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake # want to re-generate generated files that depend on it, quite correctly. # However this doesn't work as the generation script expects a specific @@ -26,20 +24,20 @@ component_test_config_suite_b_psa () { CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . make - msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO - unit tests" + msg "test: configs/config-suite-b.h - unit tests" make test - msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO - compat.sh" + msg "test: configs/config-suite-b.h - compat.sh" tests/compat.sh -m tls12 -f 'ECDHE_ECDSA.*AES.*GCM' -p mbedTLS - msg "build: configs/config-suite-b.h + USE_PSA_CRYPTO + DEBUG" + msg "build: configs/config-suite-b.h + DEBUG" MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" make clean scripts/config.py set MBEDTLS_DEBUG_C scripts/config.py set MBEDTLS_ERROR_C make ssl-opt - msg "test: configs/config-suite-b.h + USE_PSA_CRYPTO + DEBUG - ssl-opt.sh" + msg "test: configs/config-suite-b.h + DEBUG - ssl-opt.sh" tests/ssl-opt.sh } @@ -164,11 +162,9 @@ component_test_tls1_2_default_cbc_legacy_cbc_etm_cipher_only () { tests/ssl-opt.sh -f "TLS 1.2" } -component_test_config_thread_psa () { - msg "build: configs/config-thread.h + USE_PSA_CRYPTO" +component_test_config_thread () { + msg "build: configs/config-thread.h" cp configs/config-thread.h "$CONFIG_H" - scripts/config.py set MBEDTLS_PSA_CRYPTO_C - scripts/config.py set MBEDTLS_USE_PSA_CRYPTO # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake # want to re-generate generated files that depend on it, quite correctly. # However this doesn't work as the generation script expects a specific @@ -181,10 +177,10 @@ component_test_config_thread_psa () { CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . make - msg "test: configs/config-thread.h + USE_PSA_CRYPTO - unit tests" + msg "test: configs/config-thread.h - unit tests" make test - msg "test: configs/config-thread.h + USE_PSA_CRYPTO - ssl-opt.sh" + msg "test: configs/config-thread.h - ssl-opt.sh" tests/ssl-opt.sh -f 'ECJPAKE.*nolog' } @@ -221,11 +217,9 @@ component_test_tls1_2_ecjpake_compatibility () { rm s2_no_use_psa c2_no_use_psa } -component_test_tls1_2_ccm_psk_psa () { - msg "build: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO" +component_test_tls1_2_ccm_psk () { + msg "build: configs/config-ccm-psk-tls1_2.h" cp configs/config-ccm-psk-tls1_2.h "$CONFIG_H" - scripts/config.py set MBEDTLS_PSA_CRYPTO_C - scripts/config.py set MBEDTLS_USE_PSA_CRYPTO # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake # want to re-generate generated files that depend on it, quite correctly. # However this doesn't work as the generation script expects a specific @@ -238,18 +232,16 @@ component_test_tls1_2_ccm_psk_psa () { CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . make - msg "test: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO - unit tests" + msg "test: configs/config-ccm-psk-tls1_2.h - unit tests" make test - msg "test: configs/config-ccm-psk-tls1_2.h + USE_PSA_CRYPTO - compat.sh" + msg "test: configs/config-ccm-psk-tls1_2.h - compat.sh" tests/compat.sh -m tls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' } -component_test_tls1_2_ccm_psk_dtls_psa () { - msg "build: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO" +component_test_tls1_2_ccm_psk_dtls () { + msg "build: configs/config-ccm-psk-dtls1_2.h" cp configs/config-ccm-psk-dtls1_2.h "$CONFIG_H" - scripts/config.py set MBEDTLS_PSA_CRYPTO_C - scripts/config.py set MBEDTLS_USE_PSA_CRYPTO # test-ref-configs works by overwriting mbedtls_config.h; this makes cmake # want to re-generate generated files that depend on it, quite correctly. # However this doesn't work as the generation script expects a specific @@ -262,20 +254,20 @@ component_test_tls1_2_ccm_psk_dtls_psa () { CC=$ASAN_CC cmake -D GEN_FILES=Off -D CMAKE_BUILD_TYPE:String=Asan . make - msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO - unit tests" + msg "test: configs/config-ccm-psk-dtls1_2.h - unit tests" make test - msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO - compat.sh" + msg "test: configs/config-ccm-psk-dtls1_2.h - compat.sh" tests/compat.sh -m dtls12 -f '^TLS_PSK_WITH_AES_..._CCM_8' - msg "build: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO + DEBUG" + msg "build: configs/config-ccm-psk-dtls1_2.h + DEBUG" MBEDTLS_TEST_CONFIGURATION="$MBEDTLS_TEST_CONFIGURATION+DEBUG" make clean scripts/config.py set MBEDTLS_DEBUG_C scripts/config.py set MBEDTLS_ERROR_C make ssl-opt - msg "test: configs/config-ccm-psk-dtls1_2.h + USE_PSA_CRYPTO + DEBUG - ssl-opt.sh" + msg "test: configs/config-ccm-psk-dtls1_2.h + DEBUG - ssl-opt.sh" tests/ssl-opt.sh }