fuzz: fix fuzzing compilation.

It had bitrotted.

Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>
This commit is contained in:
Rusty Russell
2022-07-25 16:29:09 +09:30
committed by neil saitug
parent 7bbfef5054
commit 8f6afedafe
5 changed files with 8 additions and 4 deletions

View File

@@ -661,7 +661,7 @@ $(ALL_PROGRAMS) $(ALL_TEST_PROGRAMS):
# which brings its own main().
FUZZ_LDFLAGS = -fsanitize=fuzzer
$(ALL_FUZZ_TARGETS):
@$(call VERBOSE, "ld $@", $(LINK.o) $(filter-out %.a,$^) $(LOADLIBES) $(EXTERNAL_LDLIBS) $(LDLIBS) $(FUZZ_LDFLAGS) -o $@)
@$(call VERBOSE, "ld $@", $(LINK.o) $(filter-out %.a,$^) $(LOADLIBES) $(EXTERNAL_LDLIBS) $(LDLIBS) libccan.a $(FUZZ_LDFLAGS) -o $@)
# Everything depends on the CCAN headers, and Makefile

View File

@@ -19,6 +19,7 @@ FUZZ_COMMON_OBJS := \
common/blockheight_states.o \
common/channel_config.o \
common/close_tx.o \
common/configdir.o \
common/channel_id.o \
common/channel_type.o \
common/daemon.o \
@@ -32,13 +33,14 @@ FUZZ_COMMON_OBJS := \
common/permute_tx.o \
common/initial_channel.o \
common/initial_commit_tx.o \
common/json.o \
common/json_parse_simple.o \
common/json_stream.o \
common/key_derive.o \
common/keyset.o \
common/msg_queue.o \
common/memleak.o \
common/node_id.o \
common/psbt_keypath.o \
common/wireaddr.o \
common/setup.o \
common/status.o \

View File

@@ -77,7 +77,7 @@ void run(const uint8_t *data, size_t size)
PUBKEY_CMPR_LEN, pk2);
funding_script = bitcoin_redeem_2of2(tmpctx, pk1, pk2);
create_close_tx(tmpctx, chainparams, our_script,
create_close_tx(tmpctx, chainparams, NULL, NULL, our_script,
their_script, funding_script, &outpoint,
funding, to_us, to_them, dust_limit);

View File

@@ -17,6 +17,7 @@ void run(const uint8_t *data, size_t size)
struct secret *hsm_secret, decrypted_hsm_secret, encryption_key;
char *passphrase;
struct encrypted_hsm_secret encrypted_secret;
char *emsg;
/* Take the first 32 bytes as the plaintext hsm_secret seed,
* and the remaining ones as the passphrase. */
@@ -24,7 +25,7 @@ void run(const uint8_t *data, size_t size)
passphrase = to_string(NULL, data + 32, size - 32);
/* A valid seed, a valid passphrase. This should not fail. */
assert(!hsm_secret_encryption_key(passphrase, &encryption_key));
assert(!hsm_secret_encryption_key_with_exitcode(passphrase, &encryption_key, &emsg));
/* Roundtrip */
assert(encrypt_hsm_secret(&encryption_key, hsm_secret,
&encrypted_secret));

View File

@@ -95,6 +95,7 @@ void run(const uint8_t *data, size_t size)
wumbo, opener);
/* TODO: make initial_channel_tx() work with ASAN.. */
(void)channel;
}
clean_tmpctx();