aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTilo Eckert <tilo.eckert@flam.de>2018-11-13 12:21:53 +0100
committerAndreas Schneider <asn@cryptomilk.org>2018-11-20 08:46:41 +0100
commit8b4de1c4771d43ac87e9d4316bb02cf7e91fb4d6 (patch)
tree419c505b144fc0e8630b2be68d037ad7bea9cb1f
parent906f63ba97327bb94ae08eaecd2d05b3c424eab1 (diff)
downloadlibssh-8b4de1c4771d43ac87e9d4316bb02cf7e91fb4d6.tar.gz
libssh-8b4de1c4771d43ac87e9d4316bb02cf7e91fb4d6.tar.xz
libssh-8b4de1c4771d43ac87e9d4316bb02cf7e91fb4d6.zip
packet: Fix timeout on hostkey type mismatch instead of proper error
If the hostkey type was not in the list of acceptable hostkey types, the function failed to set the error state. Due to the fact that the calling function ssh_packet_process() does not handle the SSH_ERROR return code, the newkeys packet from the server was silently ignored, stalling the connection until a timeout occurred. Signed-off-by: Tilo Eckert <tilo.eckert@flam.de> Reviewed-by: Andreas Schneider <asn@cryptomilk.org> (cherry picked from commit 4b6eb05023f415c3c3097a69066c7f2a326d173f)
-rw-r--r--src/packet_cb.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/packet_cb.c b/src/packet_cb.c
index dc883244..af5b966c 100644
--- a/src/packet_cb.c
+++ b/src/packet_cb.c
@@ -198,7 +198,7 @@ SSH_PACKET_CALLBACK(ssh_packet_newkeys){
"preference (%s)",
server_key->type_c,
session->opts.wanted_methods[SSH_HOSTKEYS]);
- return -1;
+ goto error;
}
}