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 4b6eb05023)
This commit is contained in:
Tilo Eckert
2018-11-13 12:21:53 +01:00
committed by Andreas Schneider
parent 906f63ba97
commit 8b4de1c477

View File

@@ -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;
}
}