diff --git a/secretstore/Cargo.toml b/secretstore/Cargo.toml index e952f88..c83d6ae 100644 --- a/secretstore/Cargo.toml +++ b/secretstore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "secretstore" -version = "1.1.0" +version = "1.1.1" description = "Store a secret (such as a private key) in an encrypted file" license = "MIT" edition = "2021" @@ -18,3 +18,6 @@ rand = "0.9.0" rand_core = { version = "0.6.4", features = ["getrandom"] } scrypt = "0.11.0" zeroize = "1.8.1" +# password-hash 0.5.0 -> ^1; 1.7.3 is 1.81, 1.8.3 is 1.85 +base64ct = "=1.7.3" + diff --git a/secretstore/src/secretstore.rs b/secretstore/src/secretstore.rs index 6f824f7..839d8cb 100644 --- a/secretstore/src/secretstore.rs +++ b/secretstore/src/secretstore.rs @@ -136,7 +136,7 @@ impl SecretStore { &self, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { let file_exists = fs::exists(path_for_secret_file).map_err(|e| { format!( @@ -163,7 +163,7 @@ impl SecretStore { // Create contents let encrypted_payload = - self.assemble_encrypted_payload(encryption_password, allow_weak_password)?; + self.assemble_encrypted_payload(encryption_password, options)?; // Set restricted permissions #[cfg(feature = "unixfilepermissions")] @@ -203,7 +203,7 @@ impl SecretStore { pub fn assemble_encrypted_payload( &self, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result, String> { let mut encrypted = self.scrambled_secret_data.clone(); let _res = encrypt_scrambled_secret_data( @@ -212,7 +212,7 @@ impl SecretStore { self.encryption_version, encryption_password, &self.encryption_aux_data, - allow_weak_password.unwrap_or_default().allow_weak_password, + options.unwrap_or_default().allow_weak_password, )?; assemble_payload( self.format_version, @@ -310,12 +310,12 @@ impl SecretStoreCreator { secretstore: &SecretStore, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { secretstore.write_to_file( path_for_secret_file, encryption_password, - allow_weak_password, + options, ) } } diff --git a/seedstore-tool/Cargo.toml b/seedstore-tool/Cargo.toml index 8b280e2..87490b3 100644 --- a/seedstore-tool/Cargo.toml +++ b/seedstore-tool/Cargo.toml @@ -1,10 +1,10 @@ [package] name = "seedstore-tool" -version = "1.1.0" +version = "1.1.1" description = "Store a secret (such as a private key) in an encrypted file" license = "MIT" edition = "2021" [dependencies] bip39 = "2.1.0" -seedstore = { version = "1.1.0", path = "../seedstore", features = ["toolhelper"] } +seedstore = { path = "../seedstore", features = ["toolhelper"] } diff --git a/seedstore/Cargo.toml b/seedstore/Cargo.toml index 966c7de..109ac64 100644 --- a/seedstore/Cargo.toml +++ b/seedstore/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "seedstore" -version = "1.1.0" +version = "1.1.1" description = "Store bitcoin secret material (BIP39 mnemonic entropy, or similar) in an encrypted file" license = "MIT" edition = "2021" @@ -16,7 +16,7 @@ toolhelper = ["rpassword"] bip39 = { version = "2.1.0", features = ["zeroize"] } bitcoin = "0.32.5" rpassword = { version = "7.4.0", optional = true } -secretstore = { version = "1.1.0", path = "../secretstore" } +secretstore = { path = "../secretstore" } zeroize = "1.8.1" [dev-dependencies] diff --git a/seedstore/src/keystore.rs b/seedstore/src/keystore.rs index 403e581..ee2d833 100644 --- a/seedstore/src/keystore.rs +++ b/seedstore/src/keystore.rs @@ -114,13 +114,13 @@ impl KeyStore { &self, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { SecretStoreCreator::write_to_file( &self.secretstore, path_for_secret_file, encryption_password, - allow_weak_password, + options, ) } @@ -205,12 +205,12 @@ impl KeyStoreCreator { seedstore: &KeyStore, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { seedstore.write_to_file( path_for_secret_file, encryption_password, - allow_weak_password, + options, ) } } diff --git a/seedstore/src/seedstore.rs b/seedstore/src/seedstore.rs index 74b3a9c..9f36451 100644 --- a/seedstore/src/seedstore.rs +++ b/seedstore/src/seedstore.rs @@ -114,13 +114,13 @@ impl SeedStore { &self, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { SecretStoreCreator::write_to_file( &self.secretstore, path_for_secret_file, encryption_password, - allow_weak_password, + options, ) } @@ -423,12 +423,12 @@ impl SeedStoreCreator { seedstore: &SeedStore, path_for_secret_file: &str, encryption_password: &str, - allow_weak_password: Option, + options: Option, ) -> Result<(), String> { seedstore.write_to_file( path_for_secret_file, encryption_password, - allow_weak_password, + options, ) } }