Remove state transitions in psa_load_X_key_into_slot
These calls otherwise don't abide by our assertions about changing the slot.
psa_get_and_lock_key_slot, the only caller to these, handles the state
transitions already. It also changes the contents of the slot after these calls.
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 47ace35..9358619 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -248,11 +248,6 @@
data = (psa_se_key_data_storage_t *) key_data;
status = psa_copy_key_material_into_slot(
slot, data->slot_number, sizeof(data->slot_number));
-
- if (status == PSA_SUCCESS) {
- status = psa_key_slot_state_transition(slot, PSA_SLOT_FILLING,
- PSA_SLOT_FULL);
- }
goto exit;
}
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
@@ -262,9 +257,6 @@
goto exit;
}
- status = psa_key_slot_state_transition(slot, PSA_SLOT_FILLING,
- PSA_SLOT_FULL);
-
exit:
psa_free_persistent_key_data(key_data, key_data_length);
return status;
@@ -337,9 +329,6 @@
/* Copy actual key length and core attributes into the slot on success */
slot->key.bytes = key_buffer_length;
slot->attr = attributes.core;
-
- 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);