Secp256k1SecretKey in
https://github.com/stratum-mining/stratum/blob/dd64bf1c36ffd219cbc3a54846cde4e97361db6c/roles/stratum-apps/src/key_utils/mod.rs
can leak the inner secrets (Display impl, and Serialize and Deserialize). Key-utils should either be used only as a cli tool to derive keys or modified so that is safer, at least:
- do not derive copy and clone
- expose unsafe_inner_bytes(&self) or better unsafe_inner_bytes(self) but then we need to modify also the noise lib to own the secretes and not get a ref.
- do not implement Display or do in a way that not leak the secret
- zeroies the memory when drop (could still appear in stack traces btw)
Secp256k1SecretKeyinhttps://github.com/stratum-mining/stratum/blob/dd64bf1c36ffd219cbc3a54846cde4e97361db6c/roles/stratum-apps/src/key_utils/mod.rs
can leak the inner secrets (Display impl, and Serialize and Deserialize). Key-utils should either be used only as a cli tool to derive keys or modified so that is safer, at least: