mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
Add return value checking for FREESCALE_RNGA (#4388)
This commit is contained in:
@ -1886,15 +1886,13 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
status_t status;
|
||||
status = TRNG_GetRandomData(TRNG0, output, sz);
|
||||
(void)os;
|
||||
if (status == kStatus_Success)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return RAN_BLOCK_E;
|
||||
}
|
||||
}
|
||||
|
||||
#elif defined(FREESCALE_KSDK_2_0_RNGA)
|
||||
|
||||
@ -1902,23 +1900,27 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
status_t status;
|
||||
status = RNGA_GetRandomData(RNG, output, sz);
|
||||
(void)os;
|
||||
if (status == kStatus_Success)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
else
|
||||
{
|
||||
return RAN_BLOCK_E;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
#elif defined(FREESCALE_RNGA)
|
||||
|
||||
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||
{
|
||||
RNGA_DRV_GetRandomData(RNGA_INSTANCE, output, sz);
|
||||
return 0;
|
||||
status_t status;
|
||||
status = RNGA_GetRandomData(RNG, output, sz);
|
||||
(void)os;
|
||||
if (status == kStatus_Success)
|
||||
{
|
||||
return(0);
|
||||
}
|
||||
return RAN_BLOCK_E;
|
||||
}
|
||||
|
||||
#elif defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX) || \
|
||||
|
Reference in New Issue
Block a user