From ac1f25d6f4e2aa3a623f48f6a8daf5257eb822bd Mon Sep 17 00:00:00 2001 From: Sean Parkinson Date: Tue, 25 Feb 2025 07:51:44 +1000 Subject: [PATCH] test_wolfssl_EVP_aes_gcm: fix for mem fail testing Fix test to not leak when memory allocation failure testing. When not supporting AES-GCM streaming, allocation failures occur. Always call cleanup. --- tests/api.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/api.c b/tests/api.c index 354b0eb7bf..d127f96d55 100644 --- a/tests/api.c +++ b/tests/api.c @@ -77198,7 +77198,7 @@ static int test_wolfssl_EVP_aes_gcm(void) ciphertxtSz += len; ExpectIntEQ(1, EVP_CIPHER_CTX_ctrl(&en[i], EVP_CTRL_GCM_GET_TAG, AES_BLOCK_SIZE, tag)); - ExpectIntEQ(wolfSSL_EVP_CIPHER_CTX_cleanup(&en[i]), 1); + wolfSSL_EVP_CIPHER_CTX_cleanup(&en[i]); EVP_CIPHER_CTX_init(&de[i]); if (i == 0) { @@ -77283,7 +77283,7 @@ static int test_wolfssl_EVP_aes_gcm(void) ExpectIntEQ(0, EVP_DecryptFinal_ex(&de[i], decryptedtxt, &len)); ExpectIntEQ(0, len); - ExpectIntEQ(wolfSSL_EVP_CIPHER_CTX_cleanup(&de[i]), 1); + wolfSSL_EVP_CIPHER_CTX_cleanup(&de[i]); } #endif /* OPENSSL_EXTRA && !NO_AES && HAVE_AESGCM */ return EXPECT_RESULT();