summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Johnston <matt@ucc.asn.au>2005-01-11 16:17:03 +0000
committerMatt Johnston <matt@ucc.asn.au>2005-01-11 16:17:03 +0000
commita350a51764618481a74fdcfe5dfe62d311819716 (patch)
tree00d27dea47c3c088bdf42b370e9f3cc27f80c206
parentf91c9a3439a0f36f4550d0b4c793758834882fc6 (diff)
downloaddropbear-a350a51764618481a74fdcfe5dfe62d311819716.tar.gz
Read "y/n" response for fingerprints from /dev/tty directly so that dbclient
will work with scp.
-rw-r--r--CHANGES3
-rw-r--r--cli-kex.c12
2 files changed, 14 insertions, 1 deletions
diff --git a/CHANGES b/CHANGES
index f2689c1..086758c 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,6 @@
+- Read "y/n" response for fingerprints from /dev/tty directly so that dbclient
+ will work with scp.
+
0.44 - Mon Jan 3 2005
- SECURITY: Fix for PAM auth so that usernames are logged and conversation
diff --git a/cli-kex.c b/cli-kex.c
index 03a0670..40d4e95 100644
--- a/cli-kex.c
+++ b/cli-kex.c
@@ -115,13 +115,23 @@ void recv_msg_kexdh_reply() {
static void ask_to_confirm(unsigned char* keyblob, unsigned int keybloblen) {
char* fp = NULL;
+ FILE *tty = NULL;
+ char response = 'z';
fp = sign_key_fingerprint(keyblob, keybloblen);
fprintf(stderr, "\nHost '%s' is not in the trusted hosts file.\n(fingerprint %s)\nDo you want to continue connecting? (y/n)\n",
cli_opts.remotehost,
fp);
- if (getc(stdin) == 'y') {
+ tty = fopen(_PATH_TTY, "r");
+ if (tty) {
+ response = getc(tty);
+ fclose(tty);
+ } else {
+ response = getc(stdin);
+ }
+
+ if (response == 'y') {
m_free(fp);
return;
}