diff options
author | Özgür Kesim <oec-taler@kesim.org> | 2022-04-22 15:14:30 +0200 |
---|---|---|
committer | Özgür Kesim <oec-taler@kesim.org> | 2022-04-22 15:15:57 +0200 |
commit | 31c545b9e803310312a0d9433e79cf206e00ffe4 (patch) | |
tree | bed76f9858625a1d9f3e88d18e0b11d5ac70a7e7 /src/util/test_age_restriction.c | |
parent | eea35ffb01328f4109e4cfaeeff1c3cae586d8e4 (diff) | |
download | exchange-31c545b9e803310312a0d9433e79cf206e00ffe4.tar.xz |
-fixed tests for age restriction, now using correct seed
Diffstat (limited to 'src/util/test_age_restriction.c')
-rw-r--r-- | src/util/test_age_restriction.c | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/src/util/test_age_restriction.c b/src/util/test_age_restriction.c index bf64a705d..9b8c6dfe5 100644 --- a/src/util/test_age_restriction.c +++ b/src/util/test_age_restriction.c @@ -148,12 +148,16 @@ test_attestation (void) struct TALER_AgeCommitmentProof acp[3] = {0}; struct TALER_AgeAttestation at = {0}; uint8_t age_group = get_age_group (&age_mask, age); - uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, - UINT64_MAX); + struct GNUNET_HashCode seed; + + + GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK, + &seed, + sizeof(seed)); ret = TALER_age_restriction_commit (&age_mask, age, - salt, + &seed, &acp[0]); printf ( @@ -166,8 +170,8 @@ test_attestation (void) /* Also derive two more commitments right away */ for (uint8_t i = 0; i<2; i++) { - salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, - UINT64_MAX); + uint64_t salt = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, + UINT64_MAX); GNUNET_assert (GNUNET_OK == TALER_age_commitment_derive (&acp[i], salt, |