View Issue Details

IDProjectCategoryView StatusLast Update
0012217Talerexchangepublic2026-11-18 16:41
Reporterbot-cg [agent]  
PrioritynormalSeveritycrash 
Status new 
Product Versiongit (master) 
Summary0012217: POST /blinding-prepare for a CS key the helper announced but the offline tool has not signed aborts taler-exchange-httpd
DescriptionTEH_SECMOD_denom_cs_batch_r_pub() (taler-exchange-httpd_secmod-helpers.c) looks the client's denom_pub_hash up twice: in the helper's announced keys (hd) and in the key state built from the master-signed denominations (dk, via TEH_keys_denomination_by_hash()). It returns DENOMINATION_KEY_UNKNOWN only when hd is NULL and then does GNUNET_assert (NULL != dk). The CS helper announces keys ahead of time, and until the offline tool has signed them they are in the helper's set but not in the key state, so a /blinding-prepare request naming such a key aborts the httpd. TEH_handler_blinding_prepare() does not look the hash up itself before. The hashes of these keys are listed in future_denoms of GET /management/keys.

Confirmed by reading the code at 2a57cbcaf; not reproduced at runtime.

The attached patch answers TALER_EC_EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN when either lookup fails.
TagsNo tags attached.
Attached Files
12217-exchange-answer-blinding-prepare-for-an-unsigned-CS-.patch (1,462 bytes)   
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Christian Grothoff <christian@grothoff.org>
Date: Wed, 18 Nov 2026 17:41:26 +0100
Subject: [PATCH] exchange: answer /blinding-prepare for an unsigned CS key
 with key unknown

The CS helper announces keys before the offline tool signs them, and
such a key has no entry in the key state.

Issue: https://bugs.taler.net/n/12217

Assisted by LLM
---
 src/exchange/taler-exchange-httpd_secmod-helpers.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/exchange/taler-exchange-httpd_secmod-helpers.c b/src/exchange/taler-exchange-httpd_secmod-helpers.c
index 5e127d9c3..ea3e86b86 100644
--- a/src/exchange/taler-exchange-httpd_secmod-helpers.c
+++ b/src/exchange/taler-exchange-httpd_secmod-helpers.c
@@ -645,11 +645,12 @@ TEH_SECMOD_denom_cs_batch_r_pub (
     dk = TEH_keys_denomination_by_hash (&h_denom_pubs[i],
                                         NULL,
                                         NULL);
-    if (NULL == hd)
+    /* dk is NULL for a key the helper announced but the offline
+       tool has not signed yet */
+    if ( (NULL == hd) ||
+         (NULL == dk) )
       return TALER_EC_EXCHANGE_GENERIC_DENOMINATION_KEY_UNKNOWN;
 
-    GNUNET_assert (NULL != dk);
-
     if (GNUNET_CRYPTO_BSA_CS !=
         hd->denom_pub.bsign_pub_key->cipher)
       return TALER_EC_EXCHANGE_GENERIC_INVALID_DENOMINATION_CIPHER_FOR_OPERATION
-- 
2.47.3

Required notifications

Address or linkRemarkAdded byNotifiedActions

Relationships

child of 0012186 new Unchecked array lengths and counts in exchange, merchant and anastasis: review after 2a57cbcaf [meta] 

Activities

Issue History

Date ModifiedUsernameFieldChange
2026-11-18 16:41bot-cgNew Issue
2026-11-18 16:41bot-cgRelationship addedchild of 0012186
2026-11-18 16:41bot-cgImplementer => oec
2026-11-18 16:41bot-cgReviewer => Christian Grothoff
2026-11-18 16:41bot-cgRelease signed by => Christian Grothoff
2026-11-18 16:41bot-cgDeployed by => Christian Grothoff
2026-11-18 16:41bot-cgVerifier => Christian Grothoff
2026-11-18 16:41bot-cgCommunicator => CM_7
2026-11-18 16:41bot-cgFile Added: 12217-exchange-answer-blinding-prepare-for-an-unsigned-CS-.patch