1
0
mirror of https://github.com/ARMmbed/mbedtls.git synced 2025-05-15 03:07:16 +08:00

Change goto exit into direct return

Fix errors in merge conflict resolution - change
psa_generate_random_internal() to return directly rather than jumping to
an exit label and restore the variable psa_status_t status.

Signed-off-by: David Horstmann <david.horstmann@arm.com>
This commit is contained in:
David Horstmann 2024-03-12 16:07:08 +00:00
parent 93fa4e1b87
commit db90914232

View File

@ -4159,20 +4159,20 @@ static psa_status_t psa_generate_random_internal(uint8_t *output,
#if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG)
psa_status_t status;
size_t output_length = 0; size_t output_length = 0;
status = mbedtls_psa_external_get_random(&global_data.rng, status = mbedtls_psa_external_get_random(&global_data.rng,
output, output_size, output, output_size,
&output_length); &output_length);
if (status != PSA_SUCCESS) { if (status != PSA_SUCCESS) {
goto exit; return status;
} }
/* Breaking up a request into smaller chunks is currently not supported /* Breaking up a request into smaller chunks is currently not supported
* for the external RNG interface. */ * for the external RNG interface. */
if (output_length != output_size) { if (output_length != output_size) {
status = PSA_ERROR_INSUFFICIENT_ENTROPY; return PSA_ERROR_INSUFFICIENT_ENTROPY;
goto exit;
} }
status = PSA_SUCCESS; return PSA_SUCCESS;
#else /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */ #else /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */