Dynamic key store: disable full-key-store tests

It's impractical to fill the key store when it can grow to accommodate
millions of keys.

A later commit will restore those tests in test configurations with the
dynamic key store.

Signed-off-by: Gilles Peskine <Gilles.Peskine@arm.com>
This commit is contained in:
Gilles Peskine 2024-07-16 20:49:36 +02:00
parent 5064af62b6
commit b5891cc2cd

View File

@ -101,7 +101,11 @@ exit:
/* Currently, there is always a maximum number of volatile keys that can
* realistically be reached in tests. When we add configurations where this
* is not true, undefine the macro in such configurations. */
#if defined(MBEDTLS_PSA_KEY_STORE_DYNAMIC)
#undef MAX_VOLATILE_KEYS
#else /* Static key store */
#define MAX_VOLATILE_KEYS MBEDTLS_PSA_KEY_SLOT_COUNT
#endif
/* END_HEADER */
@ -1028,7 +1032,7 @@ exit:
}
/* END_CASE */
/* BEGIN_CASE depends_on:MBEDTLS_PSA_CRYPTO_STORAGE_C */
/* BEGIN_CASE depends_on:MBEDTLS_PSA_CRYPTO_STORAGE_C:!MBEDTLS_PSA_KEY_STORE_DYNAMIC */
void non_reusable_key_slots_integrity_in_case_of_key_slot_starvation()
{
psa_status_t status;
@ -1068,7 +1072,14 @@ void non_reusable_key_slots_integrity_in_case_of_key_slot_starvation()
TEST_ASSERT(mbedtls_svc_key_id_equal(returned_key_id, persistent_key));
/*
* Create the maximum available number of volatile keys
* Create the maximum available number of keys that are locked in
* memory. This can be:
* - volatile keys, when MBEDTLS_PSA_KEY_STORE_DYNAMIC is disabled;
* - opened persistent keys (could work, but not currently implemented
* in this test function);
* - keys in use by another thread (we don't do this because it would
* be hard to arrange and we can't control how long the keys are
* locked anyway).
*/
psa_set_key_lifetime(&attributes, PSA_KEY_LIFETIME_VOLATILE);
for (i = 0; i < available_key_slots; i++) {