aboutsummaryrefslogtreecommitdiff
path: root/src/lib/exchange_api_common.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-06-28 20:25:45 +0200
committerChristian Grothoff <christian@grothoff.org>2022-06-28 20:25:45 +0200
commitded7f9ca189d8abbfcb6eb874d68bdc1a644da8f (patch)
treee939971252fa7e25e799063f3f5cbc23e243853d /src/lib/exchange_api_common.c
parent379c580efc9d8da331e1d32dbde28111caf18a9b (diff)
-fix issue with missing signature over denomination and age restriction hash in purse deposit
Diffstat (limited to 'src/lib/exchange_api_common.c')
-rw-r--r--src/lib/exchange_api_common.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/exchange_api_common.c b/src/lib/exchange_api_common.c
index 4b36aa932..26ddb3c06 100644
--- a/src/lib/exchange_api_common.c
+++ b/src/lib/exchange_api_common.c
@@ -1170,13 +1170,22 @@ help_purse_deposit (struct CoinHistoryParseContext *pc,
struct TALER_CoinSpendSignatureP coin_sig;
const char *exchange_base_url;
bool refunded;
+ struct TALER_AgeCommitmentHash phac = { 0 };
struct GNUNET_JSON_Specification spec[] = {
GNUNET_JSON_spec_fixed_auto ("purse_pub",
&purse_pub),
GNUNET_JSON_spec_fixed_auto ("coin_sig",
&coin_sig),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
+ &coin_sig),
+ NULL),
GNUNET_JSON_spec_string ("exchange_base_url",
&exchange_base_url),
+ GNUNET_JSON_spec_mark_optional (
+ GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
+ &phac),
+ NULL),
GNUNET_JSON_spec_bool ("refunded",
&refunded),
GNUNET_JSON_spec_end ()
@@ -1195,6 +1204,8 @@ help_purse_deposit (struct CoinHistoryParseContext *pc,
exchange_base_url,
&purse_pub,
amount,
+ &pc->dk->h_key,
+ &phac,
pc->coin_pub,
&coin_sig))
{
@@ -1560,12 +1571,18 @@ TALER_EXCHANGE_check_purse_coin_conflict_ (
const struct TALER_PurseContractPublicKeyP *purse_pub,
const char *exchange_url,
const json_t *proof,
+ struct TALER_DenominationHashP *h_denom_pub,
+ struct TALER_AgeCommitmentHash *phac,
struct TALER_CoinSpendPublicKeyP *coin_pub,
struct TALER_CoinSpendSignatureP *coin_sig)
{
const char *partner_url = NULL;
struct TALER_Amount amount;
struct GNUNET_JSON_Specification spec[] = {
+ GNUNET_JSON_spec_fixed_auto ("h_denom_pub",
+ h_denom_pub),
+ GNUNET_JSON_spec_fixed_auto ("h_age_commitment",
+ phac),
GNUNET_JSON_spec_fixed_auto ("coin_sig",
coin_sig),
GNUNET_JSON_spec_fixed_auto ("coin_pub",
@@ -1594,6 +1611,8 @@ TALER_EXCHANGE_check_purse_coin_conflict_ (
partner_url,
purse_pub,
&amount,
+ h_denom_pub,
+ phac,
coin_pub,
coin_sig))
{