Problems connecting with SSH2

Peter Stuge stuge-openssh-unix-dev at cdy.org
Fri Feb 15 13:57:59 EST 2008


On Fri, Feb 15, 2008 at 03:23:19AM +0100, Peter Stuge wrote:
> OpenSSH doesn't like these. Maybe it should simply ignore packet
> types between SSH2_MSG_LOCAL_MIN and SSH2_MSG_LOCAL_MAX, rather
> than disconnect?

Joe, here is a patch you could try. Written dry with no testing, so
it may well break the communication in a different way. I am not sure
if we need to consume the remaining bytes in the packet, or not. If
not, this patch should work. I think not, since IGNORE packets can
contain extra data and packet.c currently does not deal with that.
Clever packet handling could just discard whatever is not consumed
when the next packet is read.


//Peter
-------------- next part --------------
--- packet.c.orig	2007-06-11 06:01:42.000000000 +0200
+++ packet.c	2008-02-15 03:56:36.000000000 +0100
@@ -1167,8 +1167,10 @@
 	 * return length of payload (without type field)
 	 */
 	type = buffer_get_char(&incoming_packet);
-	if (type < SSH2_MSG_MIN || type >= SSH2_MSG_LOCAL_MIN)
+	if (type < SSH2_MSG_MIN)
 		packet_disconnect("Invalid ssh2 packet type: %d", type);
+	else if (type >= SSH2_MSG_LOCAL_MIN && type <= SSH2_MSG_LOCAL_MAX)
+		type = SSH2_MSG_IGNORE;
 	if (type == SSH2_MSG_NEWKEYS)
 		set_newkeys(MODE_IN);
 	else if (type == SSH2_MSG_USERAUTH_SUCCESS && !server_side)


More information about the openssh-unix-dev mailing list