From 839badf7cf98669b7945010739d4040a1eeec87a Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 15 Apr 2020 20:29:15 +0200 Subject: [PATCH] take care of odd memset() calls --- src/util/crypto_hkdf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/util/crypto_hkdf.c b/src/util/crypto_hkdf.c index 99a50a449..9cdb9d9bc 100644 --- a/src/util/crypto_hkdf.c +++ b/src/util/crypto_hkdf.c @@ -210,7 +210,7 @@ GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, if (t > 0) { - memset (plain + k + ctx_len, 1, 1); + plain[k + ctx_len] = (char) 1; #if DEBUG_HKDF dump ("K(1)", plain, plain_len); #endif @@ -225,7 +225,7 @@ GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, for (i = 1; i < t; i++) { GNUNET_memcpy (plain, result - k, k); - memset (plain + k + ctx_len, i + 1, 1); + plain[k + ctx_len] = (char) (i + 1); gcry_md_reset (prf); #if DEBUG_HKDF dump ("K(i+1)", plain, plain_len); @@ -245,7 +245,7 @@ GNUNET_CRYPTO_hkdf_v (void *result, size_t out_len, int xtr_algo, int prf_algo, GNUNET_memcpy (plain, result - k, k); i++; } - memset (plain + k + ctx_len, i, 1); + plain[k + ctx_len] = (char) i; gcry_md_reset (prf); #if DEBUG_HKDF dump ("K(t):d", plain, plain_len); -- 2.25.1