-
Notifications
You must be signed in to change notification settings - Fork 411
Add a method to get session secret for onion packet to KeysInterface #260
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Nice, looks good, need to get implemented in full_stack_target, though. |
oops. fixed. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please squash commits so we dont have intermediary commits that don't build.
src/chain/keysinterface.rs
Outdated
|
||
fn get_session_key(&self) -> SecretKey { | ||
let child_ix = self.session_child_index.fetch_add(1, Ordering::AcqRel); | ||
self.session_master_key.ckd_priv(&self.secp_ctx, ChildNumber::from_hardened_idx(child_ix as u32)).expect("Your RNG is busted").secret_key |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, sorry, this isnt sufficient as it'll wrap back to 0 on restart and we'll re-use session keys. Can you hash in the timestamp like we do for channel keys? I'm not too worried about needing extra rng output, here, though.
@@ -265,6 +265,10 @@ 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() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oops, please avoid changing the keys used in things in the fuzz targets. You can just take TheBlueMatt@5a82977, I think.
d0bc6c3
to
ca183cf
Compare
updated. not sure ...expect("RNG is busted") is correct things to print out |
Looks good, sans the compile error that broke travis. |
ca183cf
to
7e59e1e
Compare
per
#243 (comment)