[ssh-keyscan.c]
     make -t dsa work with commercial servers, too
This commit is contained in:
Ben Lindstrom 2001-08-06 22:43:50 +00:00
parent 325e70c90f
commit de8fc6fadc
2 changed files with 10 additions and 4 deletions

View File

@ -141,6 +141,9 @@
- markus@cvs.openbsd.org 2001/08/05 23:18:20
[ssh-keyscan.1 ssh-keyscan.c]
ssh 2 support; from wayned@users.sourceforge.net
- markus@cvs.openbsd.org 2001/08/05 23:29:58
[ssh-keyscan.c]
make -t dsa work with commercial servers, too
20010803
- (djm) Fix interrupted read in entropy gatherer. Spotted by markus@ on
@ -6251,4 +6254,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
$Id: ChangeLog,v 1.1463 2001/08/06 22:41:30 mouring Exp $
$Id: ChangeLog,v 1.1464 2001/08/06 22:43:50 mouring Exp $

View File

@ -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);