commit dfebff5c2806d63c50166fcfeeb92c16c0190fd3
parent 64d38d55a8c3a0d0645dc0aeeee3fa692a294b50
Author: Christian Grothoff <christian@grothoff.org>
Date: Wed, 18 Nov 2026 17:24:38 +0100
fix #12190
Diffstat:
2 files changed, 15 insertions(+), 2 deletions(-)
diff --git a/src/util/crypto_helper_rsa.c b/src/util/crypto_helper_rsa.c
@@ -423,9 +423,15 @@ TALER_CRYPTO_helper_rsa_batch_sign (
0,
sizeof (*bss) * rsrs_length);
/* Every request must fit into an IPC message of its own, together
- with the batch header; otherwise it could never be transmitted. */
+ with the batch header; otherwise it could never be transmitted.
+ An RSA blinded message is never empty. */
for (unsigned int i = 0; i<rsrs_length; i++)
{
+ if (0 == rsrs[i].msg_size)
+ {
+ GNUNET_break_op (0);
+ return TALER_EC_GENERIC_PARAMETER_MALFORMED;
+ }
if (rsrs[i].msg_size >=
UINT16_MAX
- sizeof (struct TALER_CRYPTO_BatchSignRequest)
diff --git a/src/util/secmod_rsa.c b/src/util/secmod_rsa.c
@@ -784,7 +784,7 @@ handle_batch_sign_request (struct TES_Client *client,
struct BatchJob jobs[bs];
while ( (idx < bs) &&
- (size > sizeof (struct TALER_CRYPTO_SignRequest)) )
+ (size >= sizeof (struct TALER_CRYPTO_SignRequest)) )
{
const struct TALER_CRYPTO_SignRequest *sr = off;
uint16_t s = ntohs (sr->header.size);
@@ -802,6 +802,13 @@ handle_batch_sign_request (struct TES_Client *client,
size -= s;
}
GNUNET_break_op (0 == size);
+ if (idx < bs)
+ {
+ /* fewer requests than announced: the client waits for a reply
+ to each of them, so it must learn that the batch failed */
+ GNUNET_break_op (0);
+ failure = true;
+ }
bs = GNUNET_MIN (bs,
idx);
/* Note: we must finish (and thus reap) *every* job we started,