simon-git: putty (master): Simon Tatham
Commits to Tartarus hosted VCS
tartarus-commits at lists.tartarus.org
Fri Jan 4 08:30:42 GMT 2019
TL;DR:
35690040 Remove a lot of pointless 'struct' keywords.
0b14e737 Replace all 'sizeof(x)/sizeof(*x)' with lenof.
b6384690 Add test vectors from RFC 6234 for SHA-1 and SHA-2.
be779f98 Expose des_{en,de}crypt_xdmauth in testcrypt.
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-01-04 08:30:42
commit 35690040fd4d4fd901f5e9bc6e7712104904ced2
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=35690040fd4d4fd901f5e9bc6e7712104904ced2;hp=abebfdf0dd42467efb9b6bc50dcc0ec306cbf4e8
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Jan 4 06:51:44 2019 +0000
Remove a lot of pointless 'struct' keywords.
This is the commit that f3295e0fb _should_ have been. Yesterday I just
added some typedefs so that I didn't have to wear out my fingers
typing 'struct' in new code, but what I ought to have done is to move
all the typedefs into defs.h with the rest, and then go through
cleaning up the legacy 'struct's all through the existing code.
But I was mostly trying to concentrate on getting the test suite
finished, so I just did the minimum. Now it's time to come back and do
it better.
cmdgen.c | 16 ++--
defs.h | 22 ++++-
import.c | 54 +++++------
pageant.c | 62 ++++++-------
pageant.h | 12 +--
ssh.h | 263 +++++++++++++++++++++++++----------------------------
ssh1bpp.c | 2 +-
ssh1login-server.c | 12 +--
ssh1login.c | 14 +--
ssh2bpp.c | 14 +--
ssh2kex-server.c | 2 +-
ssh2transport.c | 24 ++---
ssh2transport.h | 20 ++--
ssh2userauth.c | 2 +-
sshaes.c | 20 ++--
ssharcf.c | 10 +-
sshblowf.c | 12 +--
sshbpp.h | 14 +--
sshccp.c | 12 +--
sshcommon.c | 2 +-
sshdes.c | 24 ++---
sshdh.c | 60 ++++++------
sshecc.c | 18 ++--
sshmd5.c | 8 +-
sshppl.h | 2 +-
sshpubk.c | 29 +++---
sshrsa.c | 81 ++++++++---------
sshrsag.c | 2 +-
sshserver.c | 4 +-
sshserver.h | 6 +-
sshsh256.c | 8 +-
sshsh512.c | 8 +-
sshsha.c | 14 +--
sshzlib.c | 2 +-
testcrypt.c | 12 +--
unix/uxpgnt.c | 2 +-
unix/uxserver.c | 10 +-
windows/winpgen.c | 14 +--
windows/winpgnt.c | 8 +-
39 files changed, 452 insertions(+), 449 deletions(-)
commit 0b14e7376e159607c6fcd0fcbb5cdf78c51195c0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=0b14e7376e159607c6fcd0fcbb5cdf78c51195c0;hp=35690040fd4d4fd901f5e9bc6e7712104904ced2
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Jan 4 07:13:08 2019 +0000
Replace all 'sizeof(x)/sizeof(*x)' with lenof.
I noticed a few of these in the course of preparing the previous
commit. I must have been writing that idiom out by hand for _ages_
before it became totally habitual to #define it as 'lenof' in every
codebase I touch. Now I've gone through and replaced all the old
verbosity with nice terse lenofs.
psftp.c | 6 +++---
sftp.c | 3 +--
sshaes.c | 5 +----
ssharcf.c | 5 +----
sshblowf.c | 5 +----
sshccp.c | 5 +----
sshdes.c | 10 ++--------
sshdh.c | 16 ++++------------
sshecc.c | 5 +----
sshrand.c | 4 ++--
sshrsa.c | 5 +----
sshsh256.c | 2 +-
sshsh512.c | 2 +-
sshzlib.c | 4 ++--
14 files changed, 22 insertions(+), 55 deletions(-)
commit b63846902ed407bc01517ace2cfee7e142be9128
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=b63846902ed407bc01517ace2cfee7e142be9128;hp=0b14e7376e159607c6fcd0fcbb5cdf78c51195c0
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Jan 4 07:50:03 2019 +0000
Add test vectors from RFC 6234 for SHA-1 and SHA-2.
This supersedes the '#ifdef TEST' main programs in sshsh256.c and
sshsh512.c. Now there's no need to build those test programs manually
on the rare occasion of modifying the hash implementations; instead
testcrypt is built every night and will run these test vectors.
RFC 6234 has some test vectors for HMAC-SHA-* as well, so I've
included the ones applicable to this implementation.
sshsh256.c | 50 ----------------
sshsh512.c | 80 --------------------------
test/cryptsuite.py | 164 +++++++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 164 insertions(+), 130 deletions(-)
commit be779f988d6ae602a91ba564e8c75bf7642627b0
web diff https://git.tartarus.org/?p=simon/putty.git;a=commitdiff;h=be779f988d6ae602a91ba564e8c75bf7642627b0;hp=b63846902ed407bc01517ace2cfee7e142be9128
Author: Simon Tatham <anakin at pobox.com>
Date: Fri Jan 4 08:23:17 2019 +0000
Expose des_{en,de}crypt_xdmauth in testcrypt.
This allows me to remove another diagnostic main() that I just found
lurking at the bottom of sshdes.c, which was there to allow manual
untangling of XDM-AUTHORIZATION-1 strings when debugging X forwarding.
Now you can ask the same kind of question at the interactive Python
prompt, without having to manually compile anything. For example, the
query you might previously have asked by building the sshdes test
program and running
$ ./sshdes 090a0b0c0d0e0f10 0123456789abcd
decrypt(090a0b0c0d0e0f10,0123456789abcd) = ab53fd65ae7f4ec3
encrypt(090a0b0c0d0e0f10,0123456789abcd) = 7065d20441f5abe3
you can now run using the standard testcrypt (bearing in mind that the
actual library function takes the key argument first):
$ python -i test/testcrypt.py
>>> from binascii import hexlify as H, unhexlify as U
>>> H(des_decrypt_xdmauth(U('0123456789abcd'),U('090a0b0c0d0e0f10')))
'ab53fd65ae7f4ec3'
>>> H(des_encrypt_xdmauth(U('0123456789abcd'),U('090a0b0c0d0e0f10')))
'7065d20441f5abe3'
sshdes.c | 55 -------------------------------------------------------
testcrypt.c | 26 ++++++++++++++++++++++++++
testcrypt.h | 2 ++
3 files changed, 28 insertions(+), 55 deletions(-)
More information about the tartarus-commits
mailing list