simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Mon Feb 4 20:35:05 GMT 2019


TL;DR:
  acc21c4c Stop using unqualified {GET,PUT}_32BIT.
  961c39cc misc.h: make some #defines into inline functions.
  7a9eb02e sshecc.c: reliably initialise ek->privateKey.
  370248a9 Give the AES CBC protocol ids back their correct names.
  10f80777 Add "cbc" suffix to ciphers in testcrypt's namespace.
  bd84c5e4 mp_modmul: cope with oversized base values.

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:           2019-02-04 20:35:05

commit acc21c4c0f95ed60421bc4a5a74caddf1ce62e55
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=acc21c4c0f95ed60421bc4a5a74caddf1ce62e55;hp=5538091f0d52c82fd77c60ef2e7807883341cb1b
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 07:39:03 2019 +0000

    Stop using unqualified {GET,PUT}_32BIT.
    
    Those were a reasonable abbreviation when the code almost never had to
    deal with little-endian numbers, but they've crept into enough places
    now (e.g. the ECC formatting) that I think I'd now prefer that every
    use of the integer read/write macros was clearly marked with its
    endianness.
    
    So all uses of GET_??BIT and PUT_??BIT are now qualified. The special
    versions in x11fwd.c, which used variable endianness because so does
    the X11 protocol, are suffixed _X11 to make that clear, and where that
    pushed line lengths over 80 characters I've taken the opportunity to
    name a local variable to remind me of what that extra parameter
    actually does.

 agentf.c            |  2 +-
 import.c            |  8 ++++----
 misc.h              |  4 ----
 pageant.c           | 12 ++++++------
 sesschan.c          |  2 +-
 sftp.c              |  2 +-
 sftpcommon.c        |  2 +-
 ssh1bpp.c           |  6 +++---
 ssh2bpp-bare.c      |  2 +-
 ssh2bpp.c           | 10 +++++-----
 sshpubk.c           |  4 ++--
 sshshare.c          | 20 ++++++++++----------
 unix/uxagentc.c     |  2 +-
 unix/uxsftpserver.c |  8 ++++----
 windows/winpgnt.c   |  4 ++--
 windows/winpgntc.c  |  2 +-
 x11fwd.c            | 24 +++++++++++++-----------
 17 files changed, 56 insertions(+), 58 deletions(-)

commit 961c39ccd02acec46af83de083ba4b44245fb9b6
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=961c39ccd02acec46af83de083ba4b44245fb9b6;hp=acc21c4c0f95ed60421bc4a5a74caddf1ce62e55
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 07:45:09 2019 +0000

    misc.h: make some #defines into inline functions.
    
    Mainly this change affects the whole {GET,PUT}_??BIT_?SB_FIRST family,
    which has always been a horrible set of macros for massive multiple-
    expansion of its arguments. Now we're allowed to use C99 in this code
    base, I can finally turn them into nice clean inline functions. As
    bonus they now take their pointer argument as a void * (const-
    qualified as appropriate) which means the call site doesn't have to
    worry about exactly which flavour of pointer it's passing.
    
    (That change also affects the GET_*_X11 macros in x11fwd.c, since I
    was just reminded of their existence too!)
    
    I've also converted NULLTOEMPTY, which was sitting right next to the
    GET/PUT macros in misc.h and it seemed a shame to leave it out.

 misc.h   | 185 ++++++++++++++++++++++++++++++++++++---------------------------
 x11fwd.c |  15 ++++--
 2 files changed, 116 insertions(+), 84 deletions(-)

commit 7a9eb02e472e809ace37a5d0e99cebde5734a894
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=7a9eb02e472e809ace37a5d0e99cebde5734a894;hp=961c39ccd02acec46af83de083ba4b44245fb9b6
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 20:12:50 2019 +0000

    sshecc.c: reliably initialise ek->privateKey.
    
    If something goes wrong part way through one of the new-key functions,
    we immediately call the corresponding freekey function before
    returning failure. That will test ek->privateKey for NULL, and if it's
    not NULL, try to free it - so we should be sure it _is_ NULL if we
    haven't put a private key in it.

 sshecc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

commit 370248a98bc7d072dc9935fff95359518ed9ce82
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=370248a98bc7d072dc9935fff95359518ed9ce82;hp=7a9eb02e472e809ace37a5d0e99cebde5734a894
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 20:13:54 2019 +0000

    Give the AES CBC protocol ids back their correct names.
    
    In commit dfdb73e10 I accidentally renamed them from "aes128-cbc" to
    "aes128" (and ditto for the other two key lengths), probably because
    of the confusing names of the C-level identifiers for those vtables.
    Now restored to the versions actually described in RFC 4253.

 sshaes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

commit 10f80777dec07ee4f0275427c13a53d6803e61c1
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=10f80777dec07ee4f0275427c13a53d6803e61c1;hp=370248a98bc7d072dc9935fff95359518ed9ce82
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 20:17:50 2019 +0000

    Add "cbc" suffix to ciphers in testcrypt's namespace.
    
    This completes the conversion begun in commit be5c0e635: now every
    CBC-mode cipher has "cbc" in its name, and doesn't leave it implicit.
    Hopefully this will never confuse me again!

 test/cryptsuite.py | 40 ++++++++++++++++++++--------------------
 testcrypt.c        | 20 ++++++++++----------
 2 files changed, 30 insertions(+), 30 deletions(-)

commit bd84c5e4b3ff18be6eb33acfdaf3a19745685735
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=bd84c5e4b3ff18be6eb33acfdaf3a19745685735;hp=10f80777dec07ee4f0275427c13a53d6803e61c1
Author: Simon Tatham <anakin at pobox.com>
Date:   Mon Feb 4 20:19:13 2019 +0000

    mp_modmul: cope with oversized base values.
    
    Previously, I checked by assertion that the base was less than the
    modulus. There were two things wrong with this policy. Firstly, it's
    perfectly _meaningful_ to want to raise a large number to a power mod
    a smaller number, even if it doesn't come up often in cryptography;
    secondly, I didn't do it right, because the check was based on the
    formal sizes (nw fields) of the mp_ints, which meant that it was
    possible to have a failure of the assertion even in the case where the
    numerical value of the base _was_ less than the modulus.
    
    In particular, this could come up in Diffie-Hellman with a fixed
    group, because the fixed group modulus was decoded from an MP_LITERAL
    in sshdh.c which gave a minimal value of nw, but the base was the
    public value sent by the other end of the connection, which would
    sometimes be sent with the leading zero byte required by the SSH-2
    mpint encoding, and would cause a value of nw one larger, failing the
    assertion.
    
    Fixed by simply using mp_modmul in monty_import, replacing the
    previous clever-but-restricted strategy that I wrote when I thought I
    could get away without having to write a general division-based
    modular reduction at all.

 mpint.c            | 19 ++++++++-----------
 test/cryptsuite.py |  4 ++++
 2 files changed, 12 insertions(+), 11 deletions(-)



More information about the tartarus-commits mailing list