Change behavior of psa_get_key_lifetime()

psa_get_key_lifetime() behavior changed regarding empty slots, now
it return the lifetime of and empty slots. Documentation in header
file updated accordingly.
This commit is contained in:
mohammad1603 2018-04-17 00:31:34 -07:00 committed by itayzafrir
parent 1c34545cfe
commit ea0500936e
2 changed files with 2 additions and 13 deletions

View file

@ -103,10 +103,6 @@ typedef enum {
* Applications may call this function more than once. Once a call
* succeeds, subsequent calls are guaranteed to succeed.
*
* \note Initial lifetime value for each key slot is initiated
* to PSA_KEY_LIFETIME_VOLATILE, user should change this value
* before calling psa_import_key() if needed.
*
* \retval PSA_SUCCESS
* \retval PSA_ERROR_INSUFFICIENT_MEMORY
* \retval PSA_ERROR_COMMUNICATION_FAILURE
@ -610,8 +606,6 @@ typedef uint32_t psa_key_lifetime_t;
* \retval PSA_ERROR_INVALID_ARGUMENT
* The key slot is invalid,
* or the key data is not correctly formatted.
* \retval PSA_ERROR_EMPTY_SLOT
* The key slot is not occupied.
*/
psa_status_t psa_get_key_lifetime(psa_key_slot_t key,
psa_key_lifetime_t *lifetime);
@ -630,11 +624,9 @@ psa_status_t psa_get_key_lifetime(psa_key_slot_t key,
* \retval PSA_ERROR_INVALID_ARGUMENT
* The key slot is invalid,
* or the key data is not correctly formatted.
* \retval PSA_ERROR_EMPTY_SLOT
* The key slot is not occupied.
*/
psa_status_t psa_set_key_lifetime(psa_key_slot_t key,
const psa_key_lifetime_t lifetime);
psa_key_lifetime_t lifetime);
/**@}*/

View file

@ -1275,9 +1275,6 @@ psa_status_t psa_get_key_lifetime(psa_key_slot_t key,
slot = &global_data.key_slots[key];
if( slot->type == PSA_KEY_TYPE_NONE )
return( PSA_ERROR_EMPTY_SLOT );
*lifetime = slot->lifetime;
return( PSA_SUCCESS );