summaryrefslogtreecommitdiff
path: root/rsa.c
diff options
context:
space:
mode:
authordamien <damien>2000-04-03 04:50:43 +0000
committerdamien <damien>2000-04-03 04:50:43 +0000
commitb2d6c0a5420ffb20828892502ad64d1c8d0ce1cb (patch)
treec29baedb5ac9f6277f7d13e5bb94fc7309326d9c /rsa.c
parentfd4da4393d2f5d5b7bfc0654aa0de04a103a5756 (diff)
downloadopenssh-b2d6c0a5420ffb20828892502ad64d1c8d0ce1cb.tar.gz
- 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);