|
|
|
@ -87,14 +87,14 @@ impl MPS {
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
fn prompt_new_password() -> io::Result<String> { |
|
|
|
|
print!("Enter passphrase for storage: "); |
|
|
|
|
print!("Enter passphrase: "); |
|
|
|
|
io::stdout().flush()?; |
|
|
|
|
let ps = rpassword::read_password()?; |
|
|
|
|
if ps.len() < 8 { |
|
|
|
|
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Passphrase must be longet that 8 letters")); |
|
|
|
|
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Passphrase must be longer that 8 letters")); |
|
|
|
|
} |
|
|
|
|
if ps.len() > 32 { |
|
|
|
|
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Passphrase must be shorted that 32 letters")); |
|
|
|
|
return Err(io::Error::new(io::ErrorKind::InvalidInput, "Passphrase must not be longer than 32 letters")); |
|
|
|
|
} |
|
|
|
|
print!("Reenter passphrase: "); |
|
|
|
|
io::stdout().flush()?; |
|
|
|
|