exchange

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

commit bd2e9c227cc2fe6ed807932f98bd537fb1b97418
parent c8bc901d6690f3d97d9b991268fcf3ebd0d8a54a
Author: Christian Grothoff <christian@grothoff.org>
Date:   Sun,  8 Nov 2026 22:40:35 +0100

caller checks signature, do not check again as that is the wrong check in the recoup-refresh case

Diffstat:
Msrc/auditor/taler-helper-auditor-coins.c | 35++++++++---------------------------
1 file changed, 8 insertions(+), 27 deletions(-)

diff --git a/src/auditor/taler-helper-auditor-coins.c b/src/auditor/taler-helper-auditor-coins.c @@ -2496,14 +2496,17 @@ purse_refund_cb (struct CoinContext *cc, * Check that the recoup operation was properly initiated by a coin * and update the denomination's losses accordingly. * + * The caller must have verified the wallet's signature authorizing the + * recoup (which differs between recoup and recoup-refresh) and must not + * call this function if that signature was invalid, as this function + * books the recoup as legitimate. + * * @param cc the context with details about the coin * @param operation name of the operation matching @a rowid * @param rowid row identifier used to uniquely identify the recoup operation * @param amount how much should be added back to the reserve * @param coin public information about the coin * @param denom_pub public key of the denomionation of @a coin - * @param coin_sig signature with @e coin_pub of type #TALER_SIGNATURE_WALLET_COIN_RECOUP - * @param coin_blind blinding factor used to blind the coin * @return #GNUNET_OK to continue to iterate, #GNUNET_SYSERR to stop */ static enum GNUNET_GenericReturnValue @@ -2512,31 +2515,13 @@ check_recoup (struct CoinContext *cc, uint64_t rowid, const struct TALER_Amount *amount, const struct TALER_CoinPublicInfo *coin, - const struct TALER_DenominationPublicKey *denom_pub, - const struct TALER_CoinSpendSignatureP *coin_sig, - const union GNUNET_CRYPTO_BlindingSecretP *coin_blind) + const struct TALER_DenominationPublicKey *denom_pub) { struct DenominationSummary *ds; enum GNUNET_DB_QueryStatus qs; const struct TALER_EXCHANGEDB_DenominationKeyInformation *issue; if (GNUNET_OK != - TALER_wallet_recoup_verify (&coin->denom_pub_hash, - coin_blind, - &coin->coin_pub, - coin_sig)) - { - qs = report_row_inconsistency (operation, - rowid, - "recoup signature invalid"); - if (0 > qs) - { - GNUNET_break (GNUNET_DB_STATUS_SOFT_ERROR == qs); - cc->qs = GNUNET_DB_STATUS_HARD_ERROR; - return GNUNET_SYSERR; - } - } - if (GNUNET_OK != TALER_test_coin_valid (coin, denom_pub)) { @@ -2716,9 +2701,7 @@ recoup_cb (struct CoinContext *cc, rowid, amount, coin, - denom_pub, - coin_sig, - coin_blind); + denom_pub); } @@ -2851,9 +2834,7 @@ recoup_refresh_cb (struct CoinContext *cc, rowid, amount, coin, - denom_pub, - coin_sig, - coin_blind); + denom_pub); }