From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff Date: Wed, 18 Nov 2026 16:01:54 +0100 Subject: [PATCH] exchange: refuse /reveal-withdraw for withdrawals without age restriction Only an age-restricted withdraw has kappa batches to reveal; for any other the age derivation asserts on the denomination's empty age mask. Issue: https://bugs.taler.net/n/12189 Assisted by LLM --- .../taler-exchange-httpd_post-reveal-withdraw.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c b/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c index a1c59f508..3441b391b 100644 --- a/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c +++ b/src/exchange/taler-exchange-httpd_post-reveal-withdraw.c @@ -662,6 +662,18 @@ TEH_handler_reveal_withdraw ( &result)) break; + /* Only an age-restricted withdraw has kappa batches to reveal */ + if (! actx.withdraw.age_proof_required) + { + GNUNET_break_op (0); + result = TALER_MHD_reply_with_error ( + rc->connection, + MHD_HTTP_NOT_FOUND, + TALER_EC_EXCHANGE_WITHDRAW_COMMITMENT_UNKNOWN, + "withdraw is not age-restricted"); + break; + } + /* Verify the computed planchets_h equals the committed one and that coins * have a maximum age group corresponding max_age (age-mask dependent) */ if (GNUNET_OK != -- 2.47.3