1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-01-09 17:38:00 +00:00

testcrypt: fix cut-and-paste goof in decrypt_length.

The length test was pasted from the ordinary decrypt function, when it
should have been pasted from encrypt_length (which got this right).
I've never tried to test those functions before, so I never noticed.
This commit is contained in:
Simon Tatham 2022-08-16 18:23:15 +01:00
parent dbc77dbd7a
commit 48708def84

View File

@ -791,7 +791,7 @@ strbuf *ssh_cipher_encrypt_length_wrapper(ssh_cipher *c, ptrlen input,
strbuf *ssh_cipher_decrypt_length_wrapper(ssh_cipher *c, ptrlen input,
unsigned long seq)
{
if (input.len % ssh_cipher_alg(c)->blksize)
if (input.len != 4)
fatal_error("ssh_cipher_decrypt_length: needs exactly 4 bytes");
strbuf *sb = strbuf_dup(input);
ssh_cipher_decrypt_length(c, sb->u, sb->len, seq);