From 4e1bdf41839fcf15592df4ca377d833c9dc52a75 Mon Sep 17 00:00:00 2001 From: Dave Eargle Date: Fri, 26 Oct 2018 02:05:23 -0600 Subject: [PATCH] make thread-safe against old openssl versions --- hydra-ssh.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/hydra-ssh.c b/hydra-ssh.c index 3808a35..7ee9405 100644 --- a/hydra-ssh.c +++ b/hydra-ssh.c @@ -33,6 +33,7 @@ int32_t start_ssh(int32_t s, char *ip, int32_t port, unsigned char options, char if (strlen(pass = hydra_get_next_password()) == 0) pass = empty; + if (new_session) { if (session) { ssh_disconnect(session); @@ -40,6 +41,7 @@ int32_t start_ssh(int32_t s, char *ip, int32_t port, unsigned char options, char ssh_free(session); } + ssh_init(); session = ssh_new(); ssh_options_set(session, SSH_OPTIONS_PORT, &port); ssh_options_set(session, SSH_OPTIONS_HOST, hydra_address2string(ip));