Ask for the password even if stdin is not connected to the TTY.
- As we prompt on the TTY, we can do that even if stdin is not
connected to it.
- Reverts f3cfb1b602
.
- Fixes #167.
This commit is contained in:
parent
1b4761a045
commit
fc3e4e046e
@ -7,7 +7,6 @@
|
|||||||
#![doc = include_str!(concat!(env!("OUT_DIR"), "/sq-usage.md"))]
|
#![doc = include_str!(concat!(env!("OUT_DIR"), "/sq-usage.md"))]
|
||||||
|
|
||||||
use anyhow::Context as _;
|
use anyhow::Context as _;
|
||||||
use is_terminal::IsTerminal;
|
|
||||||
|
|
||||||
use std::borrow::Borrow;
|
use std::borrow::Borrow;
|
||||||
use std::cell::OnceCell;
|
use std::cell::OnceCell;
|
||||||
@ -271,7 +270,6 @@ fn decrypt_key<R>(key: Key<key::SecretParts, R>, passwords: &mut Vec<Password>)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if std::io::stdin().is_terminal() {
|
|
||||||
loop {
|
loop {
|
||||||
// Prompt the user.
|
// Prompt the user.
|
||||||
match common::password::prompt_to_unlock_or_cancel(&format!(
|
match common::password::prompt_to_unlock_or_cancel(&format!(
|
||||||
@ -295,7 +293,6 @@ fn decrypt_key<R>(key: Key<key::SecretParts, R>, passwords: &mut Vec<Password>)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
Err(anyhow::anyhow!("Key {}: Unable to decrypt secret key material",
|
Err(anyhow::anyhow!("Key {}: Unable to decrypt secret key material",
|
||||||
key.keyid().to_hex()))
|
key.keyid().to_hex()))
|
||||||
|
Loading…
Reference in New Issue
Block a user