summaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2000-04-03 14:50:43 +1000
committerDamien Miller <djm@mindrot.org>2000-04-03 14:50:43 +1000
commit040f3831fcc4c2e338ab15cb55cb43d95deb390e (patch)
tree2e459b4d6e4aa4fe64bf59ae2cc4126533aa3385 /rsa.c
parentb38eff8e4ff901df9cf1113a9f14d64c3565a401 (diff)
- Wrote entropy collection routines for systems that lack /dev/random
and EGD
Diffstat (limited to 'rsa.c')
-rw-r--r--rsa.c19
1 files changed, 4 insertions, 15 deletions
diff --git a/rsa.c b/rsa.c
index babbf2b7..19160902 100644
--- a/rsa.c
+++ b/rsa.c
@@ -35,28 +35,15 @@
*/
#include "includes.h"
-RCSID("$Id: rsa.c,v 1.11 2000/03/17 12:40:16 damien Exp $");
+RCSID("$Id: rsa.c,v 1.12 2000/04/03 04:50:46 damien Exp $");
#include "rsa.h"
#include "ssh.h"
#include "xmalloc.h"
-#include "random.h"
+#include "entropy.h"
int rsa_verbose = 1;
-/*
- * Seed OpenSSL's random number generator
- */
-void
-seed_rng()
-{
- char buf[64];
-
- get_random_bytes(buf, sizeof(buf));
- RAND_seed(buf, sizeof(buf));
- memset(buf, 0, sizeof(buf));
-}
-
int
rsa_alive()
{
@@ -109,6 +96,8 @@ rsa_generate_key(RSA *prv, RSA *pub, unsigned int bits)
if (key == NULL)
fatal("rsa_generate_key: key generation failed.");
+ seed_rng();
+
/* Copy public key parameters */
pub->n = BN_new();
BN_copy(pub->n, key->n);