summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-12-21 12:45:43 +1100
committerDamien Miller <djm@mindrot.org>2001-12-21 12:45:43 +1100
commit83c02ef6239a763483b5f2dc7ffdb4b5f713052b (patch)
tree8519087955717cc9eb2fe839d06bb655d8d813c2
parent72c336def6499559ec7069fc612b45c1c4957508 (diff)
- 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
-rw-r--r--ChangeLog5
-rw-r--r--ssh-keyscan.c22
2 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e29fb6c8..587f769d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
- stevesk@cvs.openbsd.org 2001/12/10 16:45:04
[sshd.c]
possible fd leak on error; ok markus@
+ - 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
20011219
- (stevesk) OpenBSD CVS sync X11 localhost display
@@ -7043,4 +7046,4 @@
- Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1
-$Id: ChangeLog,v 1.1696 2001/12/21 01:44:28 djm Exp $
+$Id: ChangeLog,v 1.1697 2001/12/21 01:45:43 djm Exp $
diff --git a/ssh-keyscan.c b/ssh-keyscan.c
index fb061253..80eab269 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",