From 190cd8a475ee099b4e8fe6459556f2a0fecb2d7c Mon Sep 17 00:00:00 2001 From: Tobias Brunner Date: Wed, 4 Jan 2012 13:19:29 +0100 Subject: [PATCH] pluto: Use srand() to initialize the C library PRNG. Otherwise rekey and DPD times would always be the same after a restart. --- src/pluto/plutomain.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pluto/plutomain.c b/src/pluto/plutomain.c index 2e046ec0b..0f2844813 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");