1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 09:27:59 +00:00
putty-source/ssh
Simon Tatham 6d272ee007 Allow new_connection to take an optional Seat. (NFC)
This is working towards allowing the subsidiary SSH connection in an
SshProxy to share the main user-facing Seat, so as to be able to pass
through interactive prompts.

This is more difficult than the similar change with LogPolicy, because
Seats are stateful. In particular, the trust-sigil status will need to
be controlled by the SshProxy until it's ready to pass over control to
the main SSH (or whatever) connection.

To make this work, I've introduced a thing called a TempSeat, which is
(yet) another Seat implementation. When a backend hands its Seat to
new_connection(), it does it in a way that allows new_connection() to
borrow it completely, and replace it in the main backend structure
with a TempSeat, which acts as a temporary placeholder. If the main
backend tries to do things like changing trust status or sending
output, the TempSeat will buffer them; later on, when the connection
is established, TempSeat will replay the changes into the real Seat.

So, in each backend, I've made the following changes:
 - pass &foo->seat to new_connection, which may overwrite it with a
   TempSeat.
 - if it has done so (which we can tell via the is_tempseat() query
   function), then we have to free the TempSeat and reinstate our main
   Seat. The signal that we can do so is the PLUGLOG_CONNECT_SUCCESS
   notification, which indicates that SshProxy has finished all its
   connection setup work.
 - we also have to remember to free the TempSeat if our backend is
   disposed of without that having happened (e.g. because the
   connection _doesn't_ succeed).
 - in backends which have no local auth phase to worry about, ensure
   we don't call seat_set_trust_status on the main Seat _before_ it
   gets potentially replaced with a TempSeat. Moved some calls of
   seat_set_trust_status to just after new_connection(), so that now
   the initial trust status setup will go into the TempSeat (if
   appropriate) and be buffered until that seat is relinquished.

In all other uses of new_connection, where we don't have a Seat
available at all, we just pass NULL.

This is NFC, because neither new_connection() nor any of its delegates
will _actually_ do this replacement yet. We're just setting up the
framework to enable it to do so in the next commit.
2021-09-13 17:24:47 +01:00
..
agentf.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
bpp1.c New Seat callback, seat_sent(). 2021-06-27 13:52:48 +01:00
bpp2.c New Seat callback, seat_sent(). 2021-06-27 13:52:48 +01:00
bpp-bare.c New Seat callback, seat_sent(). 2021-06-27 13:52:48 +01:00
bpp.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
censor1.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
censor2.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
channel.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
CMakeLists.txt Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
common.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
connection1-client.c Divide seat_set_trust_status into query and update. 2021-09-12 09:52:46 +01:00
connection1-server.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
connection1.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
connection1.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
connection2-client.c Divide seat_set_trust_status into query and update. 2021-09-12 09:52:46 +01:00
connection2-server.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
connection2.c New Seat callback, seat_sent(). 2021-06-27 13:52:48 +01:00
connection2.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
crc-attack-detector.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
gss.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
gssc.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
gssc.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
kex2-client.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
kex2-server.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
login1-server.c Uppity: add stunt options for trivial authentication. 2021-06-19 21:34:56 +01:00
login1.c New option to reject 'trivial' success of userauth. 2021-06-19 21:34:56 +01:00
mainchan.c New Seat method, notify_session_started(). 2021-09-12 11:55:55 +01:00
nogss.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
nosharing.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
pgssapi.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
pgssapi.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
portfwd.c Allow new_connection to take an optional Seat. (NFC) 2021-09-13 17:24:47 +01:00
ppl.h New option to reject 'trivial' success of userauth. 2021-06-19 21:34:56 +01:00
scpserver.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
server.c New Seat method, notify_session_started(). 2021-09-12 11:55:55 +01:00
server.h Uppity: add stunt options for trivial authentication. 2021-06-19 21:34:56 +01:00
sesschan.c New Seat method, notify_session_started(). 2021-09-12 11:55:55 +01:00
sftp.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
sftp.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
sftpcommon.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
sftpserver.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
sharing.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
signal-list.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
ssh.c Allow new_connection to take an optional Seat. (NFC) 2021-09-13 17:24:47 +01:00
transient-hostkey-cache.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
transport2.c New Seat callback, seat_sent(). 2021-06-27 13:52:48 +01:00
transport2.h Spelling: standardise on "DSA", not "DSS". 2021-04-22 18:34:47 +01:00
ttymode-list.h Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
userauth2-client.c Divide seat_set_trust_status into query and update. 2021-09-12 09:52:46 +01:00
userauth2-server.c Uppity: add stunt options for trivial authentication. 2021-06-19 21:34:56 +01:00
verstring.c Bug workaround to delay sending our SSH greeting. 2021-08-14 11:46:21 +01:00
x11fwd.c Allow new_connection to take an optional Seat. (NFC) 2021-09-13 17:24:47 +01:00
zlib.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00