From 5a829777a67bd5d3c09ae4c5e6ef2cf81c88c6af Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Mon, 26 Nov 2018 12:33:53 -0500 Subject: [PATCH] f --- fuzz/fuzz_targets/full_stack_target.rs | 6 ++++-- src/util/mod.rs | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) 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; -- 2.39.5