Skip to content

Commit 6086d15

Browse files
tomi-fontrlubos
authored andcommitted
[nrf fromlist] tests: crypto: rename mbedtls_psa to psa
This test doesn't have anything specific to Mbed TLS, so make it a generic PSA Crypto test. At the same time stop setting the PSA Crypto provider manually. The build system should take care of enabling the appropriate one. This caused issues in cases where a different provider would be selected. Signed-off-by: Tomi Fontanilles <tomi.fontanilles@nordicsemi.no> Upstream PR #: 109827
1 parent f1de139 commit 6086d15

5 files changed

Lines changed: 12 additions & 13 deletions

File tree

MAINTAINERS.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6482,7 +6482,7 @@ West:
64826482
- ithinuel
64836483
files:
64846484
- modules/mbedtls/
6485-
- tests/crypto/mbedtls_psa/
6485+
- tests/crypto/psa/
64866486
- tests/crypto/secp256r1/
64876487
- tests/benchmarks/mbedtls/
64886488
labels:
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ CONFIG_ZTEST=y
66
CONFIG_MAIN_STACK_SIZE=2048
77

88
CONFIG_PSA_CRYPTO=y
9-
CONFIG_PSA_CRYPTO_PROVIDER_MBEDTLS=y
109
CONFIG_MBEDTLS_PSA_STATIC_KEY_SLOTS=y
1110

1211
CONFIG_PSA_WANT_ALG_SHA_1=y
Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313

1414
#include <psa/crypto.h>
1515

16-
ZTEST_USER(test_mbedtls_psa, test_generate_random)
16+
ZTEST_USER(psa_crypto_test_suite, test_generate_random)
1717
{
1818
uint8_t tmp[64];
1919
psa_status_t status;
@@ -22,7 +22,7 @@ ZTEST_USER(test_mbedtls_psa, test_generate_random)
2222
zassert_equal(status, PSA_SUCCESS);
2323
}
2424

25-
ZTEST_USER(test_mbedtls_psa, test_sha1)
25+
ZTEST_USER(psa_crypto_test_suite, test_sha1)
2626
{
2727
uint8_t in_buf[] = { 'a' };
2828
uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_SHA_1)] = { 0 };
@@ -39,7 +39,7 @@ ZTEST_USER(test_mbedtls_psa, test_sha1)
3939
zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref));
4040
}
4141

42-
ZTEST_USER(test_mbedtls_psa, test_sha224)
42+
ZTEST_USER(psa_crypto_test_suite, test_sha224)
4343
{
4444
uint8_t in_buf[] = { 'a' };
4545
uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_SHA_224)] = { 0 };
@@ -57,7 +57,7 @@ ZTEST_USER(test_mbedtls_psa, test_sha224)
5757
zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref));
5858
}
5959

60-
ZTEST_USER(test_mbedtls_psa, test_sha256)
60+
ZTEST_USER(psa_crypto_test_suite, test_sha256)
6161
{
6262
uint8_t in_buf[] = { 'a' };
6363
uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_SHA_256)] = { 0 };
@@ -76,7 +76,7 @@ ZTEST_USER(test_mbedtls_psa, test_sha256)
7676
zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref));
7777
}
7878

79-
ZTEST_USER(test_mbedtls_psa, test_sha384)
79+
ZTEST_USER(psa_crypto_test_suite, test_sha384)
8080
{
8181
uint8_t in_buf[] = { 'a' };
8282
uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_SHA_384)] = { 0 };
@@ -96,7 +96,7 @@ ZTEST_USER(test_mbedtls_psa, test_sha384)
9696
zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref));
9797
}
9898

99-
ZTEST_USER(test_mbedtls_psa, test_sha512)
99+
ZTEST_USER(psa_crypto_test_suite, test_sha512)
100100
{
101101
uint8_t in_buf[] = { 'a' };
102102
uint8_t out_buf[PSA_HASH_LENGTH(PSA_ALG_SHA_512)] = { 0 };
@@ -118,7 +118,7 @@ ZTEST_USER(test_mbedtls_psa, test_sha512)
118118
zassert_mem_equal(out_buf, out_buf_ref, sizeof(out_buf_ref));
119119
}
120120

121-
ZTEST_USER(test_mbedtls_psa, test_hmac_sha256)
121+
ZTEST_USER(psa_crypto_test_suite, test_hmac_sha256)
122122
{
123123
uint8_t key[] = { 'a' };
124124
psa_key_attributes_t key_attr = PSA_KEY_ATTRIBUTES_INIT;
@@ -151,7 +151,7 @@ ZTEST_USER(test_mbedtls_psa, test_hmac_sha256)
151151
zassert_equal(status, PSA_SUCCESS);
152152
}
153153

154-
ZTEST_USER(test_mbedtls_psa, test_aes_ecb)
154+
ZTEST_USER(psa_crypto_test_suite, test_aes_ecb)
155155
{
156156
uint8_t key[] = {0x0, 0x1, 0x2, 0x3, 0x4, 0x5, 0x6, 0x7,
157157
0x8, 0x9, 0xa, 0xb, 0xc, 0xd, 0xe, 0xf};
@@ -186,4 +186,4 @@ ZTEST_USER(test_mbedtls_psa, test_aes_ecb)
186186
zassert_equal(status, PSA_SUCCESS);
187187
}
188188

189-
ZTEST_SUITE(test_mbedtls_psa, NULL, NULL, NULL, NULL, NULL);
189+
ZTEST_SUITE(psa_crypto_test_suite, NULL, NULL, NULL, NULL, NULL);
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ common:
2121
- psa
2222

2323
tests:
24-
crypto.mbedtls_psa.with_entropy_driver:
24+
crypto.psa.with_entropy_driver:
2525
filter: CONFIG_CSPRNG_ENABLED
2626
# Pick a platform which has an entropy driver and enable it.
2727
integration_platforms:
2828
- native_sim/native/64
2929
extra_configs:
3030
- CONFIG_ENTROPY_GENERATOR=y
31-
crypto.mbedtls_psa.without_entropy_driver:
31+
crypto.psa.without_entropy_driver:
3232
filter: not CONFIG_CSPRNG_ENABLED
3333
# Pick a platform which does not have an entropy driver. In this case we
3434
# enable the timer random generator because it's always available on all

0 commit comments

Comments
 (0)