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>
This commit is contained in:
Ryan Everett 2023-11-23 16:20:45 +00:00
parent 9f176a2766
commit d69f4017fb

View file

@ -234,14 +234,10 @@ static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot)
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 */