diff --git a/CHANGELOG.md b/CHANGELOG.md index 1b596ff61..becfabc7c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -41,6 +41,9 @@ At the moment this project **does not** adhere to - Additional `hash` field in `/sign_tx` JSON body indicates which hashing algorithm to use for signing ([#553](https://github.com/entropyxyz/entropy-core/pull/553)) - Additive aux data ([#577](https://github.com/entropyxyz/entropy-core/pull/577)) +### Fixed +- Fix inconsistency between interactive and file based passwords ([#589](https://github.com/entropyxyz/entropy-core/pull/589)) + ### Removed - Remove pallet-helpers ([#581](https://github.com/entropyxyz/entropy-core/pull/581/)) diff --git a/Cargo.lock b/Cargo.lock index 2a63feef4..edd3d7042 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2534,7 +2534,7 @@ dependencies = [ "entropy-protocol", "hex", "rand 0.8.5", - "rpassword 5.0.1", + "rpassword", "scrypt", "serde", "serial_test 0.6.0", @@ -8318,23 +8318,13 @@ dependencies = [ [[package]] name = "rpassword" -version = "5.0.1" +version = "7.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffc936cf8a7ea60c58f030fd36a612a48f440610214dc54bc36431f9ea0c3efb" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "rpassword" -version = "7.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6678cf63ab3491898c0d021b493c94c9b221d91295294a2a5746eacbe5928322" +checksum = "80472be3c897911d0137b2d2b9055faf6eeac5b14e324073d83bc17b191d7e3f" dependencies = [ "libc", "rtoolbox", - "winapi", + "windows-sys 0.48.0", ] [[package]] @@ -8734,7 +8724,7 @@ dependencies = [ "parity-scale-codec", "rand 0.8.5", "regex", - "rpassword 7.2.0", + "rpassword", "sc-client-api", "sc-client-db", "sc-keystore", diff --git a/crates/kvdb/Cargo.toml b/crates/kvdb/Cargo.toml index 4ac0f1bcc..74b88896b 100644 --- a/crates/kvdb/Cargo.toml +++ b/crates/kvdb/Cargo.toml @@ -19,7 +19,7 @@ sp-core={ version="21.0.0", default-features=false } # Crypto zeroize ={ version="1.4", features=["zeroize_derive"], default-features=false } -rpassword ={ version="5.0", default-features=false } +rpassword ={ version="7.3.1", default-features=false } scrypt ={ version="0.11.0", default-features=false, features=["std"] } chacha20poly1305={ version="0.9", features=["alloc"], default-features=false } synedrion ="0.1" diff --git a/crates/threshold-signature-server/src/helpers/launch.rs b/crates/threshold-signature-server/src/helpers/launch.rs index fddf637f3..28c5e81fe 100644 --- a/crates/threshold-signature-server/src/helpers/launch.rs +++ b/crates/threshold-signature-server/src/helpers/launch.rs @@ -96,8 +96,10 @@ pub async fn load_kv_store( }; let password = if let Some(password_path) = password_path { - String::from_utf8(fs::read(password_path).expect("error reading password file")) + std::str::from_utf8(&fs::read(password_path).expect("error reading password file")) .expect("failed to convert password to string") + .trim() + .to_string() .into() } else { PasswordMethod::Prompt.execute().unwrap()