From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001 From: Christian Grothoff 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