Skip to content

Commit

Permalink
Zeroize on Wallet struct (#4624)
Browse files Browse the repository at this point in the history
Co-authored-by: sydhds <[email protected]>
  • Loading branch information
sydhds and sydhds authored Jan 12, 2024
1 parent 4dbac57 commit 96db852
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -200,3 +200,4 @@ tracing-subscriber = "0.3"
unsigned-varint = "0.8"
variant_count = "1.1"
walkdir = "2.3"
zeroize = { version = "1.7", features = ["derive"] }
1 change: 1 addition & 0 deletions massa-wallet/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,4 @@ massa_hash = {workspace = true}
massa_models = {workspace = true}
massa_signature = {workspace = true}
serde_yaml = {workspace = true}
zeroize = { worksapce = true }
5 changes: 4 additions & 1 deletion massa-wallet/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,17 +19,20 @@ use std::collections::hash_map::Entry;
use std::collections::HashSet;
use std::path::PathBuf;
use std::str::FromStr;
use zeroize::{Zeroize, ZeroizeOnDrop};

mod error;

const WALLET_VERSION: u64 = 1;

/// Contains the keypairs created in the wallet.
#[derive(Clone, Debug, Deserialize, Serialize)]
#[derive(Clone, Debug, Deserialize, Serialize, Zeroize, ZeroizeOnDrop)]
pub struct Wallet {
/// Keypairs and addresses
#[zeroize(skip)]
pub keys: PreHashMap<Address, KeyPair>,
/// Path to the file containing the keypairs (encrypted)
#[zeroize(skip)]
wallet_path: PathBuf,
/// Password
password: String,
Expand Down

0 comments on commit 96db852

Please sign in to comment.