mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-09 17:38:00 +00:00
f1c8298000
The text of the host key warnings was replicated in three places: the Windows rc file, the GTK dialog setup function, and the console.c shared between both platforms' CLI tools. Now it lives in just one place, namely ssh/common.c where the rest of the centralised host-key checking is done, so it'll be easier to adjust the wording in future. This comes with some extra automation. Paragraph wrapping is no longer done by hand in any version of these prompts. (Previously we let GTK do the wrapping on GTK, but on Windows the resource file contained a bunch of pre-wrapped LTEXT lines, and console.c had pre-wrapped terminal messages.) And the dialog heights in Windows are determined automatically based on the amount of stuff in the window. The main idea of all this is that it'll be easier to set up more elaborate kinds of host key prompt that deal with certificates (if, e.g., a server sends us a certified host key which we don't trust the CA for). But there are side benefits of this refactoring too: each tool now reliably inserts its own appname in the prompts, and also, on Windows the entire prompt text is copy-pastable. Details of implementation: there's a new type SeatDialogText which holds a set of (type, string) pairs describing the contents of a prompt. Type codes distinguish ordinary text paragraphs, paragraphs to be displayed prominently (like key fingerprints), the extra-bold scary title at the top of the 'host key changed' version of the dialog, and the various information that lives in the subsidiary 'more info' box. ssh/common.c constructs this, and passes it to the Seat to present the actual prompt. In order to deal with the different UI for answering the prompt, I've added an extra Seat method 'prompt_descriptions' which returns some snippets of text to interpolate into the messages. ssh/common.c calls that while it's still constructing the text, and incorporates the resulting snippets into the SeatDialogText. For the moment, this refactoring only affects the host key prompts. The warnings about outmoded crypto are still done the old-fashioned way; they probably ought to be similarly refactored to use this new SeatDialogText system, but it's not immediately critical for the purpose I have right now. |
||
---|---|---|
.. | ||
antispoof.c | ||
backend_socket_log.c | ||
base64_decode_atom.c | ||
base64_decode.c | ||
base64_encode_atom.c | ||
base64_encode.c | ||
base64_valid.c | ||
bufchain.c | ||
buildinfo.c | ||
burnstr.c | ||
cert-expr.c | ||
chomp.c | ||
CMakeLists.txt | ||
cmdline_get_passwd_input_state_new.c | ||
conf_dest.c | ||
conf_launchable.c | ||
conf.c | ||
ctrlparse.c | ||
ctrlset_normalise.c | ||
debug.c | ||
decode_utf8_to_wchar.c | ||
decode_utf8.c | ||
default_description.c | ||
dup_mb_to_wc.c | ||
dup_wc_to_mb.c | ||
dupcat.c | ||
dupprintf.c | ||
dupstr.c | ||
encode_utf8.c | ||
encode_wide_string_as_utf8.c | ||
fgetline.c | ||
host_ca_new_free.c | ||
host_strchr_internal.c | ||
host_strchr.c | ||
host_strcspn.c | ||
host_strduptrim.c | ||
host_strrchr.c | ||
key_components.c | ||
log_proxy_stderr.c | ||
ltime.c | ||
make_spr_sw_abort_static.c | ||
marshal.c | ||
memory.c | ||
memxor.c | ||
null_lp.c | ||
nullkey.c | ||
nullseat.c | ||
nullstrcmp.c | ||
out_of_memory.c | ||
parse_blocksize.c | ||
percent_decode.c | ||
percent_encode.c | ||
prompts.c | ||
ptrlen.c | ||
read_file_into.c | ||
seat_connection_fatal.c | ||
seat_dialog_text.c | ||
sessprep.c | ||
sk_free_peer_info.c | ||
smemclr.c | ||
smemeq.c | ||
spr_get_error_message.c | ||
ssh2_pick_fingerprint.c | ||
ssh_key_clone.c | ||
sshutils.c | ||
strbuf.c | ||
string_length_for_printf.c | ||
stripctrl.c | ||
tempseat.c | ||
tree234.c | ||
utils.h | ||
validate_manual_hostkey.c | ||
version.c | ||
wcwidth.c | ||
wildcard.c | ||
wordwrap.c | ||
write_c_string_literal.c | ||
x11_dehexify.c | ||
x11_identify_auth_proto.c | ||
x11_make_greeting.c | ||
x11_parse_ip.c | ||
x11authfile.c | ||
x11authnames.c |