1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-03 04:22:47 -05:00

Actually print announcements of Interactors' identity.

Finally, the payoff from all of this refactoring: now, when a proxy
prompts interactively during connection setup, you get a message in
advance telling you which Interactor is originating the following
messages.

To achieve this, I've arranged to link Interactors together into a
list, so that any Interactor created by a proxy has a 'parent' pointer
pointing to the Interactor its client passed to new_connection().

This allows interactor_announce() to follow the links back up the
chain and count them, so that it knows whether it's a primary
connection, or a proxy, or a proxy-for-a-proxy, or more generally an
nth-order proxy, and can include that in its announcement.

And secondly, once interactor_announce() reaches the top of the chain,
it can use that as a storage location agreed on by all Interactors in
the whole setup, to tell each other which one of them was the last to
do anything interactive. Then, whenever there's a change of
Interactor, a message can be printed to indicate it to the user; and
when the same Interactor does multiple things in succession, you don't
get a slew of pointless messages in between them all.
This commit is contained in:
Simon Tatham
2021-10-30 18:08:02 +01:00
parent 7460594433
commit 215b9d1775
3 changed files with 69 additions and 11 deletions

View File

@ -16,14 +16,6 @@ const bool ssh_proxy_supported = true;
/*
* TODO for future work:
*
* All the interactive prompts we present to the main Seat - the host
* key and weak-crypto dialog boxes, and all prompts presented via the
* userpass_input system - need adjusting so that it's clear to the
* user _which_ SSH connection they come from. At the moment, you just
* get shown a host key fingerprint or a cryptic "login as:" prompt,
* and you have to guess which server you're currently supposed to be
* interpreting it relative to.
*
* If the user manually aborts the attempt to make the proxy SSH
* connection (e.g. by hitting ^C at a userpass prompt, or refusing to
* accept the proxy server's host key), then an assertion failure
@ -607,6 +599,7 @@ Socket *sshproxy_new_connection(SockAddr *addr, const char *hostname,
*/
if (clientitr) {
sp->clientitr = clientitr;
interactor_set_child(sp->clientitr, sp->backend->interactor);
sp->clientlp = interactor_logpolicy(clientitr);