mirror of
https://github.com/openssl/openssl.git
synced 2025-01-12 13:36:28 +08:00
Ensure we call the cleanup() function when cleaning an EVP_CIPHER_CTX
In some circumstances we were not calling the cleanup() function to remove cipher specific data from an EVP_CIPHER_CTX. Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Paul Dale <pauli@openssl.org> (Merged from https://github.com/openssl/openssl/pull/19300)
This commit is contained in:
parent
25d47cccf2
commit
f817a7439e
@ -159,6 +159,8 @@ static int evp_cipher_init_internal(EVP_CIPHER_CTX *ctx,
|
||||
* (legacy code)
|
||||
*/
|
||||
if (cipher != NULL && ctx->cipher != NULL) {
|
||||
if (ctx->cipher->cleanup != NULL && !ctx->cipher->cleanup(ctx))
|
||||
return 0;
|
||||
OPENSSL_clear_free(ctx->cipher_data, ctx->cipher->ctx_size);
|
||||
ctx->cipher_data = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user