From: Matt Corallo Date: Mon, 26 Nov 2018 17:33:53 +0000 (-0500) Subject: f X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=refs%2Fheads%2F260-fuzz-change;p=rust-lightning f --- diff --git a/fuzz/fuzz_targets/full_stack_target.rs b/fuzz/fuzz_targets/full_stack_target.rs index 199307cc8..354625604 100644 --- a/fuzz/fuzz_targets/full_stack_target.rs +++ b/fuzz/fuzz_targets/full_stack_target.rs @@ -21,7 +21,7 @@ use lightning::ln::channelmanager::{ChannelManager, PaymentFailReason}; use lightning::ln::peer_handler::{MessageHandler,PeerManager,SocketDescriptor}; use lightning::ln::router::Router; use lightning::util::events::{EventsProvider,Event}; -use lightning::util::reset_rng_state; +use lightning::util::{reset_rng_state, fill_bytes}; use lightning::util::logger::Logger; use lightning::util::sha2::Sha256; use lightning::util::config::UserConfig; @@ -267,7 +267,9 @@ impl KeysInterface for KeyProvider { } fn get_session_key(&self) -> SecretKey { - SecretKey::from_slice(&Secp256k1::without_caps(), &[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]).unwrap() + let mut session_key = [0; 32]; + fill_bytes(&mut session_key); + SecretKey::from_slice(&Secp256k1::without_caps(), &session_key).unwrap() } } diff --git a/src/util/mod.rs b/src/util/mod.rs index 842fbea60..3df1529e0 100644 --- a/src/util/mod.rs +++ b/src/util/mod.rs @@ -25,7 +25,7 @@ pub mod sha2; pub(crate) mod sha2; #[cfg(feature = "fuzztarget")] -pub use self::rng::reset_rng_state; +pub use self::rng::{reset_rng_state, fill_bytes}; #[cfg(test)] pub(crate) mod test_utils;