parent
2d4f9bb25c
commit
3457f9cb43
2 changed files with 11 additions and 0 deletions
|
@ -86,6 +86,11 @@ impl Manifest {
|
|||
|
||||
/// Tells the manifest to keep track of the encryption passkey, and use it for encryption when loading or saving accounts.
|
||||
pub fn submit_passkey(&mut self, passkey: Option<String>) {
|
||||
if let Some(p) = passkey.as_ref() {
|
||||
if p.is_empty() {
|
||||
panic!("Encryption passkey cannot be empty");
|
||||
}
|
||||
}
|
||||
if passkey.is_some() {
|
||||
debug!("passkey was submitted to manifest");
|
||||
} else {
|
||||
|
|
|
@ -641,6 +641,12 @@ fn do_subcmd_encrypt(
|
|||
let mut passkey;
|
||||
loop {
|
||||
passkey = rpassword::prompt_password_stdout("Enter encryption passkey: ").ok();
|
||||
if let Some(p) = passkey.as_ref() {
|
||||
if p.is_empty() {
|
||||
error!("Passkey cannot be empty, try again.");
|
||||
continue;
|
||||
}
|
||||
}
|
||||
let passkey_confirm =
|
||||
rpassword::prompt_password_stdout("Confirm encryption passkey: ").ok();
|
||||
if passkey == passkey_confirm {
|
||||
|
|
Loading…
Reference in a new issue