simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Jul 7 18:11:04 BST 2022


TL;DR:
  a77040af Windows: add keyboard accelerators in the host key prompt.
  d8f8c897 Make HelpCtx a per-platform type, not an intorptr.
  d155009d Utility function to do terminal word wrapping.
  46332db2 Move host key dialogs over to using ShinyDialogBox.
  f1c82980 Centralise most details of host-key prompting.

Repository:     https://git.tartarus.org/simon/putty.git
On the web:     https://git.tartarus.org/?p=simon/putty.git
Branch updated: main
Committer:      Simon Tatham <anakin at pobox.com>
Date:           2022-07-07 18:11:04

commit a77040afa18f85622df4f001da2f133dd79d62eb
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a77040afa18f85622df4f001da2f133dd79d62eb;hp=f579b3c01e2bfd439d493be06b934404e13d3376
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Jul 5 18:37:15 2022 +0100

    Windows: add keyboard accelerators in the host key prompt.
    
    These went away when we moved from a standard MessageBox to a custom
    dialog, impairing accessibility. Now put some back by hand.

 windows/putty-common.rc2 | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

commit d8f8c8972aecd96d9b2ec552f21421087dd7828c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d8f8c8972aecd96d9b2ec552f21421087dd7828c;hp=a77040afa18f85622df4f001da2f133dd79d62eb
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Jul 5 18:11:54 2022 +0100

    Make HelpCtx a per-platform type, not an intorptr.
    
    Partly, this just seems more sensible, since it may well vary per
    platform beyond the ability of intorptr to specify. But more
    immediately it means the definition of the HELPCTX macro doesn't have
    to use the P() function from dialog.h, which isn't defined in any
    circumstances outside the config subsystem. And I'm about to want to
    put a help context well outside that subsystem.

 config.c                  |  2 +-
 dialog.c                  | 28 ++++++++++++++--------------
 dialog.h                  | 24 ++++++++++++------------
 unix/platform.h           |  4 +++-
 utils/ctrlset_normalise.c |  1 +
 windows/controls.c        |  6 +++---
 windows/help.h            |  4 +++-
 7 files changed, 37 insertions(+), 32 deletions(-)

commit d155009ded353e840f1f1480bb55fde9230b866c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d155009ded353e840f1f1480bb55fde9230b866c;hp=d8f8c8972aecd96d9b2ec552f21421087dd7828c
Author: Simon Tatham <anakin at pobox.com>
Date:   Wed Jul 6 19:01:15 2022 +0100

    Utility function to do terminal word wrapping.
    
    I'm planning to use this to replace some of the manually wrapped lines
    in console messages.

 misc.h               |  2 ++
 utils/CMakeLists.txt |  1 +
 utils/wordwrap.c     | 36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 39 insertions(+)

commit 46332db26e43569ccc2e4d71de54317d6ce5eca1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=46332db26e43569ccc2e4d71de54317d6ce5eca1;hp=d155009ded353e840f1f1480bb55fde9230b866c
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jul 7 17:23:27 2022 +0100

    Move host key dialogs over to using ShinyDialogBox.
    
    They were previously using an ad-hoc system for getting hold of their
    context structure, which had to be different between the WM_INITDIALOG
    handler and everything else. That's exactly what ShinyDialogBox is
    good for preventing, so let's use it, to save effort.

 windows/dialog.c         | 43 ++++++++++++++++++-------------------------
 windows/putty-common.rc2 |  2 ++
 2 files changed, 20 insertions(+), 25 deletions(-)

commit f1c82980007f9afa1ab5a5fefeab5dcaf12e8803
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=f1c82980007f9afa1ab5a5fefeab5dcaf12e8803;hp=46332db26e43569ccc2e4d71de54317d6ce5eca1
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jul 7 17:25:15 2022 +0100

    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.

 console.c                |  61 ++---------
 defs.h                   |   3 +
 proxy/sshproxy.c         |  21 +++-
 pscp.c                   |   1 +
 psftp.c                  |   1 +
 putty.h                  |  49 +++++++--
 ssh/common.c             | 102 +++++++++++++++++-
 ssh/server.c             |   1 +
 ssh/sesschan.c           |   1 +
 unix/console.c           |  87 +++++++++------
 unix/dialog.c            | 133 ++++++++++++-----------
 unix/platform.h          |   3 +-
 unix/plink.c             |   1 +
 unix/window.c            |   1 +
 utils/CMakeLists.txt     |   1 +
 utils/nullseat.c         |  13 ++-
 utils/seat_dialog_text.c |  41 +++++++
 utils/tempseat.c         |  14 ++-
 windows/console.c        |  87 +++++++++------
 windows/dialog.c         | 272 +++++++++++++++++++++++++++++++++++------------
 windows/platform.h       |   3 +-
 windows/plink.c          |   1 +
 windows/putty-common.rc2 |  64 ++---------
 windows/putty-rc.h       |   4 +-
 windows/window.c         |   1 +
 25 files changed, 644 insertions(+), 322 deletions(-)



More information about the tartarus-commits mailing list