summaryrefslogtreecommitdiff
path: root/src/auditor
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/auditor
parent379c580efc9d8da331e1d32dbde28111caf18a9b (diff)
downloadexchange-ded7f9ca189d8abbfcb6eb874d68bdc1a644da8f.tar.gz
exchange-ded7f9ca189d8abbfcb6eb874d68bdc1a644da8f.tar.bz2
exchange-ded7f9ca189d8abbfcb6eb874d68bdc1a644da8f.zip
-fix issue with missing signature over denomination and age restriction hash in purse deposit
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/taler-helper-auditor-coins.c2
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c50
2 files changed, 28 insertions, 24 deletions
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index 56afdeb90..6940369f9 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -2414,6 +2414,8 @@ purse_deposit_cb (
: TALER_ARL_exchange_url,
&deposit->purse_pub,
&deposit->amount,
+ &dh,
+ &deposit->h_age_commitment,
&deposit->coin_pub,
&deposit->coin_sig))
{
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index f0c92c260..54d3db7c3 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -1289,38 +1289,15 @@ handle_purse_deposits (
struct TALER_Amount amount_minus_fee;
struct TALER_Amount new_balance;
struct ReserveSummary *rs;
+ struct TALER_DenominationHashP h_denom_pub;
/* should be monotonically increasing */
GNUNET_assert (rowid >= ppr.last_purse_deposits_serial_id);
ppr.last_purse_deposits_serial_id = rowid + 1;
- if (GNUNET_OK !=
- TALER_wallet_purse_deposit_verify (base_url,
- &deposit->purse_pub,
- &deposit->amount,
- &deposit->coin_pub,
- &deposit->coin_sig))
- {
- TALER_ARL_report (report_bad_sig_losses,
- GNUNET_JSON_PACK (
- GNUNET_JSON_pack_string ("operation",
- "purse-deposit"),
- GNUNET_JSON_pack_uint64 ("row",
- rowid),
- TALER_JSON_pack_amount ("loss",
- &deposit->amount),
- GNUNET_JSON_pack_data_auto ("key_pub",
- &deposit->coin_pub)));
- TALER_ARL_amount_add (&total_bad_sig_loss,
- &total_bad_sig_loss,
- &deposit->amount);
- return GNUNET_OK;
- }
-
{
const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue;
enum GNUNET_DB_QueryStatus qs;
- struct TALER_DenominationHashP h_denom_pub;
qs = TALER_ARL_get_denomination_info (denom_pub,
&issue,
@@ -1349,6 +1326,31 @@ handle_purse_deposits (
&issue->fees.deposit);
}
+ if (GNUNET_OK !=
+ TALER_wallet_purse_deposit_verify (base_url,
+ &deposit->purse_pub,
+ &deposit->amount,
+ &h_denom_pub,
+ &deposit->h_age_commitment,
+ &deposit->coin_pub,
+ &deposit->coin_sig))
+ {
+ TALER_ARL_report (report_bad_sig_losses,
+ GNUNET_JSON_PACK (
+ GNUNET_JSON_pack_string ("operation",
+ "purse-deposit"),
+ GNUNET_JSON_pack_uint64 ("row",
+ rowid),
+ TALER_JSON_pack_amount ("loss",
+ &deposit->amount),
+ GNUNET_JSON_pack_data_auto ("key_pub",
+ &deposit->coin_pub)));
+ TALER_ARL_amount_add (&total_bad_sig_loss,
+ &total_bad_sig_loss,
+ &deposit->amount);
+ return GNUNET_OK;
+ }
+
TALER_ARL_amount_add (&new_balance,
auditor_balance,
&amount_minus_fee);