Skip to content

Commit

Permalink
chore: update zeroizing (#6323)
Browse files Browse the repository at this point in the history
Description
---
Cleans up zeroizing.

Motivation and Context
---
The codebase has included instances of the `#[zeroize(drop)]` attribute,
which is deprecated. This PR replaces the last such instance with the
more modern `ZeroizeOnDrop` derive macro.

How Has This Been Tested?
---
Existing tests pass.

What process can a PR reviewer use to test or verify this change?
---
Not much to check here!
  • Loading branch information
AaronFeickert committed May 7, 2024
1 parent be84910 commit d5a4258
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions comms/core/src/tor/control_client/types.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
use std::{fmt, net::SocketAddr};

use serde_derive::{Deserialize, Serialize};
use zeroize::Zeroize;
use zeroize::{Zeroize, ZeroizeOnDrop};

#[derive(Clone, Copy, Debug)]
pub enum KeyType {
Expand Down Expand Up @@ -79,8 +79,7 @@ impl fmt::Display for KeyBlob<'_> {
}
}

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Zeroize)]
#[zeroize(drop)]
#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize, Zeroize, ZeroizeOnDrop)]
pub enum PrivateKey {
/// The server should use the 1024 bit RSA key provided in as KeyBlob (v2).
Rsa1024(String),
Expand Down

0 comments on commit d5a4258

Please sign in to comment.