Skip to content

Conversation

@tarcieri
Copy link
Member

RsaPrivateKey self-zeroizes on drop, so add the ZeroizeOnDrop marker trait to RsaPrivateKey and all newtypes thereof, i.e. DecryptingKey and SigningKey for the various padding modes.

This also removes the Zeroize impl on RsaPrivateKey, since it self-zeroizes on Drop, and allowing Zeroize might accidentally permit use-after-zeroize vulnerabilities.

Closes #285.

`RsaPrivateKey` self-zeroizes on drop, so add the `ZeroizeOnDrop` marker
trait to `RsaPrivateKey` and all newtypes thereof, i.e. `DecryptingKey`
and `SigningKey` for the various padding modes.

This also removes the `Zeroize` impl on `RsaPrivateKey`, since it
self-zeroizes on `Drop`, and allowing `Zeroize` might accidentally
permit use-after-zeroize vulnerabilities.
@tarcieri tarcieri merged commit 78ea9cb into master Apr 26, 2023
@tarcieri tarcieri deleted the zeroize-on-drop branch April 26, 2023 16:39
@tarcieri tarcieri mentioned this pull request Apr 27, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pkcs1v15::SigningKey and pkcs1v15::DecryptingKey should implement Zeroize and Drop

2 participants