From eb159f5b2ea0be45a09eb57f8551f8b837e917ca Mon Sep 17 00:00:00 2001 From: Hajimu UMEMOTO Date: Wed, 17 Sep 2003 08:51:43 +0000 Subject: [PATCH] condition of padLen check was opposite. Reported by: "lg" Reviewed by: Lev Walkin --- sys/crypto/rijndael/rijndael-api-fst.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/crypto/rijndael/rijndael-api-fst.c b/sys/crypto/rijndael/rijndael-api-fst.c index d22c06e0af5..2b8c8f1ef08 100644 --- a/sys/crypto/rijndael/rijndael-api-fst.c +++ b/sys/crypto/rijndael/rijndael-api-fst.c @@ -225,7 +225,7 @@ int rijndael_padEncrypt(cipherInstance *cipher, keyInstance *key, outBuffer += 16; } padLen = 16 - (inputOctets - 16*numBlocks); - if (padLen > 0 && padLen <= 16) + if (padLen <= 0 || padLen > 16) return BAD_CIPHER_STATE; bcopy(input, block, 16 - padLen); for (cp = block + 16 - padLen; cp < block + 16; cp++)