1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-12 00:33:53 -05:00

Add a 'from_server' flag in prompts_t.

This goes with the existing 'to_server' flag (indicating whether the
values typed by the user are going to be sent over the wire or remain
local), to indicate whether the _text of the prompts_ has come over
the wire or is originated locally.

Like to_server, nothing yet uses this. It's a hedge against the
possibility of maybe having an option for all the auth prompts to work
via GUI dialog boxes.
This commit is contained in:
Simon Tatham
2019-03-09 15:50:23 +00:00
parent 530b6fed5d
commit 767a9c6e45
6 changed files with 23 additions and 0 deletions

View File

@ -383,6 +383,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
if ((s->username = get_remote_username(s->conf)) == NULL) {
s->cur_prompt = new_prompts();
s->cur_prompt->to_server = true;
s->cur_prompt->from_server = false;
s->cur_prompt->name = dupstr("SSH login name");
add_prompt(s->cur_prompt, dupstr("login as: "), true);
s->userpass_ret = seat_get_userpass_input(
@ -641,6 +642,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
} else {
s->cur_prompt = new_prompts(s->ppl.seat);
s->cur_prompt->to_server = false;
s->cur_prompt->from_server = false;
s->cur_prompt->name = dupstr("SSH key passphrase");
add_prompt(s->cur_prompt,
dupprintf("Passphrase for key \"%s\": ",
@ -805,6 +807,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
}
ppl_logevent("Received TIS challenge");
s->cur_prompt->to_server = true;
s->cur_prompt->from_server = true;
s->cur_prompt->name = dupstr("SSH TIS authentication");
/* Prompt heuristic comes from OpenSSH */
if (!memchr(challenge.ptr, '\n', challenge.len)) {
@ -853,6 +856,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
}
ppl_logevent("Received CryptoCard challenge");
s->cur_prompt->to_server = true;
s->cur_prompt->from_server = true;
s->cur_prompt->name = dupstr("SSH CryptoCard authentication");
s->cur_prompt->name_reqd = false;
/* Prompt heuristic comes from OpenSSH */
@ -885,6 +889,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl)
return;
}
s->cur_prompt->to_server = true;
s->cur_prompt->from_server = false;
s->cur_prompt->name = dupstr("SSH password");
add_prompt(s->cur_prompt, dupprintf("%s@%s's password: ",
s->username, s->savedhost),