commit a81b944eebc4f09337da5962c6218ae497e9b30e
parent f0d2f88f4c0d64399ebee18ee7f37b0315d63c0d
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 29 Jul 2026 20:06:46 +0200
fix currency cmp
Diffstat:
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/src/authorization/anastasis_authorization_plugin_iban.c b/src/authorization/anastasis_authorization_plugin_iban.c
@@ -340,14 +340,14 @@ check_payment_ok (void *cls,
extract_code (wire_subject,
&code))
return false;
- /* The amount is read back from the database in the currency configured as
- "[anastasis] CURRENCY", while the fee we expect comes from
- "[authorization-iban] COST". If those two disagree the provider is
- misconfigured; reinterpreting one as the other (as this code used to do)
- would let a transfer of the right magnitude in the wrong currency
- satisfy the challenge. */
- if (0 != strcasecmp (amount->currency,
- ctx->expected_amount.currency))
+ /* The database stamps every row with the currency configured for this
+ provider, so a mismatch here means the plugin was configured for a
+ different currency than the rest of the service. Refusing is the only
+ safe answer: comparing the magnitudes across currencies would let a
+ transfer of "5 XYZ" authorize a challenge that costs 5 EUR. */
+ if (GNUNET_YES !=
+ TALER_amount_cmp_currency (amount,
+ &ctx->expected_amount))
{
GNUNET_log (GNUNET_ERROR_TYPE_ERROR,
"Received `%s', but [authorization-iban]/COST is denominated in `%s'\n",