From dd544e1463fd1f5daab3e02629eb739d88ccd469 Mon Sep 17 00:00:00 2001 From: John Durkop Date: Mon, 12 Oct 2020 21:47:19 -0700 Subject: [PATCH] Fixed comments and test message output for new PSA tests Provided a clearer comment for the description for ignoring MBEDTLS_PSA_CRYPTO_CONFIG for full build setting. Updated message output for test_psa_crypto_config_basic and test_psa_want_ecdsa_disabled_software so it is more clear and concise in what the test is doing. Removed inclusion of the MBEDTLS_PSA_ACCEL_ALG_ECDSA since it should not have been used for that particular tests. Signed-off-by: John Durkop --- scripts/config.py | 2 +- tests/scripts/all.sh | 18 +++++++----------- 2 files changed, 8 insertions(+), 12 deletions(-) diff --git a/scripts/config.py b/scripts/config.py index bb3fa1b4a..6c299818f 100755 --- a/scripts/config.py +++ b/scripts/config.py @@ -184,7 +184,7 @@ EXCLUDE_FROM_FULL = frozenset([ 'MBEDTLS_NO_UDBL_DIVISION', # influences anything that uses bignum 'MBEDTLS_PKCS11_C', # build dependency (libpkcs11-helper) 'MBEDTLS_PLATFORM_NO_STD_FUNCTIONS', # removes a feature - 'MBEDTLS_PSA_CRYPTO_CONFIG', # used to switch between old/new style config + 'MBEDTLS_PSA_CRYPTO_CONFIG', # toggles old/new style PSA config 'MBEDTLS_PSA_CRYPTO_SPM', # platform dependency (PSA SPM) 'MBEDTLS_PSA_INJECT_ENTROPY', # build dependency (hook functions) 'MBEDTLS_REMOVE_3DES_CIPHERSUITES', # removes a feature diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 814c87f58..fe50134cc 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -1291,10 +1291,8 @@ component_test_no_use_psa_crypto_full_cmake_asan() { } component_test_psa_crypto_config_basic() { - # full plus MBEDTLS_PSA_CRYPTO_CONFIG, MBEDTLS_PSA_CRYPTO_DRIVERS, - # and PSA_CRYPTO_DRIVER_TEST minus MBEDTLS_USE_PSA_CRYPTO - msg "build: full config plus MBEDTLS_PSA_CRYPTO_CONFIG MBEDTLS_PSA_CRYPTO_DRIVERS" - msg "build: minus MBEDTLS_USE_PSA_CRYPTO" + # full plus MBEDTLS_PSA_CRYPTO_CONFIG + msg "build: full + MBEDTLS_PSA_CRYPTO_CONFIG" scripts/config.py full scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS @@ -1306,12 +1304,10 @@ component_test_psa_crypto_config_basic() { make test } -component_test_psa_crypto_config_want_ecdsa() { - # full plus MBEDTLS_PSA_CRYPTO_CONFIG, MBEDTLS_PSA_CRYPTO_DRIVERS, - # and PSA_CRYPTO_DRIVER_TEST minus MBEDTLS_USE_PSA_CRYPTO - msg "build: full config plus MBEDTLS_PSA_CRYPTO_CONFIG, MBEDTLS_PSA_CRYPTO_DRIVERS," - msg "build: PSA_CRYPTO_DRIVER_TEST, MBEDTLS_PSA_ACCEL_ALG_ECDSA," - msg "build: PSA_WANT_ALG_ECDSA minus MBEDTLS_USE_PSA_CRYPTO" +component_test_psa_want_ecdsa_disabled_software() { + # full plus MBEDTLS_PSA_CRYPTO_CONFIG with PSA_WANT_ALG_ECDSA + # without MBEDTLS_ECDSA_C + msg "build: full + MBEDTLS_PSA_CRYPTO_CONFIG + PSA_WANT_ALG_ECDSA without MBEDTLS_ECDSA_C" scripts/config.py full scripts/config.py set MBEDTLS_PSA_CRYPTO_CONFIG scripts/config.py set MBEDTLS_PSA_CRYPTO_DRIVERS @@ -1320,7 +1316,7 @@ component_test_psa_crypto_config_want_ecdsa() { scripts/config.py -f include/psa/crypto_config.h set PSA_WANT_ALG_ECDSA scripts/config.py -f include/psa/crypto_config.h set PSA_WANT_ALG_ECDSA_DETERMINISTIC # Need to define the correct symbol and include the test driver header path in order to build with the test driver - make CC=gcc CFLAGS="$ASAN_CFLAGS -DMBEDTLS_PSA_ACCEL_ALG_ECDSA -DPSA_CRYPTO_DRIVER_TEST -I../tests/include -O2" LDFLAGS="$ASAN_CFLAGS" + make CC=gcc CFLAGS="$ASAN_CFLAGS -DPSA_CRYPTO_DRIVER_TEST -I../tests/include -O2" LDFLAGS="$ASAN_CFLAGS" msg "test: psa crypto config want ECDSA" make test