aboutsummaryrefslogtreecommitdiff
path: root/src/util/test_age_restriction.c
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-04-26 23:34:14 +0200
committerFlorian Dold <florian@dold.me>2022-04-26 23:34:14 +0200
commit17a00ef22dadd10c97fea188c75a8aaeb1e64442 (patch)
tree838efd9d5c6ba577f4735b9da57a9d38489b007b /src/util/test_age_restriction.c
parent47e276e11a5d1d92bbfc3c8c2e940902af3003dd (diff)
downloadexchange-17a00ef22dadd10c97fea188c75a8aaeb1e64442.tar.xz
age restriction: make seed a HashCode due to endianess and security level concerns
Diffstat (limited to 'src/util/test_age_restriction.c')
-rw-r--r--src/util/test_age_restriction.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/util/test_age_restriction.c b/src/util/test_age_restriction.c
index 9b8c6dfe5..847ab4e98 100644
--- a/src/util/test_age_restriction.c
+++ b/src/util/test_age_restriction.c
@@ -170,11 +170,13 @@ test_attestation (void)
/* Also derive two more commitments right away */
for (uint8_t i = 0; i<2; i++)
{
- uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK,
- UINT64_MAX);
+ struct GNUNET_HashCode salt;
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &salt,
+ sizeof (salt));
GNUNET_assert (GNUNET_OK ==
TALER_age_commitment_derive (&acp[i],
- salt,
+ &salt,
&acp[i + 1]));
}