core-lightning/tests/fuzz
Matt Morehouse 5ea1fade60 fuzz: fix invalid pubkey error
pubkey_from_hexstr() was failing, which we didn't notice because we
weren't checking the return value. The problem was that we were passing
it a strlen that was half the actual length.

Relevant error:

  [libsecp256k1] illegal argument: !secp256k1_fe_is_zero(&ge->x)

  ==417723== ERROR: libFuzzer: deadly signal
    #7 0x7f5deaacc7fb in abort
    #8 0x51b0b0 in secp256k1_default_illegal_callback_fn secp256k1.c
    #9 0x51bd8e in secp256k1_ec_pubkey_serialize
    #10 0x4e235b in pubkey_to_der bitcoin/pubkey.c:29:7
    #11 0x4e2941 in pubkey_cmp bitcoin/pubkey.c:89:2
    #12 0x4e333d in bitcoin_redeem_2of2 bitcoin/script.c:144:6
    #13 0x4f1396 in run tests/fuzz/fuzz-close_tx.c:78:19
2023-04-03 16:12:29 +09:30
..
fuzz-addr.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
fuzz-amount.c cleanup: remove unneeded includes in C files. 2021-09-17 09:43:22 +09:30
fuzz-base32-64.c cleanup: remove unneeded includes in C files. 2021-09-17 09:43:22 +09:30
fuzz-bech32.c fuzz: avoid buffer overflow in bech32 target 2023-03-23 13:28:28 +10:30
fuzz-bigsize.c cleanup: remove unneeded includes in C files. 2021-09-17 09:43:22 +09:30
fuzz-bip32.c cleanup: remove unneeded includes in C files. 2021-09-17 09:43:22 +09:30
fuzz-channel_id.c fuzz: fix UBSan nullability error 2023-03-23 13:34:24 +10:30
fuzz-close_tx.c fuzz: fix invalid pubkey error 2023-04-03 16:12:29 +09:30
fuzz-descriptor_checksum.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
fuzz-hsm_encryption.c fuzz: fix fuzzing compilation. 2022-07-25 08:08:32 -07:00
fuzz-initial_channel.c fuzz: fix fuzzing compilation. 2022-07-25 08:08:32 -07:00
libfuzz.c check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
libfuzz.h check: make sure all files outside contrib/ include "config.h" first. 2021-12-06 10:05:39 +10:30
Makefile tests/fuzz: don't pull in JSON common at all. 2022-11-09 20:25:58 +10:30
run.py fuzz: add a runner Python script for fuzz targets 2020-10-21 19:34:39 +02:00