diff options
author | Christian Grothoff <christian@grothoff.org> | 2022-02-17 15:10:14 +0100 |
---|---|---|
committer | Christian Grothoff <christian@grothoff.org> | 2022-02-17 15:18:09 +0100 |
commit | a351bfc4b4ca15ce7fd998cf9691e85cf84dc426 (patch) | |
tree | 88ec3b739914739f05d4c8cae2a2af40d29ebf82 /src/exchange-tools | |
parent | 8bdf6ab19df70c16d335ecf82f2c3b2117eeb70e (diff) | |
download | exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.gz exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.tar.bz2 exchange-a351bfc4b4ca15ce7fd998cf9691e85cf84dc426.zip |
-fix CS nonce reuse check logic
Diffstat (limited to 'src/exchange-tools')
-rw-r--r-- | src/exchange-tools/taler-auditor-offline.c | 63 | ||||
-rw-r--r-- | src/exchange-tools/taler-exchange-offline.c | 55 |
2 files changed, 29 insertions, 89 deletions
diff --git a/src/exchange-tools/taler-auditor-offline.c b/src/exchange-tools/taler-auditor-offline.c index afde705b..6e37fd9b 100644 --- a/src/exchange-tools/taler-auditor-offline.c +++ b/src/exchange-tools/taler-auditor-offline.c @@ -757,10 +757,7 @@ show_denomkeys (const json_t *denomkeys) struct GNUNET_TIME_Timestamp stamp_expire_deposit; struct GNUNET_TIME_Timestamp stamp_expire_legal; 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 TALER_MasterSignatureP master_sig; struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_denom_pub ("denom_pub", @@ -768,18 +765,9 @@ show_denomkeys (const json_t *denomkeys) TALER_JSON_spec_amount ("value", currency, &coin_value), - TALER_JSON_spec_amount ("fee_withdraw", - currency, - &fee_withdraw), - TALER_JSON_spec_amount ("fee_deposit", - currency, - &fee_deposit), - TALER_JSON_spec_amount ("fee_refresh", - currency, - &fee_refresh), - TALER_JSON_spec_amount ("fee_refund", - currency, - &fee_refund), + TALER_JSON_SPEC_DENOM_FEES ("fee", + currency, + &fees), GNUNET_JSON_spec_timestamp ("stamp_start", &stamp_start), GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw", @@ -824,10 +812,7 @@ show_denomkeys (const json_t *denomkeys) stamp_expire_deposit, stamp_expire_legal, &coin_value, - &fee_withdraw, - &fee_deposit, - &fee_refresh, - &fee_refund, + &fees, &master_pub, &master_sig)) { @@ -847,10 +832,10 @@ show_denomkeys (const json_t *denomkeys) char *deposit_s; char *legal_s; - withdraw_fee_s = TALER_amount_to_string (&fee_withdraw); - deposit_fee_s = TALER_amount_to_string (&fee_deposit); - refresh_fee_s = TALER_amount_to_string (&fee_refresh); - refund_fee_s = TALER_amount_to_string (&fee_refund); + withdraw_fee_s = TALER_amount_to_string (&fees.withdraw); + deposit_fee_s = TALER_amount_to_string (&fees.deposit); + refresh_fee_s = TALER_amount_to_string (&fees.refresh); + refund_fee_s = TALER_amount_to_string (&fees.refund); deposit_s = GNUNET_strdup ( GNUNET_TIME_timestamp2s (stamp_expire_deposit)); legal_s = GNUNET_strdup ( @@ -1058,10 +1043,7 @@ sign_denomkeys (const json_t *denomkeys) struct GNUNET_TIME_Timestamp stamp_expire_deposit; struct GNUNET_TIME_Timestamp stamp_expire_legal; 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 TALER_MasterSignatureP master_sig; struct GNUNET_JSON_Specification spec[] = { TALER_JSON_spec_denom_pub ("denom_pub", @@ -1069,18 +1051,9 @@ sign_denomkeys (const json_t *denomkeys) TALER_JSON_spec_amount ("value", currency, &coin_value), - TALER_JSON_spec_amount ("fee_withdraw", - currency, - &fee_withdraw), - TALER_JSON_spec_amount ("fee_deposit", - currency, - &fee_deposit), - TALER_JSON_spec_amount ("fee_refresh", - currency, - &fee_refresh), - TALER_JSON_spec_amount ("fee_refund", - currency, - &fee_refund), + TALER_JSON_SPEC_DENOM_FEES ("fee", + currency, + &fees), GNUNET_JSON_spec_timestamp ("stamp_start", &stamp_start), GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw", @@ -1121,10 +1094,7 @@ sign_denomkeys (const json_t *denomkeys) stamp_expire_deposit, stamp_expire_legal, &coin_value, - &fee_withdraw, - &fee_deposit, - &fee_refresh, - &fee_refund, + &fees, &master_pub, &master_sig)) { @@ -1147,10 +1117,7 @@ sign_denomkeys (const json_t *denomkeys) stamp_expire_deposit, stamp_expire_legal, &coin_value, - &fee_withdraw, - &fee_deposit, - &fee_refresh, - &fee_refund, + &fees, &auditor_priv, &auditor_sig); output_operation (OP_SIGN_DENOMINATION, diff --git a/src/exchange-tools/taler-exchange-offline.c b/src/exchange-tools/taler-exchange-offline.c index 55720a1b..2446ebf3 100644 --- a/src/exchange-tools/taler-exchange-offline.c +++ b/src/exchange-tools/taler-exchange-offline.c @@ -1,6 +1,6 @@ /* This file is part of TALER - Copyright (C) 2020, 2021 Taler Systems SA + Copyright (C) 2020, 2021, 2022 Taler Systems SA TALER is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software @@ -2831,10 +2831,7 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, struct GNUNET_TIME_Timestamp stamp_expire_deposit; struct GNUNET_TIME_Timestamp stamp_expire_legal; 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 TALER_SecurityModuleSignatureP secm_sig; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("section_name", @@ -2844,18 +2841,9 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, TALER_JSON_spec_amount ("value", currency, &coin_value), - TALER_JSON_spec_amount ("fee_withdraw", - currency, - &fee_withdraw), - TALER_JSON_spec_amount ("fee_deposit", - currency, - &fee_deposit), - TALER_JSON_spec_amount ("fee_refresh", - currency, - &fee_refresh), - TALER_JSON_spec_amount ("fee_refund", - currency, - &fee_refund), + TALER_JSON_SPEC_DENOM_FEES ("fee", + currency, + &fees), GNUNET_JSON_spec_timestamp ("stamp_start", &stamp_start), GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw", @@ -2949,10 +2937,10 @@ show_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, char *deposit_s; char *legal_s; - withdraw_fee_s = TALER_amount_to_string (&fee_withdraw); - deposit_fee_s = TALER_amount_to_string (&fee_deposit); - refresh_fee_s = TALER_amount_to_string (&fee_refresh); - refund_fee_s = TALER_amount_to_string (&fee_refund); + withdraw_fee_s = TALER_amount_to_string (&fees.withdraw); + deposit_fee_s = TALER_amount_to_string (&fees.deposit); + refresh_fee_s = TALER_amount_to_string (&fees.refresh); + refund_fee_s = TALER_amount_to_string (&fees.refund); deposit_s = GNUNET_strdup ( GNUNET_TIME_timestamp2s (stamp_expire_deposit)); legal_s = GNUNET_strdup ( @@ -3324,10 +3312,7 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, struct GNUNET_TIME_Timestamp stamp_expire_deposit; struct GNUNET_TIME_Timestamp stamp_expire_legal; 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 TALER_SecurityModuleSignatureP secm_sig; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("section_name", @@ -3337,18 +3322,9 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, TALER_JSON_spec_amount ("value", currency, &coin_value), - TALER_JSON_spec_amount ("fee_withdraw", - currency, - &fee_withdraw), - TALER_JSON_spec_amount ("fee_deposit", - currency, - &fee_deposit), - TALER_JSON_spec_amount ("fee_refresh", - currency, - &fee_refresh), - TALER_JSON_spec_amount ("fee_refund", - currency, - &fee_refund), + TALER_JSON_SPEC_DENOM_FEES ("fee", + currency, + &fees), GNUNET_JSON_spec_timestamp ("stamp_start", &stamp_start), GNUNET_JSON_spec_timestamp ("stamp_expire_withdraw", @@ -3458,10 +3434,7 @@ sign_denomkeys (const struct TALER_SecurityModulePublicKeyP *secm_pub_rsa, stamp_expire_deposit, stamp_expire_legal, &coin_value, - &fee_withdraw, - &fee_deposit, - &fee_refresh, - &fee_refund, + &fees, &master_priv, &master_sig); GNUNET_assert (0 == |