summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog1
-rw-r--r--configure.in8
-rw-r--r--rsa.c5
3 files changed, 10 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index 2379ec7ad..e5511c91a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,6 @@
120000305 120000305
2 - Fix DEC compile fix 2 - Fix DEC compile fix
3 - Explicitly seed OpenSSL's PRNG before checking rsa_alive()
3 4
420000303 520000303
5 - Added "make host-key" target, Suggestion from Dominik Brettnacher 6 - Added "make host-key" target, Suggestion from Dominik Brettnacher
diff --git a/configure.in b/configure.in
index e5bdc445c..c93811c75 100644
--- a/configure.in
+++ b/configure.in
@@ -160,7 +160,9 @@ for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/
160 #include <openssl/bn.h> 160 #include <openssl/bn.h>
161 #include <openssl/sha.h> 161 #include <openssl/sha.h>
162 int main(void) 162 int main(void)
163 {RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);} 163 {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
164 RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
165 return(key==NULL);}
164 ], 166 ],
165 [ 167 [
166 AC_DEFINE(HAVE_OPENSSL) 168 AC_DEFINE(HAVE_OPENSSL)
@@ -174,7 +176,9 @@ for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/
174 #include <ssl/bn.h> 176 #include <ssl/bn.h>
175 #include <ssl/sha.h> 177 #include <ssl/sha.h>
176 int main(void) 178 int main(void)
177 {RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);} 179 {RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
180 RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
181 return(key==NULL);}
178 ], 182 ],
179 [ 183 [
180 AC_DEFINE(HAVE_SSL) 184 AC_DEFINE(HAVE_SSL)
diff --git a/rsa.c b/rsa.c
index 597d20fb8..1df8fbc95 100644
--- a/rsa.c
+++ b/rsa.c
@@ -35,7 +35,7 @@
35*/ 35*/
36 36
37#include "includes.h" 37#include "includes.h"
38RCSID("$Id: rsa.c,v 1.7 2000/01/29 09:40:22 damien Exp $"); 38RCSID("$Id: rsa.c,v 1.8 2000/03/05 05:10:46 damien Exp $");
39 39
40#include "rsa.h" 40#include "rsa.h"
41#include "ssh.h" 41#include "ssh.h"
@@ -49,6 +49,7 @@ rsa_alive()
49{ 49{
50 RSA *key; 50 RSA *key;
51 51
52 seed_rng();
52 key = RSA_generate_key(32, 3, NULL, NULL); 53 key = RSA_generate_key(32, 3, NULL, NULL);
53 if (key == NULL) 54 if (key == NULL)
54 return (0); 55 return (0);
@@ -77,7 +78,7 @@ keygen_progress(int p, int n, void *arg)
77void 78void
78seed_rng() 79seed_rng()
79{ 80{
80 char buf[32]; 81 char buf[64];
81 82
82 get_random_bytes(buf, sizeof(buf)); 83 get_random_bytes(buf, sizeof(buf));
83 RAND_seed(buf, sizeof(buf)); 84 RAND_seed(buf, sizeof(buf));