commit 9ca3826babf0f704964189c2293f2ef740f097d4
parent ce5e1fe7e6022b0649f664cb5f804b70bc6a9804
Author: Christian Grothoff <grothoff@gnunet.org>
Date: Fri, 17 Jul 2026 19:29:28 +0200
reject duplicate budis'
Diffstat:
1 file changed, 16 insertions(+), 1 deletion(-)
diff --git a/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c b/src/donau/donau-httpd_post-batch-issue-CHARITY_ID.c
@@ -62,7 +62,6 @@ parse_json_bkp (struct DONAU_BlindedUniqueDonorIdentifierKeyPair *bkp,
GNUNET_break_op (0);
return GNUNET_SYSERR;
}
- /* FIXME: Check for duplicate blinded UDIs.*/
return GNUNET_OK;
}
@@ -212,6 +211,22 @@ DH_handler_post_batch_issue (struct DH_RequestContext *rc,
}
}
+ /* Reject duplicate blinded UDIs within the request. */
+ for (size_t i = 0; i < num_bkps; i++)
+ for (size_t j = i + 1; j < num_bkps; j++)
+ if (0 == GNUNET_CRYPTO_blinded_message_cmp (
+ bkps[i].blinded_udi.blinded_message,
+ bkps[j].blinded_udi.blinded_message))
+ {
+ GNUNET_break_op (0);
+ free_bkps (num_bkps,
+ bkps);
+ return TALER_MHD_reply_with_error (rc->connection,
+ MHD_HTTP_BAD_REQUEST,
+ TALER_EC_GENERIC_PARAMETER_MALFORMED,
+ "budikeypairs");
+ }
+
{
enum GNUNET_DB_QueryStatus qs_charity;