forked from wolfSSL/wolfssl
Fix infinite loop
'ret' could be set to non-zero inside the loop and the 'cmac->bufferSz' never gets reset causing 'add' to become 0 in the subsequent loop.
This commit is contained in:
@@ -211,7 +211,7 @@ int wc_CmacUpdate(Cmac* cmac, const byte* in, word32 inSz)
|
||||
/* Clear CRYPTOCB_UNAVAILABLE return code */
|
||||
ret = 0;
|
||||
|
||||
while (inSz != 0) {
|
||||
while ((ret == 0) && (inSz != 0)) {
|
||||
word32 add = min(inSz, AES_BLOCK_SIZE - cmac->bufferSz);
|
||||
XMEMCPY(&cmac->buffer[cmac->bufferSz], in, add);
|
||||
|
||||
|
Reference in New Issue
Block a user