Refactor `psa_load_persistent_key_into_slot` to remove bad `goto`
Merges the two calls to `psa_copy_key_material_into_slot.
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 5ecc3a7..0278009 100644
--- a/library/psa_crypto_slot_management.c
+++ b/library/psa_crypto_slot_management.c
@@ -234,14 +234,10 @@
status = PSA_ERROR_DATA_INVALID;
goto exit;
}
- 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) {
- slot->status = PSA_SLOT_OCCUPIED;
- }
- goto exit;
+ data = (psa_se_key_data_storage_t *) key_data;
+ key_data = data->slot_number;
+ key_data_length = sizeof(key_data);
}
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */