]> asedeno.scripts.mit.edu Git - PuTTY.git/commit
Split ssh2_cipher's keylen field into two.
authorSimon Tatham <anakin@pobox.com>
Thu, 10 Sep 2015 07:10:52 +0000 (08:10 +0100)
committerSimon Tatham <anakin@pobox.com>
Thu, 10 Sep 2015 07:11:26 +0000 (08:11 +0100)
commit43be90e287996e1be6f92f5a426475df25c16e10
tree2289d967f391f4d07ba2a68b9ff6db723ec38a36
parentb08895f02cc34f2a3f5e1281f929fe33a0dff657
Split ssh2_cipher's keylen field into two.

The revamp of key generation in commit e460f3083 made the assumption
that you could decide how many bytes of key material to generate by
converting cipher->keylen from bits to bytes. This is a good
assumption for all ciphers except DES/3DES: since the SSH DES key
setup ignores one bit in every byte of key material it's given, you
need more bytes than its keylen field would have you believe. So
currently the DES ciphers aren't being keyed correctly.

The original keylen field is used for deciding how big a DH group to
request, and on that basis I think it still makes sense to keep it
reflecting the true entropy of a cipher key. So it turns out we need
two _separate_ key length fields per cipher - one for the real
entropy, and one for the much more obvious purpose of knowing how much
data to ask for from ssh2_mkkey.

A compensatory advantage, though, is that we can now measure the
latter directly in bytes rather than bits, so we no longer have to
faff about with dividing by 8 and rounding up.
ssh.c
ssh.h
sshaes.c
ssharcf.c
sshblowf.c
sshccp.c
sshdes.c