1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-15 18:17:32 -05:00

Move sanitisation of k-i prompts into the SSH code.

Now, instead of each seat's prompt-handling function doing the
control-char sanitisation of prompt text, the SSH code does it. This
means we can do it differently depending on the prompt.

In particular, prompts _we_ generate (e.g. a genuine request for your
private key's passphrase) are not sanitised; but prompts coming from
the server (in keyboard-interactive mode, or its more restricted SSH-1
analogues, TIS and CryptoCard) are not only sanitised but also
line-length limited and surrounded by uncounterfeitable headers, like
I've just done to the authentication banners.

This should mean that if a malicious server tries to fake the local
passphrase prompt (perhaps because it's somehow already got a copy of
your _encrypted_ private key), you can tell the difference.
This commit is contained in:
Simon Tatham
2019-03-09 15:51:38 +00:00
parent 767a9c6e45
commit e21afff605
6 changed files with 182 additions and 142 deletions

View File

@ -100,8 +100,6 @@ struct terminal_tag {
termchar basic_erase_char, erase_char;
bufchain inbuf; /* terminal input buffer */
bufchain_sink inbuf_bs;
StripCtrlChars *inbuf_scc;
pos curs; /* cursor */
pos savecurs; /* saved cursor position */