1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00
putty-source/utils
Simon Tatham f1c8298000 Centralise most details of host-key prompting.
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.
2022-07-07 18:05:32 +01:00
..
antispoof.c Marshalling macros put_dataz and put_datalit. 2021-11-19 15:09:17 +00:00
backend_socket_log.c Move some more files into subdirectories. 2021-11-23 18:52:15 +00:00
base64_decode_atom.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
base64_decode.c Improve the base64 utility functions. 2022-04-25 14:10:16 +01:00
base64_encode_atom.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
base64_encode.c Improve the base64 utility functions. 2022-04-25 14:10:16 +01:00
base64_valid.c New utility function base64_valid(). 2022-05-01 11:27:37 +01:00
bufchain.c Add some more bufchain_try_* functions. 2021-11-19 10:35:38 +00:00
buildinfo.c buildinfo: add cases to recognise MSVC 17.1 and 17.2. 2022-05-31 13:28:50 +01:00
burnstr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
cert-expr.c Certificate trust scope: change to a boolean-expression system. 2022-06-25 14:32:23 +01:00
chomp.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
CMakeLists.txt Centralise most details of host-key prompting. 2022-07-07 18:05:32 +01:00
cmdline_get_passwd_input_state_new.c Fix command-line password handling in Restart Session. 2022-05-18 13:05:17 +01:00
conf_dest.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
conf_launchable.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
conf.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
ctrlparse.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
ctrlset_normalise.c Make HelpCtx a per-platform type, not an intorptr. 2022-07-07 17:34:24 +01:00
debug.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
decode_utf8_to_wchar.c Add a manual single-char UTF-8 decoder. 2022-03-12 18:51:21 +00:00
decode_utf8.c Add a manual single-char UTF-8 decoder. 2022-03-12 18:51:21 +00:00
default_description.c Add 'description' methods for Backend and Plug. 2021-10-24 10:48:25 +01:00
dup_mb_to_wc.c Remove a redundant file in utils. 2021-11-30 18:48:06 +00:00
dup_wc_to_mb.c Remove uni_tbl from struct unicode_data. 2022-06-01 09:28:25 +01:00
dupcat.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
dupprintf.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
dupstr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
encode_utf8.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
encode_wide_string_as_utf8.c win_set_[icon_]title: send a codepage along with the string. 2021-10-16 14:00:46 +01:00
fgetline.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_ca_new_free.c Certificate trust scope: change to a boolean-expression system. 2022-06-25 14:32:23 +01:00
host_strchr_internal.c Build various unit-test main() programs in utils. 2021-04-18 08:30:44 +01:00
host_strchr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strcspn.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strduptrim.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
host_strrchr.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
key_components.c Extra helper functions for adding key_components. 2022-04-24 08:39:04 +01:00
log_proxy_stderr.c Move some more files into subdirectories. 2021-11-23 18:52:15 +00:00
ltime.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
make_spr_sw_abort_static.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
marshal.c marshal.[ch]: remove redundant declaration. 2021-11-19 15:09:17 +00:00
memory.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
memxor.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
null_lp.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
nullkey.c Certificate-specific ssh_key method suite. 2022-04-25 15:09:31 +01:00
nullseat.c Centralise most details of host-key prompting. 2022-07-07 18:05:32 +01:00
nullstrcmp.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
out_of_memory.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
parse_blocksize.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
percent_decode.c Routines for %-encoding and %-decoding. 2022-06-25 14:30:39 +01:00
percent_encode.c Routines for %-encoding and %-decoding. 2022-06-25 14:30:39 +01:00
prompts.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
ptrlen.c A few more ptrlen functions. 2022-06-25 14:30:39 +01:00
read_file_into.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
seat_connection_fatal.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
seat_dialog_text.c Centralise most details of host-key prompting. 2022-07-07 18:05:32 +01:00
sessprep.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
sk_free_peer_info.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
smemclr.c Fix typo in comment. 2021-04-19 17:14:01 +01:00
smemeq.c Make smemeq return unsigned, not bool. 2022-04-15 17:46:06 +01:00
spr_get_error_message.c Richer data type for interactive prompt results. 2021-12-28 18:08:31 +00:00
ssh2_pick_fingerprint.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
ssh_key_clone.c Utility function ssh_key_clone(). 2022-04-24 08:39:04 +01:00
sshutils.c Move the SSH implementation into its own subdirectory. 2021-04-22 18:09:13 +01:00
strbuf.c Utility function strbuf_dup. 2022-04-24 08:38:27 +01:00
string_length_for_printf.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
stripctrl.c Fix use-after-free in locale-based stripctrl. 2022-04-22 15:19:25 +01:00
tempseat.c Centralise most details of host-key prompting. 2022-07-07 18:05:32 +01:00
tree234.c Fix a batch of typos in comments and docs. 2022-01-03 06:40:51 +00:00
utils.h New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
validate_manual_hostkey.c Fix manual host key validation. 2021-10-25 18:12:21 +01:00
version.c New library-style 'utils' subdirectories. 2021-04-18 08:18:27 +01:00
wcwidth.c wcwidth.c: update to Unicode 14.0.0. 2021-10-10 14:55:15 +01:00
wildcard.c Build various unit-test main() programs in utils. 2021-04-18 08:30:44 +01:00
wordwrap.c Utility function to do terminal word wrapping. 2022-07-07 18:05:32 +01:00
write_c_string_literal.c Remove duplicated string-literal formatter in Telnet proxy. 2021-12-22 15:05:04 +00:00
x11_dehexify.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11_identify_auth_proto.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11_make_greeting.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11_parse_ip.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11authfile.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00
x11authnames.c Break up x11fwd.c. 2021-04-18 08:18:27 +01:00