RustCrypto / RSA

RSA implementation in pure Rust
Apache License 2.0
550 stars 153 forks source link

Impl `ZeroizeOnDrop` for `RsaPrivateKey`+newtypes #311

Closed tarcieri closed 1 year ago

tarcieri commented 1 year ago

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.