mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-03-31 02:32:49 -05:00

A user reported recently that if you connect to a Telnet server via a proxy that requires authentication, and enter the auth details manually in the PuTTY terminal window, then the entire Telnet session is shown with trust sigils to its left. This happens because telnet.c calls seat_set_trust_status(false) as soon as it's called new_connection() to make the Socket. But the interactive proxy authentication dialogue hasn't happened yet, at that point. So the proxy resets the trust status to true and asks for a username and password, and then nothing ever resets it to false, because telnet.c thought it had already done that. The solution is to defer the Telnet backend's change of trust status to when we get the notification that the socket is properly connected, which arrives via plug_log(PLUGLOG_CONNECT_SUCCESS). The same bug occurs in raw.c and supdup.c, but not in rlogin.c, because Rlogin has an initial authentication exchange known to the protocol, and already delays resetting the trust status until after that has concluded.