mirror of
https://github.com/yuzu-mirror/mbedtls.git
synced 2026-04-20 22:05:15 +00:00
psa: slot mgmt: Add unaccessed slots counter in stats
Add a counter of unaccessed slots and use it in tests to check that at the end of PSA tests all key slot are unaccessed. Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
parent
f95a2b1190
commit
0c3752a46b
3 changed files with 11 additions and 0 deletions
|
|
@ -24,6 +24,7 @@
|
|||
#include "test/psa_helpers.h"
|
||||
|
||||
#include <psa/crypto.h>
|
||||
#include <psa_crypto_slot_management.h>
|
||||
|
||||
static int test_helper_is_psa_pristine( int line, const char *file )
|
||||
{
|
||||
|
|
@ -40,6 +41,10 @@ static int test_helper_is_psa_pristine( int line, const char *file )
|
|||
msg = "An external slot has not been closed properly.";
|
||||
else if( stats.half_filled_slots != 0 )
|
||||
msg = "A half-filled slot has not been cleared properly.";
|
||||
else if( stats.unaccessed_slots != PSA_KEY_SLOT_COUNT )
|
||||
{
|
||||
msg = "Some slots are still marked as accessed.";
|
||||
}
|
||||
|
||||
/* If the test has already failed, don't overwrite the failure
|
||||
* information. Do keep the stats lookup above, because it can be
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue