From 11c52837112421af755bc7bc21569011274909ad Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Fri, 17 Jan 2020 19:54:16 +0100 Subject: prepare API to enable verification of fees in coin history check --- src/lib/exchange_api_deposit.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'src/lib/exchange_api_deposit.c') diff --git a/src/lib/exchange_api_deposit.c b/src/lib/exchange_api_deposit.c index 69584ee24..23ec8a3bd 100644 --- a/src/lib/exchange_api_deposit.c +++ b/src/lib/exchange_api_deposit.c @@ -101,9 +101,10 @@ struct TALER_EXCHANGE_DepositHandle struct TALER_Amount amount_with_fee; /** - * Total value of the coin being transacted with. + * @brief Public information about the coin's denomination key. + * Note that the "key" field itself has been zero'ed out. */ - struct TALER_Amount coin_value; + struct TALER_EXCHANGE_DenomPublicKey dki; /** * Chance that we will inform the auditor about the deposit @@ -250,7 +251,8 @@ verify_deposit_signature_forbidden (const struct history = json_object_get (json, "history"); if (GNUNET_OK != - TALER_EXCHANGE_verify_coin_history (dh->coin_value.currency, + TALER_EXCHANGE_verify_coin_history (&dh->dki, + dh->dki.value.currency, &dh->depconf.coin_pub, history, &total)) @@ -269,7 +271,7 @@ verify_deposit_signature_forbidden (const struct } if (0 >= TALER_amount_cmp (&total, - &dh->coin_value)) + &dh->dki.value)) { /* transaction should have still fit */ GNUNET_break (0); @@ -604,7 +606,9 @@ TALER_EXCHANGE_deposit (struct TALER_EXCHANGE_Handle *exchange, dh->depconf.coin_pub = *coin_pub; dh->depconf.merchant = *merchant_pub; dh->amount_with_fee = *amount; - dh->coin_value = dki->value; + dh->dki = *dki; + dh->dki.key.rsa_public_key = NULL; /* lifetime not warranted, so better + not copy the pointer */ eh = TEL_curl_easy_get (dh->url); if (GNUNET_OK != -- cgit v1.2.3