mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-31 19:24:42 +02:00
Using "rand()" to seed our PRNG as its available on all INTIME RTOS versions.
This commit is contained in:
@@ -2236,8 +2236,8 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|||||||
#elif defined(INTIME_RTOS)
|
#elif defined(INTIME_RTOS)
|
||||||
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
||||||
{
|
{
|
||||||
uint32_t rand;
|
uint32_t randval;
|
||||||
word32 len = sizeof(rand);
|
word32 len = sizeof(randval);
|
||||||
|
|
||||||
if (output == NULL) {
|
if (output == NULL) {
|
||||||
return BUFFER_E;
|
return BUFFER_E;
|
||||||
@@ -2246,8 +2246,8 @@ int wc_GenerateSeed(OS_Seed* os, byte* output, word32 sz)
|
|||||||
while (sz > 0) {
|
while (sz > 0) {
|
||||||
if (sz < len)
|
if (sz < len)
|
||||||
len = sz;
|
len = sz;
|
||||||
rand = arc4random(); /* returns 32-bits of random */
|
randval = rand(); /* returns 32-bits of random */
|
||||||
XMEMCPY(output, &rand, len);
|
XMEMCPY(output, &randval, len);
|
||||||
output += len;
|
output += len;
|
||||||
sz -= len;
|
sz -= len;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user