Refactor lifetime checking to reflect split in location and persistence

Signed-off-by: Steven Cooreman <steven.cooreman@silabs.com>
This commit is contained in:
Steven Cooreman 2020-06-08 18:28:25 +02:00
parent 8335f41cda
commit c59de6ab7e
3 changed files with 8 additions and 5 deletions

View file

@ -1500,7 +1500,7 @@ static psa_status_t psa_validate_key_attributes(
{
psa_status_t status;
if( attributes->core.lifetime != PSA_KEY_LIFETIME_VOLATILE )
if( ! PSA_KEY_LIFETIME_IS_VOLATILE( attributes->core.lifetime ) )
{
status = psa_validate_persistent_key_parameters(
attributes->core.lifetime, attributes->core.id,
@ -1660,7 +1660,7 @@ static psa_status_t psa_finish_key_creation(
(void) driver;
#if defined(MBEDTLS_PSA_CRYPTO_STORAGE_C)
if( slot->attr.lifetime != PSA_KEY_LIFETIME_VOLATILE )
if( ! PSA_KEY_LIFETIME_IS_VOLATILE( slot->attr.lifetime ) )
{
#if defined(MBEDTLS_PSA_CRYPTO_SE_C)
if( driver != NULL )