exchange

Base system with REST service to issue digital coins, run by the payment service provider
Log | Files | Refs | Submodules | README | LICENSE

commit 7ecdd9aeb7452694067be580987603b0fff2726d
parent 4a6cfde8d1b9a1eb4f8cc253b92d531d23855778
Author: Christian Grothoff <grothoff@gnunet.org>
Date:   Sat, 11 Jul 2026 20:27:52 +0200

init to zero, just in case

Diffstat:
Msrc/exchange/taler-exchange-httpd_post-management-drain.c | 2+-
Msrc/exchange/taler-exchange-httpd_post-management-global-fees.c | 2+-
Msrc/exchange/taler-exchange-httpd_post-management-wire-disable.c | 2+-
Msrc/exchange/taler-exchange-httpd_post-management-wire-fee.c | 2+-
Msrc/exchange/taler-exchange-httpd_post-reveal-melt.c | 25+++++++------------------
5 files changed, 11 insertions(+), 22 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_post-management-drain.c b/src/exchange/taler-exchange-httpd_post-management-drain.c @@ -119,7 +119,7 @@ TEH_handler_management_post_drain ( struct MHD_Connection *connection, const json_t *root) { - struct DrainContext dc; + struct DrainContext dc = {0}; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_string ("debit_account_section", &dc.account_section), diff --git a/src/exchange/taler-exchange-httpd_post-management-global-fees.c b/src/exchange/taler-exchange-httpd_post-management-global-fees.c @@ -171,7 +171,7 @@ TEH_handler_management_post_global_fees ( struct MHD_Connection *connection, const json_t *root) { - struct AddFeeContext afc; + struct AddFeeContext afc = {0}; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("master_sig", &afc.master_sig), diff --git a/src/exchange/taler-exchange-httpd_post-management-wire-disable.c b/src/exchange/taler-exchange-httpd_post-management-wire-disable.c @@ -145,7 +145,7 @@ TEH_handler_management_post_wire_disable ( struct MHD_Connection *connection, const json_t *root) { - struct DelWireContext awc; + struct DelWireContext awc = {0}; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("master_sig_del", &awc.master_sig), diff --git a/src/exchange/taler-exchange-httpd_post-management-wire-fee.c b/src/exchange/taler-exchange-httpd_post-management-wire-fee.c @@ -154,7 +154,7 @@ TEH_handler_management_post_wire_fees ( struct MHD_Connection *connection, const json_t *root) { - struct AddFeeContext afc; + struct AddFeeContext afc = {0}; struct GNUNET_JSON_Specification spec[] = { GNUNET_JSON_spec_fixed_auto ("master_sig", &afc.master_sig), diff --git a/src/exchange/taler-exchange-httpd_post-reveal-melt.c b/src/exchange/taler-exchange-httpd_post-reveal-melt.c @@ -317,6 +317,11 @@ calculate_blinded_detail ( * - Calculates the blinded coin planchet hashes * - Calculates the refresh commitment from above data * - Compares the calculated commitment with existing one + * - Verifies, for the disclosed (cut-and-choose) coins only, that all public + * keys in indices larger than the age group corresponding to max_age are + * derived from the constant public key. As only the disclosed coins are + * checked, this enforces the max_age bound merely probabilistically, not + * deterministically. * * The derivation of a fresh coin from the old coin is defined in * https://docs.taler.net/design-documents/062-pq-refresh.html @@ -345,18 +350,10 @@ verify_commitment ( struct TEH_KeyStateHandle *keys; struct TEH_DenominationKey *denom_keys[rf->num_coins]; struct TALER_DenominationHashP *denoms_h[rf->num_coins]; - struct TALER_Amount total_amount; - struct TALER_Amount total_fee; bool is_cs[rf->num_coins]; size_t cs_count = 0; GNUNET_assert (rf->noreveal_index < TALER_CNC_KAPPA); - GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, - &total_amount)); - GNUNET_assert (GNUNET_OK == - TALER_amount_set_zero (TEH_currency, - &total_fee)); memset (denom_keys, 0, sizeof(denom_keys)); @@ -428,14 +425,6 @@ verify_commitment ( return GNUNET_SYSERR; } - /* Accumulate amount and fees */ - GNUNET_assert (0 <= TALER_amount_add (&total_amount, - &total_amount, - &denom_keys[i]->meta.value)); - GNUNET_assert (0 <= TALER_amount_add (&total_fee, - &total_fee, - &denom_keys[i]->meta.fees.refresh)); - if (GNUNET_CRYPTO_BSA_CS == denom_keys[i]->denom_pub.bsign_pub_key->cipher) { @@ -656,8 +645,8 @@ verify_commitment ( TALER_refresh_get_commitment_v27 (&rc, &rf->refresh_seed, rf->no_blinding_seed - ? NULL - : &rf->blinding_seed, + ? NULL + : &rf->blinding_seed, &kappa_planchets_h, &rf->coin.coin_pub, &rf->amount_with_fee);