simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Tue Jan 14 07:00:45 GMT 2020


TL;DR:
  93f7b324 cgtest: stop also behaving like cmdgen.
  356e14cd cgtest: fix all memory leaks.
  df577ab1 cgtest: add tests for elliptic-curve keys.
  187cc8bf PuTTYgen: permit and prefer 255 as bit count for ed25519.
  00065111 cgtest: add more command line options.

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-01-14 07:00:45

commit 93f7b324a51d0d73e5c8cfecfc0077939bafc7ba
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=93f7b324a51d0d73e5c8cfecfc0077939bafc7ba;hp=43a63019f5bdc627170212ec5ed8c1333ad4727b
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 13 22:04:32 2020 +0000

    cgtest: stop also behaving like cmdgen.
    
    The self-test mode of command-line PuTTYgen used to be compiled by
    manually setting a #define, so that it would _replace_ the puttygen
    binary. Therefore, it was useful to still have it behave like puttygen
    if invoked with arguments, so that you didn't have to annoyingly
    recompile back and forth to switch between manual and automated
    testing.
    
    But now that cgtest is built _alongside_ puttygen, there's no need for
    that. If someone needs the non-test version of puttygen, it's right
    there next to cgtest. So I've removed that weird special case, and
    replaced it with a new command-line syntax for cgtest which supports a
    -v option (which itself replaces configuration via an awkward
    environment variable CGTEST_VERBOSE).

 cmdgen.c | 21 +++++++++++----------
 1 file changed, 11 insertions(+), 10 deletions(-)

commit 356e14cd89fc6dedc97960d0cef6f59ead61b45f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=356e14cd89fc6dedc97960d0cef6f59ead61b45f;hp=93f7b324a51d0d73e5c8cfecfc0077939bafc7ba
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 13 22:14:02 2020 +0000

    cgtest: fix all memory leaks.
    
    I've adjusted the cmdgen main program so that it does all early
    returns via the 'goto out' idiom, so that they still go through all
    the last-minute freeing steps. That meant I had to adjust a few of the
    last-minute freeing steps so they don't try to do impossible things
    like freeing SSH2_WRONG_PASSPHRASE or calling a vtable method of a
    null object. Also added a couple of completely missing frees, in
    cmdgen itself ('outfiletmp') and in the cgtest wrapper main ('fp').
    
    Now cgtest gets a completely clean run through Leak Sanitiser.

 cmdgen.c | 67 ++++++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 40 insertions(+), 27 deletions(-)

commit df577ab152a7281e2f392ebc05d3178bde803cc1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=df577ab152a7281e2f392ebc05d3178bde803cc1;hp=356e14cd89fc6dedc97960d0cef6f59ead61b45f
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 13 22:32:03 2020 +0000

    cgtest: add tests for elliptic-curve keys.
    
    We've supported ECC keys for a while, but cgtest has never tested them
    before. Now it does.
    
    This wasn't quite as simple as adding two extra key types to the list.
    I had to add a system of per-key-type flags in the tests to trigger
    different expectations and workarounds: the new key types can't be
    converted to and from ssh.com format, they behave differently from
    rsa1 if you try (in that they'll get as far as asking for the
    passphrase _before_ realising the key is an unsupported kind), and
    also it turns out we disagree with OpenSSH ssh-keygen on the bit count
    to write in the fingerprint of an ed25519 key. (We say 255, and they
    say 256.)
    
    But having fixed all those things, the tests pass.

 cmdgen.c | 174 ++++++++++++++++++++++++++++++++++++++++++++-------------------
 1 file changed, 121 insertions(+), 53 deletions(-)

commit 187cc8bfccaf9a3ddbe7b344adf5618ba524243e
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=187cc8bfccaf9a3ddbe7b344adf5618ba524243e;hp=df577ab152a7281e2f392ebc05d3178bde803cc1
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Jan 14 06:39:32 2020 +0000

    PuTTYgen: permit and prefer 255 as bit count for ed25519.
    
    In setting up the ECC tests for cmdgen, I noticed that OpenSSH and
    PuTTYgen disagree on the bit length to put in a key fingerprint for an
    ed25519 key: we think 255, they think 256.
    
    On reflection, I think 255 is more accurate, which is why I bodged
    get_fp() in the test suite to ignore that difference when checking our
    key fingerprint against OpenSSH's. But having done that, it now seems
    silly that if you unnecessarily specify a bit count at ed25519
    generation time, cmdgen will insist that it be 256!
    
    255 is now permitted everywhere an ed25519 bit count is input. 256 is
    also still allowed for backwards compatibility but 255 is preferred by
    the error message if you give any other value.

 cmdgen.c          | 6 +++---
 sshecc.c          | 2 +-
 windows/winpgen.c | 2 +-
 3 files changed, 5 insertions(+), 5 deletions(-)

commit 00065111c97b3891ea4a79ea09d91edef516f21b
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=00065111c97b3891ea4a79ea09d91edef516f21b;hp=187cc8bfccaf9a3ddbe7b344adf5618ba524243e
Author: Simon Tatham <anakin at pobox.com>
Date:   Tue Jan 14 06:42:26 2020 +0000

    cgtest: add more command line options.
    
    You can now restrict testing to a single key type (for quicker round
    trips once you know what you're debugging). Also --help, on general
    principles now that there's more than one option.

 cmdgen.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)



More information about the tartarus-commits mailing list