Compatibility with 1.2.16 (commercial)?

Mark D. Baushke mdb at juniper.net
Tue Oct 31 06:23:17 EST 2000


Hi Benjamin,

There is no good reason that an OpenSSH client should not be able to
speak to a 1.4 protocol ssh server.

	Enjoy!
	-- Mark

The following is a patch against openssh-SNAP-20001028 to use the
appropriate minor version number for clients connecting to down-rev
servers. Could the powers that be consider this one for inclusion in
the next OpenSSH release?

--- sshconnect.c~	Fri Sep 22 23:15:57 2000
+++ sshconnect.c	Mon Oct 30 11:16:22 2000
@@ -321,6 +321,7 @@
 	int remote_major, remote_minor, i, mismatch;
 	int connection_in = packet_get_connection_in();
 	int connection_out = packet_get_connection_out();
+	int use_minor = PROTOCOL_MINOR_1;
 
 	/* Read other side\'s version identification. */
 	for (;;) {
@@ -377,10 +378,18 @@
 		} else if (remote_minor == 3) {
 			/* We speak 1.3, too. */
 			enable_compat13();
+			use_minor = 3;
 			if (options.forward_agent) {
 				log("Agent forwarding disabled for protocol 1.3");
 				options.forward_agent = 0;
 			}
+		} else if (remote_minor == 4) {
+			/* We speak 1.4, too. */
+			use_minor = 4;
+			if (options.forward_agent) {
+				log("Agent forwarding disabled for protocol 1.4");
+				options.forward_agent = 0;
+			}
 		}
 		break;
 	case 2:
@@ -402,7 +411,7 @@
 	/* Send our own protocol version identification. */
 	snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
 	    compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
-	    compat20 ? PROTOCOL_MINOR_2 : PROTOCOL_MINOR_1,
+	    compat20 ? PROTOCOL_MINOR_2 : use_minor,
 	    SSH_VERSION);
 	if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf))
 		fatal("write: %.100s", strerror(errno));





More information about the openssh-unix-dev mailing list