]> andersk Git - openssh.git/commitdiff
- dtucker@cvs.openbsd.org 2008/07/01 07:24:22
authordtucker <dtucker>
Wed, 2 Jul 2008 12:34:30 +0000 (12:34 +0000)
committerdtucker <dtucker>
Wed, 2 Jul 2008 12:34:30 +0000 (12:34 +0000)
     [sshconnect.c sshd.c]
     Send CR LF during protocol banner exchanges, but only for Protocol 2 only,
     in order to comply with RFC 4253.  bz #1443, ok djm@

ChangeLog
sshconnect.c
sshd.c

index fc8dcca3c4d5603b55c3c26353269205ffa08ef3..50b523512049aeebd40b7ad7171b77f858e3081a 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
      [sshconnect.c]
      Check ExitOnForwardFailure if forwardings are disabled due to a failed
      host key check.  ok djm@
+   - dtucker@cvs.openbsd.org 2008/07/01 07:24:22
+     [sshconnect.c sshd.c]
+     Send CR LF during protocol banner exchanges, but only for Protocol 2 only,
+     in order to comply with RFC 4253.  bz #1443, ok djm@
 
 20080630
  - (djm) OpenBSD CVS Sync
index 8c5f66dd5576e33c81aa7bda2cce40dc27ba189a..ec8ba33e01674ea93d7b1cc14a9beb0e81621f78 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshconnect.c,v 1.210 2008/07/01 07:20:52 dtucker Exp $ */
+/* $OpenBSD: sshconnect.c,v 1.211 2008/07/01 07:24:22 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -537,10 +537,10 @@ ssh_exchange_identification(int timeout_ms)
                    (options.protocol & SSH_PROTO_2) ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
                    remote_major);
        /* Send our own protocol version identification. */
-       snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n",
+       snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s",
            compat20 ? PROTOCOL_MAJOR_2 : PROTOCOL_MAJOR_1,
            compat20 ? PROTOCOL_MINOR_2 : minor1,
-           SSH_VERSION);
+           SSH_VERSION, compat20 ? "\r\n" : "\n");
        if (atomicio(vwrite, connection_out, buf, strlen(buf)) != strlen(buf))
                fatal("write: %.100s", strerror(errno));
        client_version_string = xstrdup(buf);
diff --git a/sshd.c b/sshd.c
index 8ebbbee7bbb997c81605a3d6a8c9e99a0e442c2e..c952f7ad2bb904619e55c92a5b9704ba2dc38495 100644 (file)
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: sshd.c,v 1.362 2008/06/14 17:07:11 dtucker Exp $ */
+/* $OpenBSD: sshd.c,v 1.363 2008/07/01 07:24:22 dtucker Exp $ */
 /*
  * Author: Tatu Ylonen <ylo@cs.hut.fi>
  * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -399,7 +399,7 @@ sshd_exchange_identification(int sock_in, int sock_out)
        int mismatch;
        int remote_major, remote_minor;
        int major, minor;
-       char *s;
+       char *s, *newline = "\n";
        char buf[256];                  /* Must not be larger than remote_version. */
        char remote_version[256];       /* Must be at least as big as buf. */
 
@@ -410,11 +410,13 @@ sshd_exchange_identification(int sock_in, int sock_out)
        } else if (options.protocol & SSH_PROTO_2) {
                major = PROTOCOL_MAJOR_2;
                minor = PROTOCOL_MINOR_2;
+               newline = "\r\n";
        } else {
                major = PROTOCOL_MAJOR_1;
                minor = PROTOCOL_MINOR_1;
        }
-       snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s\n", major, minor, SSH_VERSION);
+       snprintf(buf, sizeof buf, "SSH-%d.%d-%.100s%s", major, minor,
+           SSH_VERSION, newline);
        server_version_string = xstrdup(buf);
 
        /* Send our protocol version identification. */
This page took 1.030777 seconds and 5 git commands to generate.