aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schneider <asn@cryptomilk.org>2014-12-17 19:39:18 +0100
committerAndreas Schneider <asn@cryptomilk.org>2014-12-17 19:39:18 +0100
commitb7b535816d5fa49b0d1783f4cb42086f4169b1da (patch)
tree317968a313dde1fe9c70b4355b5a5ef2c532f39f /src
parentd8e691b58a54ccaadcad11b3b205c77b27b8dbe5 (diff)
downloadlibssh-b7b535816d5fa49b0d1783f4cb42086f4169b1da.tar.gz
libssh-b7b535816d5fa49b0d1783f4cb42086f4169b1da.tar.xz
libssh-b7b535816d5fa49b0d1783f4cb42086f4169b1da.zip
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 <asn@cryptomilk.org>
Diffstat (limited to 'src')
-rw-r--r--src/libcrypto.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/libcrypto.c b/src/libcrypto.c
index 479c8c18..00f107f7 100644
--- a/src/libcrypto.c
+++ b/src/libcrypto.c
@@ -19,11 +19,14 @@
* MA 02111-1307, USA.
*/
+#include "config.h"
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
+#ifdef HAVE_SYS_TIME_H
#include <sys/time.h>
+#endif
#include "libssh/priv.h"
#include "libssh/session.h"
@@ -80,9 +83,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) {