diff --git a/cmdline.c b/cmdline.c index 1aced283..812b71e7 100644 --- a/cmdline.c +++ b/cmdline.c @@ -87,9 +87,13 @@ SeatPromptResult cmdline_get_passwd_input( /* * We only handle prompts which don't echo (which we assume to be * passwords), and (currently) we only cope with a password prompt - * that comes in a prompt-set on its own. + * that comes in a prompt-set on its own. Also, we don't use a + * command-line password for any kind of prompt which is destined + * for local use rather than to be sent to the server: the idea is + * to pre-fill _passwords_, not private-key passphrases (for which + * there are better alternatives available). */ - if (p->n_prompts != 1 || p->prompts[0]->echo) { + if (p->n_prompts != 1 || p->prompts[0]->echo || !p->to_server) { return SPR_INCOMPLETE; } diff --git a/ssh/connection2.c b/ssh/connection2.c index f2f07b17..77b8d0ec 100644 --- a/ssh/connection2.c +++ b/ssh/connection2.c @@ -989,7 +989,7 @@ static void ssh2_connection_process_queue(PacketProtocolLayer *ppl) */ if (ssh2_connection_need_antispoof_prompt(s)) { s->antispoof_prompt = ssh_ppl_new_prompts(&s->ppl); - s->antispoof_prompt->to_server = true; + s->antispoof_prompt->to_server = false; s->antispoof_prompt->from_server = false; s->antispoof_prompt->name = dupstr("Authentication successful"); add_prompt(