diff options
author | Matt Johnston <matt@ucc.asn.au> | 2012-06-29 23:19:43 +0800 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2012-06-29 23:19:43 +0800 |
commit | d2159458977265708689e4e7c13358c310e7c122 (patch) | |
tree | dfd3ba5610ab46a0b00a8ab593fecea0cdb12901 /common-runopts.c | |
parent | 51525d1855cda4300bed57183890857b5c959712 (diff) | |
download | dropbear-d2159458977265708689e4e7c13358c310e7c122.tar.gz |
Improve RNG seeding.
Try to read from /dev/urandom multiple times, take input from extra sources,
and use /dev/random when generating private keys
Diffstat (limited to 'common-runopts.c')
-rw-r--r-- | common-runopts.c | 4 |
1 files changed, 4 insertions, 0 deletions
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; } |