simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Sun Feb 2 14:07:02 GMT 2020
TL;DR:
c25dc9c2 cgtest: add missing \n in an error message.
5db2f4ca Expose lf_load_keyfile outside sshpubk.c.
36d214c5 Allow import.c to read from a BinarySource.
7599a57a Allow cmdgen to read keys from standard input.
Repository: https://git.tartarus.org/simon/putty.git
On the web: https://git.tartarus.org/?p=simon/putty.git
Branch updated: master
Committer: Simon Tatham <anakin at pobox.com>
Date: 2020-02-02 14:07:02
commit c25dc9c2fd4ee90180a3c62a983bbd1726338ccd
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c25dc9c2fd4ee90180a3c62a983bbd1726338ccd;hp=fb5da46c4826f5bfbbe158c05b88de49e1c3b930
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Feb 2 11:27:03 2020 +0000
cgtest: add missing \n in an error message.
cmdgen.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
commit 5db2f4ca7eb2fe5927360cb9703a395a488bbd07
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5db2f4ca7eb2fe5927360cb9703a395a488bbd07;hp=c25dc9c2fd4ee90180a3c62a983bbd1726338ccd
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Feb 2 11:27:03 2020 +0000
Expose lf_load_keyfile outside sshpubk.c.
I'm about to use it in cmdgen for a minor UI improvement. Also, I
expect it to be useful in the Pageant client code sooner or later.
While I'm here, I've also tweaked its UI a little so that it reports a
more precise error, and provided a version that can read from an
already open stdio stream.
defs.h | 1 +
ssh.h | 13 ++++++
sshpubk.c | 143 ++++++++++++++++++++++++++++++++++++++++----------------------
3 files changed, 106 insertions(+), 51 deletions(-)
commit 36d214c50bfb2e7a8902f823ede22c67adae0b6c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=36d214c50bfb2e7a8902f823ede22c67adae0b6c;hp=5db2f4ca7eb2fe5927360cb9703a395a488bbd07
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Feb 2 11:58:24 2020 +0000
Allow import.c to read from a BinarySource.
Like sshpubk.c before it, the loading side of import.c now works by
first slurping the whole input file into a LoadedFile structure, and
then using the BinarySource system to parse the file contents entirely
in memory.
The old API is still present and works the same as ever, but now we
also provide a secondary API that can import a foreign key file from a
BinarySource.
This is rather a superficial conversion: I've replaced all calls to
fgetline() with a local static function bsgetline() which presents
more or less the same interface for a BinarySource: that is, it still
returns a dynamically allocated string containing the line of text, so
that the followup code could change as little as possible. It would be
nice to come back in future and modernise this code to use ptrlens
throughout, saving all the unnecessary allocations.
import.c | 163 +++++++++++++++++++++++++++++++++------------------------------
ssh.h | 6 +++
utils.c | 2 +-
3 files changed, 92 insertions(+), 79 deletions(-)
commit 7599a57a33ab8bc3ad94ccc175732fbf05eef8a6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7599a57a33ab8bc3ad94ccc175732fbf05eef8a6;hp=36d214c50bfb2e7a8902f823ede22c67adae0b6c
Author: Simon Tatham <anakin at pobox.com>
Date: Sun Feb 2 11:41:06 2020 +0000
Allow cmdgen to read keys from standard input.
This reworks the cmdgen main program so that it loads the input file
into a LoadedFile right at the start, and then every time it needs to
do something with the contents, it calls one of the API functions
taking a BinarySource instead of one taking a Filename.
The usefulness of this is that now we can read from things that aren't
regular files, and can't be rewound or reopened. In particular, the
filename "-" is now taken (per the usual convention) to mean standard
input.
So now you can pipe a public or private key file into cmdgen's
standard input and have it do something useful. For example, I was
recently experimenting with the SFTP-only SSH server that comes with
'proftpd', which keeps its authorized_keys file in RFC 4716 format
instead of the OpenSSH one-liner format, and I found I wanted to do
grep 'my-key-comment' ~/.ssh/authorized_keys | puttygen -p -
to quickly get hold of my existing public key to put in that file. But
I had to go via a temporary file to make that work, because puttygen
couldn't read from standard input. Next time, it will be able to!
cmdgen.c | 42 ++++++++++++++++++++++++++++++++----------
ssh.h | 1 +
sshpubk.c | 4 +---
3 files changed, 34 insertions(+), 13 deletions(-)
More information about the tartarus-commits
mailing list