mirror of
https://github.com/wolfSSL/wolfssl.git
synced 2025-07-30 18:57:27 +02:00
test: don't free AesXts struct in-between tests that reuse the key
This commit is contained in:
@ -7909,7 +7909,6 @@ static int aes_xts_128_test(void)
|
|||||||
ERROR_OUT(-5410, out);
|
ERROR_OUT(-5410, out);
|
||||||
if (XMEMCMP(p1, buf, AES_BLOCK_SIZE))
|
if (XMEMCMP(p1, buf, AES_BLOCK_SIZE))
|
||||||
ERROR_OUT(-5411, out);
|
ERROR_OUT(-5411, out);
|
||||||
wc_AesXtsFree(aes);
|
|
||||||
|
|
||||||
/* fail case with decrypting using wrong key */
|
/* fail case with decrypting using wrong key */
|
||||||
XMEMSET(buf, 0, sizeof(buf));
|
XMEMSET(buf, 0, sizeof(buf));
|
||||||
@ -7922,6 +7921,8 @@ static int aes_xts_128_test(void)
|
|||||||
if (XMEMCMP(p2, buf, sizeof(p2)) == 0) /* fail case with wrong key */
|
if (XMEMCMP(p2, buf, sizeof(p2)) == 0) /* fail case with wrong key */
|
||||||
ERROR_OUT(-5413, out);
|
ERROR_OUT(-5413, out);
|
||||||
|
|
||||||
|
wc_AesXtsFree(aes);
|
||||||
|
|
||||||
/* set correct key and retest */
|
/* set correct key and retest */
|
||||||
XMEMSET(buf, 0, sizeof(buf));
|
XMEMSET(buf, 0, sizeof(buf));
|
||||||
if (wc_AesXtsSetKey(aes, k2, sizeof(k2), AES_DECRYPTION,
|
if (wc_AesXtsSetKey(aes, k2, sizeof(k2), AES_DECRYPTION,
|
||||||
|
Reference in New Issue
Block a user