Test Fixes

1. Found a problem in AES-GCM encrypt where it could step on the ciphertext with the correct sized IV.
This commit is contained in:
John Safranek
2018-04-12 17:33:01 -07:00
parent 1538ceef47
commit f7fa648f77

View File

@ -9041,11 +9041,11 @@ int wc_AesGcmEncrypt_ex(Aes* aes, byte* out, const byte* in, word32 sz,
} }
if (ret == 0) { if (ret == 0) {
XMEMCPY(ivOut, aes->reg, ivOutSz);
ret = wc_AesGcmEncrypt(aes, out, in, sz, ret = wc_AesGcmEncrypt(aes, out, in, sz,
(byte*)aes->reg, ivOutSz, (byte*)aes->reg, ivOutSz,
authTag, authTagSz, authTag, authTagSz,
authIn, authInSz); authIn, authInSz);
XMEMCPY(ivOut, aes->reg, ivOutSz);
IncCtr((byte*)aes->reg, ivOutSz); IncCtr((byte*)aes->reg, ivOutSz);
} }