summaryrefslogtreecommitdiff
path: root/sshconnect.c
diff options
context:
space:
mode:
authorBen Lindstrom <mouring@eviladmin.org>2001-03-13 04:57:58 +0000
committerBen Lindstrom <mouring@eviladmin.org>2001-03-13 04:57:58 +0000
commitcfccef96a35cb954023a31f9bc10cf3b8f9f8ed3 (patch)
tree4b4137478ea523bc49c8b53aace863e9a80e0031 /sshconnect.c
parent9ae2bb6790ab8d00b5cd29309889b2db50a9bef9 (diff)
- OpenBSD CVS Sync
- markus@cvs.openbsd.org 2001/03/12 22:02:02 [key.c key.h ssh-add.c ssh-keygen.c sshconnect.c sshconnect2.c] remove old key_fingerprint interface, s/_ex//
Diffstat (limited to 'sshconnect.c')
-rw-r--r--sshconnect.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/sshconnect.c b/sshconnect.c
index 573ae76b1..d82be89e9 100644
--- a/sshconnect.c
+++ b/sshconnect.c
@@ -13,7 +13,7 @@
13 */ 13 */
14 14
15#include "includes.h" 15#include "includes.h"
16RCSID("$OpenBSD: sshconnect.c,v 1.99 2001/03/10 15:31:00 deraadt Exp $"); 16RCSID("$OpenBSD: sshconnect.c,v 1.100 2001/03/12 22:02:02 markus Exp $");
17 17
18#include <openssl/bn.h> 18#include <openssl/bn.h>
19 19
@@ -481,7 +481,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
481 Key *file_key; 481 Key *file_key;
482 char *type = key_type(host_key); 482 char *type = key_type(host_key);
483 char *ip = NULL; 483 char *ip = NULL;
484 char hostline[1000], *hostp; 484 char hostline[1000], *hostp, *fp;
485 HostStatus host_status; 485 HostStatus host_status;
486 HostStatus ip_status; 486 HostStatus ip_status;
487 int local = 0, host_ip_differ = 0; 487 int local = 0, host_ip_differ = 0;
@@ -612,11 +612,13 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
612 } else if (options.strict_host_key_checking == 2) { 612 } else if (options.strict_host_key_checking == 2) {
613 /* The default */ 613 /* The default */
614 char prompt[1024]; 614 char prompt[1024];
615 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
615 snprintf(prompt, sizeof(prompt), 616 snprintf(prompt, sizeof(prompt),
616 "The authenticity of host '%.200s (%s)' can't be established.\n" 617 "The authenticity of host '%.200s (%s)' can't be established.\n"
617 "%s key fingerprint is %s.\n" 618 "%s key fingerprint is %s.\n"
618 "Are you sure you want to continue connecting (yes/no)? ", 619 "Are you sure you want to continue connecting (yes/no)? ",
619 host, ip, type, key_fingerprint(host_key)); 620 host, ip, type, fp);
621 xfree(fp);
620 if (!read_yes_or_no(prompt, -1)) 622 if (!read_yes_or_no(prompt, -1))
621 fatal("Aborted by user!"); 623 fatal("Aborted by user!");
622 } 624 }
@@ -655,6 +657,7 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
655 error("Offending key for IP in %s:%d", ip_file, ip_line); 657 error("Offending key for IP in %s:%d", ip_file, ip_line);
656 } 658 }
657 /* The host key has changed. */ 659 /* The host key has changed. */
660 fp = key_fingerprint(host_key, SSH_FP_MD5, SSH_FP_HEX);
658 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); 661 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
659 error("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @"); 662 error("@ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @");
660 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@"); 663 error("@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@");
@@ -662,11 +665,12 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
662 error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!"); 665 error("Someone could be eavesdropping on you right now (man-in-the-middle attack)!");
663 error("It is also possible that the %s host key has just been changed.", type); 666 error("It is also possible that the %s host key has just been changed.", type);
664 error("The fingerprint for the %s key sent by the remote host is\n%s.", 667 error("The fingerprint for the %s key sent by the remote host is\n%s.",
665 type, key_fingerprint(host_key)); 668 type, fp);
666 error("Please contact your system administrator."); 669 error("Please contact your system administrator.");
667 error("Add correct host key in %.100s to get rid of this message.", 670 error("Add correct host key in %.100s to get rid of this message.",
668 user_hostfile); 671 user_hostfile);
669 error("Offending key in %s:%d", host_file, host_line); 672 error("Offending key in %s:%d", host_file, host_line);
673 xfree(fp);
670 674
671 /* 675 /*
672 * If strict host key checking is in use, the user will have 676 * If strict host key checking is in use, the user will have