From db9091423267d805c165c99e80bbb1eff4dfb4cc Mon Sep 17 00:00:00 2001 From: David Horstmann Date: Tue, 12 Mar 2024 16:07:08 +0000 Subject: [PATCH] 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 --- library/psa_crypto.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/library/psa_crypto.c b/library/psa_crypto.c index 089751a93d..9b22348c78 100644 --- a/library/psa_crypto.c +++ b/library/psa_crypto.c @@ -4159,20 +4159,20 @@ static psa_status_t psa_generate_random_internal(uint8_t *output, #if defined(MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG) + psa_status_t status; size_t output_length = 0; status = mbedtls_psa_external_get_random(&global_data.rng, output, output_size, &output_length); if (status != PSA_SUCCESS) { - goto exit; + return status; } /* Breaking up a request into smaller chunks is currently not supported * for the external RNG interface. */ if (output_length != output_size) { - status = PSA_ERROR_INSUFFICIENT_ENTROPY; - goto exit; + return PSA_ERROR_INSUFFICIENT_ENTROPY; } - status = PSA_SUCCESS; + return PSA_SUCCESS; #else /* MBEDTLS_PSA_CRYPTO_EXTERNAL_RNG */