From 9ec9070e9d2628636b0c0f0927fca036a7f47ac5 Mon Sep 17 00:00:00 2001 From: suveshpratapa <66088488+suveshpratapa@users.noreply.github.com> Date: Fri, 8 Jan 2021 14:59:26 -0500 Subject: [PATCH] [efr32] fix for trng entropy API (#6050) When obtaining entropy data, trng_get_random checks the status for any noise, and if so, cleans its queues and keeps the entropy accumulator of mbedtls running. In the process, TRNG might not have any new samples available, so a zero length output is valid, and we should keep running rather than exit fatally. --- examples/platforms/efr32/src/entropy.c | 1 - 1 file changed, 1 deletion(-) diff --git a/examples/platforms/efr32/src/entropy.c b/examples/platforms/efr32/src/entropy.c index 3a755e156..b9c629cb6 100644 --- a/examples/platforms/efr32/src/entropy.c +++ b/examples/platforms/efr32/src/entropy.c @@ -51,7 +51,6 @@ otError otPlatEntropyGet(uint8_t *aOutput, uint16_t aOutputLength) // Non-zero return values for mbedtls_hardware_poll() signify an error has occurred otEXPECT_ACTION(0 == mbedtls_hardware_poll(NULL, &aOutput[outputLen], remaining, &partialLen), error = OT_ERROR_FAILED); - otEXPECT_ACTION(partialLen > 0, error = OT_ERROR_FAILED); } exit: