WjCryptLib icon indicating copy to clipboard operation
WjCryptLib copied to clipboard

Fix stack buffer overflow in AES-CBC test

Open fishilico opened this issue 3 years ago • 0 comments

Hello,

While testing Pull Request https://github.com/WaterJuice/WjCryptLib/pull/7, projects/WjCryptLibTest/WjCryptLibTest was failing. Investing why led me to discovering a problem with the size of a stack buffer in the code which tests AES-CBC.

On x86-64, the AES-CBC test fails because the vector local buffer is to small to hold the encrypted test vector: the vector was created with 64 bytes while the buffer can only hold 48.

This Pull Requests increases TEST_VECTOR_OUTPUT_SIZE to 64 to fix this issue.

fishilico avatar May 29 '22 14:05 fishilico