simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Wed Apr 7 20:19:12 BST 2021
TL;DR:
21c2e451 winpgnt: fix crash if deferred-decryption passphrase is wrong.
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: 2021-04-07 20:19:12
commit 21c2e451dade78bf5590af4b84a68fc608840317
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=21c2e451dade78bf5590af4b84a68fc608840317;hp=1069ba6a01d16d9b0f5ee50e4d74cb3ff80d39c5
Author: Simon Tatham <anakin at pobox.com>
Date: Wed Apr 7 20:15:34 2021 +0100
winpgnt: fix crash if deferred-decryption passphrase is wrong.
Thanks to Jacob for spotting this one: when we hand a passphrase back
to pageant.c via pageant_passphrase_request_success(), if the key
doesn't decrypt successfully, pageant.c responds by immediately
issuing another passphrase prompt - and it does it _synchronously_, by
calling back from within pageant_passphrase_request_success(). In this
case, the effect is that we end up in ask_passphrase_common(), which
starts by asserting that nonmodal_passphrase_hwnd is NULL - but it
wasn't NULL _quite_ yet, because end_passphrase_dialog() was expecting
to clean it up immediately after pageant_passphrase_request_success()
returned, i.e. just too late.
The heavyweight fix would be to arrange a toplevel callback to defer
opening the new window until after the old one had been cleaned up.
But in this case I don't think there's any need: it's enough to simply
do the operations in end_passphrase_dialog() in the opposite order, so
that first we destroy the old window and set nonmodal_passphrase_hwnd
back to NULL, and _then_ we call into pageant.c which might call us
back and open a fresh window.
windows/winpgnt.c | 18 +++++++++++++++---
1 file changed, 15 insertions(+), 3 deletions(-)
More information about the tartarus-commits
mailing list