global: replace randombytes_buf() with randbytes() wrapper.
This allows us to override it for deterministic results. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
@@ -9,9 +9,9 @@
|
||||
#include <common/json_stream.h>
|
||||
#include <common/onion_message.h>
|
||||
#include <common/overflows.h>
|
||||
#include <common/randbytes.h>
|
||||
#include <plugins/offers.h>
|
||||
#include <plugins/offers_offer.h>
|
||||
#include <sodium/randombytes.h>
|
||||
|
||||
static bool msat_or_any(const char *buffer,
|
||||
const jsmntok_t *tok,
|
||||
@@ -706,8 +706,8 @@ struct command_result *json_invoicerequest(struct command *cmd,
|
||||
* - MUST set `invreq_metadata` to an unpredictable series of bytes.
|
||||
*/
|
||||
invreq->invreq_metadata = tal_arr(invreq, u8, 16);
|
||||
randombytes_buf(invreq->invreq_metadata,
|
||||
tal_bytelen(invreq->invreq_metadata));
|
||||
randbytes(invreq->invreq_metadata,
|
||||
tal_bytelen(invreq->invreq_metadata));
|
||||
|
||||
/* BOLT #12:
|
||||
* - otherwise (not responding to an offer):
|
||||
|
||||
Reference in New Issue
Block a user