summaryrefslogtreecommitdiffstats
path: root/crypto/hmac/hmac.c
diff options
context:
space:
mode:
Diffstat (limited to 'crypto/hmac/hmac.c')
-rw-r--r--crypto/hmac/hmac.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/crypto/hmac/hmac.c b/crypto/hmac/hmac.c
index 6d1aaf845f..2fe5119385 100644
--- a/crypto/hmac/hmac.c
+++ b/crypto/hmac/hmac.c
@@ -182,9 +182,9 @@ HMAC_CTX *HMAC_CTX_new(void)
static void hmac_ctx_cleanup(HMAC_CTX *ctx)
{
- EVP_MD_CTX_init(ctx->i_ctx);
- EVP_MD_CTX_init(ctx->o_ctx);
- EVP_MD_CTX_init(ctx->md_ctx);
+ EVP_MD_CTX_reset(ctx->i_ctx);
+ EVP_MD_CTX_reset(ctx->o_ctx);
+ EVP_MD_CTX_reset(ctx->md_ctx);
ctx->md = NULL;
ctx->key_length = 0;
memset(ctx->key, 0, sizeof(HMAC_MAX_MD_CBLOCK));
@@ -194,9 +194,9 @@ void HMAC_CTX_free(HMAC_CTX *ctx)
{
if (ctx != NULL) {
hmac_ctx_cleanup(ctx);
- EVP_MD_CTX_destroy(ctx->i_ctx);
- EVP_MD_CTX_destroy(ctx->o_ctx);
- EVP_MD_CTX_destroy(ctx->md_ctx);
+ EVP_MD_CTX_free(ctx->i_ctx);
+ EVP_MD_CTX_free(ctx->o_ctx);
+ EVP_MD_CTX_free(ctx->md_ctx);
OPENSSL_free(ctx);
}
}
@@ -205,15 +205,15 @@ int HMAC_CTX_init(HMAC_CTX *ctx)
{
hmac_ctx_cleanup(ctx);
if (ctx->i_ctx == NULL)
- ctx->i_ctx = EVP_MD_CTX_create();
+ ctx->i_ctx = EVP_MD_CTX_new();
if (ctx->i_ctx == NULL)
goto err;
if (ctx->o_ctx == NULL)
- ctx->o_ctx = EVP_MD_CTX_create();
+ ctx->o_ctx = EVP_MD_CTX_new();
if (ctx->o_ctx == NULL)
goto err;
if (ctx->md_ctx == NULL)
- ctx->md_ctx = EVP_MD_CTX_create();
+ ctx->md_ctx = EVP_MD_CTX_new();
if (ctx->md_ctx == NULL)
goto err;
ctx->md = NULL;