Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 13 additions & 7 deletions fuzz/src/base32.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,29 +16,35 @@ pub fn do_test(data: &[u8]) {
if let Ok(s) = std::str::from_utf8(data) {
let first_decoding = base32::Alphabet::RFC4648 { padding: true }.decode(s);
if let Ok(first_decoding) = first_decoding {
let encoding_response = base32::Alphabet::RFC4648 { padding: true }.encode(&first_decoding);
let encoding_response =
base32::Alphabet::RFC4648 { padding: true }.encode(&first_decoding);
assert_eq!(encoding_response, s.to_ascii_uppercase());
let second_decoding = base32::Alphabet::RFC4648 { padding: true }.decode(&encoding_response).unwrap();
let second_decoding =
base32::Alphabet::RFC4648 { padding: true }.decode(&encoding_response).unwrap();
assert_eq!(first_decoding, second_decoding);
}
}

if let Ok(s) = std::str::from_utf8(data) {
let first_decoding = base32::Alphabet::RFC4648 { padding: false }.decode(s);
if let Ok(first_decoding) = first_decoding {
let encoding_response = base32::Alphabet::RFC4648 { padding: false }.encode(&first_decoding);
let encoding_response =
base32::Alphabet::RFC4648 { padding: false }.encode(&first_decoding);
assert_eq!(encoding_response, s.to_ascii_uppercase());
let second_decoding = base32::Alphabet::RFC4648 { padding: false }.decode(&encoding_response).unwrap();
let second_decoding =
base32::Alphabet::RFC4648 { padding: false }.decode(&encoding_response).unwrap();
assert_eq!(first_decoding, second_decoding);
}
}

let encode_response = base32::Alphabet::RFC4648 { padding: false }.encode(&data);
let decode_response = base32::Alphabet::RFC4648 { padding: false }.decode(&encode_response).unwrap();
let decode_response =
base32::Alphabet::RFC4648 { padding: false }.decode(&encode_response).unwrap();
assert_eq!(data, decode_response);

let encode_response = base32::Alphabet::RFC4648 { padding: true }.encode(&data);
let decode_response = base32::Alphabet::RFC4648 { padding: true }.decode(&encode_response).unwrap();
let decode_response =
base32::Alphabet::RFC4648 { padding: true }.decode(&encode_response).unwrap();
assert_eq!(data, decode_response);
}

Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/base32_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/bech32_parse_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/bolt11_deser_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/chanmon_consistency_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/chanmon_deser_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/fromstr_to_netaddress_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/full_stack_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/indexedmap_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/invoice_deser_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/invoice_request_deser_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_accept_channel_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_accept_channel_v2_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_announcement_signatures_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_channel_announcement_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_channel_details_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_channel_ready_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_channel_reestablish_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_channel_update_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_closing_signed_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_commitment_signed_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_decoded_onion_error_packet_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_error_message_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_funding_created_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_funding_signed_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_gossip_timestamp_filter_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_init_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_node_announcement_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_open_channel_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_open_channel_v2_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_ping_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_pong_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_query_channel_range_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_query_short_channel_ids_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_reply_channel_range_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_reply_short_channel_ids_end_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_revoke_and_ack_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_shutdown_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_splice_ack_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_splice_locked_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_splice_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_stfu_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_tx_abort_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_tx_ack_rbf_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
1 change: 1 addition & 0 deletions fuzz/src/bin/msg_tx_add_input_target.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
// To modify it, modify target_template.txt and run gen_target.sh instead.

#![cfg_attr(feature = "libfuzzer_fuzz", no_main)]
#![cfg_attr(rustfmt, rustfmt_skip)]

#[cfg(not(fuzzing))]
compile_error!("Fuzz targets need cfg=fuzzing");
Expand Down
Loading