From 454d10035a543df90c1736510249d5ecfe3e2e72 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:14:17 +0000 Subject: [PATCH 01/10] components-configuration-crypto: Migrated simple ASAN components. Migrate all straightfoward components from using $ASAN_CFLAGS to CMAKE_BUILD_TYPE:String=Asan Signed-off-by: Minos Galanakis --- .../components-configuration-crypto.sh | 44 ++++++++++++------- 1 file changed, 27 insertions(+), 17 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 6ac6d17c6fff..c2ade912cd17 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -47,7 +47,9 @@ component_test_crypto_with_static_key_slots() { scripts/config.py unset MBEDTLS_PSA_KEY_STORE_DYNAMIC msg "test: crypto full + MBEDTLS_PSA_STATIC_KEY_SLOTS" - $MAKE_COMMAND CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" test + cmake -D CMAKE_BUILD_TYPE:String=Asan . + make + make test } # check_renamed_symbols HEADER LIB @@ -241,10 +243,11 @@ component_test_psa_external_rng_no_drbg_use_psa () { scripts/config.py unset MBEDTLS_CTR_DRBG_C scripts/config.py unset MBEDTLS_HMAC_DRBG_C scripts/config.py unset PSA_WANT_ALG_DETERMINISTIC_ECDSA # Requires HMAC_DRBG - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - main suites" - $MAKE_COMMAND test + make test msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - ssl-opt.sh (subset)" tests/ssl-opt.sh -f 'Default\|opaque' @@ -257,10 +260,11 @@ component_test_psa_external_rng_use_psa_crypto () { scripts/config.py unset MBEDTLS_CTR_DRBG_C scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG/NV_SEED" - $MAKE_COMMAND test + make test msg "test: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG/NV_SEED" tests/ssl-opt.sh -f 'Default\|opaque' @@ -273,14 +277,15 @@ component_full_no_pkparse_pkwrite () { scripts/config.py unset MBEDTLS_PK_PARSE_C scripts/config.py unset MBEDTLS_PK_WRITE_C - $MAKE_COMMAND CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . # Ensure that PK_[PARSE|WRITE]_C were not re-enabled accidentally (additive config). not grep mbedtls_pk_parse_key ${BUILTIN_SRC_PATH}/pkparse.o not grep mbedtls_pk_write_key_der ${BUILTIN_SRC_PATH}/pkwrite.o msg "test: full without pkparse and pkwrite" - $MAKE_COMMAND test + make test } component_test_crypto_full_md_light_only () { @@ -443,10 +448,11 @@ component_test_everest_curve25519_only () { scripts/config.py unset-all "PSA_WANT_ECC_[0-9A-Z_a-z]*$" scripts/config.py set PSA_WANT_ECC_MONTGOMERY_255 - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: Everest ECDH context, only Curve25519" # ~ 50s - $MAKE_COMMAND test + make test } component_test_psa_collect_statuses () { @@ -542,10 +548,11 @@ component_test_psa_crypto_config_ffdh_2048_only () { scripts/config.py unset PSA_WANT_DH_RFC7919_6144 scripts/config.py unset PSA_WANT_DH_RFC7919_8192 - $MAKE_COMMAND CFLAGS="$ASAN_CFLAGS -Werror" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: full config - only DH 2048" - $MAKE_COMMAND test + make test msg "ssl-opt: full config - only DH 2048" tests/ssl-opt.sh -f "ffdh" @@ -1340,10 +1347,11 @@ build_and_test_psa_want_key_pair_partial () { # crypto_config.h so we just disable the one we don't want. scripts/config.py unset "$disabled_psa_want" - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: $base_config - ${disabled_psa_want}" - $MAKE_COMMAND test + make test } component_test_psa_ecc_key_pair_no_derive () { @@ -1868,10 +1876,11 @@ component_test_aead_chachapoly_disabled () { msg "build: full minus CHACHAPOLY" scripts/config.py full scripts/config.py unset PSA_WANT_ALG_CHACHA20_POLY1305 - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: full minus CHACHAPOLY" - $MAKE_COMMAND test + make test } component_test_aead_only_ccm () { @@ -1879,10 +1888,11 @@ component_test_aead_only_ccm () { scripts/config.py full scripts/config.py unset PSA_WANT_ALG_CHACHA20_POLY1305 scripts/config.py unset PSA_WANT_ALG_GCM - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . msg "test: full minus CHACHAPOLY and GCM" - $MAKE_COMMAND test + make test } component_test_ccm_aes_sha256 () { From 166e8dae506dc8321ec9b35f5b751a9096f97851 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:18:17 +0000 Subject: [PATCH 02/10] components-configuration-crypto: Migrated test_full_static_keystore to cmake Optimization for size (-Os) is required. Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index c2ade912cd17..7acca44e00e4 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -2352,10 +2352,10 @@ component_test_full_static_keystore () { msg "build: full config - MBEDTLS_PSA_KEY_STORE_DYNAMIC" scripts/config.py full scripts/config.py unset MBEDTLS_PSA_KEY_STORE_DYNAMIC - $MAKE_COMMAND CC=clang CFLAGS="$ASAN_CFLAGS -Os" LDFLAGS="$ASAN_CFLAGS" - + CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -Os" LDFLAGS="$ASAN_CFLAGS" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . msg "test: full config - MBEDTLS_PSA_KEY_STORE_DYNAMIC" - $MAKE_COMMAND test + make test } component_test_psa_crypto_drivers () { From dfca097e4396ab54f4fa31d7822b18e1baf69974 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:25:16 +0000 Subject: [PATCH 03/10] components-configuration-crypto: Migrated test_tfm_config_p256m_driver_accel_ec to cmake Compilation flags, and spe include directories have been adjusted Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 7acca44e00e4..2b35078d7751 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -1280,7 +1280,8 @@ component_test_tfm_config_p256m_driver_accel_ec () { common_tfm_config # Build crypto library - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -I../framework/tests/include/spe" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -I$PWD/framework/tests/include/spe" cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake --build . # Make sure any built-in EC alg was not re-enabled by accident (additive config) not grep mbedtls_ecdsa_ ${BUILTIN_SRC_PATH}/ecdsa.o @@ -1299,7 +1300,7 @@ component_test_tfm_config_p256m_driver_accel_ec () { # Run the tests msg "test: TF-M config + p256m driver + accel ECDH(E)/ECDSA" - $MAKE_COMMAND test + make test } # Keep this in sync with component_test_tfm_config_p256m_driver_accel_ec() as From a10daf887d4d0ced80d2739a06d8638ec55aebdd Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:33:31 +0000 Subject: [PATCH 04/10] components-configuration-crypto: Migrated straightforwad Release components to cmake - By default all unspecified build-type components should be release - CMAKE_BUILD_TYPE:String=Release enables the following CFLAGS: "-O2 -Werror -Wall -Wextra" Signed-off-by: Minos Galanakis --- .../components-configuration-crypto.sh | 106 +++++++++++------- 1 file changed, 63 insertions(+), 43 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 2b35078d7751..9c1daf4cfb03 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -146,10 +146,11 @@ component_test_psa_crypto_without_heap() { component_test_no_rsa_key_pair_generation () { msg "build: default config minus PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" scripts/config.py unset PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: default config minus PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" - $MAKE_COMMAND test + make test } component_test_no_pem_no_fs () { @@ -338,13 +339,13 @@ component_test_full_no_cipher () { # The following modules directly depends on CIPHER_C scripts/config.py unset MBEDTLS_NIST_KW_C - $MAKE_COMMAND - + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . # Ensure that CIPHER_C was not re-enabled not grep mbedtls_cipher_init ${BUILTIN_SRC_PATH}/cipher.o msg "test: full no CIPHER" - $MAKE_COMMAND test + make test } component_test_full_no_ccm () { @@ -363,10 +364,11 @@ component_test_full_no_ccm () { # PSA_WANT_ALG_CCM to be re-enabled. scripts/config.py unset PSA_WANT_ALG_CCM - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full no PSA_WANT_ALG_CCM" - $MAKE_COMMAND test + make test } component_test_full_no_ccm_star_no_tag () { @@ -394,13 +396,14 @@ component_test_full_no_ccm_star_no_tag () { scripts/config.py unset PSA_WANT_ALG_CBC_NO_PADDING scripts/config.py unset PSA_WANT_ALG_CBC_PKCS7 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . # Ensure MBEDTLS_PSA_BUILTIN_CIPHER was not enabled not grep mbedtls_psa_cipher ${PSA_CORE_PATH}/psa_crypto_cipher.o msg "test: full no PSA_WANT_ALG_CCM_STAR_NO_TAG" - $MAKE_COMMAND test + make test } component_test_config_symmetric_only () { @@ -957,10 +960,11 @@ component_test_psa_crypto_config_reference_ecc_ecp_light_only () { config_psa_crypto_config_ecp_light_only 0 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test suites: full with non-accelerated EC algs" - $MAKE_COMMAND test + make test msg "ssl-opt: full with non-accelerated EC algs" tests/ssl-opt.sh @@ -1055,10 +1059,11 @@ component_test_psa_crypto_config_reference_ecc_no_ecp_at_all () { config_psa_crypto_no_ecp_at_all 0 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full + non accelerated EC algs" - $MAKE_COMMAND test + make test msg "ssl-opt: full + non accelerated EC algs" tests/ssl-opt.sh @@ -1221,10 +1226,11 @@ common_test_psa_crypto_config_reference_ecc_ffdh_no_bignum () { config_psa_crypto_config_accel_ecc_ffdh_no_bignum 0 "$test_target" - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test suites: full + non accelerated EC algs + USE_PSA" - $MAKE_COMMAND test + make test msg "ssl-opt: full + non accelerated $accel_text algs + USE_PSA" tests/ssl-opt.sh @@ -1426,12 +1432,13 @@ component_test_psa_crypto_config_reference_rsa_crypto () { # Build # ----- - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . # Run the tests # ------------- msg "test: crypto_full with non-accelerated RSA" - $MAKE_COMMAND test + make test } # This is a temporary test to verify that full RSA support is present even when @@ -1461,10 +1468,11 @@ component_test_new_psa_want_key_pair_symbol () { scripts/config.py unset PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_EXPORT scripts/config.py unset PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "Test: crypto config - PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC" - $MAKE_COMMAND test + make test # Parse only 1 relevant line from the outcome file, i.e. a test which is # performing RSA signature. @@ -1580,10 +1588,11 @@ component_test_psa_crypto_config_reference_hash_use_psa () { config_psa_crypto_hash_use_psa 0 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full without accelerated hashes" - $MAKE_COMMAND test + make test msg "test: ssl-opt.sh, full without accelerated hashes" tests/ssl-opt.sh @@ -1649,10 +1658,11 @@ component_test_psa_crypto_config_reference_hmac () { config_psa_crypto_hmac_use_psa 0 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full without accelerated hmac" - $MAKE_COMMAND test + make test } component_test_psa_crypto_config_accel_aead () { @@ -1753,10 +1763,11 @@ component_test_psa_crypto_config_reference_cipher_aead_cmac () { msg "build: full config with non-accelerated cipher inc. AEAD and CMAC" common_psa_crypto_config_accel_cipher_aead_cmac - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full config with non-accelerated cipher inc. AEAD and CMAC" - $MAKE_COMMAND test + make test msg "ssl-opt: full config with non-accelerated cipher inc. AEAD and CMAC" # Exclude password-protected key tests as in test_psa_crypto_config_accel_cipher_aead_cmac. @@ -1867,10 +1878,11 @@ component_test_full_block_cipher_legacy_dispatch () { common_block_cipher_dispatch 0 - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: full + legacy dispatch in block_cipher" - $MAKE_COMMAND test + make test } component_test_aead_chachapoly_disabled () { @@ -1903,9 +1915,10 @@ component_test_ccm_aes_sha256 () { echo '#define MBEDTLS_CONFIG_H ' >"$CONFIG_H" cp tf-psa-crypto/configs/crypto-config-ccm-aes-sha256.h "$CRYPTO_CONFIG_H" - $MAKE_COMMAND + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: CCM + AES + SHA256 configuration" - $MAKE_COMMAND test + make test } # Test that the given .o file builds with all (valid) combinations of the given options. @@ -2093,10 +2106,11 @@ component_test_aes_only_128_bit_keys () { scripts/config.py set MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH scripts/config.py set MBEDTLS_PSA_CRYPTO_RNG_STRENGTH 128 - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH" - $MAKE_COMMAND test + make test } component_test_no_ctr_drbg_aes_only_128_bit_keys () { @@ -2105,10 +2119,11 @@ component_test_no_ctr_drbg_aes_only_128_bit_keys () { scripts/config.py set MBEDTLS_PSA_CRYPTO_RNG_STRENGTH 128 scripts/config.py unset MBEDTLS_CTR_DRBG_C - $MAKE_COMMAND CC=clang CFLAGS='-Werror -Wall -Wextra' + CC=clang cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - CTR_DRBG_C" - $MAKE_COMMAND test + make test } component_test_aes_only_128_bit_keys_have_builtins () { @@ -2118,10 +2133,11 @@ component_test_aes_only_128_bit_keys_have_builtins () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_AESCE_C - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" - $MAKE_COMMAND test + make test msg "selftest: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" programs/test/selftest @@ -2133,38 +2149,42 @@ component_test_gcm_largetable () { scripts/config.py unset MBEDTLS_AESNI_C scripts/config.py unset MBEDTLS_AESCE_C - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: default config - GCM_LARGE_TABLE - AESNI_C - AESCE_C" - $MAKE_COMMAND test + make test } component_test_aes_fewer_tables () { msg "build: default config with AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: AES_FEWER_TABLES" - $MAKE_COMMAND test + make test } component_test_aes_rom_tables () { msg "build: default config with AES_ROM_TABLES enabled" scripts/config.py set MBEDTLS_AES_ROM_TABLES - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: AES_ROM_TABLES" - $MAKE_COMMAND test + make test } component_test_aes_fewer_tables_and_rom_tables () { msg "build: default config with AES_ROM_TABLES and AES_FEWER_TABLES enabled" scripts/config.py set MBEDTLS_AES_FEWER_TABLES scripts/config.py set MBEDTLS_AES_ROM_TABLES - $MAKE_COMMAND CFLAGS='-O2 -Werror -Wall -Wextra' + cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . msg "test: AES_FEWER_TABLES + AES_ROM_TABLES" - $MAKE_COMMAND test + make test } # helper for component_test_block_cipher_no_decrypt_aesni() which: From 5b58ee60d3993a29d505adade02ec49d05e8901c Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:42:17 +0000 Subject: [PATCH 05/10] components-configuration-crypto: Migrated include dir dependant Release components to cmake Moved the following components to CMAKE_BUILD_TYPE:String=Release and adjusted the include paths for cmake: * component_build_psa_crypto_spm * component_test_tfm_config_no_p256m Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 9c1daf4cfb03..dadbded5dd2f 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -69,8 +69,9 @@ component_build_psa_crypto_spm () { # We can only compile, not link, since our test and sample programs # aren't equipped for the modified names used when MBEDTLS_PSA_CRYPTO_SPM # is active. - $MAKE_COMMAND CC=gcc CFLAGS='-Werror -Wall -Wextra -I../framework/tests/include/spe' lib + CFLAGS="-I$PWD/framework/tests/include/spe" cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . --target lib # Check that if a symbol is renamed by crypto_spe.h, the non-renamed # version is not present. echo "Checking for renamed symbols in the library" @@ -1320,8 +1321,8 @@ component_test_tfm_config_no_p256m () { scripts/config.py -f "$CRYPTO_CONFIG_H" unset MBEDTLS_PSA_P256M_DRIVER_ENABLED msg "build: TF-M config without p256m" - $MAKE_COMMAND CFLAGS='-Werror -Wall -Wextra -I../framework/tests/include/spe' tests - + CFLAGS="-I$PWD/framework/tests/include/spe" cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . # Check that p256m was not built not grep p256_ecdsa_ library/libmbedcrypto.a @@ -1330,7 +1331,7 @@ component_test_tfm_config_no_p256m () { not grep mbedtls_cipher ${BUILTIN_SRC_PATH}/cipher.o msg "test: TF-M config without p256m" - $MAKE_COMMAND test + make test } # This is an helper used by: From 42c9f33b116241c7a8a882b94eaddca3b84d2e1a Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:46:54 +0000 Subject: [PATCH 06/10] component-configuration-crypto: Migrated component_test_crypto_full_md_light_only to cmake Use compilation directory for object discovery in out-of-source CMake builds. Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index dadbded5dd2f..5d6b28530f3f 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -305,16 +305,23 @@ component_test_crypto_full_md_light_only () { # Disable things that would auto-enable MD_C scripts/config.py unset MBEDTLS_PKCS5_C + # Note: Creating a directory, ensures cmake will not use a random name to + # place the compilation object files. + mkdir mdtest && cd mdtest + MD_OBJECT_PATH="tf-psa-crypto/drivers/builtin/CMakeFiles/builtin.dir/src" + # Note: MD-light is auto-enabled in build_info.h by modules that need it, # which we haven't disabled, so no need to explicitly enable it. - $MAKE_COMMAND CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS" LDFLAGS="$ASAN_CFLAGS" + CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan ../ + cmake --build . # Make sure we don't have the HMAC functions, but the hashing functions - not grep mbedtls_md_hmac ${BUILTIN_SRC_PATH}/md.o - grep mbedtls_md ${BUILTIN_SRC_PATH}/md.o + not grep mbedtls_md_hmac ${MD_OBJECT_PATH}/md.c.o + grep mbedtls_md ${MD_OBJECT_PATH}/md.c.o msg "test: crypto_full with only the light subset of MD" - $MAKE_COMMAND test + make test + cd .. && rm -r mdtest } component_test_full_no_cipher () { From f3e7ca61df2491a2a723f646b7ac817b41831e2f Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 11:56:31 +0000 Subject: [PATCH 07/10] components-configuration-crypto: Migrated components to cmakes' CMAKE_BUILD_TYPE:String=None Improve compilation flag granularity by disabling CMAKE_BUILD_TYPE defaults and asserting test-specific flags manually. Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 5d6b28530f3f..8b5ecdfec188 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -507,14 +507,18 @@ component_test_crypto_for_psa_service () { scripts/config.py unset MBEDTLS_PK_C scripts/config.py unset MBEDTLS_PK_PARSE_C scripts/config.py unset MBEDTLS_PK_WRITE_C - $MAKE_COMMAND CFLAGS='-O1 -Werror' all test + CFLAGS="-O1" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . + make test are_empty_libraries library/libmbedx509.* library/libmbedtls.* } component_build_crypto_baremetal () { msg "build: make, crypto only, baremetal config" scripts/config.py crypto_baremetal - $MAKE_COMMAND CFLAGS="-O1 -Werror -I$PWD/framework/tests/include/baremetal-override/" + CFLAGS="-O1 -I$PWD/framework/tests/include/baremetal-override/" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . + make test are_empty_libraries library/libmbedx509.* library/libmbedtls.* } @@ -2230,8 +2234,10 @@ helper_block_cipher_no_decrypt_build_test () { [ -n "$unset_opts" ] && echo "Disabling: $unset_opts" && scripts/config.py unset-all $unset_opts msg "build: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" - $MAKE_COMMAND clean - $MAKE_COMMAND CFLAGS="-O2 $cflags" LDFLAGS="$ldflags" + + make -f ./scripts/legacy.make clean + CFLAGS="-O2 $cflags" LDFLAGS="$ldflags" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . # Make sure we don't have mbedtls_xxx_setkey_dec in AES/ARIA/CAMELLIA not grep mbedtls_aes_setkey_dec ${BUILTIN_SRC_PATH}/aes.o @@ -2243,7 +2249,7 @@ helper_block_cipher_no_decrypt_build_test () { not grep mbedtls_aesni_inverse_key ${BUILTIN_SRC_PATH}/aesni.o msg "test: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" - $MAKE_COMMAND test + make test msg "selftest: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" programs/test/selftest From a878ad0008cd873edd53893954380c80d96bc398 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 14:53:37 +0000 Subject: [PATCH 08/10] components-configuration-crypto: Migrated test_sha3_variations to cmake Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 8b5ecdfec188..204a76066146 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -2064,6 +2064,8 @@ END #define PSA_WANT_ALG_SHA3_384 1 #define PSA_WANT_ALG_SHA3_512 1 #define PSA_WANT_KEY_TYPE_AES 1 + #define PSA_WANT_ALG_GCM 1 + #define PSA_WANT_ALG_HKDF 1 #define MBEDTLS_PSA_CRYPTO_C #define MBEDTLS_CTR_DRBG_C #define MBEDTLS_PSA_BUILTIN_GET_ENTROPY @@ -2071,13 +2073,14 @@ END END msg "all loops unrolled" - $MAKE_COMMAND clean - make -C tests ../tf-psa-crypto/tests/test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" + CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=1 -DMBEDTLS_SHA3_PI_UNROLL=1 -DMBEDTLS_SHA3_CHI_UNROLL=1 -DMBEDTLS_SHA3_RHO_UNROLL=1" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . ./tf-psa-crypto/tests/test_suite_shax msg "all loops rolled up" - $MAKE_COMMAND clean - make -C tests ../tf-psa-crypto/tests/test_suite_shax CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=0 -DMBEDTLS_SHA3_PI_UNROLL=0 -DMBEDTLS_SHA3_CHI_UNROLL=0 -DMBEDTLS_SHA3_RHO_UNROLL=0" + cmake --build . --target clean + CFLAGS="-DMBEDTLS_SHA3_THETA_UNROLL=0 -DMBEDTLS_SHA3_PI_UNROLL=0 -DMBEDTLS_SHA3_CHI_UNROLL=0 -DMBEDTLS_SHA3_RHO_UNROLL=0" cmake -D CMAKE_BUILD_TYPE:String=None . + cmake --build . ./tf-psa-crypto/tests/test_suite_shax } From a73b50bf4f32ce2420ff7d77504851846a68c7fe Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Mon, 1 Dec 2025 12:14:59 +0000 Subject: [PATCH 09/10] component-configuration-crypto: Migrated build_psa_alt_headers The original make -C tests, contains a perl inliner to generate the alt-headers. Replicated that logic in sed regex. Signed-off-by: Minos Galanakis --- tests/scripts/components-configuration-crypto.sh | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 204a76066146..15a1bfa3eb2e 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -2441,15 +2441,21 @@ component_build_psa_config_file () { component_build_psa_alt_headers () { msg "build: make with PSA alt headers" # ~20s + PSA_ALT_HDRS="$PWD/framework/tests/include/alt-extra" # Generate alternative versions of the substitutable headers with the # same content except different include guards. - make -C tests ../framework/tests/include/alt-extra/psa/crypto_platform_alt.h ../framework/tests/include/alt-extra/psa/crypto_struct_alt.h + sed -E 's/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \ + tf-psa-crypto/include/psa/crypto_platform.h \ + > $PSA_ALT_HDRS/psa/crypto_platform_alt.h + + sed -E 's/^(# *(define|ifndef) +[A-Za-z0-9_]+)_H\b/\1_ALT_H/' \ + tf-psa-crypto/include/psa/crypto_struct.h \ + > $PSA_ALT_HDRS/psa/crypto_struct_alt.h # Build the library and some programs. - # Don't build the fuzzers to avoid having to go through hoops to set - # a correct include path for programs/fuzz/Makefile. - $MAKE_COMMAND CFLAGS="-I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'" lib - make -C programs -o fuzz CFLAGS="-I ../framework/tests/include/alt-extra -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'" + CFLAGS="-I$PSA_ALT_HDRS -DMBEDTLS_PSA_CRYPTO_PLATFORM_FILE='\"psa/crypto_platform_alt.h\"' -DMBEDTLS_PSA_CRYPTO_STRUCT_FILE='\"psa/crypto_struct_alt.h\"'" cmake -D CMAKE_BUILD_TYPE:String=Release . + cmake --build . --target lib + cmake --build . --target programs # Check that we're getting the alternative include guards and not the # original include guards. From 61f5ab10ae5b81882a85a64910d8c604cd4c3f89 Mon Sep 17 00:00:00 2001 From: Minos Galanakis Date: Tue, 2 Dec 2025 11:42:40 +0000 Subject: [PATCH 10/10] component-configuration-crypto: Added consistent cmake commands. Update the previously modified component to use consistent syntax: * make -> cmake --build . * make test -> ctest * Removed redudant CC=$ASAN_CC for BUILD_TYPE:String=Asan Signed-off-by: Minos Galanakis --- .../components-configuration-crypto.sh | 98 +++++++++---------- 1 file changed, 49 insertions(+), 49 deletions(-) diff --git a/tests/scripts/components-configuration-crypto.sh b/tests/scripts/components-configuration-crypto.sh index 15a1bfa3eb2e..a9f43683f11d 100644 --- a/tests/scripts/components-configuration-crypto.sh +++ b/tests/scripts/components-configuration-crypto.sh @@ -48,8 +48,8 @@ component_test_crypto_with_static_key_slots() { msg "test: crypto full + MBEDTLS_PSA_STATIC_KEY_SLOTS" cmake -D CMAKE_BUILD_TYPE:String=Asan . - make - make test + cmake --build . + ctest } # check_renamed_symbols HEADER LIB @@ -151,7 +151,7 @@ component_test_no_rsa_key_pair_generation () { cmake --build . msg "test: default config minus PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_GENERATE" - make test + ctest } component_test_no_pem_no_fs () { @@ -245,11 +245,11 @@ component_test_psa_external_rng_no_drbg_use_psa () { scripts/config.py unset MBEDTLS_CTR_DRBG_C scripts/config.py unset MBEDTLS_HMAC_DRBG_C scripts/config.py unset PSA_WANT_ALG_DETERMINISTIC_ECDSA # Requires HMAC_DRBG - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - main suites" - make test + ctest msg "test: PSA_CRYPTO_EXTERNAL_RNG minus *_DRBG, PSA crypto - ssl-opt.sh (subset)" tests/ssl-opt.sh -f 'Default\|opaque' @@ -262,11 +262,11 @@ component_test_psa_external_rng_use_psa_crypto () { scripts/config.py unset MBEDTLS_CTR_DRBG_C scripts/config.py unset MBEDTLS_ENTROPY_NV_SEED scripts/config.py unset MBEDTLS_PLATFORM_NV_SEED_ALT - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG/NV_SEED" - make test + ctest msg "test: full + PSA_CRYPTO_EXTERNAL_RNG + USE_PSA_CRYPTO minus CTR_DRBG/NV_SEED" tests/ssl-opt.sh -f 'Default\|opaque' @@ -279,7 +279,7 @@ component_full_no_pkparse_pkwrite () { scripts/config.py unset MBEDTLS_PK_PARSE_C scripts/config.py unset MBEDTLS_PK_WRITE_C - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . # Ensure that PK_[PARSE|WRITE]_C were not re-enabled accidentally (additive config). @@ -287,7 +287,7 @@ component_full_no_pkparse_pkwrite () { not grep mbedtls_pk_write_key_der ${BUILTIN_SRC_PATH}/pkwrite.o msg "test: full without pkparse and pkwrite" - make test + ctest } component_test_crypto_full_md_light_only () { @@ -312,7 +312,7 @@ component_test_crypto_full_md_light_only () { # Note: MD-light is auto-enabled in build_info.h by modules that need it, # which we haven't disabled, so no need to explicitly enable it. - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan ../ + cmake -D CMAKE_BUILD_TYPE:String=Asan ../ cmake --build . # Make sure we don't have the HMAC functions, but the hashing functions @@ -320,7 +320,7 @@ component_test_crypto_full_md_light_only () { grep mbedtls_md ${MD_OBJECT_PATH}/md.c.o msg "test: crypto_full with only the light subset of MD" - make test + ctest cd .. && rm -r mdtest } @@ -353,7 +353,7 @@ component_test_full_no_cipher () { not grep mbedtls_cipher_init ${BUILTIN_SRC_PATH}/cipher.o msg "test: full no CIPHER" - make test + ctest } component_test_full_no_ccm () { @@ -376,7 +376,7 @@ component_test_full_no_ccm () { cmake --build . msg "test: full no PSA_WANT_ALG_CCM" - make test + ctest } component_test_full_no_ccm_star_no_tag () { @@ -411,7 +411,7 @@ component_test_full_no_ccm_star_no_tag () { not grep mbedtls_psa_cipher ${PSA_CORE_PATH}/psa_crypto_cipher.o msg "test: full no PSA_WANT_ALG_CCM_STAR_NO_TAG" - make test + ctest } component_test_config_symmetric_only () { @@ -459,11 +459,11 @@ component_test_everest_curve25519_only () { scripts/config.py unset-all "PSA_WANT_ECC_[0-9A-Z_a-z]*$" scripts/config.py set PSA_WANT_ECC_MONTGOMERY_255 - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: Everest ECDH context, only Curve25519" # ~ 50s - make test + ctest } component_test_psa_collect_statuses () { @@ -509,7 +509,7 @@ component_test_crypto_for_psa_service () { scripts/config.py unset MBEDTLS_PK_WRITE_C CFLAGS="-O1" cmake -D CMAKE_BUILD_TYPE:String=None . cmake --build . - make test + ctest are_empty_libraries library/libmbedx509.* library/libmbedtls.* } @@ -518,7 +518,7 @@ component_build_crypto_baremetal () { scripts/config.py crypto_baremetal CFLAGS="-O1 -I$PWD/framework/tests/include/baremetal-override/" cmake -D CMAKE_BUILD_TYPE:String=None . cmake --build . - make test + ctest are_empty_libraries library/libmbedx509.* library/libmbedtls.* } @@ -563,11 +563,11 @@ component_test_psa_crypto_config_ffdh_2048_only () { scripts/config.py unset PSA_WANT_DH_RFC7919_6144 scripts/config.py unset PSA_WANT_DH_RFC7919_8192 - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: full config - only DH 2048" - make test + ctest msg "ssl-opt: full config - only DH 2048" tests/ssl-opt.sh -f "ffdh" @@ -976,7 +976,7 @@ component_test_psa_crypto_config_reference_ecc_ecp_light_only () { cmake --build . msg "test suites: full with non-accelerated EC algs" - make test + ctest msg "ssl-opt: full with non-accelerated EC algs" tests/ssl-opt.sh @@ -1075,7 +1075,7 @@ component_test_psa_crypto_config_reference_ecc_no_ecp_at_all () { cmake --build . msg "test: full + non accelerated EC algs" - make test + ctest msg "ssl-opt: full + non accelerated EC algs" tests/ssl-opt.sh @@ -1242,7 +1242,7 @@ common_test_psa_crypto_config_reference_ecc_ffdh_no_bignum () { cmake --build . msg "test suites: full + non accelerated EC algs + USE_PSA" - make test + ctest msg "ssl-opt: full + non accelerated $accel_text algs + USE_PSA" tests/ssl-opt.sh @@ -1298,7 +1298,7 @@ component_test_tfm_config_p256m_driver_accel_ec () { common_tfm_config # Build crypto library - CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -I$PWD/framework/tests/include/spe" cmake -D CMAKE_BUILD_TYPE:String=Asan . + CFLAGS="$ASAN_CFLAGS -I$PWD/framework/tests/include/spe" cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . # Make sure any built-in EC alg was not re-enabled by accident (additive config) @@ -1318,7 +1318,7 @@ component_test_tfm_config_p256m_driver_accel_ec () { # Run the tests msg "test: TF-M config + p256m driver + accel ECDH(E)/ECDSA" - make test + ctest } # Keep this in sync with component_test_tfm_config_p256m_driver_accel_ec() as @@ -1342,7 +1342,7 @@ component_test_tfm_config_no_p256m () { not grep mbedtls_cipher ${BUILTIN_SRC_PATH}/cipher.o msg "test: TF-M config without p256m" - make test + ctest } # This is an helper used by: @@ -1366,11 +1366,11 @@ build_and_test_psa_want_key_pair_partial () { # crypto_config.h so we just disable the one we don't want. scripts/config.py unset "$disabled_psa_want" - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: $base_config - ${disabled_psa_want}" - make test + ctest } component_test_psa_ecc_key_pair_no_derive () { @@ -1450,7 +1450,7 @@ component_test_psa_crypto_config_reference_rsa_crypto () { # Run the tests # ------------- msg "test: crypto_full with non-accelerated RSA" - make test + ctest } # This is a temporary test to verify that full RSA support is present even when @@ -1484,7 +1484,7 @@ component_test_new_psa_want_key_pair_symbol () { cmake --build . msg "Test: crypto config - PSA_WANT_KEY_TYPE_RSA_KEY_PAIR_BASIC" - make test + ctest # Parse only 1 relevant line from the outcome file, i.e. a test which is # performing RSA signature. @@ -1604,7 +1604,7 @@ component_test_psa_crypto_config_reference_hash_use_psa () { cmake --build . msg "test: full without accelerated hashes" - make test + ctest msg "test: ssl-opt.sh, full without accelerated hashes" tests/ssl-opt.sh @@ -1674,7 +1674,7 @@ component_test_psa_crypto_config_reference_hmac () { cmake --build . msg "test: full without accelerated hmac" - make test + ctest } component_test_psa_crypto_config_accel_aead () { @@ -1779,7 +1779,7 @@ component_test_psa_crypto_config_reference_cipher_aead_cmac () { cmake --build . msg "test: full config with non-accelerated cipher inc. AEAD and CMAC" - make test + ctest msg "ssl-opt: full config with non-accelerated cipher inc. AEAD and CMAC" # Exclude password-protected key tests as in test_psa_crypto_config_accel_cipher_aead_cmac. @@ -1894,18 +1894,18 @@ component_test_full_block_cipher_legacy_dispatch () { cmake --build . msg "test: full + legacy dispatch in block_cipher" - make test + ctest } component_test_aead_chachapoly_disabled () { msg "build: full minus CHACHAPOLY" scripts/config.py full scripts/config.py unset PSA_WANT_ALG_CHACHA20_POLY1305 - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: full minus CHACHAPOLY" - make test + ctest } component_test_aead_only_ccm () { @@ -1913,11 +1913,11 @@ component_test_aead_only_ccm () { scripts/config.py full scripts/config.py unset PSA_WANT_ALG_CHACHA20_POLY1305 scripts/config.py unset PSA_WANT_ALG_GCM - CC=$ASAN_CC cmake -D CMAKE_BUILD_TYPE:String=Asan . + cmake -D CMAKE_BUILD_TYPE:String=Asan . cmake --build . msg "test: full minus CHACHAPOLY and GCM" - make test + ctest } component_test_ccm_aes_sha256 () { @@ -1930,7 +1930,7 @@ component_test_ccm_aes_sha256 () { cmake -D CMAKE_BUILD_TYPE:String=Release . cmake --build . msg "test: CCM + AES + SHA256 configuration" - make test + ctest } # Test that the given .o file builds with all (valid) combinations of the given options. @@ -2125,7 +2125,7 @@ component_test_aes_only_128_bit_keys () { cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH" - make test + ctest } component_test_no_ctr_drbg_aes_only_128_bit_keys () { @@ -2138,7 +2138,7 @@ component_test_no_ctr_drbg_aes_only_128_bit_keys () { cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - CTR_DRBG_C" - make test + ctest } component_test_aes_only_128_bit_keys_have_builtins () { @@ -2152,7 +2152,7 @@ component_test_aes_only_128_bit_keys_have_builtins () { cmake --build . msg "test: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" - make test + ctest msg "selftest: default config + AES_ONLY_128_BIT_KEY_LENGTH - AESNI_C - AESCE_C" programs/test/selftest @@ -2168,7 +2168,7 @@ component_test_gcm_largetable () { cmake --build . msg "test: default config - GCM_LARGE_TABLE - AESNI_C - AESCE_C" - make test + ctest } component_test_aes_fewer_tables () { @@ -2178,7 +2178,7 @@ component_test_aes_fewer_tables () { cmake --build . msg "test: AES_FEWER_TABLES" - make test + ctest } component_test_aes_rom_tables () { @@ -2188,7 +2188,7 @@ component_test_aes_rom_tables () { cmake --build . msg "test: AES_ROM_TABLES" - make test + ctest } component_test_aes_fewer_tables_and_rom_tables () { @@ -2199,7 +2199,7 @@ component_test_aes_fewer_tables_and_rom_tables () { cmake --build . msg "test: AES_FEWER_TABLES + AES_ROM_TABLES" - make test + ctest } # helper for component_test_block_cipher_no_decrypt_aesni() which: @@ -2252,7 +2252,7 @@ helper_block_cipher_no_decrypt_build_test () { not grep mbedtls_aesni_inverse_key ${BUILTIN_SRC_PATH}/aesni.o msg "test: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" - make test + ctest msg "selftest: default config + BLOCK_CIPHER_NO_DECRYPT${set_opts:+ + $set_opts}${unset_opts:+ - $unset_opts} with $cflags${ldflags:+, $ldflags}" programs/test/selftest @@ -2390,10 +2390,10 @@ component_test_full_static_keystore () { msg "build: full config - MBEDTLS_PSA_KEY_STORE_DYNAMIC" scripts/config.py full scripts/config.py unset MBEDTLS_PSA_KEY_STORE_DYNAMIC - CC=$ASAN_CC CFLAGS="$ASAN_CFLAGS -Os" LDFLAGS="$ASAN_CFLAGS" cmake -D CMAKE_BUILD_TYPE:String=None . + CFLAGS="$ASAN_CFLAGS -Os" LDFLAGS="$ASAN_CFLAGS" cmake -D CMAKE_BUILD_TYPE:String=None . cmake --build . msg "test: full config - MBEDTLS_PSA_KEY_STORE_DYNAMIC" - make test + ctest } component_test_psa_crypto_drivers () {