]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
When encrypting packet length with ChaCha20, treat sequence number as 32 bits.
authorBen Harris <bjh21@bjh21.me.uk>
Wed, 24 Jun 2015 20:58:11 +0000 (21:58 +0100)
committerBen Harris <bjh21@bjh21.me.uk>
Wed, 24 Jun 2015 20:58:11 +0000 (21:58 +0100)
commit307aaccc59f6fbfdf7b980ae709c083786044163
treed6692e909e027f16a4d14857875a8d2489cabc79
parent0bd014e456a0e5f755c45a8a5a420d6fad85c1d8
When encrypting packet length with ChaCha20, treat sequence number as 32 bits.

While ChaCha20 takes a 64-bit nonce, SSH-2 defines the message
sequence number to wrap at 2^32 and OpenSSH stores it in a u_int32_t,
so the upper 32 bits should always be zero.  PuTTY was getting this
wrong, and either using an incorrect nonce or causing GCC to complain
about an invalid shift, depending on the size of "unsigned long".  Now
I think it gets it right.
sshccp.c