From 9f5a7ce70ae1da223b6cbb598f81538828723bea Mon Sep 17 00:00:00 2001 From: Frank Denis Date: Mon, 14 Apr 2014 21:37:42 -0700 Subject: [PATCH] hardcoded size -> sizeof --- src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c | 4 ++-- src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c b/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c index 89de8812..9cd69ac3 100644 --- a/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c +++ b/src/libsodium/crypto_auth/hmacsha256/cp/hmac_hmacsha256.c @@ -66,7 +66,7 @@ crypto_auth_hmacsha256_init(crypto_auth_hmacsha256_state *state, } crypto_hash_sha256_update(&state->octx, pad, 64); - sodium_memzero((void *) khash, 32); + sodium_memzero((void *) khash, sizeof khash); return 0; } @@ -91,7 +91,7 @@ crypto_auth_hmacsha256_final(crypto_auth_hmacsha256_state *state, crypto_hash_sha256_update(&state->octx, ihash, 32); crypto_hash_sha256_final(&state->octx, out); - sodium_memzero((void *) ihash, 32); + sodium_memzero((void *) ihash, sizeof ihash); return 0; } diff --git a/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c b/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c index 8d841543..4ffd2645 100644 --- a/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c +++ b/src/libsodium/crypto_auth/hmacsha512/cp/hmac_hmacsha512.c @@ -66,7 +66,7 @@ crypto_auth_hmacsha512_init(crypto_auth_hmacsha512_state *state, } crypto_hash_sha512_update(&state->octx, pad, 128); - sodium_memzero((void *) khash, 64); + sodium_memzero((void *) khash, sizeof khash); return 0; } @@ -91,7 +91,7 @@ crypto_auth_hmacsha512_final(crypto_auth_hmacsha512_state *state, crypto_hash_sha512_update(&state->octx, ihash, 64); crypto_hash_sha512_final(&state->octx, out); - sodium_memzero((void *) ihash, 64); + sodium_memzero((void *) ihash, sizeof ihash); return 0; }