mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-12-24 17:41:01 +03:00
Remove unused and duplicated erros, fix documentation and tests
Remove unused and duplicated erros, fix documentation and tests
This commit is contained in:
@@ -363,7 +363,6 @@ psa_status_t psa_import_key(psa_key_slot_t key,
|
||||
}
|
||||
|
||||
slot->type = type;
|
||||
slot->lifetime = 0;
|
||||
return( PSA_SUCCESS );
|
||||
}
|
||||
|
||||
@@ -1292,17 +1291,17 @@ psa_status_t psa_set_key_lifetime(psa_key_slot_t key,
|
||||
if( key == 0 || key > MBEDTLS_PSA_KEY_SLOT_COUNT )
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
if( lifetime != PSA_KEY_LIFETIME_VOLATILE &&
|
||||
lifetime != PSA_KEY_LIFETIME_PERSISTENT &&
|
||||
lifetime != PSA_KEY_LIFETIME_WRITE_ONCE)
|
||||
return( PSA_ERROR_INVALID_ARGUMENT );
|
||||
|
||||
slot = &global_data.key_slots[key];
|
||||
if( slot->type == PSA_KEY_TYPE_NONE )
|
||||
return( PSA_ERROR_EMPTY_SLOT );
|
||||
|
||||
if( lifetime != PSA_KEY_LIFETIME_VOLATILE &&
|
||||
lifetime != PSA_KEY_LIFETIME_PERSISTENT &&
|
||||
lifetime != PSA_KEY_LIFETIME_WRITE_ONCE)
|
||||
return( PSA_ERROR_INVALID_LIFETIME );
|
||||
|
||||
if ( slot->lifetime == PSA_KEY_LIFETIME_WRITE_ONCE )
|
||||
return( PSA_ERROR_KEY_LIFETIME_CHANGE );
|
||||
if ( lifetime != PSA_KEY_LIFETIME_VOLATILE )
|
||||
return( PSA_ERROR_NOT_SUPPORTED );
|
||||
|
||||
slot->lifetime = lifetime;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user