summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2000-11-06 23:16:35 +0000
committermarkus <markus@openbsd.org>2000-11-06 23:16:35 +0000
commit48b99e8acc47fb3deb6fdebe37296d5744e301b8 (patch)
treef7843c04ee560df9ac1dd1e2e9489c90692c15da
parentdo not disabled rhosts(rsa) if server port > 1024; from pekkas@netcore.fi (diff)
downloadwireguard-openbsd-48b99e8acc47fb3deb6fdebe37296d5744e301b8.tar.xz
wireguard-openbsd-48b99e8acc47fb3deb6fdebe37296d5744e301b8.zip
downgrade client to 1.3 if server is 1.4; help from mdb@juniper.net
-rw-r--r--usr.bin/ssh/sshconnect.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c
index a0551f0927c..6248e1c5a0c 100644
--- a/usr.bin/ssh/sshconnect.c
+++ b/usr.bin/ssh/sshconnect.c
@@ -13,7 +13,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: sshconnect.c,v 1.80 2000/11/06 23:13:26 markus Exp $");
+RCSID("$OpenBSD: sshconnect.c,v 1.81 2000/11/06 23:16:35 markus Exp $");
#include <openssl/bn.h>
#include <openssl/dsa.h>
@@ -313,6 +313,7 @@ ssh_exchange_identification()
int remote_major, remote_minor, i, mismatch;
int connection_in = packet_get_connection_in();
int connection_out = packet_get_connection_out();
+ int minor1 = PROTOCOL_MINOR_1;
/* Read other side\'s version identification. */
for (;;) {
@@ -366,9 +367,10 @@ ssh_exchange_identification()
}
if (remote_minor < 3) {
fatal("Remote machine has too old SSH software version.");
- } else if (remote_minor == 3) {
+ } else if (remote_minor == 3 || remote_minor == 4) {
/* We speak 1.3, too. */
enable_compat13();
+ minor1 = 3;
if (options.forward_agent) {
log("Agent forwarding disabled for protocol 1.3");
options.forward_agent = 0;
@@ -394,7 +396,7 @@ ssh_exchange_identification()
/* 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 : minor1,
SSH_VERSION);
if (atomicio(write, connection_out, buf, strlen(buf)) != strlen(buf))
fatal("write: %.100s", strerror(errno));