SE keys: make psa_destroy_key remove the key from storage

This commit is contained in:
Gilles Peskine 2019-08-13 15:11:49 +02:00
parent 8fe253ae4a
commit caec27821f

View file

@ -1050,7 +1050,7 @@ psa_status_t psa_destroy_key( psa_key_handle_t handle )
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
if( slot->attr.lifetime == PSA_KEY_LIFETIME_PERSISTENT )
if( slot->attr.lifetime != PSA_KEY_LIFETIME_VOLATILE )
{
storage_status =
psa_destroy_persistent_key( slot->attr.id );