From d2159458977265708689e4e7c13358c310e7c122 Mon Sep 17 00:00:00 2001 From: Matt Johnston Date: Fri, 29 Jun 2012 23:19:43 +0800 Subject: Improve RNG seeding. Try to read from /dev/urandom multiple times, take input from extra sources, and use /dev/random when generating private keys --- common-runopts.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'common-runopts.c') diff --git a/common-runopts.c b/common-runopts.c index 784055a..32e475e 100644 --- a/common-runopts.c +++ b/common-runopts.c @@ -29,6 +29,7 @@ #include "dbutil.h" #include "auth.h" #include "algo.h" +#include "random.h" runopts opts; /* GLOBAL */ @@ -45,6 +46,9 @@ int readhostkey(const char * filename, sign_key * hostkey, int *type) { goto out; } buf_setpos(buf, 0); + + addrandom(buf_getptr(buf, buf->len), buf->len); + if (buf_get_priv_key(buf, hostkey, type) == DROPBEAR_FAILURE) { goto out; } -- cgit v1.2.1