summaryrefslogtreecommitdiffhomepage
path: root/common-runopts.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2012-06-29 23:19:43 +0800
committerMatt Johnston <matt@ucc.asn.au>2012-06-29 23:19:43 +0800
commitd5ccc32b4d8903562107a534fbe09433c27d2880 (patch)
tree467f88f9f0d6d85c2be90d2a590504ec10742bba /common-runopts.c
parentdb34044c7fdfcdf85a2606b686d60910e1ff36b6 (diff)
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.c4
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;
}