Use ScopedEVP_AEAD_CTX in ImplDispatchTest.AEAD_AES_GCM. EVP_AEAD_CTX_cleanup is often a no-op now that the data is embedded, but best to be tidy. Change-Id: I1ba56e5e36d6e69ae1ba07e40c4a7bda7329fa79 Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/37430 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/impl_dispatch_test.cc b/crypto/impl_dispatch_test.cc index 54ee704..2c3a613 100644 --- a/crypto/impl_dispatch_test.cc +++ b/crypto/impl_dispatch_test.cc
@@ -105,12 +105,12 @@ const uint8_t kPlaintext[40] = {1, 2, 3, 4, 0}; uint8_t ciphertext[sizeof(kPlaintext) + 16]; size_t ciphertext_len; - EVP_AEAD_CTX ctx; - ASSERT_TRUE(EVP_AEAD_CTX_init(&ctx, EVP_aead_aes_128_gcm(), kZeros, + bssl::ScopedEVP_AEAD_CTX ctx; + ASSERT_TRUE(EVP_AEAD_CTX_init(ctx.get(), EVP_aead_aes_128_gcm(), kZeros, sizeof(kZeros), EVP_AEAD_DEFAULT_TAG_LENGTH, nullptr)); ASSERT_TRUE(EVP_AEAD_CTX_seal( - &ctx, ciphertext, &ciphertext_len, sizeof(ciphertext), kZeros, + ctx.get(), ciphertext, &ciphertext_len, sizeof(ciphertext), kZeros, EVP_AEAD_nonce_length(EVP_aead_aes_128_gcm()), kPlaintext, sizeof(kPlaintext), nullptr, 0)); });