hmac/hmac.c: fix sizeof typo in hmac_ctx_cleanup.
authorAndy Polyakov <appro@openssl.org>
Wed, 8 Jun 2016 18:38:12 +0000 (20:38 +0200)
committerAndy Polyakov <appro@openssl.org>
Thu, 9 Jun 2016 19:22:24 +0000 (21:22 +0200)
Reviewed-by: Matt Caswell <matt@openssl.org>
crypto/hmac/hmac.c

index 848b581..da7f586 100644 (file)
@@ -141,7 +141,7 @@ static void hmac_ctx_cleanup(HMAC_CTX *ctx)
     EVP_MD_CTX_reset(ctx->md_ctx);
     ctx->md = NULL;
     ctx->key_length = 0;
-    memset(ctx->key, 0, sizeof(HMAC_MAX_MD_CBLOCK));
+    OPENSSL_cleanse(ctx->key, sizeof(ctx->key));
 }
 
 void HMAC_CTX_free(HMAC_CTX *ctx)