summaryrefslogtreecommitdiff
path: root/src/util
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2020-04-15 20:29:15 +0200
committerChristian Grothoff <christian@grothoff.org>2020-04-15 20:29:15 +0200
commit839badf7cf98669b7945010739d4040a1eeec87a (patch)
tree2eac3e10e4cbf209f9bfbc0ed8707ec1978e68b5 /src/util
parentb7be5b9f5d3e5ca4be1aaf663b271cdde0f69ef4 (diff)
take care of odd memset() calls
Diffstat (limited to 'src/util')
-rw-r--r--src/util/crypto_hkdf.c6
1 files 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);