From 8b4de1c4771d43ac87e9d4316bb02cf7e91fb4d6 Mon Sep 17 00:00:00 2001 From: Tilo Eckert Date: Tue, 13 Nov 2018 12:21:53 +0100 Subject: [PATCH] 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 Reviewed-by: Andreas Schneider (cherry picked from commit 4b6eb05023f415c3c3097a69066c7f2a326d173f) --- src/packet_cb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; } }