simon-git: putty (main): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Nov 22 19:16:02 GMT 2021


TL;DR:
  a434b130 Pass diffiehellman ssh_kex objects to testcrypt.
  beff1cb6 testcrypt: move TD_foo declarations up the file.
  d4fedfeb testcrypt: move enumerated types out into another header.
  9ceb2c49 testcrypt: introduce and use 'checkenum' protocol query.
  67b11add Move some tests into the test subdirectory.

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-11-22 19:16:01

commit a434b13050196846bf3afb8347e9b7f130d9f643
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=a434b13050196846bf3afb8347e9b7f130d9f643;hp=42120dd1c5184191ba90d127073ef99d28d61b53
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 22 18:31:05 2021 +0000

    Pass diffiehellman ssh_kex objects to testcrypt.
    
    This slightly simplifies the lookup function get_dh_group(), but
    mostly, the point is to make it more similar to the other lookup
    functions, because I'm planning to have those autogenerated.

 crypto/diffie-hellman.c | 6 +++---
 ssh.h                   | 3 +++
 testcrypt.c             | 8 ++++----
 3 files changed, 10 insertions(+), 7 deletions(-)

commit beff1cb600b8b47547fe39bdcbbb61c7ab19557c
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=beff1cb600b8b47547fe39bdcbbb61c7ab19557c;hp=a434b13050196846bf3afb8347e9b7f130d9f643
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 22 18:35:08 2021 +0000

    testcrypt: move TD_foo declarations up the file.
    
    A completely trivial change which I only put in its own commit so that
    the next one will have a less confusing-looking diff.

 testcrypt.c | 56 ++++++++++++++++++++++++++++----------------------------
 1 file changed, 28 insertions(+), 28 deletions(-)

commit d4fedfebdc5fea7c3ee876b95bc9453954f5e4bd
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=d4fedfebdc5fea7c3ee876b95bc9453954f5e4bd;hp=beff1cb600b8b47547fe39bdcbbb61c7ab19557c
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 22 18:38:36 2021 +0000

    testcrypt: move enumerated types out into another header.
    
    Now all the lookup functions like get_hashalg() and
    get_primegenpolicy() are autogenerated by macro expansion from a
    header a little like the existing testcrypt.h. But the macros are much
    simpler this time.
    
    This doesn't really change anything, _except_ that now I'll be able to
    reinclude the same header to do other things with the list of
    enumerated types.

 testcrypt-enum.h | 144 +++++++++++++++++++++++++
 testcrypt.c      | 313 ++++++-------------------------------------------------
 2 files changed, 175 insertions(+), 282 deletions(-)

commit 9ceb2c49ae79c40e7836589cf3f04385043e45e6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=9ceb2c49ae79c40e7836589cf3f04385043e45e6;hp=d4fedfebdc5fea7c3ee876b95bc9453954f5e4bd
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 22 18:39:45 2021 +0000

    testcrypt: introduce and use 'checkenum' protocol query.
    
    This allows the Python side of testcrypt to check in advance if a
    given string is a valid element of an enumeration, and if not, cleanly
    throw a Python-level exception without terminating the testcrypt
    subprocess.
    
    Should be useful in both manual use (when I'm trying something out by
    hand and make a typo or misremember a spelling), and automated use (if
    I make the same kind of error in cryptsuite.py then the exception dump
    will make more sense).
    
    In order to do this, the new handle_checkenum() function has to
    recognise all the enumerated types by name and match them up to their
    lookup functions - which is just the kind of thing that can now be
    done easily be reincluding testcrypt-enum.h with different #defines.

 test/testcrypt.py | 10 +++++++++-
 testcrypt.c       | 20 ++++++++++++++++++++
 2 files changed, 29 insertions(+), 1 deletion(-)

commit 67b11add593153244f4ec910352c4a65fb3d63c9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=67b11add593153244f4ec910352c4a65fb3d63c9;hp=9ceb2c49ae79c40e7836589cf3f04385043e45e6
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Nov 22 18:50:12 2021 +0000

    Move some tests into the test subdirectory.
    
    Now testcrypt has _two_ header files, that's more files than I want at
    the top level, so I decided to move it.
    
    It has a good claim to live in either 'test' or 'crypto', but in the
    end I decided it wasn't quite specific enough to crypto (it already
    also tests things in keygen and proxy), and also, the Python half of
    the mechanism already lives in 'test', so it can live alongside that.
    
    Having done that, it seemed silly to leave testsc and testzlib at the
    top level: those have 'test' in the names as well, so they can go in
    the test subdir as well.
    
    While I'm renaming, also renamed testcrypt.h to testcrypt-func.h to
    distinguish it from the new testcrypt-enum.h.

 CMakeLists.txt                            |  2 +-
 testcrypt-enum.h => test/testcrypt-enum.h |  0
 testcrypt.h => test/testcrypt-func.h      |  0
 testcrypt.c => test/testcrypt.c           | 42 +++++++++++++++----------------
 test/testcrypt.py                         |  6 ++---
 testsc.c => test/testsc.c                 |  0
 testzlib.c => test/testzlib.c             |  0
 unix/CMakeLists.txt                       |  4 +--
 8 files changed, 27 insertions(+), 27 deletions(-)



More information about the tartarus-commits mailing list