summaryrefslogtreecommitdiff
path: root/ssh-keyscan.c
diff options
context:
space:
mode:
Diffstat (limited to 'ssh-keyscan.c')
-rw-r--r--ssh-keyscan.c22
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 @@
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",