simon-git: putty (master): Simon Tatham

Commits to Tartarus hosted VCS tartarus-commits at lists.tartarus.org
Sun Jan 26 16:51:55 GMT 2020


TL;DR:
  ba020476 wm_copydata_got_response: fix wrong prototype.
  0a4e068a Update _MSC_VER translation table.
  cbfba7a0 Greatly improve printf format-string checking.
  247866a9 Fix format string mistakes revealed by new checking.
  82a7e8c4 New wrapper macro for printf("%zu"), for old VS compat.
  213723a7 Fix misplaced parens in window.c.
  404f5587 sshprng.c: remove pointless pending_output buffer.
  600bf247 Fix text name of hmac-sha1-96-buggy.

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-26 16:51:55

commit ba0204760e8c831a30e2e156dfae8206e02b9334
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=ba0204760e8c831a30e2e156dfae8206e02b9334;hp=7b79d22021296e4ae941b383ab34971a9f2b0a1b
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 12:45:30 2020 +0000

    wm_copydata_got_response: fix wrong prototype.
    
    In an early draft of commit de38a4d82 I used 'void *' as the reqid
    type, and then I thought better of it and made it a special type of
    its own, in keeping with my usual idea that it's better to have your
    casts somewhat checked than totally unchecked. One remnant of the
    'void *' version got past me. Now fixed.

 windows/winpgnt.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit 0a4e068adaa6162d2d42a33a23e7687e19525a81
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0a4e068adaa6162d2d42a33a23e7687e19525a81;hp=ba0204760e8c831a30e2e156dfae8206e02b9334
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 15:16:47 2020 +0000

    Update _MSC_VER translation table.
    
    The entry for 19.0 which we included in advance of its listing on the
    official page is now confirmed, and also three followup versions.

 misc.c | 10 +++++++---
 1 file changed, 7 insertions(+), 3 deletions(-)

commit cbfba7a0e954fe0f2c3602594fa609be21a35833
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=cbfba7a0e954fe0f2c3602594fa609be21a35833;hp=0a4e068adaa6162d2d42a33a23e7687e19525a81
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 14:49:31 2020 +0000

    Greatly improve printf format-string checking.
    
    I've added the gcc-style attribute("printf") to a lot of printf-shaped
    functions in this code base that didn't have it. To make that easier,
    I moved the wrapping macro into defs.h, and also enabled it if we
    detect the __clang__ macro as well as __GNU__ (hence, it will be used
    when building for Windows using clang-cl).
    
    The result is that a great many format strings in the code are now
    checked by the compiler, where they were previously not. This causes
    build failures, which I'll fix in the next commit.

 cmdgen.c    |  4 ++--
 defs.h      | 20 ++++++++++++++++++++
 logging.c   |  2 +-
 misc.h      | 26 +++-----------------------
 network.h   |  3 ++-
 pageant.c   |  5 +++--
 pageant.h   |  4 ++--
 pscp.c      |  6 +++---
 putty.h     | 13 +++++++------
 scpserver.c |  9 ++++++---
 ssh.h       | 12 ++++++------
 sshshare.c  |  8 ++++----
 testcrypt.c |  2 +-
 testsc.c    |  2 +-
 tree234.c   |  2 +-
 15 files changed, 62 insertions(+), 56 deletions(-)

commit 247866a9d3e7b6ecae951a6bee7f876e399d3d01
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=247866a9d3e7b6ecae951a6bee7f876e399d3d01;hp=cbfba7a0e954fe0f2c3602594fa609be21a35833
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 15:00:13 2020 +0000

    Fix format string mistakes revealed by new checking.
    
    An assortment of errors: int vs size_t confusion (probably undetected
    since the big switchover in commit 0cda34c6f), some outright spurious
    parameters after the format string (copy-paste errors), a particularly
    silly one in pscp.c (a comma between two halves of what should have
    been a single string literal), and a _missing_ format string in ssh.c
    (but luckily in a context where the only text that would be wrongly
    treated as a format string was error messages generated elsewhere in
    PuTTY).

 logging.c        | 4 ++--
 misc.c           | 2 +-
 pscp.c           | 2 +-
 ssh.c            | 2 +-
 ssh2connection.c | 3 ++-
 sshhmac.c        | 2 +-
 sshrsa.c         | 2 +-
 sshshare.c       | 3 ++-
 8 files changed, 11 insertions(+), 9 deletions(-)

commit 82a7e8c4ac25a13011e1b23f04faba7a52258e2a
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=82a7e8c4ac25a13011e1b23f04faba7a52258e2a;hp=247866a9d3e7b6ecae951a6bee7f876e399d3d01
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 10:59:07 2020 +0000

    New wrapper macro for printf("%zu"), for old VS compat.
    
    A user reports that Visual Studio 2013 and earlier have printf
    implementations in their C library that don't support the 'z' modifier
    to indicate that an integer argument is size_t. The 'I' modifier
    apparently works in place of it.
    
    To avoid littering ifdefs everywhere, I've invented my own inttypes.h
    style macros to wrap size_t formatting directives, which are defined
    to %zu and %zx normally, or %Iu and %Ix in old-VS mode. Those are in
    defs.h, and they're used everywhere that a %z might otherwise get into
    the Windows build.

 defs.h            |  7 +++++++
 logging.c         |  7 ++++---
 pageant.c         | 11 ++++++-----
 sshprng.c         |  8 ++++----
 sshpubk.c         |  4 ++--
 sshrsa.c          |  4 ++--
 testcrypt.c       |  2 +-
 testsc.c          |  4 ++--
 windows/winpgnt.c |  2 +-
 9 files changed, 29 insertions(+), 20 deletions(-)

commit 213723a718fdf874418eea734bf1016518830a71
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=213723a718fdf874418eea734bf1016518830a71;hp=82a7e8c4ac25a13011e1b23f04faba7a52258e2a
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 14:39:40 2020 +0000

    Fix misplaced parens in window.c.
    
    This was pointed out as a compiler warning when I test-built with
    up-to-date clang-cl. It looks as if it would cause the IDM_FULLSCREEN
    item on the system menu to be wrongly greyed/ungreyed, but in fact I
    think it's benign, because MF_BYCOMMAND == 0. So it's _just_ a
    warning fix, luckily!

 windows/window.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit 404f5587055aa4e147be80055df975515650a876
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=404f5587055aa4e147be80055df975515650a876;hp=213723a718fdf874418eea734bf1016518830a71
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 10:58:27 2020 +0000

    sshprng.c: remove pointless pending_output buffer.
    
    In an early draft of the new PRNG, before I decided to get rid of
    random_byte() and replace it with random_read(), it was important
    after generating a hash-worth of PRNG output to buffer it so as to
    return it a byte at a time. So the PRNG data structure itself had to
    keep a hash-sized buffer of pending output, and be able to return the
    next byte from it on every random_byte() call.
    
    But when random_read() came in, there was no need to do that any more,
    because at the end of a read, the generator is re-seeded and the
    remains of any generated data is deliberately thrown away. So the
    pending_output buffer has no need to live in the persistent prng
    object; it can be relegated to a local variable inside random_read
    (and a couple of other functions that used the same buffer since it
    was conveniently there).
    
    A side effect of this is that we're no longer yielding the bytes of
    each hash in reverse order, because only the previous silly code
    structure made it convenient. Fortunately, of course, nothing is
    depending on that - except the cryptsuite tests, which I've updated.

 sshprng.c          | 47 ++++++++++++++++++++---------------------------
 test/cryptsuite.py |  7 +++----
 2 files changed, 23 insertions(+), 31 deletions(-)

commit 600bf247d304fc18c9d6b3ec0d18c609253d52a9
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=600bf247d304fc18c9d6b3ec0d18c609253d52a9;hp=404f5587055aa4e147be80055df975515650a876
Author: Simon Tatham <anakin at pobox.com>
Date:   Sun Jan 26 16:46:16 2020 +0000

    Fix text name of hmac-sha1-96-buggy.
    
    I carefully set up separate mechanisms for the "-96" suffix on the
    hash name and the "bug-compatible" in parens after it, so that the
    latter could share its parens with annotations from the underlying
    hash. And then I forgot to _use_ the second mechanism!
    
    Also added ssh2_mac_text_name to the testcrypt API so I could check it
    easily. The result before this fix:
    
    >>> ssh2_mac_text_name(ssh2_mac_new("hmac_sha1_96_buggy", None))
    'HMAC-SHA-1-96 (bug-compatible) (unaccelerated)'
    
    And after, which is what I intended all along:
    
    >>> ssh2_mac_text_name(ssh2_mac_new("hmac_sha1_96_buggy", None))
    'HMAC-SHA-1-96 (bug-compatible, unaccelerated)'

 sshhmac.c   | 4 ++--
 testcrypt.h | 1 +
 2 files changed, 3 insertions(+), 2 deletions(-)



More information about the tartarus-commits mailing list