You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: fuzz/fuzz_targets/full_stack_target.rs
+20-2Lines changed: 20 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -1,3 +1,12 @@
1
+
//! Test that no series of bytes received over the wire/connections created/payments sent can
2
+
//! result in a crash. We do this by standing up a node and then reading bytes from input to denote
3
+
//! actions such as creating new inbound/outbound connections, bytes to be read from a connection,
4
+
//! or payments to send/ways to handle events generated.
5
+
//! This test has been very useful, though due to its complexity good starting inputs are critical.
6
+
7
+
//Uncomment this for libfuzzer builds:
8
+
//#![no_main]
9
+
1
10
externcrate bitcoin;
2
11
externcrate bitcoin_hashes;
3
12
externcrate lightning;
@@ -9,11 +18,12 @@ use bitcoin::blockdata::script::{Builder, Script};
9
18
use bitcoin::blockdata::opcodes;
10
19
use bitcoin::consensus::encode::deserialize;
11
20
use bitcoin::network::constants::Network;
12
-
use bitcoin::util::hash::{BitcoinHash,Sha256dHash,Hash160};
21
+
use bitcoin::util::hash::{BitcoinHash,Sha256dHash};
13
22
14
23
use bitcoin_hashes::HashasTraitImport;
15
24
use bitcoin_hashes::HashEngineasTraitImportEngine;
16
25
use bitcoin_hashes::sha256::HashasSha256;
26
+
use bitcoin_hashes::hash160::HashasHash160;
17
27
18
28
use lightning::chain::chaininterface::{BroadcasterInterface,ConfirmationTarget,ChainListener,FeeEstimator,ChainWatchInterfaceUtil};
19
29
use lightning::chain::transaction::OutPoint;
@@ -235,7 +245,7 @@ impl KeysInterface for KeyProvider {
235
245
fnget_destination_script(&self) -> Script{
236
246
let secp_ctx = Secp256k1::signing_only();
237
247
let channel_monitor_claim_key = SecretKey::from_slice(&secp_ctx,&hex::decode("0fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff").unwrap()[..]).unwrap();
238
-
let our_channel_monitor_claim_key_hash = Hash160::from_data(&PublicKey::from_secret_key(&secp_ctx,&channel_monitor_claim_key).serialize());
248
+
let our_channel_monitor_claim_key_hash = Hash160::hash(&PublicKey::from_secret_key(&secp_ctx,&channel_monitor_claim_key).serialize());
0 commit comments