Corrected security relevant bug
This commit is contained in:
parent
8c0fe153be
commit
c10a68bd43
3 changed files with 11 additions and 12 deletions
|
|
@ -17,14 +17,15 @@ pub struct DhKeyPair {
|
|||
|
||||
impl Drop for DhKeyPair {
|
||||
fn drop(&mut self) {
|
||||
core::mem::drop(&mut self.private_key);
|
||||
core::mem::drop(&mut self.public_key);
|
||||
self.private_key = SecretKey::random(&mut OsRng);
|
||||
self.public_key = self.private_key.public_key();
|
||||
}
|
||||
}
|
||||
|
||||
impl Zeroize for DhKeyPair {
|
||||
fn zeroize(&mut self) {
|
||||
core::mem::drop(self);
|
||||
self.private_key = SecretKey::random(&mut OsRng);
|
||||
self.public_key = self.private_key.public_key();
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue