summaryrefslogtreecommitdiff
path: root/src/auditor
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2022-02-17 15:10:14 +0100
committerChristian Grothoff <christian@grothoff.org>2022-02-17 15:18:09 +0100
commita351bfc4b4ca15ce7fd998cf9691e85cf84dc426 (patch)
tree88ec3b739914739f05d4c8cae2a2af40d29ebf82 /src/auditor
parent8bdf6ab19df70c16d335ecf82f2c3b2117eeb70e (diff)
downloadexchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.gz
exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.bz2
exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.zip
-fix CS nonce reuse check logic
Diffstat (limited to 'src/auditor')
-rw-r--r--src/auditor/report-lib.c2
-rw-r--r--src/auditor/taler-helper-auditor-aggregation.c6
-rw-r--r--src/auditor/taler-helper-auditor-coins.c34
-rw-r--r--src/auditor/taler-helper-auditor-reserves.c2
4 files changed, 16 insertions, 28 deletions
diff --git a/src/auditor/report-lib.c b/src/auditor/report-lib.c
index 97270ffbe..b59846364 100644
--- a/src/auditor/report-lib.c
+++ b/src/auditor/report-lib.c
@@ -141,7 +141,7 @@ add_denomination (
GNUNET_h2s (&issue->denom_hash.hash),
TALER_amount2s (&value));
TALER_amount_ntoh (&value,
- &issue->fee_withdraw);
+ &issue->fees.withdraw);
GNUNET_log (GNUNET_ERROR_TYPE_DEBUG,
"Withdraw fee is %s\n",
TALER_amount2s (&value));
diff --git a/src/auditor/taler-helper-auditor-aggregation.c b/src/auditor/taler-helper-auditor-aggregation.c
index 7fffcd284..0b6f6557b 100644
--- a/src/auditor/taler-helper-auditor-aggregation.c
+++ b/src/auditor/taler-helper-auditor-aggregation.c
@@ -471,7 +471,7 @@ check_transaction_history_for_deposit (
/* Fee according to denomination data of auditor */
TALER_amount_ntoh (&fee_expected,
- &issue->fee_deposit);
+ &issue->fees.deposit);
if (0 !=
TALER_amount_cmp (&fee_expected,
fee_claimed))
@@ -496,7 +496,7 @@ check_transaction_history_for_deposit (
struct TALER_Amount fee_expected;
TALER_amount_ntoh (&fee_expected,
- &issue->fee_refresh);
+ &issue->fees.refresh);
if (0 !=
TALER_amount_cmp (&fee_expected,
fee_claimed))
@@ -540,7 +540,7 @@ check_transaction_history_for_deposit (
struct TALER_Amount fee_expected;
TALER_amount_ntoh (&fee_expected,
- &issue->fee_refund);
+ &issue->fees.refund);
if (0 !=
TALER_amount_cmp (&fee_expected,
fee_claimed))
diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c
index 2ed8e5a15..1b45fea0b 100644
--- a/src/auditor/taler-helper-auditor-coins.c
+++ b/src/auditor/taler-helper-auditor-coins.c
@@ -1281,7 +1281,7 @@ refresh_session_cb (void *cls,
TALER_denom_pub_hash (denom_pub,
&h_denom_pub);
TALER_amount_ntoh (&fee_refresh,
- &issue->fee_refresh);
+ &issue->fees.refresh);
if (GNUNET_OK !=
TALER_wallet_melt_verify (amount_with_fee,
&fee_refresh,
@@ -1375,7 +1375,7 @@ refresh_session_cb (void *cls,
struct TALER_Amount value;
TALER_amount_ntoh (&fee,
- &reveal_ctx.new_issues[i]->fee_withdraw);
+ &reveal_ctx.new_issues[i]->fees.withdraw);
TALER_amount_ntoh (&value,
&reveal_ctx.new_issues[i]->value);
TALER_ARL_amount_add (&refresh_cost,
@@ -1391,7 +1391,7 @@ refresh_session_cb (void *cls,
struct TALER_Amount melt_fee;
TALER_amount_ntoh (&melt_fee,
- &issue->fee_refresh);
+ &issue->fees.refresh);
if (TALER_ARL_SR_POSITIVE !=
TALER_ARL_amount_subtract_neg (&amount_without_fee,
amount_with_fee,
@@ -1528,7 +1528,7 @@ refresh_session_cb (void *cls,
struct TALER_Amount rfee;
TALER_amount_ntoh (&rfee,
- &issue->fee_refresh);
+ &issue->fees.refresh);
TALER_ARL_amount_add (&total_melt_fee_income,
&total_melt_fee_income,
&rfee);
@@ -1622,7 +1622,7 @@ deposit_cb (void *cls,
&deposit->wire_salt,
&h_wire);
TALER_amount_ntoh (&deposit_fee,
- &issue->fee_deposit);
+ &issue->fees.deposit);
/* NOTE: This is one of the operations we might eventually
want to do in parallel in the background to improve
auditor performance! */
@@ -1727,7 +1727,7 @@ deposit_cb (void *cls,
struct TALER_Amount dfee;
TALER_amount_ntoh (&dfee,
- &issue->fee_deposit);
+ &issue->fees.deposit);
TALER_ARL_amount_add (&total_deposit_fee_income,
&total_deposit_fee_income,
&dfee);
@@ -1822,7 +1822,7 @@ refund_cb (void *cls,
}
TALER_amount_ntoh (&refund_fee,
- &issue->fee_refund);
+ &issue->fees.refund);
if (TALER_ARL_SR_INVALID_NEGATIVE ==
TALER_ARL_amount_subtract_neg (&amount_without_fee,
amount_with_fee,
@@ -2179,10 +2179,7 @@ check_denomination (
enum GNUNET_DB_QueryStatus qs;
struct TALER_AuditorSignatureP auditor_sig;
struct TALER_Amount coin_value;
- struct TALER_Amount fee_withdraw;
- struct TALER_Amount fee_deposit;
- struct TALER_Amount fee_refresh;
- struct TALER_Amount fee_refund;
+ struct TALER_DenomFeeSet fees;
struct GNUNET_TIME_Timestamp start;
struct GNUNET_TIME_Timestamp end;
@@ -2190,14 +2187,8 @@ check_denomination (
(void) denom_pub;
TALER_amount_ntoh (&coin_value,
&issue->value);
- TALER_amount_ntoh (&fee_withdraw,
- &issue->fee_withdraw);
- TALER_amount_ntoh (&fee_deposit,
- &issue->fee_deposit);
- TALER_amount_ntoh (&fee_refresh,
- &issue->fee_refresh);
- TALER_amount_ntoh (&fee_refund,
- &issue->fee_refund);
+ TALER_denom_fee_set_ntoh (&fees,
+ &issue->fees);
start = GNUNET_TIME_timestamp_ntoh (issue->start);
end = GNUNET_TIME_timestamp_ntoh (issue->expire_legal);
qs = TALER_ARL_edb->select_auditor_denom_sig (TALER_ARL_edb->cls,
@@ -2225,10 +2216,7 @@ check_denomination (
GNUNET_TIME_timestamp_ntoh (issue->expire_deposit),
end,
&coin_value,
- &fee_withdraw,
- &fee_deposit,
- &fee_refresh,
- &fee_refund,
+ &fees,
&TALER_ARL_auditor_pub,
&auditor_sig))
{
diff --git a/src/auditor/taler-helper-auditor-reserves.c b/src/auditor/taler-helper-auditor-reserves.c
index e9cd51d8c..fa096fe05 100644
--- a/src/auditor/taler-helper-auditor-reserves.c
+++ b/src/auditor/taler-helper-auditor-reserves.c
@@ -594,7 +594,7 @@ handle_reserve_out (void *cls,
}
TALER_amount_ntoh (&withdraw_fee,
- &issue->fee_withdraw);
+ &issue->fees.withdraw);
TALER_amount_ntoh (&auditor_value,
&issue->value);
TALER_ARL_amount_add (&auditor_amount_with_fee,