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; }