diff --git a/CMakeLists.txt b/CMakeLists.txt index 15670d69..5ccd8570 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -33,7 +33,8 @@ add_library(crypto STATIC add_subdirectory(crypto) add_library(network STATIC - be_misc.c nullplug.c errsock.c proxy/proxy.c logging.c x11disp.c) + be_misc.c nullplug.c errsock.c logging.c x11disp.c + proxy/proxy.c proxy/interactor.c) add_library(keygen STATIC import.c) diff --git a/defs.h b/defs.h index 172a30b7..437bef97 100644 --- a/defs.h +++ b/defs.h @@ -103,6 +103,7 @@ typedef struct Backend Backend; typedef struct BackendVtable BackendVtable; typedef struct Interactor Interactor; typedef struct InteractorVtable InteractorVtable; +typedef struct InteractionReadySeat InteractionReadySeat; typedef struct Ldisc_tag Ldisc; typedef struct LogContext LogContext; diff --git a/otherbackends/rlogin.c b/otherbackends/rlogin.c index 035295c9..099f115b 100644 --- a/otherbackends/rlogin.c +++ b/otherbackends/rlogin.c @@ -335,7 +335,8 @@ static void rlogin_try_username_prompt(void *ctx) { Rlogin *rlogin = (Rlogin *)ctx; - int ret = seat_get_userpass_input(rlogin->seat, rlogin->prompt); + int ret = seat_get_userpass_input( + interactor_announce(&rlogin->interactor), rlogin->prompt); if (ret < 0) return; diff --git a/proxy/interactor.c b/proxy/interactor.c new file mode 100644 index 00000000..8006ae64 --- /dev/null +++ b/proxy/interactor.c @@ -0,0 +1,18 @@ +/* + * Centralised functions for the Interactor trait. + */ + +#include "putty.h" + +InteractionReadySeat interactor_announce(Interactor *itr) +{ + Seat *seat = interactor_get_seat(itr); + + /* TODO: print an announcement of this Interactor's identity, when + * appropriate */ + + InteractionReadySeat iseat; + iseat.seat = seat; + + return iseat; +} diff --git a/proxy/sshproxy.c b/proxy/sshproxy.c index 8d8a0e90..55de65e6 100644 --- a/proxy/sshproxy.c +++ b/proxy/sshproxy.c @@ -267,6 +267,13 @@ static size_t sshproxy_output(Seat *seat, SeatOutputType type, return bufchain_size(&sp->ssh_to_socket); } +static inline InteractionReadySeat wrap(Seat *seat) +{ + InteractionReadySeat iseat; + iseat.seat = seat; + return iseat; +} + static size_t sshproxy_banner(Seat *seat, const void *data, size_t len) { SshProxy *sp = container_of(seat, SshProxy, seat); @@ -275,7 +282,7 @@ static size_t sshproxy_banner(Seat *seat, const void *data, size_t len) * If we have access to the outer Seat, pass the SSH login * banner on to it. */ - return seat_banner(sp->clientseat, data, len); + return seat_banner(wrap(sp->clientseat), data, len); } else { return 0; } @@ -311,7 +318,7 @@ static int sshproxy_get_userpass_input(Seat *seat, prompts_t *p) * If we have access to the outer Seat, pass this prompt * request on to it. FIXME: appropriately adjusted */ - return seat_get_userpass_input(sp->clientseat, p); + return seat_get_userpass_input(wrap(sp->clientseat), p); } /* @@ -353,7 +360,7 @@ static int sshproxy_confirm_ssh_host_key( * request on to it. FIXME: appropriately adjusted */ return seat_confirm_ssh_host_key( - sp->clientseat, host, port, keytype, keystr, keydisp, + wrap(sp->clientseat), host, port, keytype, keystr, keydisp, key_fingerprints, mismatch, callback, ctx); } @@ -377,7 +384,7 @@ static int sshproxy_confirm_weak_crypto_primitive( * request on to it. FIXME: appropriately adjusted */ return seat_confirm_weak_crypto_primitive( - sp->clientseat, algtype, algname, callback, ctx); + wrap(sp->clientseat), algtype, algname, callback, ctx); } /* @@ -402,7 +409,7 @@ static int sshproxy_confirm_weak_cached_hostkey( * request on to it. FIXME: appropriately adjusted */ return seat_confirm_weak_cached_hostkey( - sp->clientseat, algname, betteralgs, callback, ctx); + wrap(sp->clientseat), algname, betteralgs, callback, ctx); } /* diff --git a/putty.h b/putty.h index 7887535f..5c7a01f0 100644 --- a/putty.h +++ b/putty.h @@ -633,6 +633,24 @@ enum { /* In (no)sshproxy.c */ extern const bool ssh_proxy_supported; +/* + * This structure type wraps a Seat pointer, in a way that has no + * purpose except to be a different type. + * + * The Seat wrapper functions that present interactive prompts all + * expect one of these in place of their ordinary Seat pointer. You + * get one by calling interactor_announce (defined below), which will + * print a message (if not already done) identifying the Interactor + * that originated the prompt. + * + * This arranges that the C type system itself will check that no call + * to any of those Seat methods has omitted the mandatory call to + * interactor_announce beforehand. + */ +struct InteractionReadySeat { + Seat *seat; +}; + /* * The Interactor trait is implemented by anything that is capable of * presenting interactive prompts or questions to the user during @@ -688,6 +706,8 @@ static inline Seat *interactor_get_seat(Interactor *itr) static inline void interactor_set_seat(Interactor *itr, Seat *seat) { itr->vt->set_seat(itr, seat); } +InteractionReadySeat interactor_announce(Interactor *itr); + /* Interactors that are Backends will find this helper function useful * in constructing their description strings */ char *default_description(const BackendVtable *backvt, @@ -1277,10 +1297,12 @@ static inline bool seat_eof(Seat *seat) { return seat->vt->eof(seat); } static inline void seat_sent(Seat *seat, size_t bufsize) { seat->vt->sent(seat, bufsize); } -static inline size_t seat_banner(Seat *seat, const void *data, size_t len) -{ return seat->vt->banner(seat, data, len); } -static inline int seat_get_userpass_input(Seat *seat, prompts_t *p) -{ return seat->vt->get_userpass_input(seat, p); } +static inline size_t seat_banner( + InteractionReadySeat iseat, const void *data, size_t len) +{ return iseat.seat->vt->banner(iseat.seat, data, len); } +static inline int seat_get_userpass_input(InteractionReadySeat iseat, + prompts_t *p) +{ return iseat.seat->vt->get_userpass_input(iseat.seat, p); } static inline void seat_notify_session_started(Seat *seat) { seat->vt->notify_session_started(seat); } static inline void seat_notify_remote_exit(Seat *seat) @@ -1294,19 +1316,21 @@ static inline char *seat_get_ttymode(Seat *seat, const char *mode) static inline void seat_set_busy_status(Seat *seat, BusyStatus status) { seat->vt->set_busy_status(seat, status); } static inline int seat_confirm_ssh_host_key( - Seat *seat, const char *h, int p, const char *ktyp, char *kstr, - const char *kdsp, char **fps, bool mis, + InteractionReadySeat iseat, const char *h, int p, const char *ktyp, + char *kstr, const char *kdsp, char **fps, bool mis, void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->confirm_ssh_host_key(seat, h, p, ktyp, kstr, kdsp, fps, - mis, cb, ctx); } +{ return iseat.seat->vt->confirm_ssh_host_key( + iseat.seat, h, p, ktyp, kstr, kdsp, fps, mis, cb, ctx); } static inline int seat_confirm_weak_crypto_primitive( - Seat *seat, const char *atyp, const char *aname, + InteractionReadySeat iseat, const char *atyp, const char *aname, void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->confirm_weak_crypto_primitive(seat, atyp, aname, cb, ctx); } +{ return iseat.seat->vt->confirm_weak_crypto_primitive( + iseat.seat, atyp, aname, cb, ctx); } static inline int seat_confirm_weak_cached_hostkey( - Seat *seat, const char *aname, const char *better, + InteractionReadySeat iseat, const char *aname, const char *better, void (*cb)(void *ctx, int result), void *ctx) -{ return seat->vt->confirm_weak_cached_hostkey(seat, aname, better, cb, ctx); } +{ return iseat.seat->vt->confirm_weak_cached_hostkey( + iseat.seat, aname, better, cb, ctx); } static inline bool seat_is_utf8(Seat *seat) { return seat->vt->is_utf8(seat); } static inline void seat_echoedit_update(Seat *seat, bool ec, bool ed) @@ -1347,12 +1371,12 @@ static inline size_t seat_stderr_pl(Seat *seat, ptrlen data) { return seat_output(seat, SEAT_OUTPUT_STDERR, data.ptr, data.len); } /* Alternative API for seat_banner taking a ptrlen */ -static inline size_t seat_banner_pl(Seat *seat, ptrlen data) -{ return seat->vt->banner(seat, data.ptr, data.len); } +static inline size_t seat_banner_pl(InteractionReadySeat iseat, ptrlen data) +{ return iseat.seat->vt->banner(iseat.seat, data.ptr, data.len); } /* In the utils subdir: print a message to the Seat which can't be * spoofed by server-supplied auth-time output such as SSH banners */ -void seat_antispoof_msg(Seat *seat, const char *msg); +void seat_antispoof_msg(InteractionReadySeat iseat, const char *msg); /* * Stub methods for seat implementations that want to use the obvious diff --git a/ssh.h b/ssh.h index e633da20..c32ff686 100644 --- a/ssh.h +++ b/ssh.h @@ -1708,8 +1708,8 @@ void add_to_commasep(strbuf *buf, const char *data); bool get_commasep_word(ptrlen *list, ptrlen *word); int verify_ssh_host_key( - Seat *seat, Conf *conf, const char *host, int port, ssh_key *key, - const char *keytype, char *keystr, const char *keydisp, + InteractionReadySeat iseat, Conf *conf, const char *host, int port, + ssh_key *key, const char *keytype, char *keystr, const char *keydisp, char **fingerprints, void (*callback)(void *ctx, int result), void *ctx); typedef struct ssh_transient_hostkey_cache ssh_transient_hostkey_cache; diff --git a/ssh/common.c b/ssh/common.c index ee09910a..c7d98061 100644 --- a/ssh/common.c +++ b/ssh/common.c @@ -851,8 +851,8 @@ bool ssh2_bpp_check_unimplemented(BinaryPacketProtocol *bpp, PktIn *pktin) */ int verify_ssh_host_key( - Seat *seat, Conf *conf, const char *host, int port, ssh_key *key, - const char *keytype, char *keystr, const char *keydisp, + InteractionReadySeat iseat, Conf *conf, const char *host, int port, + ssh_key *key, const char *keytype, char *keystr, const char *keydisp, char **fingerprints, void (*callback)(void *ctx, int result), void *ctx) { /* @@ -923,7 +923,7 @@ int verify_ssh_host_key( */ bool mismatch = (storage_status != 1); return seat_confirm_ssh_host_key( - seat, host, port, keytype, keystr, keydisp, fingerprints, mismatch, + iseat, host, port, keytype, keystr, keydisp, fingerprints, mismatch, callback, ctx); } diff --git a/ssh/connection1.c b/ssh/connection1.c index e0b4aac6..47ffd3c7 100644 --- a/ssh/connection1.c +++ b/ssh/connection1.c @@ -380,11 +380,11 @@ static void ssh1_connection_process_queue(PacketProtocolLayer *ppl) s->antispoof_prompt, dupstr("Access granted. Press Return to begin session. "), false); s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt); + ppl_get_iseat(&s->ppl), s->antispoof_prompt); while (s->antispoof_ret < 0) { crReturnV; s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt); + ppl_get_iseat(&s->ppl), s->antispoof_prompt); } free_prompts(s->antispoof_prompt); s->antispoof_prompt = NULL; diff --git a/ssh/connection2.c b/ssh/connection2.c index a6bc553b..86bd315a 100644 --- a/ssh/connection2.c +++ b/ssh/connection2.c @@ -993,11 +993,11 @@ static void ssh2_connection_process_queue(PacketProtocolLayer *ppl) s->antispoof_prompt, dupstr("Access granted. Press Return to begin session. "), false); s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt); + ppl_get_iseat(&s->ppl), s->antispoof_prompt); while (s->antispoof_ret < 0) { crReturnV; s->antispoof_ret = seat_get_userpass_input( - s->ppl.seat, s->antispoof_prompt); + ppl_get_iseat(&s->ppl), s->antispoof_prompt); } free_prompts(s->antispoof_prompt); s->antispoof_prompt = NULL; diff --git a/ssh/kex2-client.c b/ssh/kex2-client.c index 2435534c..8a3a290a 100644 --- a/ssh/kex2-client.c +++ b/ssh/kex2-client.c @@ -854,8 +854,8 @@ void ssh2kex_coroutine(struct ssh2_transport_state *s, bool *aborted) ppl_logevent("%s", fingerprints[fptype_default]); s->dlgret = verify_ssh_host_key( - s->ppl.seat, s->conf, s->savedhost, s->savedport, s->hkey, - ssh_key_cache_id(s->hkey), s->keystr, keydisp, + ppl_get_iseat(&s->ppl), s->conf, s->savedhost, s->savedport, + s->hkey, ssh_key_cache_id(s->hkey), s->keystr, keydisp, fingerprints, ssh2_transport_dialog_callback, s); ssh2_free_all_fingerprints(fingerprints); diff --git a/ssh/login1.c b/ssh/login1.c index 001b3d8e..62c7b866 100644 --- a/ssh/login1.c +++ b/ssh/login1.c @@ -243,7 +243,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) char **fingerprints = rsa_ssh1_fake_all_fingerprints(&s->hostkey); s->dlgret = verify_ssh_host_key( - s->ppl.seat, s->conf, s->savedhost, s->savedport, NULL, + ppl_get_iseat(&s->ppl), s->conf, s->savedhost, s->savedport, NULL, "rsa", keystr, keydisp, fingerprints, ssh1_login_dialog_callback, s); @@ -325,7 +325,7 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) /* Warn about chosen cipher if necessary. */ if (warn) { s->dlgret = seat_confirm_weak_crypto_primitive( - s->ppl.seat, "cipher", cipher_string, + ppl_get_iseat(&s->ppl), "cipher", cipher_string, ssh1_login_dialog_callback, s); crMaybeWaitUntilV(s->dlgret >= 0); if (s->dlgret == 0) { @@ -391,11 +391,12 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) 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(s->ppl.seat, s->cur_prompt); + s->userpass_ret = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* @@ -688,11 +689,11 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) dupprintf("Passphrase for key \"%s\": ", s->publickey_comment), false); s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* Failed to get a passphrase. Terminate. */ @@ -942,11 +943,12 @@ static void ssh1_login_process_queue(PacketProtocolLayer *ppl) * or CryptoCard exchange if we're doing TIS or CryptoCard * authentication. */ - s->userpass_ret = seat_get_userpass_input(s->ppl.seat, s->cur_prompt); + s->userpass_ret = seat_get_userpass_input( + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* diff --git a/ssh/ppl.h b/ssh/ppl.h index 66f46038..c3625166 100644 --- a/ssh/ppl.h +++ b/ssh/ppl.h @@ -49,6 +49,7 @@ struct PacketProtocolLayer { /* Logging and error-reporting facilities. */ LogContext *logctx; Seat *seat; /* for dialog boxes, session output etc */ + Interactor *interactor; /* for ppl_get_iseat */ Ssh *ssh; /* for session termination + assorted connection-layer ops */ /* Known bugs in the remote implementation. */ @@ -68,6 +69,9 @@ static inline void ssh_ppl_reconfigure(PacketProtocolLayer *ppl, Conf *conf) static inline size_t ssh_ppl_queued_data_size(PacketProtocolLayer *ppl) { return ppl->vt->queued_data_size(ppl); } +static inline InteractionReadySeat ppl_get_iseat(PacketProtocolLayer *ppl) +{ return interactor_announce(ppl->interactor); } + /* ssh_ppl_free is more than just a macro wrapper on the vtable; it * does centralised parts of the freeing too. */ void ssh_ppl_free(PacketProtocolLayer *ppl); diff --git a/ssh/server.c b/ssh/server.c index 724abaf4..888ff87d 100644 --- a/ssh/server.c +++ b/ssh/server.c @@ -375,6 +375,7 @@ static void server_connect_ppl(server *srv, PacketProtocolLayer *ppl) ppl->logctx = srv->logctx; ppl->ssh = &srv->ssh; ppl->seat = &srv->seat; + ppl->interactor = NULL; ppl->remote_bugs = srv->remote_bugs; } diff --git a/ssh/ssh.c b/ssh/ssh.c index 1def173e..8a70b665 100644 --- a/ssh/ssh.c +++ b/ssh/ssh.c @@ -168,6 +168,7 @@ static void ssh_connect_ppl(Ssh *ssh, PacketProtocolLayer *ppl) { ppl->bpp = ssh->bpp; ppl->seat = ssh->seat; + ppl->interactor = &ssh->interactor; ppl->ssh = ssh; ppl->logctx = ssh->logctx; ppl->remote_bugs = ssh->remote_bugs; diff --git a/ssh/transport2.c b/ssh/transport2.c index 9c49d55c..f0975431 100644 --- a/ssh/transport2.c +++ b/ssh/transport2.c @@ -1313,7 +1313,7 @@ static void ssh2_transport_process_queue(PacketProtocolLayer *ppl) /* Use the special warning prompt that lets us provide * a list of better algorithms */ s->dlgret = seat_confirm_weak_cached_hostkey( - s->ppl.seat, s->hostkey_alg->ssh_id, betteralgs, + ppl_get_iseat(&s->ppl), s->hostkey_alg->ssh_id, betteralgs, ssh2_transport_dialog_callback, s); sfree(betteralgs); } else { @@ -2148,7 +2148,7 @@ static int ssh2_transport_confirm_weak_crypto_primitive( add234(s->weak_algorithms_consented_to, (void *)alg); return seat_confirm_weak_crypto_primitive( - s->ppl.seat, type, name, ssh2_transport_dialog_callback, s); + ppl_get_iseat(&s->ppl), type, name, ssh2_transport_dialog_callback, s); } static size_t ssh2_transport_queued_data_size(PacketProtocolLayer *ppl) diff --git a/ssh/userauth2-client.c b/ssh/userauth2-client.c index e82abe8a..b6ed5704 100644 --- a/ssh/userauth2-client.c +++ b/ssh/userauth2-client.c @@ -443,11 +443,11 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->cur_prompt->name = dupstr("SSH login name"); add_prompt(s->cur_prompt, dupstr("login as: "), true); s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* @@ -521,7 +521,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) (seat_verbose(s->ppl.seat) || seat_interactive(s->ppl.seat))) { if (s->banner_scc) { seat_antispoof_msg( - s->ppl.seat, + ppl_get_iseat(&s->ppl), "Pre-authentication banner message from server:"); seat_set_trust_status(s->ppl.seat, false); } @@ -529,7 +529,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) bool mid_line = false; while (bufchain_size(&s->banner) > 0) { ptrlen data = bufchain_prefix(&s->banner); - seat_banner_pl(s->ppl.seat, data); + seat_banner_pl(ppl_get_iseat(&s->ppl), data); mid_line = (((const char *)data.ptr)[data.len-1] != '\n'); bufchain_consume(&s->banner, data.len); @@ -537,11 +537,12 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) bufchain_clear(&s->banner); if (mid_line) - seat_banner_pl(s->ppl.seat, PTRLEN_LITERAL("\r\n")); + seat_banner_pl(ppl_get_iseat(&s->ppl), + PTRLEN_LITERAL("\r\n")); if (s->banner_scc) { seat_set_trust_status(s->ppl.seat, true); - seat_antispoof_msg(s->ppl.seat, + seat_antispoof_msg(ppl_get_iseat(&s->ppl), "End of banner message from server"); } } @@ -912,11 +913,11 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) s->publickey_comment), false); s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* Failed to get a passphrase. Terminate. */ @@ -1343,8 +1344,8 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) if (!s->ki_printed_header && s->ki_scc && (s->num_prompts || name.len || inst.len)) { seat_antispoof_msg( - s->ppl.seat, "Keyboard-interactive authentication " - "prompts from server:"); + ppl_get_iseat(&s->ppl), "Keyboard-interactive " + "authentication prompts from server:"); s->ki_printed_header = true; seat_set_trust_status(s->ppl.seat, false); } @@ -1391,11 +1392,11 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) * user's response(s). */ s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* @@ -1446,7 +1447,7 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) if (s->ki_printed_header) { seat_set_trust_status(s->ppl.seat, true); seat_antispoof_msg( - s->ppl.seat, + ppl_get_iseat(&s->ppl), "End of keyboard-interactive prompts from server"); } @@ -1473,11 +1474,11 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) false); s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* @@ -1585,11 +1586,11 @@ static void ssh2_userauth_process_queue(PacketProtocolLayer *ppl) */ while (!got_new) { s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); while (s->userpass_ret < 0) { crReturnV; s->userpass_ret = seat_get_userpass_input( - s->ppl.seat, s->cur_prompt); + ppl_get_iseat(&s->ppl), s->cur_prompt); } if (!s->userpass_ret) { /* diff --git a/utils/antispoof.c b/utils/antispoof.c index d8599455..3a633189 100644 --- a/utils/antispoof.c +++ b/utils/antispoof.c @@ -1,11 +1,11 @@ #include "putty.h" #include "misc.h" -void seat_antispoof_msg(Seat *seat, const char *msg) +void seat_antispoof_msg(InteractionReadySeat iseat, const char *msg) { strbuf *sb = strbuf_new(); - seat_set_trust_status(seat, true); - if (seat_can_set_trust_status(seat)) { + seat_set_trust_status(iseat.seat, true); + if (seat_can_set_trust_status(iseat.seat)) { /* * If the seat can directly indicate that this message is * generated by the client, then we can just use the message @@ -23,6 +23,6 @@ void seat_antispoof_msg(Seat *seat, const char *msg) put_byte(sb, '-'); } put_datapl(sb, PTRLEN_LITERAL("\r\n")); - seat_banner_pl(seat, ptrlen_from_strbuf(sb)); + seat_banner_pl(iseat, ptrlen_from_strbuf(sb)); strbuf_free(sb); }