summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--sys/crypto/rijndael/rijndael-api-fst.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/crypto/rijndael/rijndael-api-fst.c b/sys/crypto/rijndael/rijndael-api-fst.c
index 2b8c8f1..0777de1 100644
--- a/sys/crypto/rijndael/rijndael-api-fst.c
+++ b/sys/crypto/rijndael/rijndael-api-fst.c
@@ -246,7 +246,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;
for (i = 0; i < 16 - padLen; i++) {
block[i] = input[i] ^ iv[i];
OpenPOWER on IntegriCloud