summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authordtucker <dtucker>2008-07-02 12:34:30 +0000
committerdtucker <dtucker>2008-07-02 12:34:30 +0000
commit7038cff7ee8ac28ca17f8a5d5337525fdb8a596e (patch)
tree792e6ea644670985e1b0dbd540c9e4b14574e6e6 /sshd.c
parent499ad32e38befa166b3a97bfdf1127e85bc9e8ad (diff)
downloadopenssh-7038cff7ee8ac28ca17f8a5d5337525fdb8a596e.tar.gz
- 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@
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sshd.c b/sshd.c
index 8ebbbee7..c952f7ad 100644
--- 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. */