simon-git: putty (main): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sat Jan 15 18:57:55 GMT 2022
TL;DR:
dc183e16 Windows Pageant and PuTTYgen: spiff up option parsing.
11aa9ab8 Windows PuTTYgen: support cmdgen's key-type and PPK options.
8a288393 Windows Pageant: integrate with Windows OpenSSH.
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-01-15 18:57:55
commit dc183e1649b429a98fa39fdedb42d5e5ab820f26
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=dc183e1649b429a98fa39fdedb42d5e5ab820f26;hp=91806dfbb7977820b85a170841108ba2973abef6
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jan 15 18:27:19 2022 +0000
Windows Pageant and PuTTYgen: spiff up option parsing.
These two tools had ad-hoc command loops with similar options, and I
want to extend both (in particular, in a way that introduces options
with arguments). So I've started by throwing together some common code
to do all the tedious bits like finding option arguments wherever they
might be, throwing errors, handling "--" and so on.
Should be no functional change to the existing command-line syntax,
except that now all long options are recognised in both "-foo" and
"--foo" form.
windows/CMakeLists.txt | 1 +
windows/pageant.c | 100 +++++++++++++++++++-----------------
windows/platform.h | 13 +++++
windows/puttygen.c | 49 +++++++++++++-----
windows/utils/aux_match_opt.c | 117 ++++++++++++++++++++++++++++++++++++++++++
5 files changed, 220 insertions(+), 60 deletions(-)
commit 11aa9ab8f3f426131fdeb2f37f98a94802a0a37c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=11aa9ab8f3f426131fdeb2f37f98a94802a0a37c;hp=dc183e1649b429a98fa39fdedb42d5e5ab820f26
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jan 15 18:30:34 2022 +0000
Windows PuTTYgen: support cmdgen's key-type and PPK options.
This imports the following options from command-line PuTTYgen, which
all correspond to controls in Windows PuTTYgen's GUI, and let you set
the GUI controls to initial values of your choice:
-t <key type>
-b <bits>
-E <fingerprint type>
--primes <prime gen policy>
--strong-rsa
--ppk-param <KDF parameters or PPK version etc>
The idea is that if someone generates a lot of keys and has standard
non-default preferences, they can make a shortcut that passes those
preferences on the command line.
doc/pubkey.but | 76 +++++++++++++++++++++++
windows/puttygen.c | 175 ++++++++++++++++++++++++++++++++++++++++++++++++++---
2 files changed, 242 insertions(+), 9 deletions(-)
commit 8a2883933d4f664681a015341cf8760a0231a41b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8a2883933d4f664681a015341cf8760a0231a41b;hp=11aa9ab8f3f426131fdeb2f37f98a94802a0a37c
Author: Simon Tatham <anakin at pobox.com>
Date: Sat Jan 15 18:36:22 2022 +0000
Windows Pageant: integrate with Windows OpenSSH.
After a discussion with a user recently, I investigated the Windows
native ssh.exe, and found it uses a Windows named pipe to talk to its
ssh-agent, in exactly the same way Pageant does. So if you tell
ssh.exe where to find Pageant's pipe, it can talk directly to Pageant,
and then you can have just one SSH agent.
The slight problem is that Pageant's pipe name is not stable. It's
generated using the same system as connection-sharing pipe names, and
contains a hex hash value whose preimage was fed through
CryptProtectData. And the problem with _that_ is that CryptProtectData
apparently reinitialises its seed between login sessions (though it's
stable within a login session), which I hadn't fully realised when I
reused the same pipe-name construction code.
One possibility, of course, would be to change Pageant so that it uses
a fixed pipe name. But after a bit of thought, I think I actually like
this feature, because the Windows named pipe namespace isn't
segregated into areas writable by only particular users, so anyone
using that namespace on a multiuser Windows box is potentially
vulnerable to someone else squatting on the name you wanted to use.
Using this system makes that harder, because the squatter won't be
able to predict what the name is going to be! (Unless you shut down
Pageant and start it up again within one login session - but there's
only so much we can do. And squatting is at most a DoS, because
PuTTY's named-pipe client code checks ownership of the other end of
the pipe in all cases.)
So instead I've gone for a different approach. Windows Pageant now
supports an extra command-line option to write out a snippet of
OpenSSH config file format on startup, containing an 'IdentityAgent'
directive which points at the location of its named pipe. So you can
use the 'Include' directive in your main .ssh/config to include this
extra snippet, and then ssh.exe invocations will be able to find
wherever the current Pageant has put its pipe.
doc/pageant.but | 22 ++++++++++++++++++++++
windows/pageant.c | 30 ++++++++++++++++++++++++++++++
2 files changed, 52 insertions(+)
More information about the tartarus-commits
mailing list