From: Tobias Brunner Date: Wed, 4 Jan 2012 12:19:29 +0000 (+0100) Subject: pluto: Use srand() to initialize the C library PRNG. X-Git-Tag: 4.6.2~63 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=190cd8a475ee099b4e8fe6459556f2a0fecb2d7c;p=thirdparty%2Fstrongswan.git pluto: Use srand() to initialize the C library PRNG. Otherwise rekey and DPD times would always be the same after a restart. --- diff --git a/src/pluto/plutomain.c b/src/pluto/plutomain.c index 2e046ec0b6..0f28448133 100644 --- a/src/pluto/plutomain.c +++ b/src/pluto/plutomain.c @@ -675,6 +675,9 @@ int main(int argc, char **argv) close(fd); } + /* for uncritical pseudo random numbers */ + srand(time(NULL) + getpid()); + init_constants(); init_log("pluto");