Fix for InTime RTOS v5. The arc4random_buf wasn't added until v6, so opting to use arc4random. ZD 11760.

This commit is contained in:
David Garske
2021-02-25 08:54:30 -08:00
parent c201b6801c
commit acff0e8781

View File

@ -2236,19 +2236,24 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
#elif defined(INTIME_RTOS)
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
{
int ret = 0;
(void)os;
uint32_t rand;
word32 len = sizeof(rand);
if (output == NULL) {
return BUFFER_E;
}
/* Note: Investigate better solution */
/* no return to check */
arc4random_buf(output, sz);
while (sz > 0) {
if (sz < len)
len = sz;
rand = arc4random(); /* returns 32-bits of random */
XMEMCPY(output, &rand, len);
output += len;
sz -= len;
}
(void)os;
return ret;
return 0;
}
#elif defined(WOLFSSL_WICED)