mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-15 23:42:41 +00:00
Update psa_load_X_key_into_slot
These functions (on success) take a slot from PSA_SLOT_FILLING to PSA_SLOT_FULL. Signed-off-by: Ryan Everett <ryan.everett@arm.com>
This commit is contained in:
parent
c70ce576bd
commit
eb27dc0f3a
@ -250,7 +250,8 @@ static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot)
|
||||
slot, data->slot_number, sizeof(data->slot_number));
|
||||
|
||||
if (status == PSA_SUCCESS) {
|
||||
slot->status = PSA_SLOT_OCCUPIED;
|
||||
status = psa_key_slot_state_transition(slot, PSA_SLOT_FILLING,
|
||||
PSA_SLOT_FULL);
|
||||
}
|
||||
goto exit;
|
||||
}
|
||||
@ -261,7 +262,8 @@ static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot)
|
||||
goto exit;
|
||||
}
|
||||
|
||||
slot->status = PSA_SLOT_OCCUPIED;
|
||||
status = psa_key_slot_state_transition(slot, PSA_SLOT_FILLING,
|
||||
PSA_SLOT_FULL);
|
||||
|
||||
exit:
|
||||
psa_free_persistent_key_data(key_data, key_data_length);
|
||||
@ -335,8 +337,9 @@ static psa_status_t psa_load_builtin_key_into_slot(psa_key_slot_t *slot)
|
||||
/* Copy actual key length and core attributes into the slot on success */
|
||||
slot->key.bytes = key_buffer_length;
|
||||
slot->attr = attributes.core;
|
||||
slot->status = PSA_SLOT_OCCUPIED;
|
||||
|
||||
status = psa_key_slot_state_transition(slot, PSA_SLOT_FILLING,
|
||||
PSA_SLOT_FULL);
|
||||
exit:
|
||||
if (status != PSA_SUCCESS) {
|
||||
psa_remove_key_data_from_memory(slot);
|
||||
|
Loading…
x
Reference in New Issue
Block a user