merchant

Merchant backend to process payments, run by merchants
Log | Files | Refs | Submodules | README | LICENSE

commit ac4c7c1baeb1c3fb0cd5b94f7440b5817a5203cb
parent be36d19b930ada87ed724ba5452f8fd3131377ac
Author: Florian Dold <dold@taler.net>
Date:   Fri, 28 Aug 2026 12:05:30 +0200

fix order ID randomness

GNUNET_CRYPTO_random_u64 did not return proper 64 bits of randomness but
instead truncated to 32 bits. This has been fixed in GNUnet, but since
we just need 64 bits and the upper bound doens't matter, we now just use
GNUNET_CRYPTO_random_block instead.

The low entropy order ID led to payment failures due to collisions in
the order ID.

Diffstat:
Msrc/backend/taler-merchant-httpd_post-private-orders.c | 4+++-
1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/backend/taler-merchant-httpd_post-private-orders.c b/src/backend/taler-merchant-httpd_post-private-orders.c @@ -3804,7 +3804,9 @@ phase_parse_order (struct OrderContext *oc) /* Check for error state of strftime */ GNUNET_assert (0 != off); buf[off++] = '-'; - rand = GNUNET_CRYPTO_random_u64 (UINT64_MAX); + /* The encoded suffix is raw identifier entropy, not a bounded number. */ + GNUNET_CRYPTO_random_block (&rand, + sizeof (rand)); last = GNUNET_STRINGS_data_to_string (&rand, sizeof (uint64_t), &buf[off],