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 848b5819472dc533b37246784ed46cd36c636106..da7f58688f1e3037f37ca2e49ba4347368da5448 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)