diff -rupN a/include/libssh/wrapper.h b/include/libssh/wrapper.h --- a/include/libssh/wrapper.h 2013-07-26 06:39:39.000000000 +0000 +++ b/include/libssh/wrapper.h 2014-03-09 16:38:49.807812235 +0000 @@ -44,5 +44,6 @@ int crypt_set_algorithms_server(ssh_sess struct ssh_crypto_struct *crypto_new(void); void crypto_free(struct ssh_crypto_struct *crypto); +void ssh_reseed(void); #endif /* WRAPPER_H_ */ diff -rupN a/src/bind.c b/src/bind.c --- a/src/bind.c 2013-07-26 06:39:39.000000000 +0000 +++ b/src/bind.c 2014-03-09 16:39:00.571080087 +0000 @@ -375,6 +375,7 @@ int ssh_bind_accept(ssh_bind sshbind, ss session->dsa_key = dsa; session->rsa_key = rsa; + ssh_reseed(); return SSH_OK; } diff -rupN a/src/libcrypto.c b/src/libcrypto.c --- a/src/libcrypto.c 2013-07-26 06:39:39.000000000 +0000 +++ b/src/libcrypto.c 2014-03-09 16:40:07.807331327 +0000 @@ -23,6 +23,7 @@ #include #include #include +#include #include "libssh/priv.h" #include "libssh/session.h" @@ -38,6 +39,8 @@ #include #include #include +#include + #ifdef HAVE_OPENSSL_AES_H #define HAS_AES #include @@ -66,6 +69,12 @@ static int alloc_key(struct crypto_struc return 0; } +void ssh_reseed(void) { + struct timeval tv; + gettimeofday(&tv, NULL); + RAND_add(&tv, sizeof(tv), 0.0); +} + SHACTX sha1_init(void) { SHACTX c = malloc(sizeof(*c)); if (c == NULL) { diff -rupN a/src/libgcrypt.c b/src/libgcrypt.c --- a/src/libgcrypt.c 2013-07-26 06:39:39.000000000 +0000 +++ b/src/libgcrypt.c 2014-03-09 16:40:51.730392881 +0000 @@ -41,6 +41,9 @@ static int alloc_key(struct crypto_struc return 0; } +void ssh_reseed(void) { + } + SHACTX sha1_init(void) { SHACTX ctx = NULL; gcry_md_open(&ctx, GCRY_MD_SHA1, 0);