From 489f09a8434721edebeb3b20713e325fc4b55b78 Mon Sep 17 00:00:00 2001 From: Pavol Rusnak Date: Tue, 26 Apr 2016 19:51:49 +0200 Subject: [PATCH] fix sizeof usage --- hmac.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hmac.c b/hmac.c index a3f4763038..f334ada7e7 100644 --- a/hmac.c +++ b/hmac.c @@ -58,7 +58,7 @@ void hmac_sha256_Final(HMAC_SHA256_CTX *hctx, uint8_t *hmac) sha256_Update(&(hctx->ctx), hash, SHA256_DIGEST_LENGTH); sha256_Final(&(hctx->ctx), hmac); MEMSET_BZERO(hash, sizeof(hash)); - MEMSET_BZERO(hctx, sizeof(hctx)); + MEMSET_BZERO(hctx, sizeof(HMAC_SHA256_CTX)); } void hmac_sha256(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac) @@ -101,7 +101,7 @@ void hmac_sha512_Final(HMAC_SHA512_CTX *hctx, uint8_t *hmac) sha512_Update(&(hctx->ctx), hash, SHA512_DIGEST_LENGTH); sha512_Final(&(hctx->ctx), hmac); MEMSET_BZERO(hash, sizeof(hash)); - MEMSET_BZERO(hctx, sizeof(hctx)); + MEMSET_BZERO(hctx, sizeof(HMAC_SHA512_CTX)); } void hmac_sha512(const uint8_t *key, const uint32_t keylen, const uint8_t *msg, const uint32_t msglen, uint8_t *hmac)