summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--ssh-keyscan.c22
2 files changed, 16 insertions, 11 deletions
diff --git a/ChangeLog b/ChangeLog
index e29fb6c88..587f769df 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -15,6 +15,9 @@
15 - stevesk@cvs.openbsd.org 2001/12/10 16:45:04 15 - stevesk@cvs.openbsd.org 2001/12/10 16:45:04
16 [sshd.c] 16 [sshd.c]
17 possible fd leak on error; ok markus@ 17 possible fd leak on error; ok markus@
18 - markus@cvs.openbsd.org 2001/12/10 20:34:31
19 [ssh-keyscan.c]
20 check that server supports v1 for -t rsa1, report from wirth@dfki.de
18 21
1920011219 2220011219
20 - (stevesk) OpenBSD CVS sync X11 localhost display 23 - (stevesk) OpenBSD CVS sync X11 localhost display
@@ -7043,4 +7046,4 @@
7043 - Wrote replacements for strlcpy and mkdtemp 7046 - Wrote replacements for strlcpy and mkdtemp
7044 - Released 1.0pre1 7047 - Released 1.0pre1
7045 7048
7046$Id: ChangeLog,v 1.1696 2001/12/21 01:44:28 djm Exp $ 7049$Id: ChangeLog,v 1.1697 2001/12/21 01:45:43 djm Exp $
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 @@
7 */ 7 */
8 8
9#include "includes.h" 9#include "includes.h"
10RCSID("$OpenBSD: ssh-keyscan.c,v 1.32 2001/11/22 05:27:29 stevesk Exp $"); 10RCSID("$OpenBSD: ssh-keyscan.c,v 1.33 2001/12/10 20:34:31 markus Exp $");
11 11
12#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H) 12#if defined(HAVE_SYS_QUEUE_H) && !defined(HAVE_BOGUS_SYS_QUEUE_H)
13#include <sys/queue.h> 13#include <sys/queue.h>
@@ -493,8 +493,9 @@ static void
493congreet(int s) 493congreet(int s)
494{ 494{
495 char buf[256], *cp; 495 char buf[256], *cp;
496 char remote_version[sizeof buf];
496 size_t bufsiz; 497 size_t bufsiz;
497 int n = 0; 498 int remote_major, remote_minor, n = 0;
498 con *c = &fdcon[s]; 499 con *c = &fdcon[s];
499 500
500 bufsiz = sizeof(buf); 501 bufsiz = sizeof(buf);
@@ -516,20 +517,21 @@ congreet(int s)
516 return; 517 return;
517 } 518 }
518 *cp = '\0'; 519 *cp = '\0';
520 if (sscanf(buf, "SSH-%d.%d-%[^\n]\n",
521 &remote_major, &remote_minor, remote_version) == 3)
522 compat_datafellows(remote_version);
523 else
524 datafellows = 0;
519 if (c->c_keytype != KT_RSA1) { 525 if (c->c_keytype != KT_RSA1) {
520 int remote_major, remote_minor;
521 char remote_version[sizeof buf];
522
523 if (sscanf(buf, "SSH-%d.%d-%[^\n]\n",
524 &remote_major, &remote_minor, remote_version) == 3)
525 compat_datafellows(remote_version);
526 else
527 datafellows = 0;
528 if (!ssh2_capable(remote_major, remote_minor)) { 526 if (!ssh2_capable(remote_major, remote_minor)) {
529 debug("%s doesn't support ssh2", c->c_name); 527 debug("%s doesn't support ssh2", c->c_name);
530 confree(s); 528 confree(s);
531 return; 529 return;
532 } 530 }
531 } else if (remote_major != 1) {
532 debug("%s doesn't support ssh1", c->c_name);
533 confree(s);
534 return;
533 } 535 }
534 fprintf(stderr, "# %s %s\n", c->c_name, chop(buf)); 536 fprintf(stderr, "# %s %s\n", c->c_name, chop(buf));
535 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n", 537 n = snprintf(buf, sizeof buf, "SSH-%d.%d-OpenSSH-keyscan\r\n",