summaryrefslogtreecommitdiff
path: root/src/testing/testing_api_cmd_withdraw.c
diff options
context:
space:
mode:
authorÖzgür Kesim <oec-taler@kesim.org>2022-04-21 14:27:29 +0200
committerÖzgür Kesim <oec-taler@kesim.org>2022-04-21 14:27:29 +0200
commitb84c88fc0421abb12c83892af3fa9934c4e33b24 (patch)
treecbacd5309a0bac662c2c0132ad818d1b02a04194 /src/testing/testing_api_cmd_withdraw.c
parent137bd971544f3b0332af32e68ae37fb9e74bae69 (diff)
downloadexchange-b84c88fc0421abb12c83892af3fa9934c4e33b24.tar.gz
exchange-b84c88fc0421abb12c83892af3fa9934c4e33b24.tar.bz2
exchange-b84c88fc0421abb12c83892af3fa9934c4e33b24.zip
Fixed seed size for TALER_age_restriction_commit
Also, added src/util/tv_age_restriction.{c,json} for/as test vectors for age restriction.
Diffstat (limited to 'src/testing/testing_api_cmd_withdraw.c')
-rw-r--r--src/testing/testing_api_cmd_withdraw.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/testing/testing_api_cmd_withdraw.c b/src/testing/testing_api_cmd_withdraw.c
index 80f8402cf..de862f91a 100644
--- a/src/testing/testing_api_cmd_withdraw.c
+++ b/src/testing/testing_api_cmd_withdraw.c
@@ -578,19 +578,21 @@ TALER_TESTING_cmd_withdraw_amount (const char *label,
{
struct TALER_AgeCommitmentProof *acp;
struct TALER_AgeCommitmentHash *hac;
- uint32_t seed;
+ struct GNUNET_HashCode seed;
struct TALER_AgeMask mask;
acp = GNUNET_new (struct TALER_AgeCommitmentProof);
hac = GNUNET_new (struct TALER_AgeCommitmentHash);
- seed = GNUNET_CRYPTO_random_u64 (GNUNET_CRYPTO_QUALITY_WEAK, UINT64_MAX);
mask = TALER_extensions_age_restriction_ageMask ();
+ GNUNET_CRYPTO_random_block (GNUNET_CRYPTO_QUALITY_WEAK,
+ &seed,
+ sizeof(seed));
if (GNUNET_OK !=
TALER_age_restriction_commit (
&mask,
age,
- seed,
+ &seed,
acp))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,