MBEDTLS_PSA_INJECT_ENTROPY: Skip incompatible tests

When MBEDTLS_PSA_INJECT_ENTROPY is enabled, we disable standard entropy
sources, so mbedtls_entropy_func() doesn't work out of the box. Disable
tests that rely on it. MBEDTLS_PSA_INJECT_ENTROPY is intended for PSA-only
environments anyway, so it doesn't matter if some legacy features don't work
normally.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2023-04-28 23:41:38 +02:00
parent c2d16b2159
commit c548468b69
3 changed files with 6 additions and 3 deletions

View file

@ -135,7 +135,7 @@ int read_nv_seed(unsigned char *buf, size_t buf_len)
/* END_HEADER */ /* END_HEADER */
/* BEGIN_DEPENDENCIES /* BEGIN_DEPENDENCIES
* depends_on:MBEDTLS_ENTROPY_C * depends_on:MBEDTLS_ENTROPY_C:!MBEDTLS_PSA_INJECT_ENTROPY
* END_DEPENDENCIES * END_DEPENDENCIES
*/ */

View file

@ -25,7 +25,10 @@ validate_module_init_key_based:1
Custom entropy sources: all standard Custom entropy sources: all standard
custom_entropy_sources:0x0000ffff:PSA_SUCCESS custom_entropy_sources:0x0000ffff:PSA_SUCCESS
# MBEDTLS_PSA_INJECT_ENTROPY means that a source of entropy (the seed file)
# is effectively always available.
Custom entropy sources: none Custom entropy sources: none
depends_on:!MBEDTLS_PSA_INJECT_ENTROPY
custom_entropy_sources:0:PSA_ERROR_INSUFFICIENT_ENTROPY custom_entropy_sources:0:PSA_ERROR_INSUFFICIENT_ENTROPY
Fake entropy: never returns anything Fake entropy: never returns anything

View file

@ -18,7 +18,7 @@
/* END_HEADER */ /* END_HEADER */
/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_C:MBEDTLS_CTR_DRBG_C */ /* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_C:!MBEDTLS_PSA_INJECT_ENTROPY:MBEDTLS_CTR_DRBG_C */
void random_twice_with_ctr_drbg() void random_twice_with_ctr_drbg()
{ {
mbedtls_entropy_context entropy; mbedtls_entropy_context entropy;
@ -60,7 +60,7 @@ exit:
} }
/* END_CASE */ /* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_C:MBEDTLS_HMAC_DRBG_C */ /* BEGIN_CASE depends_on:MBEDTLS_ENTROPY_C:!MBEDTLS_PSA_INJECT_ENTROPY:MBEDTLS_HMAC_DRBG_C */
void random_twice_with_hmac_drbg(int md_type) void random_twice_with_hmac_drbg(int md_type)
{ {
mbedtls_entropy_context entropy; mbedtls_entropy_context entropy;