1
0
mirror of https://github.com/Mbed-TLS/mbedtls.git synced 2025-07-30 22:43:08 +03:00

Add psa_purge_key API

Signed-off-by: Ronald Cron <ronald.cron@arm.com>
This commit is contained in:
Ronald Cron
2020-08-04 15:49:48 +02:00
parent cf56a0a320
commit 277a85f1ef
2 changed files with 38 additions and 0 deletions

View File

@ -306,6 +306,21 @@ psa_status_t psa_close_key( psa_key_handle_t handle )
return( psa_wipe_key_slot( slot ) );
}
psa_status_t psa_purge_key( mbedtls_svc_key_id_t key )
{
psa_status_t status;
psa_key_slot_t *slot;
status = psa_get_key_slot( key, &slot );
if( status != PSA_SUCCESS )
return( status );
if( slot->attr.lifetime == PSA_KEY_LIFETIME_VOLATILE )
return PSA_SUCCESS;
return( psa_wipe_key_slot( slot ) );
}
void mbedtls_psa_get_stats( mbedtls_psa_stats_t *stats )
{
size_t slot_idx;