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 07:56:04 +0100
commit4b6eb05023f415c3c3097a69066c7f2a326d173f (patch)
tree04c25a0254e2f45579d22e5bada2a7f5fb509542
parent59ada799d765a828ef48897221579d56012bd240 (diff)
downloadlibssh-4b6eb05023f415c3c3097a69066c7f2a326d173f.tar.gz
libssh-4b6eb05023f415c3c3097a69066c7f2a326d173f.tar.xz
libssh-4b6eb05023f415c3c3097a69066c7f2a326d173f.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>
-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;
}
}