[sshconnect1.c sshconnect2.c sshconnect.c]
     unify hostkey check error messages, simplify prompt.
This commit is contained in:
Damien Miller 2001-10-10 15:03:11 +10:00
parent 9c75142917
commit 59d9fb9e55
4 changed files with 11 additions and 10 deletions

View File

@ -15,6 +15,9 @@
- markus@cvs.openbsd.org 2001/10/06 00:36:42 - markus@cvs.openbsd.org 2001/10/06 00:36:42
[session.c] [session.c]
fix typo in error message, sync with do_exec_nopty fix typo in error message, sync with do_exec_nopty
- markus@cvs.openbsd.org 2001/10/06 11:18:19
[sshconnect1.c sshconnect2.c sshconnect.c]
unify hostkey check error messages, simplify prompt.
20011007 20011007
- (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys. - (bal) ssh-copy-id corrected permissions for .ssh/ and authorized_keys.
@ -6660,4 +6663,4 @@
- Wrote replacements for strlcpy and mkdtemp - Wrote replacements for strlcpy and mkdtemp
- Released 1.0pre1 - Released 1.0pre1
$Id: ChangeLog,v 1.1589 2001/10/10 05:02:46 djm Exp $ $Id: ChangeLog,v 1.1590 2001/10/10 05:03:11 djm Exp $

View File

@ -13,7 +13,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect.c,v 1.112 2001/10/06 00:14:50 markus Exp $"); RCSID("$OpenBSD: sshconnect.c,v 1.113 2001/10/06 11:18:19 markus Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
@ -506,8 +506,8 @@ confirm(const char *prompt)
if (f == NULL) if (f == NULL)
return 0; return 0;
fflush(stdout); fflush(stdout);
while (1) {
fprintf(stderr, "%s", prompt); fprintf(stderr, "%s", prompt);
while (1) {
if (fgets(buf, sizeof(buf), f) == NULL) { if (fgets(buf, sizeof(buf), f) == NULL) {
fprintf(stderr, "\n"); fprintf(stderr, "\n");
strlcpy(buf, "no", sizeof buf); strlcpy(buf, "no", sizeof buf);
@ -520,7 +520,7 @@ confirm(const char *prompt)
else if (strcmp(buf, "no") == 0) else if (strcmp(buf, "no") == 0)
retval = 0; retval = 0;
else else
fprintf(stderr, "Please type 'yes' or 'no'.\n"); fprintf(stderr, "Please type 'yes' or 'no': ");
if (retval != -1) { if (retval != -1) {
if (f != stdin) if (f != stdin)
@ -703,7 +703,6 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
"(yes/no)? ", host, ip, type, fp); "(yes/no)? ", host, ip, type, fp);
xfree(fp); xfree(fp);
if (!confirm(prompt)) { if (!confirm(prompt)) {
log("Aborted by user!");
goto fail; goto fail;
} }
} }
@ -821,7 +820,6 @@ check_host_key(char *host, struct sockaddr *hostaddr, Key *host_key,
} else if (options.strict_host_key_checking == 2) { } else if (options.strict_host_key_checking == 2) {
if (!confirm("Are you sure you want " if (!confirm("Are you sure you want "
"to continue connecting (yes/no)? ")) { "to continue connecting (yes/no)? ")) {
log("Aborted by user!");
goto fail; goto fail;
} }
} }

View File

@ -13,7 +13,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect1.c,v 1.40 2001/09/27 15:31:17 markus Exp $"); RCSID("$OpenBSD: sshconnect1.c,v 1.41 2001/10/06 11:18:19 markus Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/evp.h> #include <openssl/evp.h>
@ -982,7 +982,7 @@ ssh_kex(char *host, struct sockaddr *hostaddr)
k.type = KEY_RSA1; k.type = KEY_RSA1;
k.rsa = host_key; k.rsa = host_key;
if (verify_host_key(host, hostaddr, &k) == -1) if (verify_host_key(host, hostaddr, &k) == -1)
fatal("host_key verification failed"); fatal("Host key verification failed.");
client_flags = SSH_PROTOFLAG_SCREEN_NUMBER | SSH_PROTOFLAG_HOST_IN_FWD_OPEN; client_flags = SSH_PROTOFLAG_SCREEN_NUMBER | SSH_PROTOFLAG_HOST_IN_FWD_OPEN;

View File

@ -23,7 +23,7 @@
*/ */
#include "includes.h" #include "includes.h"
RCSID("$OpenBSD: sshconnect2.c,v 1.82 2001/08/31 11:46:39 markus Exp $"); RCSID("$OpenBSD: sshconnect2.c,v 1.83 2001/10/06 11:18:19 markus Exp $");
#include <openssl/bn.h> #include <openssl/bn.h>
#include <openssl/md5.h> #include <openssl/md5.h>
@ -75,7 +75,7 @@ static int
verify_host_key_callback(Key *hostkey) verify_host_key_callback(Key *hostkey)
{ {
if (verify_host_key(xxx_host, xxx_hostaddr, hostkey) == -1) if (verify_host_key(xxx_host, xxx_hostaddr, hostkey) == -1)
fatal("verify_host_key failed"); fatal("Host key verification failed.");
return 0; return 0;
} }