mirror of
https://github.com/PowerShell/openssh-portable.git
synced 2025-07-29 16:54:51 +02:00
- Explicitly seed OpenSSL's PRNG before checking rsa_alive()
This commit is contained in:
parent
01bedb83b1
commit
fac99cd12a
@ -1,5 +1,6 @@
|
|||||||
20000305
|
20000305
|
||||||
- Fix DEC compile fix
|
- Fix DEC compile fix
|
||||||
|
- Explicitly seed OpenSSL's PRNG before checking rsa_alive()
|
||||||
|
|
||||||
20000303
|
20000303
|
||||||
- Added "make host-key" target, Suggestion from Dominik Brettnacher
|
- Added "make host-key" target, Suggestion from Dominik Brettnacher
|
||||||
|
@ -160,7 +160,9 @@ for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/
|
|||||||
#include <openssl/bn.h>
|
#include <openssl/bn.h>
|
||||||
#include <openssl/sha.h>
|
#include <openssl/sha.h>
|
||||||
int main(void)
|
int main(void)
|
||||||
{RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);}
|
{RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
|
||||||
|
RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
|
||||||
|
return(key==NULL);}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
AC_DEFINE(HAVE_OPENSSL)
|
AC_DEFINE(HAVE_OPENSSL)
|
||||||
@ -174,7 +176,9 @@ for ssldir in "" $tryssldir /usr /usr/local/openssl /usr/lib/openssl /usr/local/
|
|||||||
#include <ssl/bn.h>
|
#include <ssl/bn.h>
|
||||||
#include <ssl/sha.h>
|
#include <ssl/sha.h>
|
||||||
int main(void)
|
int main(void)
|
||||||
{RSA *key;key=RSA_generate_key(32,3,NULL,NULL);return(key==NULL);}
|
{RSA *key; char seed[2048];memset(seed, 0, sizeof(seed));
|
||||||
|
RAND_seed(seed, sizeof(seed));key=RSA_generate_key(32,3,NULL,NULL);
|
||||||
|
return(key==NULL);}
|
||||||
],
|
],
|
||||||
[
|
[
|
||||||
AC_DEFINE(HAVE_SSL)
|
AC_DEFINE(HAVE_SSL)
|
||||||
|
5
rsa.c
5
rsa.c
@ -35,7 +35,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "includes.h"
|
#include "includes.h"
|
||||||
RCSID("$Id: rsa.c,v 1.7 2000/01/29 09:40:22 damien Exp $");
|
RCSID("$Id: rsa.c,v 1.8 2000/03/05 05:10:46 damien Exp $");
|
||||||
|
|
||||||
#include "rsa.h"
|
#include "rsa.h"
|
||||||
#include "ssh.h"
|
#include "ssh.h"
|
||||||
@ -49,6 +49,7 @@ rsa_alive()
|
|||||||
{
|
{
|
||||||
RSA *key;
|
RSA *key;
|
||||||
|
|
||||||
|
seed_rng();
|
||||||
key = RSA_generate_key(32, 3, NULL, NULL);
|
key = RSA_generate_key(32, 3, NULL, NULL);
|
||||||
if (key == NULL)
|
if (key == NULL)
|
||||||
return (0);
|
return (0);
|
||||||
@ -77,7 +78,7 @@ keygen_progress(int p, int n, void *arg)
|
|||||||
void
|
void
|
||||||
seed_rng()
|
seed_rng()
|
||||||
{
|
{
|
||||||
char buf[32];
|
char buf[64];
|
||||||
|
|
||||||
get_random_bytes(buf, sizeof(buf));
|
get_random_bytes(buf, sizeof(buf));
|
||||||
RAND_seed(buf, sizeof(buf));
|
RAND_seed(buf, sizeof(buf));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user