diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-05 23:29:59 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-08-05 23:29:59 +0000 |
commit | 2e249ed77fb9d32e161d3457d9252252d9d1e963 (patch) | |
tree | 7ec4c9ffd2ac27c505e0def16e64b9164f164ca0 | |
parent | 895566b8155ce66e8478d2d7312ad8aeec88a774 (diff) |
make -t dsa work with commercial servers, too
-rw-r--r-- | usr.bin/ssh/ssh-keyscan.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 6a2c62fcace..35f872472a8 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.26 2001/08/05 23:18:20 markus Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.27 2001/08/05 23:29:58 markus Exp $"); #include <sys/queue.h> #include <errno.h> @@ -479,8 +479,11 @@ congreet(int s) bufsiz = sizeof(buf); cp = buf; - while (bufsiz-- && (n = read(s, cp, 1)) == 1 && *cp != '\n' && *cp != '\r') + while (bufsiz-- && (n = read(s, cp, 1)) == 1 && *cp != '\n') { + if (*cp == '\r') + *cp = '\n'; cp++; + } if (n < 0) { if (errno != ECONNREFUSED) error("read (%s): %s", c->c_name, strerror(errno)); @@ -493,7 +496,6 @@ congreet(int s) return; } *cp = '\0'; - fprintf(stderr, "# %s %s\n", c->c_name, buf); if (c->c_keytype != KT_RSA1) { int remote_major, remote_minor; char remote_version[sizeof buf]; @@ -509,6 +511,7 @@ congreet(int s) return; } } + fprintf(stderr, "# %s %s\n", c->c_name, chop(buf)); n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", c->c_keytype == KT_RSA1? PROTOCOL_MAJOR_1 : PROTOCOL_MAJOR_2, c->c_keytype == KT_RSA1? PROTOCOL_MINOR_1 : PROTOCOL_MINOR_2); |