提交 5c6c4c5c 编写于 作者: B Benjamin Kaduk 提交者: Rich Salz

Don't free in cleanup routine

Cleanse instead, and free in the free routine.

Seems to have been introduced in commit
846ec07d when EVP_CIPHER_CTX was made
opaque.
Reviewed-by: NRichard Levitte <levitte@openssl.org>
Reviewed-by: NRich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2798)
上级 695ecf8b
......@@ -60,7 +60,7 @@ CMAC_CTX *CMAC_CTX_new(void)
void CMAC_CTX_cleanup(CMAC_CTX *ctx)
{
EVP_CIPHER_CTX_free(ctx->cctx);
EVP_CIPHER_CTX_cleanup(ctx->cctx);
OPENSSL_cleanse(ctx->tbl, EVP_MAX_BLOCK_LENGTH);
OPENSSL_cleanse(ctx->k1, EVP_MAX_BLOCK_LENGTH);
OPENSSL_cleanse(ctx->k2, EVP_MAX_BLOCK_LENGTH);
......@@ -78,6 +78,7 @@ void CMAC_CTX_free(CMAC_CTX *ctx)
if (!ctx)
return;
CMAC_CTX_cleanup(ctx);
EVP_CIPHER_CTX_free(ctx->cctx);
OPENSSL_free(ctx);
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册