Skip to content

Commit ff1f02e

Browse files
juhaylinenanangl
authored andcommitted
[nrf noup] tests: secure_storage: Fix issues
Set CONFIG_TFM_PROFILE_TYPE_MEDIUM for boards with TF-M to enable ITS and PS. Enable CONFIG_PSA_WANT_GENERATE_RANDOM to fix persistent_key tests when TF-M is used. native_sim target needs CONFIG_PSA_WANT_ALG_ECB_NO_PADDING. Skip checking of private_reserved field in psa_key_attributes if present. Increase maximum ITS asset size. Signed-off-by: Juha Ylinen <[email protected]>
1 parent 0b40b44 commit ff1f02e

File tree

6 files changed

+18
-2
lines changed

6 files changed

+18
-2
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: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,12 @@ 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+
zassert_equal(key_attributes.private_bits, retrieved_key_attributes.private_bits);
80+
zassert_equal(key_attributes.private_id, retrieved_key_attributes.private_id);
81+
zassert_equal(key_attributes.private_lifetime, retrieved_key_attributes.private_lifetime);
82+
zassert_mem_equal(&key_attributes.private_policy, &retrieved_key_attributes.private_policy,
83+
sizeof(key_attributes.private_policy));
84+
8085
ret = psa_destroy_key(ID);
8186
zassert_equal(ret, PSA_SUCCESS);
8287
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_MEDIUM=y
15+
- CONFIG_PSA_WANT_GENERATE_RANDOM=y
1316
integration_platforms:
1417
- nrf9151dk/nrf9151/ns

tests/subsys/secure_storage/psa/its/overlay-secure_storage.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,6 @@ CONFIG_ZTEST_STACK_SIZE=3072
22
CONFIG_MAIN_STACK_SIZE=2048
33

44
CONFIG_SECURE_STORAGE=y
5+
6+
# native_sim requires ECB cipher to be enabled
7+
CONFIG_PSA_WANT_ALG_ECB_NO_PADDING=y
Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
CONFIG_TFM_ITS_MAX_ASSET_SIZE_OVERRIDE=y
2-
CONFIG_TFM_ITS_MAX_ASSET_SIZE=256
2+
CONFIG_TFM_ITS_MAX_ASSET_SIZE=512
3+
CONFIG_TFM_PROFILE_TYPE_MEDIUM=y
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
11
CONFIG_ZTEST=y
2+
CONFIG_ZTEST_STACK_SIZE=3072

0 commit comments

Comments
 (0)