Skip to content

Commit ab3e35a

Browse files
committed
[nrf noup] tests: secure_storage: Fix build issues
Set CONFIG_TFM_PROFILE_TYPE_NOT_SET for boards with TF-M to enable ITS and PS. Enable also CONFIG_PSA_WANT_GENERATE_RANDOM. native_sim target needs CONFIG_PSA_WANT_ALG_ECB_NO_PADDING. Skip checking of private_reserved field in psa_key_attributes if present. Signed-off-by: Juha Ylinen <[email protected]>
1 parent 2c0fef5 commit ab3e35a

File tree

3 files changed

+13
-1
lines changed

3 files changed

+13
-1
lines changed

tests/subsys/secure_storage/psa/crypto/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ CONFIG_ZTEST=y
22

33
CONFIG_PSA_WANT_KEY_TYPE_AES=y
44
CONFIG_PSA_WANT_ALG_CBC_NO_PADDING=y
5+
6+
# native_sim requires ECB cipher to be enabled
7+
CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y

tests/subsys/secure_storage/psa/crypto/src/main.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,13 @@ ZTEST(secure_storage_psa_crypto, test_its_caller_isolation)
7676

7777
ret = psa_get_key_attributes(ID, &retrieved_key_attributes);
7878
zassert_equal(ret, PSA_SUCCESS);
79-
zassert_mem_equal(&retrieved_key_attributes, &key_attributes, sizeof(key_attributes));
79+
80+
uint8_t size = sizeof(key_attributes);
81+
#if defined(CONFIG_BUILD_WITH_TFM) && !defined(MBEDTLS_PSA_CRYPTO_KEY_ID_ENCODES_OWNER)
82+
/* Skip checking of private_reserved field */
83+
size -= sizeof(key_attributes.private_reserved);
84+
#endif
85+
zassert_mem_equal(&retrieved_key_attributes, &key_attributes, size);
8086
ret = psa_destroy_key(ID);
8187
zassert_equal(ret, PSA_SUCCESS);
8288
ret = psa_get_key_attributes(ID, &retrieved_key_attributes);

tests/subsys/secure_storage/psa/crypto/testcase.yaml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,8 @@ tests:
1010
- nrf54l15dk/nrf54l15/cpuapp
1111
secure_storage.psa.crypto.tfm:
1212
filter: CONFIG_BUILD_WITH_TFM
13+
extra_args:
14+
- CONFIG_TFM_PROFILE_TYPE_NOT_SET=y
15+
- CONFIG_PSA_WANT_GENERATE_RANDOM=y
1316
integration_platforms:
1417
- nrf9151dk/nrf9151/ns

0 commit comments

Comments
 (0)