Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nrf_security: Use int return type for nrf_cc3xx return values #12117

Merged
merged 1 commit into from
Aug 23, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 6 additions & 6 deletions subsys/nrf_security/src/psa_crypto_driver_wrappers.c
Original file line number Diff line number Diff line change
Expand Up @@ -2435,28 +2435,29 @@ psa_status_t psa_driver_wrapper_init_random(psa_driver_random_context_t *context
psa_status_t psa_driver_wrapper_get_random(psa_driver_random_context_t *context, uint8_t *output,
size_t output_size)
{
psa_status_t status;
#if defined(PSA_CRYPTO_DRIVER_ALG_PRNG_TEST)
status = prng_test_generate_random(output, output_size);
psa_status_t status;

status = prng_test_generate_random(output, output_size);
if (status != PSA_ERROR_NOT_SUPPORTED) {
return status;
}
#endif
#if defined(PSA_CRYPTO_DRIVER_ALG_PRNG_CC3XX_PLATFORM)
size_t output_length;
int err;

/* Using internal context. */
(void)context;

#if defined(PSA_CRYPTO_DRIVER_ALG_CTR_DRBG_CC3XX_PLATFORM)
status = nrf_cc3xx_platform_ctr_drbg_get(NULL, output, output_size, &output_length);
err = nrf_cc3xx_platform_ctr_drbg_get(NULL, output, output_size, &output_length);
#elif defined(PSA_CRYPTO_DRIVER_ALG_HMAC_DRBG_CC3XX_PLATFORM)
status = nrf_cc3xx_platform_hmac_drbg_get(NULL, output, output_size, &output_length);
err = nrf_cc3xx_platform_hmac_drbg_get(NULL, output, output_size, &output_length);
#else
#error "Enable CONFIG_PSA_WANT_ALG_CTR_DRBG or CONFIG_PSA_WANT_ALG_HMAC_DRBG"
#endif
if (status != NRF_CC3XX_PLATFORM_SUCCESS) {
if (err != NRF_CC3XX_PLATFORM_SUCCESS) {
return PSA_ERROR_HARDWARE_FAILURE;
}

Expand All @@ -2468,7 +2469,6 @@ psa_status_t psa_driver_wrapper_get_random(psa_driver_random_context_t *context,
#endif /* defined(PSA_CRYPTO_DRIVER_ALG_PRNG_CC3XX_PLATFORM) */

#if defined(PSA_CRYPTO_DRIVER_ALG_PRNG_OBERON)
(void)status;
#if defined(PSA_CRYPTO_DRIVER_ALG_CTR_DRBG_OBERON)
return oberon_ctr_drbg_get_random(&context->oberon_ctr_drbg_ctx, output, output_size);
#elif defined(PSA_CRYPTO_DRIVER_ALG_HMAC_DRBG_OBERON)
Expand Down
Loading