hide password
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2019-09-17 19:01:56 +02:00
parent 06a1342cd5
commit 40bf047528
3 changed files with 14 additions and 3 deletions

View File

@@ -88,9 +88,9 @@ pub fn add_key_to_luks(conf: &Config) -> Fido2LuksResult<u8> {
luks::open(&conf.device.canonicalize()?)
};
let prev_key_info = ask_str(
let prev_key_info = rpassword::read_password_from_tty(Some(
"Please enter your current password or path to a keyfile in order to add a new key: ",
)?;
))?;
let prev_key = match prev_key_info.as_ref() {
"" => None,
@@ -119,7 +119,6 @@ pub fn add_key_to_luks(conf: &Config) -> Fido2LuksResult<u8> {
assemble_secret(&perform_challenge(&conf.credential_id, &salt)?, &salt)
};
dbg!("Adding key");
let slot = handle.add_keyslot(&secret, prev_key.as_ref().map(|b| b.as_slice()), None)?;
Ok(slot)
}