simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Thu Jan 9 20:03:54 GMT 2020


TL;DR:
  c1a13c97 Unix Pageant: fix missing free at exit.
  9cf2db5f testcrypt: fix malformatted error message.
  a6021a2f testcrypt: fix the rsa_ssh1_encrypt wrapper.
  af72a11d testcrypt: handle int as a return type.
  cbfd7dad Change line ending wording in PPK format spec.
  13e988b6 Factor out rsa_ssh1_private_blob_agent and expose in testcrypt.
  8a87f450 Expose key generation functions in testcrypt.
  e5fbed76 Rename all public/private key load/save functions.
  32d61d7c Add some more marshalling functions, for file parsing.
  ef843e96 New macro PTRLEN_DECL_LITERAL.
  9cc586e6 Rewrite SSH key loading and saving using marshal.h.
  5cfc90ff Expose the key-file marshalling functions in testcrypt.
  d30387c7 Add cryptsuite tests for key file load and save.
  8c7b0a78 New test script 'agenttest.py' for testing Pageant.
  c6a9bf86 Rework Pageant to keep all keys in one big tree.

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-09 20:03:54

commit c1a13c97daae5414a5dba12c49877d0a25a7fb02
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c1a13c97daae5414a5dba12c49877d0a25a7fb02;hp=f51d5f816ffbea3eeda94dfe0f557f8d4968cf98
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 02:37:49 2020 +0000

    Unix Pageant: fix missing free at exit.
    
    It's totally harmless, except that if you test Pageant under Leak
    Sanitiser it makes an annoying error dump at the end of the run.

 unix/uxpgnt.c | 1 +
 1 file changed, 1 insertion(+)

commit 9cf2db5f94592c43b2423372ee19d3d8ec0ea5df
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9cf2db5f94592c43b2423372ee19d3d8ec0ea5df;hp=c1a13c97daae5414a5dba12c49877d0a25a7fb02
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:58:01 2020 +0000

    testcrypt: fix malformatted error message.
    
    I managed to get two format parameters reversed in the message when a
    return type is unhandled.

 test/testcrypt.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit a6021a2f29745a99697de3d50ca8386e228e6305
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a6021a2f29745a99697de3d50ca8386e228e6305;hp=9cf2db5f94592c43b2423372ee19d3d8ec0ea5df
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 19:16:58 2020 +0000

    testcrypt: fix the rsa_ssh1_encrypt wrapper.
    
    It wasn't expanding the output strbuf to the full size of the key
    modulus, so the output delivered to Python was only a part of the
    mpint it should have been.
    
    (Also, that was logically speaking a buffer overrun - we were writing
    to the strbuf buffer beyond its length - although in practice I think
    the _physical_ size of the buffer was large enough not to show it up
    even under ASan. In any case, a buffer overrun only in the test suite,
    and in a function I hadn't even got round to testing, is about the
    best place to have one.)
    
    While I'm here, I've also changed the way that the testcrypt wrapper
    on rsa_ssh1_encrypt indicates failure: now we have the 'opt_'
    mechanism, it can do that by returning None rather than "".

 testcrypt.c | 10 +++++++---
 testcrypt.h |  2 +-
 2 files changed, 8 insertions(+), 4 deletions(-)

commit af72a11d544968dabc29b3d015d86bed62499377
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=af72a11d544968dabc29b3d015d86bed62499377;hp=a6021a2f29745a99697de3d50ca8386e228e6305
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:57:51 2020 +0000

    testcrypt: handle int as a return type.
    
    I accepted both 'int' and 'uint' as function argument types, but
    hadn't previously noticed that only 'uint' is handled properly as a
    return type. Now both are.

 test/testcrypt.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit cbfd7dadacbed92ed25d132cdc04cee819e9202a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=cbfd7dadacbed92ed25d132cdc04cee819e9202a;hp=af72a11d544968dabc29b3d015d86bed62499377
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 19:52:19 2020 +0000

    Change line ending wording in PPK format spec.
    
    This doesn't affect what files are _legal_: the spec said we tolerated
    three kinds of line ending, and it still says we tolerate the same
    three. But I noticed that we're actually outputting \n by preference,
    whereas the spec said we prefer \r\n. I'd rather change the docs than
    the code.

 sshpubk.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit 13e988b6ee852b0ed71b9336c4aeed55823cc167
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=13e988b6ee852b0ed71b9336c4aeed55823cc167;hp=cbfd7dadacbed92ed25d132cdc04cee819e9202a
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 19:16:29 2020 +0000

    Factor out rsa_ssh1_private_blob_agent and expose in testcrypt.
    
    This will come in useful in an upcoming testcrypt-using Python script.

 pageant.c   | 8 +-------
 ssh.h       | 1 +
 sshrsa.c    | 9 +++++++++
 testcrypt.h | 1 +
 4 files changed, 12 insertions(+), 7 deletions(-)

commit 8a87f4509c2349b26e6c8a07e24af8f659474b15
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8a87f4509c2349b26e6c8a07e24af8f659474b15;hp=13e988b6ee852b0ed71b9336c4aeed55823cc167
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 07:21:30 2020 +0000

    Expose key generation functions in testcrypt.
    
    They're not much use for 'real' key generation, since like all the
    other randomness-using testcrypt functions, they need you to have
    explicitly queued up some random data. But for generating keys for
    test purposes, they have the great virtue that they deliver the key in
    the internal format, where we can generate all the various public and
    private blobs from it as well as the on-disk formats.
    
    A minor change to one of the keygen functions itself: rsa_generate now
    fills in the 'bits' and 'bytes' fields of the returned RSAKey, without
    which it didn't actually work to try to generate a public blob from
    it. (We'd never noticed before, because no previous client of
    rsa_generate even tried that.)

 Recipe      | 15 +++++++++------
 sshrsag.c   |  3 +++
 testcrypt.c | 44 ++++++++++++++++++++++++++++++++++++++++++++
 testcrypt.h | 11 ++++++++++-
 4 files changed, 66 insertions(+), 7 deletions(-)

commit e5fbed76321d7907c60c7bd93cfeebc86783ecaa
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=e5fbed76321d7907c60c7bd93cfeebc86783ecaa;hp=8a87f4509c2349b26e6c8a07e24af8f659474b15
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 5 10:28:45 2020 +0000

    Rename all public/private key load/save functions.
    
    Now they have names that are more consistent (no more userkey_this but
    that_userkey); a bit shorter; and, most importantly, all the current
    functions end in _f to indicate that they deal with keys stored in
    disk files. I'm about to add a second set of entry points that deal
    with keys via the more general BinarySource / BinarySink interface,
    which will sit alongside these with a different suffix.

 cmdgen.c          | 23 +++++++++++------------
 pageant.c         | 15 ++++++++-------
 ssh.h             | 33 +++++++++++++++++----------------
 ssh1login.c       | 13 ++++++-------
 ssh2userauth.c    | 12 +++++-------
 sshpubk.c         | 27 ++++++++++++---------------
 unix/uxpgnt.c     |  8 ++++----
 unix/uxserver.c   | 15 +++++++--------
 windows/winpgen.c | 19 ++++++++-----------
 9 files changed, 78 insertions(+), 87 deletions(-)

commit 32d61d7c48b7cf0eb7445fb410e339bbcadd1d61
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=32d61d7c48b7cf0eb7445fb410e339bbcadd1d61;hp=e5fbed76321d7907c60c7bd93cfeebc86783ecaa
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:55:41 2020 +0000

    Add some more marshalling functions, for file parsing.
    
    There are new functions here to get the next contiguous string of
    characters from a given set (like strspn/strcspn, only for
    BinarySource, and returning a ptrlen of what they skipped over). Also
    we can get a line of text with the trailing newline chomped off.
    Finally, I've provided a function to rewind a BinarySource to a
    previous position with error checking.

 marshal.c | 58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 marshal.h | 15 +++++++++++++++
 2 files changed, 73 insertions(+)

commit ef843e963833d430be7c29977635e15ff53ff443
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ef843e963833d430be7c29977635e15ff53ff443;hp=32d61d7c48b7cf0eb7445fb410e339bbcadd1d61
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 5 11:11:26 2020 +0000

    New macro PTRLEN_DECL_LITERAL.
    
    This is like PTRLEN_LITERAL, but you can use it in a _declaration_ of
    a compile-time constant ptrlen, instead of a literal in expression
    context. 'const ptrlen foo = PTRLEN_DECL_LITERAL("bar");'

 misc.h | 4 ++++
 1 file changed, 4 insertions(+)

commit 9cc586e605e3db1d6c2294f209da26e633046f3f
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9cc586e605e3db1d6c2294f209da26e633046f3f;hp=ef843e963833d430be7c29977635e15ff53ff443
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:57:09 2020 +0000

    Rewrite SSH key loading and saving using marshal.h.
    
    All the functions that read and write public and private keys to a
    FILE * are now small wrappers on top of an underlying set of functions
    that read data in the same format from a BinarySource, or write it to
    a strbuf. This sets me up to deal with key files in contexts other
    than on disk.

 ssh.h     |  18 +-
 sshpubk.c | 640 ++++++++++++++++++++++++++++++++++----------------------------
 2 files changed, 370 insertions(+), 288 deletions(-)

commit 5cfc90ff0de9d51c1556186e4935e9f4cb0cb7a0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=5cfc90ff0de9d51c1556186e4935e9f4cb0cb7a0;hp=9cc586e605e3db1d6c2294f209da26e633046f3f
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:58:25 2020 +0000

    Expose the key-file marshalling functions in testcrypt.
    
    This will allow me to write tests for them.

 Recipe      |   4 +-
 testcrypt.c | 122 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 testcrypt.h |  13 +++++++
 3 files changed, 135 insertions(+), 4 deletions(-)

commit d30387c780c05faef8070699ebd8c2ad2b6594bd
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d30387c780c05faef8070699ebd8c2ad2b6594bd;hp=5cfc90ff0de9d51c1556186e4935e9f4cb0cb7a0
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 19:58:37 2020 +0000

    Add cryptsuite tests for key file load and save.
    
    This adds stability tests (of the form 'make sure this behaves
    tomorrow the same way it behaved today, taking on faith that the
    latter was right') for all the new in-memory APIs for public and
    private key load/save.

 test/cryptsuite.py | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 115 insertions(+)

commit 8c7b0a787f6dbe29cbb40f68f59b558c0003e3e5
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=8c7b0a787f6dbe29cbb40f68f59b558c0003e3e5;hp=d30387c780c05faef8070699ebd8c2ad2b6594bd
Author: Simon Tatham <anakin at pobox.com>
Date:   Thu Jan 9 02:37:58 2020 +0000

    New test script 'agenttest.py' for testing Pageant.
    
    Well, actually, two new test programs. agenttest.py is the actual
    test; it depends on agenttestgen.py which generates a collection of
    test private keys, using the newly exposed testcrypt interface to our
    key generation code.
    
    In this commit I've also factored out some Python SSH marshalling code
    from cryptsuite, and moved it into a module ssh.py which the agent
    tests can reuse.

 test/agenttest.py     | 252 ++++++++++++++++++++++++++++++++++++++++++++++++++
 test/agenttestdata.py |  14 +++
 test/agenttestgen.py  |  89 ++++++++++++++++++
 test/cryptsuite.py    |  27 +-----
 test/ssh.py           |  98 ++++++++++++++++++++
 5 files changed, 454 insertions(+), 26 deletions(-)

commit c6a9bf86018fabdaf63b4c0931518540dd0de178
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=c6a9bf86018fabdaf63b4c0931518540dd0de178;hp=8c7b0a787f6dbe29cbb40f68f59b558c0003e3e5
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Jan 6 20:59:07 2020 +0000

    Rework Pageant to keep all keys in one big tree.
    
    I think this is on balance a cleanup in its own right. But the main
    purpose is that now Pageant has its own struct that wraps the RSAKey
    and ssh2_userkey objects it gets from the rest of the code. So I'll be
    able to put extra Pageant-specific data in that struct in future.

 pageant.c | 349 ++++++++++++++++++++++++++++++++++++--------------------------
 1 file changed, 204 insertions(+), 145 deletions(-)



More information about the tartarus-commits mailing list