OpenSSL: Fix a memory leak in CMAC
The OpenSSL 3.0 (or newer) version of omac1_aes_vector() did not free
the EVP_MAC. This resulted in a memory leak that shows up in a bit
strange way in valgrind reports and because of that, was not caught
during automated testing.
Fixes: 0c61f6234f
("OpenSSL: Implement CMAC using the EVP_MAC API")
Signed-off-by: Jouni Malinen <quic_jouni@quicinc.com>
This commit is contained in:
parent
4bc61b6577
commit
a9bc6e89df
1 changed files with 1 additions and 0 deletions
|
@ -1835,6 +1835,7 @@ int omac1_aes_vector(const u8 *key, size_t key_len, size_t num_elem,
|
||||||
ret = 0;
|
ret = 0;
|
||||||
fail:
|
fail:
|
||||||
EVP_MAC_CTX_free(ctx);
|
EVP_MAC_CTX_free(ctx);
|
||||||
|
EVP_MAC_free(emac);
|
||||||
return ret;
|
return ret;
|
||||||
#else /* OpenSSL version >= 3.0 */
|
#else /* OpenSSL version >= 3.0 */
|
||||||
CMAC_CTX *ctx;
|
CMAC_CTX *ctx;
|
||||||
|
|
Loading…
Reference in a new issue