condition of padLen check was opposite.

Reported by:	"lg" <zevlg@yandex.ru>
Reviewed by:	Lev Walkin <vlm@netli.com>
This commit is contained in:
Hajimu UMEMOTO 2003-09-17 08:51:43 +00:00
parent d099a9d164
commit eb159f5b2e
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=120157

View File

@ -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++)