diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | ssh-keyscan.c | 20 |
2 files changed, 18 insertions, 8 deletions
@@ -58,6 +58,10 @@ | |||
58 | [ssh_config.5] | 58 | [ssh_config.5] |
59 | mention control socket fallback behaviour, reported by | 59 | mention control socket fallback behaviour, reported by |
60 | tryponraj AT gmail.com | 60 | tryponraj AT gmail.com |
61 | - djm@cvs.openbsd.org 2005/10/30 04:01:03 | ||
62 | [ssh-keyscan.c] | ||
63 | make ssh-keygen discard junk from server before SSH- ident, spotted by | ||
64 | dave AT cirt.net; ok dtucker@ | ||
61 | 65 | ||
62 | 20051102 | 66 | 20051102 |
63 | - (dtucker) [openbsd-compat/bsd-misc.c] Bug #1108: fix broken strdup(). | 67 | - (dtucker) [openbsd-compat/bsd-misc.c] Bug #1108: fix broken strdup(). |
@@ -3191,4 +3195,4 @@ | |||
3191 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM | 3195 | - (djm) Trim deprecated options from INSTALL. Mention UsePAM |
3192 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu | 3196 | - (djm) Fix quote handling in sftp; Patch from admorten AT umich.edu |
3193 | 3197 | ||
3194 | $Id: ChangeLog,v 1.3940 2005/11/05 04:11:48 djm Exp $ | 3198 | $Id: ChangeLog,v 1.3941 2005/11/05 04:12:28 djm Exp $ |
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index 8ac97bd35..6915102dd 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c | |||
@@ -7,7 +7,7 @@ | |||
7 | */ | 7 | */ |
8 | 8 | ||
9 | #include "includes.h" | 9 | #include "includes.h" |
10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.56 2005/09/13 23:40:07 djm Exp $"); | 10 | RCSID("$OpenBSD: ssh-keyscan.c,v 1.57 2005/10/30 04:01:03 djm Exp $"); |
11 | 11 | ||
12 | #include "openbsd-compat/sys-queue.h" | 12 | #include "openbsd-compat/sys-queue.h" |
13 | 13 | ||
@@ -499,12 +499,18 @@ congreet(int s) | |||
499 | size_t bufsiz; | 499 | size_t bufsiz; |
500 | con *c = &fdcon[s]; | 500 | con *c = &fdcon[s]; |
501 | 501 | ||
502 | bufsiz = sizeof(buf); | 502 | for (;;) { |
503 | cp = buf; | 503 | memset(buf, '\0', sizeof(buf)); |
504 | while (bufsiz-- && (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { | 504 | bufsiz = sizeof(buf); |
505 | if (*cp == '\r') | 505 | cp = buf; |
506 | *cp = '\n'; | 506 | while (bufsiz-- && |
507 | cp++; | 507 | (n = atomicio(read, s, cp, 1)) == 1 && *cp != '\n') { |
508 | if (*cp == '\r') | ||
509 | *cp = '\n'; | ||
510 | cp++; | ||
511 | } | ||
512 | if (n != 1 || strncmp(buf, "SSH-", 4) == 0) | ||
513 | break; | ||
508 | } | 514 | } |
509 | if (n == 0) { | 515 | if (n == 0) { |
510 | switch (errno) { | 516 | switch (errno) { |