mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-06 20:41:14 +00:00
x: Remove Zeroize impl for secret types (#782)
This commit is contained in:
parent
55e3e00d97
commit
e3c2455f63
2 changed files with 4 additions and 28 deletions
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
Entries are listed in reverse chronological order.
|
||||
|
||||
## Unreleased
|
||||
|
||||
* Remove `Zeroize` impl for `x25519::{EphemeralSecret, ReusableSecret, SharedSecret, StaticSecret}` to prevent misuse. These are now only zeroized on drop.
|
||||
|
||||
# 2.x Series
|
||||
|
||||
* Note: All `x255919-dalek` 2.x releases are in sync with the underlying `curve25519-dalek` 4.x releases.
|
||||
|
|
|
|||
|
|
@ -111,13 +111,6 @@ impl<'a> From<&'a EphemeralSecret> for PublicKey {
|
|||
impl Drop for EphemeralSecret {
|
||||
fn drop(&mut self) {
|
||||
#[cfg(feature = "zeroize")]
|
||||
self.zeroize();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "zeroize")]
|
||||
impl Zeroize for EphemeralSecret {
|
||||
fn zeroize(&mut self) {
|
||||
self.0.zeroize();
|
||||
}
|
||||
}
|
||||
|
|
@ -182,13 +175,6 @@ impl<'a> From<&'a ReusableSecret> for PublicKey {
|
|||
impl Drop for ReusableSecret {
|
||||
fn drop(&mut self) {
|
||||
#[cfg(feature = "zeroize")]
|
||||
self.zeroize();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "reusable_secrets", feature = "zeroize"))]
|
||||
impl Zeroize for ReusableSecret {
|
||||
fn zeroize(&mut self) {
|
||||
self.0.zeroize();
|
||||
}
|
||||
}
|
||||
|
|
@ -279,13 +265,6 @@ impl AsRef<[u8]> for StaticSecret {
|
|||
impl Drop for StaticSecret {
|
||||
fn drop(&mut self) {
|
||||
#[cfg(feature = "zeroize")]
|
||||
self.zeroize();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(all(feature = "static_secrets", feature = "zeroize"))]
|
||||
impl Zeroize for StaticSecret {
|
||||
fn zeroize(&mut self) {
|
||||
self.0.zeroize();
|
||||
}
|
||||
}
|
||||
|
|
@ -362,13 +341,6 @@ impl AsRef<[u8]> for SharedSecret {
|
|||
impl Drop for SharedSecret {
|
||||
fn drop(&mut self) {
|
||||
#[cfg(feature = "zeroize")]
|
||||
self.zeroize();
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(feature = "zeroize")]
|
||||
impl Zeroize for SharedSecret {
|
||||
fn zeroize(&mut self) {
|
||||
self.0.zeroize();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue