From 186331875a8cc2a784176ec4573446152b4f7420 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 12 Apr 2022 15:58:03 +0200 Subject: [PATCH] test_psa_crypto_config_accel_cipher: deactivate CMAC We don't yet support all combinations of configurations. With all.sh as it currently stands, component_test_psa_crypto_config_accel_cipher results in a build where PSA_WANT_ALG_CMAC is disabled but CMAC operations succeed nonetheless, going via the driver. With the systematic testing of not-supported operations, this now results in a test failure. The code in all.sh does not respect the principle documented in df885c052c701b89c24ad5f305114f8f8b39d750: > The PSA_WANT_* macros have to be the same as the ones > used to build the Mbed TLS library the test driver > library is supposed to be linked to as the PSA_WANT_* > macros are used in the definition of structures and > macros that are shared by the PSA crypto core, > Mbed TLS drivers and the driver test library. Disable PSA_WANT_ALG_CMAC completely in this test component. This is not wrong and it makes the test component pass. Signed-off-by: Gilles Peskine --- tests/scripts/all.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/scripts/all.sh b/tests/scripts/all.sh index 7adc06ca2..1bde00340 100755 --- a/tests/scripts/all.sh +++ b/tests/scripts/all.sh @@ -1760,6 +1760,10 @@ component_test_psa_crypto_config_accel_hash () { component_test_psa_crypto_config_accel_cipher () { msg "test: MBEDTLS_PSA_CRYPTO_CONFIG with accelerated cipher" + # This test case focuses on cipher+AEAD. We don't yet support all + # combinations of configurations, so deactivate block-cipher-based MACs. + scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_CMAC + loc_accel_list="ALG_CBC_NO_PADDING ALG_CBC_PKCS7 ALG_CTR ALG_CFB ALG_OFB ALG_XTS KEY_TYPE_DES" loc_accel_flags=$( echo "$loc_accel_list" | sed 's/[^ ]* */-DLIBTESTDRIVER1_MBEDTLS_PSA_ACCEL_&/g' ) make -C tests libtestdriver1.a CFLAGS="$ASAN_CFLAGS $loc_accel_flags" LDFLAGS="$ASAN_CFLAGS" @@ -1774,7 +1778,6 @@ component_test_psa_crypto_config_accel_cipher () { # PSA configuration options. scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_STREAM_CIPHER scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_ECB_NO_PADDING - scripts/config.py -f include/psa/crypto_config.h unset PSA_WANT_ALG_CMAC scripts/config.py unset MBEDTLS_CIPHER_MODE_CBC scripts/config.py unset MBEDTLS_CIPHER_PADDING_PKCS7