search for: random_init_rng

Displaying 1 result from an estimated 1 matches for "random_init_rng".

2006 Mar 17
1
[PATCH] OpenSSL RNG initialization
...==================================================== RCS file: /home/cvs/dovecot/src/lib/randgen.c,v retrieving revision 1.13 diff -u -r1.13 randgen.c --- src/lib/randgen.c 6 Jan 2005 19:08:19 -0000 1.13 +++ src/lib/randgen.c 10 Mar 2006 17:15:03 -0000 @@ -81,6 +81,42 @@ return buf; } +static void random_init_rng(void) +{ + int counter = 0; + struct timeval tv; +#ifdef HAVE_GETRUSAGE + struct rusage ru; +#endif + + /* + * If the RNG is already seeded, we can return + * immediately. + */ + if (RAND_status() == 1) + return; + + /* + * Else, try to seed it. Unfortunately we don't have + * /dev/urando...