summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
authormouring <mouring>2001-08-06 22:43:50 +0000
committermouring <mouring>2001-08-06 22:43:50 +0000
commit58a40ab6340149d17ecea61b233879fa439822c5 (patch)
tree57419a461ea2b19808f750971c4637038560702c /ssh-keyscan.c
parente2b16d8ec44b6b98f438e99f77d6d8c48cdb7ea1 (diff)
downloadopenssh-58a40ab6340149d17ecea61b233879fa439822c5.tar.gz
- markus@cvs.openbsd.org 2001/08/05 23:29:58
[ssh-keyscan.c] make -t dsa work with commercial servers, too
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index 5a992515..3f8c5b40 100644
--- a/ssh-keyscan.c
+++ b/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 $");
#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
#include <sys/queue.h>
@@ -499,8 +499,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));
@@ -513,7 +516,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];
@@ -529,6 +531,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);