summaryrefslogtreecommitdiffstats
path: root/crypto/engine/eng_openssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/engine/eng_openssl.c')
-rw-r--r--crypto/engine/eng_openssl.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/crypto/engine/eng_openssl.c b/crypto/engine/eng_openssl.c
index 78fa3c8d45..cc91044f82 100644
--- a/crypto/engine/eng_openssl.c
+++ b/crypto/engine/eng_openssl.c
@@ -463,15 +463,10 @@ static int ossl_hmac_copy(EVP_PKEY_CTX *dst, EVP_PKEY_CTX *src)
static void ossl_hmac_cleanup(EVP_PKEY_CTX *ctx)
{
- OSSL_HMAC_PKEY_CTX *hctx;
- hctx = EVP_PKEY_CTX_get_data(ctx);
+ OSSL_HMAC_PKEY_CTX *hctx = EVP_PKEY_CTX_get_data(ctx);
+
HMAC_CTX_cleanup(&hctx->ctx);
- if (hctx->ktmp.data) {
- if (hctx->ktmp.length)
- OPENSSL_cleanse(hctx->ktmp.data, hctx->ktmp.length);
- OPENSSL_free(hctx->ktmp.data);
- hctx->ktmp.data = NULL;
- }
+ OPENSSL_clear_free(hctx->ktmp.data, hctx->ktmp.length);
OPENSSL_free(hctx);
}