mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-28 10:05:05 +03:00
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:
parent
9f176a2766
commit
d69f4017fb
@ -234,14 +234,10 @@ static psa_status_t psa_load_persistent_key_into_slot(psa_key_slot_t *slot)
|
|||||||
status = PSA_ERROR_DATA_INVALID;
|
status = PSA_ERROR_DATA_INVALID;
|
||||||
goto exit;
|
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) {
|
data = (psa_se_key_data_storage_t *) key_data;
|
||||||
slot->status = PSA_SLOT_OCCUPIED;
|
key_data = data->slot_number;
|
||||||
}
|
key_data_length = sizeof(key_data);
|
||||||
goto exit;
|
|
||||||
}
|
}
|
||||||
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
|
#endif /* MBEDTLS_PSA_CRYPTO_SE_C */
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user