summaryrefslogtreecommitdiff
path: root/src/exchange
diff options
context:
space:
mode:
authorFlorian Dold <florian@dold.me>2022-09-05 13:45:08 +0200
committerFlorian Dold <florian@dold.me>2022-09-05 13:45:08 +0200
commit0c0c5986129a472ba18a958ba59be227affde9ef (patch)
treeb77d4d1ee25914aa3850cf32ee194f81014e3b77 /src/exchange
parent57752ed36cf1e94663a4a1d8f17e0f92cc75b2dc (diff)
downloadexchange-0c0c5986129a472ba18a958ba59be227affde9ef.tar.gz
exchange-0c0c5986129a472ba18a958ba59be227affde9ef.tar.bz2
exchange-0c0c5986129a472ba18a958ba59be227affde9ef.zip
set age mask before hashing age commitment
Diffstat (limited to 'src/exchange')
-rw-r--r--src/exchange/taler-exchange-httpd_common_deposit.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/exchange/taler-exchange-httpd_common_deposit.c b/src/exchange/taler-exchange-httpd_common_deposit.c
index 1e4312996..3420f9cac 100644
--- a/src/exchange/taler-exchange-httpd_common_deposit.c
+++ b/src/exchange/taler-exchange-httpd_common_deposit.c
@@ -68,10 +68,6 @@ TEH_common_purse_deposit_parse_coin (
return res;
}
- if (! coin->cpi.no_age_commitment)
- TALER_age_commitment_hash (&coin->age_commitment,
- &coin->cpi.h_age_commitment);
-
/* check denomination exists and is valid */
{
struct TEH_DenominationKey *dk;
@@ -85,6 +81,12 @@ TEH_common_purse_deposit_parse_coin (
GNUNET_JSON_parse_free (spec);
return (MHD_YES == mret) ? GNUNET_NO : GNUNET_SYSERR;
}
+ if (! coin->cpi.no_age_commitment)
+ {
+ coin->age_commitment.mask = dk->meta.age_mask;
+ TALER_age_commitment_hash (&coin->age_commitment,
+ &coin->cpi.h_age_commitment);
+ }
if (0 > TALER_amount_cmp (&dk->meta.value,
&coin->amount))
{