summaryrefslogtreecommitdiff
path: root/sshd.c
diff options
context:
space:
mode:
authordjm@openbsd.org <djm@openbsd.org>2017-02-06 09:22:51 +0000
committerDamien Miller <djm@mindrot.org>2017-02-06 20:23:47 +1100
commit5b90709ab8704dafdb31e5651073b259d98352bc (patch)
treeda0da26059aed9b3c09b67b5317ffcc58094c55e /sshd.c
parent97c31c46ee2e6b46dfffdfc4f90bbbf188064cbc (diff)
upstream commit
Restore \r\n newline sequence for server ident string. The CR got lost in the flensing of SSHv1. Pointed out by Stef Bon Upstream-ID: 5333fd43ce5396bf5999496096fac5536e678fac
Diffstat (limited to 'sshd.c')
-rw-r--r--sshd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sshd.c b/sshd.c
index 48fd64f3d..c2c1cc8a6 100644
--- a/sshd.c
+++ b/sshd.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: sshd.c,v 1.481 2017/02/03 02:56:00 dtucker Exp $ */ 1/* $OpenBSD: sshd.c,v 1.482 2017/02/06 09:22:51 djm Exp $ */
2/* 2/*
3 * Author: Tatu Ylonen <ylo@cs.hut.fi> 3 * Author: Tatu Ylonen <ylo@cs.hut.fi>
4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland 4 * Copyright (c) 1995 Tatu Ylonen <ylo@cs.hut.fi>, Espoo, Finland
@@ -362,14 +362,14 @@ sshd_exchange_identification(struct ssh *ssh, int sock_in, int sock_out)
362{ 362{
363 u_int i; 363 u_int i;
364 int remote_major, remote_minor; 364 int remote_major, remote_minor;
365 char *s, *newline = "\n"; 365 char *s;
366 char buf[256]; /* Must not be larger than remote_version. */ 366 char buf[256]; /* Must not be larger than remote_version. */
367 char remote_version[256]; /* Must be at least as big as buf. */ 367 char remote_version[256]; /* Must be at least as big as buf. */
368 368
369 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s%s", 369 xasprintf(&server_version_string, "SSH-%d.%d-%.100s%s%s\r\n",
370 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION, 370 PROTOCOL_MAJOR_2, PROTOCOL_MINOR_2, SSH_VERSION,
371 *options.version_addendum == '\0' ? "" : " ", 371 *options.version_addendum == '\0' ? "" : " ",
372 options.version_addendum, newline); 372 options.version_addendum);
373 373
374 /* Send our protocol version identification. */ 374 /* Send our protocol version identification. */
375 if (atomicio(vwrite, sock_out, server_version_string, 375 if (atomicio(vwrite, sock_out, server_version_string,