While the users of os_random() do not really need strong pseudo random
numebrs, there is no significant harm in seeding random() with data from
os_get_random(), i.e., /dev/urandom, to get different sequence of not so
strong pseudo random values from os_random() for each time the process
is started.
Signed-off-by: Jouni Malinen <j@w1.fi>
int os_program_init(void)
{
+ unsigned int seed;
+
#ifdef ANDROID
/*
* We ignore errors here since errors are normal if we
capset(&header, &cap);
#endif /* ANDROID */
+ os_get_random((unsigned char *) &seed, sizeof(seed));
+ srandom(seed);
+
return 0;
}