Skip to content

Commit 51a462a

Browse files
author
Oren Cohen
committed
Use entropy injection on any NVseed platform or PSA dual-core/v8
1 parent 86c7a59 commit 51a462a

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

TESTS/mbed-crypto/sanity/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@
3030

3131
using namespace utest::v1;
3232

33-
#ifdef MBEDTLS_ENTROPY_NV_SEED
33+
#if defined(MBEDTLS_ENTROPY_NV_SEED) || defined(COMPONENT_PSA_SRV_IPC)
3434

3535
#if !defined(MAX)
3636
#define MAX(a,b) (((a)>(b))?(a):(b))
@@ -47,7 +47,7 @@ void inject_entropy()
4747
}
4848
mbedtls_psa_inject_entropy(seed, MBEDTLS_PSA_INJECT_ENTROPY_MIN_SIZE);
4949
}
50-
#endif
50+
#endif // defined(MBEDTLS_ENTROPY_NV_SEED) || defined(COMPONENT_PSA_SRV_IPC)
5151

5252
void test_crypto_random(void)
5353
{
@@ -297,12 +297,12 @@ void test_crypto_key_derivation(void)
297297
utest::v1::status_t case_setup_handler(const Case *const source, const size_t index_of_case)
298298
{
299299
psa_status_t status = psa_crypto_init();
300-
#if defined(MBEDTLS_ENTROPY_NV_SEED)
300+
#if defined(MBEDTLS_ENTROPY_NV_SEED) || defined(COMPONENT_PSA_SRV_IPC)
301301
if (status == PSA_ERROR_INSUFFICIENT_ENTROPY) {
302302
inject_entropy();
303303
status = psa_crypto_init();
304304
}
305-
#endif /* MBEDTLS_ENTROPY_NV_SEED */
305+
#endif /* defined(MBEDTLS_ENTROPY_NV_SEED) || defined(COMPONENT_PSA_SRV_IPC) */
306306
TEST_ASSERT_EQUAL(PSA_SUCCESS, status);
307307
return greentea_case_setup_handler(source, index_of_case);
308308
}

0 commit comments

Comments
 (0)