From 48708def8430e8ae346bfb9a33a92c1cff60ebe7 Mon Sep 17 00:00:00 2001 From: Simon Tatham Date: Tue, 16 Aug 2022 18:23:15 +0100 Subject: [PATCH] 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. --- test/testcrypt.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/testcrypt.c b/test/testcrypt.c index cb4e6b81..de09af33 100644 --- a/test/testcrypt.c +++ b/test/testcrypt.c @@ -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);