From caec27821fab3db60bc52bea08602d7b1528d724 Mon Sep 17 00:00:00 2001 From: Gilles Peskine Date: Tue, 13 Aug 2019 15:11:49 +0200 Subject: [PATCH] SE keys: make psa_destroy_key remove the key from storage --- library/psa_crypto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 6041732fd1..4fee3cd022 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -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 );