mirror of
https://github.com/aljazceru/lightning.git
synced 2025-12-22 16:44:20 +01:00
test_onion: fix random padding.
Randomness is now at start; thanks valgrind! Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -498,7 +498,7 @@ bool create_onion(const secp256k1_pubkey pubkey[],
|
|||||||
/* Unused hops filled with random, so even recipient can't tell
|
/* Unused hops filled with random, so even recipient can't tell
|
||||||
* how many were used. */
|
* how many were used. */
|
||||||
junk_hops = MAX_HOPS - num;
|
junk_hops = MAX_HOPS - num;
|
||||||
random_bytes(onion->hop + num, junk_hops * sizeof(struct hop));
|
random_bytes(onion->hop, junk_hops * sizeof(struct hop));
|
||||||
|
|
||||||
for (i = num - 1; i >= 0; i--) {
|
for (i = num - 1; i >= 0; i--) {
|
||||||
size_t other_hops, len;
|
size_t other_hops, len;
|
||||||
|
|||||||
Reference in New Issue
Block a user