mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-25 07:17:40 +01:00
Merge pull request #416 from TheBlueMatt/2019-12-fuzz-clib
Refactor fuzzing to be a C-callable library plus rust binaries
This commit is contained in:
commit
be677dc4f4
72 changed files with 1619 additions and 873 deletions
125
fuzz/Cargo.toml
125
fuzz/Cargo.toml
|
@ -14,6 +14,7 @@ cargo-fuzz = true
|
|||
afl_fuzz = ["afl"]
|
||||
honggfuzz_fuzz = ["honggfuzz"]
|
||||
libfuzzer_fuzz = ["libfuzzer-sys"]
|
||||
stdin_fuzz = []
|
||||
|
||||
[dependencies]
|
||||
afl = { version = "0.4", optional = true }
|
||||
|
@ -36,123 +37,7 @@ members = ["."]
|
|||
lto = true
|
||||
codegen-units = 1
|
||||
|
||||
[[bin]]
|
||||
name = "peer_crypt_target"
|
||||
path = "fuzz_targets/peer_crypt_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "full_stack_target"
|
||||
path = "fuzz_targets/full_stack_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "chanmon_fail_consistency"
|
||||
path = "fuzz_targets/chanmon_fail_consistency.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "router_target"
|
||||
path = "fuzz_targets/router_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "chanmon_deser_target"
|
||||
path = "fuzz_targets/chanmon_deser_target.rs"
|
||||
|
||||
# message fuzz targets
|
||||
[[bin]]
|
||||
name = "msg_ping_target"
|
||||
path = "fuzz_targets/msg_targets/msg_ping_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_pong_target"
|
||||
path = "fuzz_targets/msg_targets/msg_pong_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_error_message_target"
|
||||
path = "fuzz_targets/msg_targets/msg_error_message_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_update_add_htlc_target"
|
||||
path = "fuzz_targets/msg_targets/msg_update_add_htlc_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_accept_channel_target"
|
||||
path = "fuzz_targets/msg_targets/msg_accept_channel_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_closing_signed_target"
|
||||
path = "fuzz_targets/msg_targets/msg_closing_signed_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_commitment_signed_target"
|
||||
path = "fuzz_targets/msg_targets/msg_commitment_signed_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_funding_created_target"
|
||||
path = "fuzz_targets/msg_targets/msg_funding_created_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_funding_locked_target"
|
||||
path = "fuzz_targets/msg_targets/msg_funding_locked_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_funding_signed_target"
|
||||
path = "fuzz_targets/msg_targets/msg_funding_signed_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_open_channel_target"
|
||||
path = "fuzz_targets/msg_targets/msg_open_channel_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_revoke_and_ack_target"
|
||||
path = "fuzz_targets/msg_targets/msg_revoke_and_ack_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_shutdown_target"
|
||||
path = "fuzz_targets/msg_targets/msg_shutdown_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_update_fail_malformed_htlc_target"
|
||||
path = "fuzz_targets/msg_targets/msg_update_fail_malformed_htlc_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_update_fee_target"
|
||||
path = "fuzz_targets/msg_targets/msg_update_fee_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_update_fulfill_htlc_target"
|
||||
path = "fuzz_targets/msg_targets/msg_update_fulfill_htlc_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_update_fail_htlc_target"
|
||||
path = "fuzz_targets/msg_targets/msg_update_fail_htlc_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_channel_reestablish_target"
|
||||
path = "fuzz_targets/msg_targets/msg_channel_reestablish_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_announcement_signatures_target"
|
||||
path = "fuzz_targets/msg_targets/msg_announcement_signatures_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_channel_announcement_target"
|
||||
path = "fuzz_targets/msg_targets/msg_channel_announcement_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_channel_update_target"
|
||||
path = "fuzz_targets/msg_targets/msg_channel_update_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_decoded_onion_error_packet_target"
|
||||
path = "fuzz_targets/msg_targets/msg_decoded_onion_error_packet_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_init_target"
|
||||
path = "fuzz_targets/msg_targets/msg_init_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_node_announcement_target"
|
||||
path = "fuzz_targets/msg_targets/msg_node_announcement_target.rs"
|
||||
|
||||
[[bin]]
|
||||
name = "msg_onion_hop_data_target"
|
||||
path = "fuzz_targets/msg_targets/msg_onion_hop_data_target.rs"
|
||||
[lib]
|
||||
name = "lightning_fuzz"
|
||||
path = "src/lib.rs"
|
||||
crate-type = ["rlib", "dylib", "staticlib"]
|
||||
|
|
44
fuzz/src/bin/chanmon_consistency_target.rs
Normal file
44
fuzz/src/bin/chanmon_consistency_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::chanmon_consistency::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
chanmon_consistency_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
chanmon_consistency_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
chanmon_consistency_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
chanmon_consistency_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/chanmon_deser_target.rs
Normal file
44
fuzz/src/bin/chanmon_deser_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::chanmon_deser::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
chanmon_deser_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
chanmon_deser_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
chanmon_deser_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
chanmon_deser_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/full_stack_target.rs
Normal file
44
fuzz/src/bin/full_stack_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::full_stack::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
full_stack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
full_stack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
full_stack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
full_stack_run(data.as_ptr(), data.len());
|
||||
}
|
42
fuzz/src/bin/gen_target.sh
Executable file
42
fuzz/src/bin/gen_target.sh
Executable file
|
@ -0,0 +1,42 @@
|
|||
#!/bin/sh
|
||||
|
||||
echo "#include <stdint.h>" > ../../targets.h
|
||||
GEN_TEST() {
|
||||
cat target_template.txt | sed s/TARGET_NAME/$1/ | sed s/TARGET_MOD/$2$1/ > $1_target.rs
|
||||
echo "void $1_run(const unsigned char* data, size_t data_len);" >> ../../targets.h
|
||||
}
|
||||
|
||||
GEN_TEST chanmon_deser
|
||||
GEN_TEST chanmon_consistency
|
||||
GEN_TEST full_stack
|
||||
GEN_TEST peer_crypt
|
||||
GEN_TEST router
|
||||
|
||||
GEN_TEST msg_accept_channel msg_targets::
|
||||
GEN_TEST msg_announcement_signatures msg_targets::
|
||||
GEN_TEST msg_channel_reestablish msg_targets::
|
||||
GEN_TEST msg_closing_signed msg_targets::
|
||||
GEN_TEST msg_commitment_signed msg_targets::
|
||||
GEN_TEST msg_decoded_onion_error_packet msg_targets::
|
||||
GEN_TEST msg_funding_created msg_targets::
|
||||
GEN_TEST msg_funding_locked msg_targets::
|
||||
GEN_TEST msg_funding_signed msg_targets::
|
||||
GEN_TEST msg_init msg_targets::
|
||||
GEN_TEST msg_open_channel msg_targets::
|
||||
GEN_TEST msg_revoke_and_ack msg_targets::
|
||||
GEN_TEST msg_shutdown msg_targets::
|
||||
GEN_TEST msg_update_fail_htlc msg_targets::
|
||||
GEN_TEST msg_update_fail_malformed_htlc msg_targets::
|
||||
GEN_TEST msg_update_fee msg_targets::
|
||||
GEN_TEST msg_update_fulfill_htlc msg_targets::
|
||||
|
||||
GEN_TEST msg_channel_announcement msg_targets::
|
||||
GEN_TEST msg_channel_update msg_targets::
|
||||
GEN_TEST msg_node_announcement msg_targets::
|
||||
|
||||
GEN_TEST msg_update_add_htlc msg_targets::
|
||||
GEN_TEST msg_error_message msg_targets::
|
||||
GEN_TEST msg_onion_hop_data msg_targets::
|
||||
|
||||
GEN_TEST msg_ping msg_targets::
|
||||
GEN_TEST msg_pong msg_targets::
|
44
fuzz/src/bin/msg_accept_channel_target.rs
Normal file
44
fuzz/src/bin/msg_accept_channel_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_accept_channel::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_accept_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_accept_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_accept_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_accept_channel_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_announcement_signatures_target.rs
Normal file
44
fuzz/src/bin/msg_announcement_signatures_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_announcement_signatures::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_announcement_signatures_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_announcement_signatures_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_announcement_signatures_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_announcement_signatures_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_channel_announcement_target.rs
Normal file
44
fuzz/src/bin/msg_channel_announcement_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_announcement::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_channel_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_channel_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_channel_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_channel_announcement_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_channel_reestablish_target.rs
Normal file
44
fuzz/src/bin/msg_channel_reestablish_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_reestablish::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_channel_reestablish_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_channel_reestablish_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_channel_reestablish_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_channel_reestablish_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_channel_update_target.rs
Normal file
44
fuzz/src/bin/msg_channel_update_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_update::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_channel_update_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_channel_update_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_channel_update_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_channel_update_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_closing_signed_target.rs
Normal file
44
fuzz/src/bin/msg_closing_signed_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_closing_signed::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_closing_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_closing_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_closing_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_closing_signed_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_commitment_signed_target.rs
Normal file
44
fuzz/src/bin/msg_commitment_signed_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_commitment_signed::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_commitment_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_commitment_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_commitment_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_commitment_signed_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_decoded_onion_error_packet_target.rs
Normal file
44
fuzz/src/bin/msg_decoded_onion_error_packet_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_decoded_onion_error_packet::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_decoded_onion_error_packet_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_decoded_onion_error_packet_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_decoded_onion_error_packet_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_decoded_onion_error_packet_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_error_message_target.rs
Normal file
44
fuzz/src/bin/msg_error_message_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_error_message::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_error_message_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_error_message_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_error_message_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_error_message_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_funding_created_target.rs
Normal file
44
fuzz/src/bin/msg_funding_created_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_created::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_funding_created_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_funding_created_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_funding_created_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_funding_created_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_funding_locked_target.rs
Normal file
44
fuzz/src/bin/msg_funding_locked_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_locked::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_funding_locked_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_funding_locked_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_funding_locked_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_funding_locked_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_funding_signed_target.rs
Normal file
44
fuzz/src/bin/msg_funding_signed_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_signed::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_funding_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_funding_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_funding_signed_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_funding_signed_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_init_target.rs
Normal file
44
fuzz/src/bin/msg_init_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_init::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_init_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_init_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_init_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_init_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_node_announcement_target.rs
Normal file
44
fuzz/src/bin/msg_node_announcement_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_node_announcement::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_node_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_node_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_node_announcement_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_node_announcement_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_onion_hop_data_target.rs
Normal file
44
fuzz/src/bin/msg_onion_hop_data_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_onion_hop_data::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_onion_hop_data_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_onion_hop_data_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_onion_hop_data_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_onion_hop_data_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_open_channel_target.rs
Normal file
44
fuzz/src/bin/msg_open_channel_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_open_channel::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_open_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_open_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_open_channel_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_open_channel_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_ping_target.rs
Normal file
44
fuzz/src/bin/msg_ping_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_ping::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_ping_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_ping_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_ping_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_ping_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_pong_target.rs
Normal file
44
fuzz/src/bin/msg_pong_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_pong::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_pong_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_pong_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_pong_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_pong_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_revoke_and_ack_target.rs
Normal file
44
fuzz/src/bin/msg_revoke_and_ack_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_revoke_and_ack::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_revoke_and_ack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_revoke_and_ack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_revoke_and_ack_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_revoke_and_ack_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_shutdown_target.rs
Normal file
44
fuzz/src/bin/msg_shutdown_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_shutdown::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_shutdown_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_shutdown_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_shutdown_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_shutdown_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_update_add_htlc_target.rs
Normal file
44
fuzz/src/bin/msg_update_add_htlc_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_add_htlc::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_update_add_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_update_add_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_update_add_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_update_add_htlc_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_update_fail_htlc_target.rs
Normal file
44
fuzz/src/bin/msg_update_fail_htlc_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fail_htlc::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_update_fail_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_update_fail_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_update_fail_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_update_fail_htlc_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs
Normal file
44
fuzz/src/bin/msg_update_fail_malformed_htlc_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fail_malformed_htlc::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_update_fail_malformed_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_update_fail_malformed_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_update_fail_malformed_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_update_fail_malformed_htlc_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_update_fee_target.rs
Normal file
44
fuzz/src/bin/msg_update_fee_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fee::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_update_fee_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_update_fee_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_update_fee_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_update_fee_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/msg_update_fulfill_htlc_target.rs
Normal file
44
fuzz/src/bin/msg_update_fulfill_htlc_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fulfill_htlc::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
msg_update_fulfill_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
msg_update_fulfill_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
msg_update_fulfill_htlc_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
msg_update_fulfill_htlc_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/peer_crypt_target.rs
Normal file
44
fuzz/src/bin/peer_crypt_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::peer_crypt::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
peer_crypt_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
peer_crypt_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
peer_crypt_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
peer_crypt_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/router_target.rs
Normal file
44
fuzz/src/bin/router_target.rs
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::router::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
router_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
router_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
router_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
router_run(data.as_ptr(), data.len());
|
||||
}
|
44
fuzz/src/bin/target_template.txt
Normal file
44
fuzz/src/bin/target_template.txt
Normal file
|
@ -0,0 +1,44 @@
|
|||
// This file is auto-generated by gen_target.sh based on target_template.txt
|
||||
// To modify it, modify target_template.txt and run gen_target.sh instead.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::TARGET_MOD::*;
|
||||
|
||||
use std::io::Read;
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
TARGET_NAME_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
TARGET_NAME_run(data.as_ptr(), data.len());
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
TARGET_NAME_run(data.as_ptr(), data.len());
|
||||
});
|
||||
|
||||
#[cfg(feature = "stdin_fuzz")]
|
||||
fn main() {
|
||||
let mut data = Vec::with_capacity(8192);
|
||||
std::io::stdin().read_to_end(&mut data).unwrap();
|
||||
TARGET_NAME_run(data.as_ptr(), data.len());
|
||||
}
|
|
@ -9,14 +9,6 @@
|
|||
//! send-side handling is correct, other peers. We consider it a failure if any action results in a
|
||||
//! channel being force-closed.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate bitcoin;
|
||||
extern crate bitcoin_hashes;
|
||||
extern crate lightning;
|
||||
extern crate secp256k1;
|
||||
|
||||
use bitcoin::BitcoinHash;
|
||||
use bitcoin::blockdata::block::BlockHeader;
|
||||
use bitcoin::blockdata::transaction::{Transaction, TxOut};
|
||||
|
@ -44,7 +36,6 @@ use lightning::util::config::UserConfig;
|
|||
use lightning::util::events::{EventsProvider, MessageSendEventsProvider};
|
||||
use lightning::util::ser::{Readable, ReadableArgs, Writeable, Writer};
|
||||
|
||||
mod utils;
|
||||
use utils::test_logger;
|
||||
|
||||
use secp256k1::key::{PublicKey,SecretKey};
|
||||
|
@ -745,34 +736,11 @@ pub fn do_test(data: &[u8]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn chanmon_consistency_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
do_test(data);
|
||||
});
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,16 +1,11 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate bitcoin;
|
||||
extern crate bitcoin_hashes;
|
||||
extern crate lightning;
|
||||
|
||||
use bitcoin_hashes::sha256d::Hash as Sha256dHash;
|
||||
|
||||
use lightning::ln::channelmonitor;
|
||||
use lightning::util::ser::{ReadableArgs, Writer};
|
||||
|
||||
mod utils;
|
||||
use utils::test_logger;
|
||||
|
||||
use std::io::Cursor;
|
||||
|
@ -41,30 +36,13 @@ pub fn do_test(data: &[u8]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn chanmon_deser_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
fn duplicate_crash() {
|
||||
super::do_test(&::hex::decode("00").unwrap());
|
|
@ -4,14 +4,6 @@
|
|||
//! or payments to send/ways to handle events generated.
|
||||
//! This test has been very useful, though due to its complexity good starting inputs are critical.
|
||||
|
||||
//Uncomment this for libfuzzer builds:
|
||||
//#![no_main]
|
||||
|
||||
extern crate bitcoin;
|
||||
extern crate bitcoin_hashes;
|
||||
extern crate lightning;
|
||||
extern crate secp256k1;
|
||||
|
||||
use bitcoin::blockdata::block::BlockHeader;
|
||||
use bitcoin::blockdata::transaction::{Transaction, TxOut};
|
||||
use bitcoin::blockdata::script::{Builder, Script};
|
||||
|
@ -37,8 +29,6 @@ use lightning::util::events::{EventsProvider,Event};
|
|||
use lightning::util::logger::Logger;
|
||||
use lightning::util::config::UserConfig;
|
||||
|
||||
mod utils;
|
||||
|
||||
use utils::test_logger;
|
||||
|
||||
use secp256k1::key::{PublicKey,SecretKey};
|
||||
|
@ -532,37 +522,12 @@ pub fn do_test(data: &[u8], logger: &Arc<dyn Logger>) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new("".to_owned()));
|
||||
do_test(data, &logger);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn full_stack_run(data: *const u8, datalen: usize) {
|
||||
let logger: Arc<dyn Logger> = Arc::new(test_logger::TestLogger::new("".to_owned()));
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) }, &logger);
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new("".to_owned()));
|
||||
do_test(data, &logger);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
#[macro_use] extern crate libfuzzer_sys;
|
||||
#[cfg(feature = "libfuzzer_fuzz")]
|
||||
fuzz_target!(|data: &[u8]| {
|
||||
let logger: Arc<Logger> = Arc::new(test_logger::TestLogger::new("".to_owned()));
|
||||
do_test(data, &logger);
|
||||
});
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
use utils::test_logger;
|
15
fuzz/src/lib.rs
Normal file
15
fuzz/src/lib.rs
Normal file
|
@ -0,0 +1,15 @@
|
|||
extern crate bitcoin;
|
||||
extern crate bitcoin_hashes;
|
||||
extern crate lightning;
|
||||
extern crate secp256k1;
|
||||
extern crate hex;
|
||||
|
||||
mod utils;
|
||||
|
||||
pub mod chanmon_deser;
|
||||
pub mod chanmon_consistency;
|
||||
pub mod full_stack;
|
||||
pub mod peer_crypt;
|
||||
pub mod router;
|
||||
|
||||
pub mod msg_targets;
|
|
@ -1,11 +1,16 @@
|
|||
#!/bin/sh
|
||||
|
||||
GEN_TEST() {
|
||||
tn=$(echo $1 | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\2/g')
|
||||
fn=msg_$(echo $tn | tr '[:upper:]' '[:lower:]')_target.rs
|
||||
cat msg_target_template.txt | sed s/MSG_TARGET/$1/ | sed "s/TEST_MSG/$2/" | sed "s/EXTRA_ARGS/$3/" > $fn
|
||||
tn=msg_$(echo $1 | sed 's/\([a-z0-9]\)\([A-Z]\)/\1_\2/g' | tr '[:upper:]' '[:lower:]')
|
||||
fn=${tn}.rs
|
||||
cat msg_target_template.txt | sed s/MSG_TARGET/$1/ | sed "s/TARGET_NAME/$tn/" | sed "s/TEST_MSG/$2/" | sed "s/EXTRA_ARGS/$3/" > $fn
|
||||
echo "pub mod $tn;" >> mod.rs
|
||||
}
|
||||
|
||||
echo "mod utils;" > mod.rs
|
||||
|
||||
# Note when adding new targets here you should add a similar line in src/bin/gen_target.sh
|
||||
|
||||
GEN_TEST AcceptChannel test_msg ""
|
||||
GEN_TEST AnnouncementSignatures test_msg ""
|
||||
GEN_TEST ChannelReestablish test_msg ""
|
26
fuzz/src/msg_targets/mod.rs
Normal file
26
fuzz/src/msg_targets/mod.rs
Normal file
|
@ -0,0 +1,26 @@
|
|||
mod utils;
|
||||
pub mod msg_accept_channel;
|
||||
pub mod msg_announcement_signatures;
|
||||
pub mod msg_channel_reestablish;
|
||||
pub mod msg_closing_signed;
|
||||
pub mod msg_commitment_signed;
|
||||
pub mod msg_decoded_onion_error_packet;
|
||||
pub mod msg_funding_created;
|
||||
pub mod msg_funding_locked;
|
||||
pub mod msg_funding_signed;
|
||||
pub mod msg_init;
|
||||
pub mod msg_open_channel;
|
||||
pub mod msg_revoke_and_ack;
|
||||
pub mod msg_shutdown;
|
||||
pub mod msg_update_fail_htlc;
|
||||
pub mod msg_update_fail_malformed_htlc;
|
||||
pub mod msg_update_fee;
|
||||
pub mod msg_update_fulfill_htlc;
|
||||
pub mod msg_channel_announcement;
|
||||
pub mod msg_channel_update;
|
||||
pub mod msg_node_announcement;
|
||||
pub mod msg_update_add_htlc;
|
||||
pub mod msg_error_message;
|
||||
pub mod msg_onion_hop_data;
|
||||
pub mod msg_ping;
|
||||
pub mod msg_pong;
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::AcceptChannel, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_accept_channel_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::AnnouncementSignatures, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_announcement_signatures_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_exact!(msgs::ChannelAnnouncement, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_channel_announcement_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::ChannelReestablish, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_channel_reestablish_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_exact!(msgs::ChannelUpdate, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_channel_update_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::ClosingSigned, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_closing_signed_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::CommitmentSigned, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_commitment_signed_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::DecodedOnionErrorPacket, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_decoded_onion_error_packet_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_hole!(msgs::ErrorMessage, data, 32, 2);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_error_message_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::FundingCreated, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_funding_created_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::FundingLocked, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_funding_locked_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::FundingSigned, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_funding_signed_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::Init, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_init_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_exact!(msgs::NodeAnnouncement, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_node_announcement_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_hole!(msgs::OnionHopData, data, 1+8+8+4, 12);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_onion_hop_data_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::OpenChannel, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_open_channel_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_simple!(msgs::Ping, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_ping_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_simple!(msgs::Pong, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_pong_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::RevokeAndACK, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_revoke_and_ack_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::Shutdown, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_shutdown_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
TEST_MSG!(msgs::MSG_TARGET, dataEXTRA_ARGS);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn TARGET_NAME_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg_hole!(msgs::UpdateAddHTLC, data, 85, 33);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_update_add_htlc_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::UpdateFailHTLC, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_update_fail_htlc_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::UpdateFailMalformedHTLC, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_update_fail_malformed_htlc_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::UpdateFee, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_update_fee_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,39 +1,20 @@
|
|||
// This file is auto-generated by gen_target.sh based on msg_target_template.txt
|
||||
// To modify it, modify msg_target_template.txt and run gen_target.sh instead.
|
||||
|
||||
extern crate lightning;
|
||||
|
||||
use lightning::ln::msgs;
|
||||
|
||||
mod utils;
|
||||
use utils::VecWriter;
|
||||
use msg_targets::utils::VecWriter;
|
||||
|
||||
#[inline]
|
||||
pub fn do_test(data: &[u8]) {
|
||||
test_msg!(msgs::UpdateFulfillHTLC, data);
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn msg_update_fulfill_htlc_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
#[test]
|
|
@ -1,6 +1,3 @@
|
|||
extern crate lightning;
|
||||
extern crate secp256k1;
|
||||
|
||||
use lightning::ln::peer_channel_encryptor::PeerChannelEncryptor;
|
||||
|
||||
use secp256k1::key::{PublicKey,SecretKey};
|
||||
|
@ -78,30 +75,13 @@ pub fn do_test(data: &[u8]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn peer_crypt_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
fn duplicate_crash() {
|
||||
super::do_test(&::hex::decode("01").unwrap());
|
|
@ -1,8 +1,3 @@
|
|||
extern crate bitcoin;
|
||||
extern crate bitcoin_hashes;
|
||||
extern crate lightning;
|
||||
extern crate secp256k1;
|
||||
|
||||
use bitcoin_hashes::sha256d::Hash as Sha256dHash;
|
||||
use bitcoin::blockdata::script::{Script, Builder};
|
||||
use bitcoin::blockdata::block::Block;
|
||||
|
@ -18,8 +13,6 @@ use lightning::util::ser::Readable;
|
|||
|
||||
use secp256k1::key::PublicKey;
|
||||
|
||||
mod utils;
|
||||
|
||||
use utils::test_logger;
|
||||
|
||||
use std::sync::Arc;
|
||||
|
@ -238,30 +231,13 @@ pub fn do_test(data: &[u8]) {
|
|||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "afl")]
|
||||
#[macro_use] extern crate afl;
|
||||
#[cfg(feature = "afl")]
|
||||
fn main() {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
#[no_mangle]
|
||||
pub extern "C" fn router_run(data: *const u8, datalen: usize) {
|
||||
do_test(unsafe { std::slice::from_raw_parts(data, datalen) });
|
||||
}
|
||||
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
#[macro_use] extern crate honggfuzz;
|
||||
#[cfg(feature = "honggfuzz")]
|
||||
fn main() {
|
||||
loop {
|
||||
fuzz!(|data| {
|
||||
do_test(data);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
extern crate hex;
|
||||
#[cfg(test)]
|
||||
mod tests {
|
||||
|
||||
#[test]
|
||||
fn duplicate_crash() {
|
||||
super::do_test(&::hex::decode("00").unwrap());
|
31
fuzz/targets.h
Normal file
31
fuzz/targets.h
Normal file
|
@ -0,0 +1,31 @@
|
|||
#include <stdint.h>
|
||||
void chanmon_deser_run(const unsigned char* data, size_t data_len);
|
||||
void chanmon_consistency_run(const unsigned char* data, size_t data_len);
|
||||
void full_stack_run(const unsigned char* data, size_t data_len);
|
||||
void peer_crypt_run(const unsigned char* data, size_t data_len);
|
||||
void router_run(const unsigned char* data, size_t data_len);
|
||||
void msg_accept_channel_run(const unsigned char* data, size_t data_len);
|
||||
void msg_announcement_signatures_run(const unsigned char* data, size_t data_len);
|
||||
void msg_channel_reestablish_run(const unsigned char* data, size_t data_len);
|
||||
void msg_closing_signed_run(const unsigned char* data, size_t data_len);
|
||||
void msg_commitment_signed_run(const unsigned char* data, size_t data_len);
|
||||
void msg_decoded_onion_error_packet_run(const unsigned char* data, size_t data_len);
|
||||
void msg_funding_created_run(const unsigned char* data, size_t data_len);
|
||||
void msg_funding_locked_run(const unsigned char* data, size_t data_len);
|
||||
void msg_funding_signed_run(const unsigned char* data, size_t data_len);
|
||||
void msg_init_run(const unsigned char* data, size_t data_len);
|
||||
void msg_open_channel_run(const unsigned char* data, size_t data_len);
|
||||
void msg_revoke_and_ack_run(const unsigned char* data, size_t data_len);
|
||||
void msg_shutdown_run(const unsigned char* data, size_t data_len);
|
||||
void msg_update_fail_htlc_run(const unsigned char* data, size_t data_len);
|
||||
void msg_update_fail_malformed_htlc_run(const unsigned char* data, size_t data_len);
|
||||
void msg_update_fee_run(const unsigned char* data, size_t data_len);
|
||||
void msg_update_fulfill_htlc_run(const unsigned char* data, size_t data_len);
|
||||
void msg_channel_announcement_run(const unsigned char* data, size_t data_len);
|
||||
void msg_channel_update_run(const unsigned char* data, size_t data_len);
|
||||
void msg_node_announcement_run(const unsigned char* data, size_t data_len);
|
||||
void msg_update_add_htlc_run(const unsigned char* data, size_t data_len);
|
||||
void msg_error_message_run(const unsigned char* data, size_t data_len);
|
||||
void msg_onion_hop_data_run(const unsigned char* data, size_t data_len);
|
||||
void msg_ping_run(const unsigned char* data, size_t data_len);
|
||||
void msg_pong_run(const unsigned char* data, size_t data_len);
|
|
@ -1,18 +1,23 @@
|
|||
#!/bin/bash
|
||||
set -e
|
||||
|
||||
pushd fuzz_targets/msg_targets
|
||||
pushd src/msg_targets
|
||||
rm msg_*.rs
|
||||
./gen_target.sh
|
||||
[ "$(git diff)" != "" ] && exit 1
|
||||
popd
|
||||
pushd src/bin
|
||||
rm *_target.rs
|
||||
./gen_target.sh
|
||||
[ "$(git diff)" != "" ] && exit 1
|
||||
popd
|
||||
|
||||
cargo install --force honggfuzz
|
||||
for TARGET in fuzz_targets/*.rs fuzz_targets/msg_targets/*_target.rs; do
|
||||
for TARGET in src/bin/*.rs; do
|
||||
FILENAME=$(basename $TARGET)
|
||||
FILE="${FILENAME%.*}"
|
||||
HFUZZ_RUN_ARGS="--exit_upon_crash -v -n2"
|
||||
if [ "$FILE" = "chanmon_fail_consistency" ]; then
|
||||
if [ "$FILE" = "chanmon_consistency_target" ]; then
|
||||
HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -F 64 -N100000"
|
||||
else
|
||||
HFUZZ_RUN_ARGS="$HFUZZ_RUN_ARGS -N1000000"
|
||||
|
|
Loading…
Add table
Reference in a new issue