summaryrefslogtreecommitdiffstats
path: root/usr.bin/ssh/ssh-keyscan.c
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2001-12-10 20:34:31 +0000
committermarkus <markus@openbsd.org>2001-12-10 20:34:31 +0000
commit2a05ca0f7ec5ad664234b99a489bc3851a26db55 (patch)
tree6c1d0610d147fb8a8175c425f4370d446900bf40 /usr.bin/ssh/ssh-keyscan.c
parentfollow post-2.1 ip_off & ip_len byte orders (diff)
downloadwireguard-openbsd-2a05ca0f7ec5ad664234b99a489bc3851a26db55.tar.xz
wireguard-openbsd-2a05ca0f7ec5ad664234b99a489bc3851a26db55.zip
check that server supports v1 for -t rsa1, report from wirth@dfki.de
Diffstat (limited to 'usr.bin/ssh/ssh-keyscan.c')
-rw-r--r--usr.bin/ssh/ssh-keyscan.c22
1 files changed, 12 insertions, 10 deletions
diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c
index 2f7b0df2bf3..d714feb94b7 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.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 $");
#include <sys/queue.h>
#include <errno.h>
@@ -469,8 +469,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);
@@ -492,20 +493,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",