-
Notifications
You must be signed in to change notification settings - Fork 225
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
Zeroize - make sure it's used were needed, and capture practices #412
Comments
@gww-parity I finally rewrite my notes about secret memory. KeystoreSubstrate key usage looks very well designed, care was taken to isolate signing into a keystore abstraction: see https://github.com/paritytech/substrate/blob/c51455b9ce6901fb1624bcfee22724f7a6f69c6e/client/keystore/src/lib.rs#L329 (
The keystore also store 'ephemeral' secret in heap memory this time.
On this point, if we wanted to change something, I would probably try to put those in SecretString (zeroize them as for the passphrase). Still some function inevitably have to return secrets on stack, those function are currently public. One could consider trying to make them private, but given the big codebase and the multiple use case
host functionsIn primitives/io/src/lib.rs the runtime host functions from crypto interface uses these keystore (with ephemeral key).
One could probably propose to switch the optionall seed parameter to a non optional one. But this does not relate directly with our problematic. Also note that in case someone is using a secret key in runtime memory (except for offchain), this is onchain processing and not a secret. I really start thinking that those host function are more designed for offchain (at least generate one). CC\ @tomusdrw ?
|
\close with paritytech/substrate#6955 merged |
This issues is to capture following two aspects:
The text was updated successfully, but these errors were encountered: