config-tfm: disable CIPHER_C

We also add a check in "all.sh" components:
- component_test_tfm_config_p256m_driver_accel_ec
- component_test_tfm_config
to ensure that CIPHER_C was not re-enabled accidentally.

Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
Valerio Setti 2023-12-04 12:07:30 +01:00
parent 58d0206f39
commit 5e18b90c95
2 changed files with 13 additions and 0 deletions

View File

@ -45,6 +45,11 @@
#undef MBEDTLS_PLATFORM_STD_EXIT_SUCCESS #undef MBEDTLS_PLATFORM_STD_EXIT_SUCCESS
#undef MBEDTLS_PLATFORM_STD_EXIT_FAILURE #undef MBEDTLS_PLATFORM_STD_EXIT_FAILURE
/* CCM is the only cipher/AEAD enabled in TF-M configuration files, but it
* does not need CIPHER_C to be enabled, so we can disabled it in order
* to reduce code size further. */
#undef MBEDTLS_CIPHER_C
/* /*
* In order to get an example config that works cleanly out-of-the-box * In order to get an example config that works cleanly out-of-the-box
* for both baremetal and non-baremetal builds, we detect baremetal builds * for both baremetal and non-baremetal builds, we detect baremetal builds

View File

@ -3265,6 +3265,10 @@ component_test_tfm_config_p256m_driver_accel_ec () {
# Check that p256m was built # Check that p256m was built
grep -q p256_ecdsa_ library/libmbedcrypto.a grep -q p256_ecdsa_ library/libmbedcrypto.a
# In "config-tfm.h" we disabled CIPHER_C tweaking TF-M's configuration
# files, so we want to ensure that it has not be re-enabled accidentally.
not grep mbedtls_cipher library/cipher.o
# Run the tests # Run the tests
msg "test: TF-M config + p256m driver + accel ECDH(E)/ECDSA" msg "test: TF-M config + p256m driver + accel ECDH(E)/ECDSA"
make test make test
@ -3286,6 +3290,10 @@ component_test_tfm_config() {
# Check that p256m was not built # Check that p256m was not built
not grep p256_ecdsa_ library/libmbedcrypto.a not grep p256_ecdsa_ library/libmbedcrypto.a
# In "config-tfm.h" we disabled CIPHER_C tweaking TF-M's configuration
# files, so we want to ensure that it has not be re-enabled accidentally.
not grep mbedtls_cipher library/cipher.o
msg "test: TF-M config" msg "test: TF-M config"
make test make test
} }