Skip to content

Commit ac1f25d

Browse files
committed
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.
1 parent a856415 commit ac1f25d

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

tests/api.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -77198,7 +77198,7 @@ static int test_wolfssl_EVP_aes_gcm(void)
7719877198
ciphertxtSz += len;
7719977199
ExpectIntEQ(1, EVP_CIPHER_CTX_ctrl(&en[i], EVP_CTRL_GCM_GET_TAG,
7720077200
AES_BLOCK_SIZE, tag));
77201-
ExpectIntEQ(wolfSSL_EVP_CIPHER_CTX_cleanup(&en[i]), 1);
77201+
wolfSSL_EVP_CIPHER_CTX_cleanup(&en[i]);
7720277202

7720377203
EVP_CIPHER_CTX_init(&de[i]);
7720477204
if (i == 0) {
@@ -77283,7 +77283,7 @@ static int test_wolfssl_EVP_aes_gcm(void)
7728377283
ExpectIntEQ(0, EVP_DecryptFinal_ex(&de[i], decryptedtxt, &len));
7728477284
ExpectIntEQ(0, len);
7728577285

77286-
ExpectIntEQ(wolfSSL_EVP_CIPHER_CTX_cleanup(&de[i]), 1);
77286+
wolfSSL_EVP_CIPHER_CTX_cleanup(&de[i]);
7728777287
}
7728877288
#endif /* OPENSSL_EXTRA && !NO_AES && HAVE_AESGCM */
7728977289
return EXPECT_RESULT();

0 commit comments

Comments
 (0)