diff options
author | Damien Miller <djm@mindrot.org> | 2001-12-21 02:45:43 +0100 |
---|---|---|
committer | Damien Miller <djm@mindrot.org> | 2001-12-21 02:45:43 +0100 |
commit | 83c02ef6239a763483b5f2dc7ffdb4b5f713052b (patch) | |
tree | 8519087955717cc9eb2fe839d06bb655d8d813c2 /ssh-keyscan.c | |
parent | - stevesk@cvs.openbsd.org 2001/12/10 16:45:04 (diff) | |
download | openssh-83c02ef6239a763483b5f2dc7ffdb4b5f713052b.tar.xz openssh-83c02ef6239a763483b5f2dc7ffdb4b5f713052b.zip |
- markus@cvs.openbsd.org 2001/12/10 20:34:31
[ssh-keyscan.c]
check that server supports v1 for -t rsa1, report from wirth@dfki.de
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r-- | ssh-keyscan.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/ssh-keyscan.c b/ssh-keyscan.c index fb061253c..80eab2692 100644 --- a/ssh-keyscan.c +++ b/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.32 2001/11/22 05:27:29 stevesk Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.33 2001/12/10 20:34:31 markus Exp $"); #if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) #include <sys/queue.h> @@ -493,8 +493,9 @@ static void congreet(int s) { char buf[256], *cp; + char remote_version[sizeof buf]; size_t bufsiz; - int n = 0; + int remote_major, remote_minor, n = 0; con *c = &fdcon[s]; bufsiz = sizeof(buf); @@ -516,20 +517,21 @@ congreet(int s) return; } *cp = '\0'; + if (sscanf(buf, "SSH-%d.%d-%[^\n]\n", + &remote_major, &remote_minor, remote_version) == 3) + compat_datafellows(remote_version); + else + datafellows = 0; if (c->c_keytype != KT_RSA1) { - int remote_major, remote_minor; - char remote_version[sizeof buf]; - - if (sscanf(buf, "SSH-%d.%d-%[^\n]\n", - &remote_major, &remote_minor, remote_version) == 3) - compat_datafellows(remote_version); - else - datafellows = 0; if (!ssh2_capable(remote_major, remote_minor)) { debug("%s doesn't support ssh2", c->c_name); confree(s); return; } + } else if (remote_major != 1) { + debug("%s doesn't support ssh1", c->c_name); + confree(s); + return; } fprintf(stderr, "# %s %s\n", c->c_name, chop(buf)); n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", |