summaryrefslogtreecommitdiffhomepage
path: root/random.c
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2013-03-26 01:35:22 +0800
committerMatt Johnston <matt@ucc.asn.au>2013-03-26 01:35:22 +0800
commit73e22c115c7aa5604c6a2135a5d2c1bc38161cb1 (patch)
tree3804dbbee79b860aafe8db7a81780bbd8fa7c6f3 /random.c
parent9be0d6b53d6b85a8f273ee28876405fbca49b9fd (diff)
refactor kexdh code a bit, start working on ecdh etc
--HG-- branch : ecc
Diffstat (limited to 'random.c')
-rw-r--r--random.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/random.c b/random.c
index 0378e9a..20095aa 100644
--- a/random.c
+++ b/random.c
@@ -36,6 +36,8 @@ static uint32_t counter = 0;
static unsigned char hashpool[SHA1_HASH_SIZE] = {0};
static int donerandinit = 0;
+int dropbear_ltc_prng = -1;
+
#define INIT_SEED_SIZE 32 /* 256 bits */
/* The basic setup is we read some data from /dev/(u)random or prngd and hash it
@@ -231,6 +233,13 @@ void seedrandom() {
sha1_done(&hs, hashpool);
+#ifdef DROPBEAR_LTC_PRNG
+ if (dropbear_ltc_prng == -1) {
+ dropbear_ltc_prng = register_prng(&dropbear_prng_desc);
+ dropbear_assert(dropbear_ltc_prng != -1);
+ }
+#endif
+
counter = 0;
donerandinit = 1;