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>
diff --git a/library/psa_crypto_slot_management.c b/library/psa_crypto_slot_management.c
index a21388a..3d997a5 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -250,7 +250,8 @@
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 @@
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 @@
/* 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);