From 055f102601c201463d628d910c2f9dfe0e91d075 Mon Sep 17 00:00:00 2001 From: Andreas Schneider Date: Wed, 17 Dec 2014 19:39:18 +0100 Subject: libcrypto: Fix Windows build with ssh_reseed(). gettimeofday() is not available on Windows and we need it only in case of forking. Signed-off-by: Andreas Schneider (cherry picked from commit b7b535816d5fa49b0d1783f4cb42086f4169b1da) --- src/libcrypto.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'src') diff --git a/src/libcrypto.c b/src/libcrypto.c index 174b0c64..afa8bdc9 100644 --- a/src/libcrypto.c +++ b/src/libcrypto.c @@ -19,11 +19,14 @@ * MA 02111-1307, USA. */ +#include "config.h" #include #include #include +#ifdef HAVE_SYS_TIME_H #include +#endif #include "libssh/priv.h" #include "libssh/session.h" @@ -78,9 +81,11 @@ static int alloc_key(struct ssh_cipher_struct *cipher) { } void ssh_reseed(void){ +#ifndef _WIN32 struct timeval tv; gettimeofday(&tv, NULL); RAND_add(&tv, sizeof(tv), 0.0); +#endif } SHACTX sha1_init(void) { -- cgit