mirror of
https://github.com/lightningdevkit/rust-lightning.git
synced 2025-02-23 22:56:54 +01:00
Add explicit compile errors when cfg=fuzzing is mis-set
This commit is contained in:
parent
acb4c539f7
commit
b0cb5583b1
38 changed files with 114 additions and 0 deletions
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::chanmon_consistency::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::chanmon_deser::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::full_stack::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_accept_channel::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_announcement_signatures::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_announcement::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_reestablish::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_channel_update::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_closing_signed::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_commitment_signed::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_decoded_onion_error_packet::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_error_message::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_created::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_locked::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_funding_signed::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_gossip_timestamp_filter::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_init::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_node_announcement::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_onion_hop_data::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_open_channel::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_ping::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_pong::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_query_channel_range::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_query_short_channel_ids::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_reply_channel_range::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_reply_short_channel_ids_end::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_revoke_and_ack::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_shutdown::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_add_htlc::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fail_htlc::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fail_malformed_htlc::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fee::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::msg_targets::msg_update_fulfill_htlc::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::peer_crypt::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::router::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::TARGET_MOD::*;
|
||||
|
||||
|
|
|
@ -12,6 +12,9 @@
|
|||
|
||||
#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
|
||||
|
||||
#[cfg(not(fuzzing))]
|
||||
compile_error!("Fuzz targets need cfg=fuzzing");
|
||||
|
||||
extern crate lightning_fuzz;
|
||||
use lightning_fuzz::zbase32::*;
|
||||
|
||||
|
|
|
@ -36,6 +36,9 @@
|
|||
#[cfg(not(any(feature = "std", feature = "no-std")))]
|
||||
compile_error!("at least one of the `std` or `no-std` features must be enabled");
|
||||
|
||||
#[cfg(all(fuzzing, test))]
|
||||
compile_error!("Tests will always fail with cfg=fuzzing");
|
||||
|
||||
#[macro_use]
|
||||
extern crate alloc;
|
||||
extern crate bitcoin;
|
||||
|
|
Loading…
Add table
Reference in a new issue