diff options
| author | Christian Grothoff <christian@grothoff.org> | 2022-06-28 20:25:45 +0200 | 
|---|---|---|
| committer | Christian Grothoff <christian@grothoff.org> | 2022-06-28 20:25:45 +0200 | 
| commit | ded7f9ca189d8abbfcb6eb874d68bdc1a644da8f (patch) | |
| tree | e939971252fa7e25e799063f3f5cbc23e243853d /src/auditor/taler-helper-auditor-reserves.c | |
| parent | 379c580efc9d8da331e1d32dbde28111caf18a9b (diff) | |
-fix issue with missing signature over denomination and age restriction hash in purse deposit
Diffstat (limited to 'src/auditor/taler-helper-auditor-reserves.c')
| -rw-r--r-- | src/auditor/taler-helper-auditor-reserves.c | 50 | 
1 files changed, 26 insertions, 24 deletions
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c index f0c92c26..54d3db7c 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);  | 
