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

This commit is contained in:
shimun 2021-02-07 11:09:49 +01:00
parent b0404f2fc1
commit dc55edff4d
Signed by: shimun
GPG Key ID: E81D8382DC2F971B
3 changed files with 6 additions and 6 deletions

2
Cargo.lock generated
View File

@ -377,7 +377,7 @@ dependencies = [
[[package]] [[package]]
name = "fido2luks" name = "fido2luks"
version = "0.2.15" version = "0.2.16"
dependencies = [ dependencies = [
"ctap_hmac", "ctap_hmac",
"failure", "failure",

View File

@ -1,6 +1,6 @@
[package] [package]
name = "fido2luks" name = "fido2luks"
version = "0.2.15" version = "0.2.16"
authors = ["shimunn <shimun@shimun.net>"] authors = ["shimunn <shimun@shimun.net>"]
edition = "2018" edition = "2018"

View File

@ -177,10 +177,10 @@ pub fn run_cli() -> Fido2LuksResult<()> {
)), )),
} }
}; };
let secret = |verify: bool| -> Fido2LuksResult<([u8; 32], FidoCredential)> { let secret = |q: &str, verify: bool| -> Fido2LuksResult<([u8; 32], FidoCredential)> {
derive_secret( derive_secret(
&credentials.ids.0, &credentials.ids.0,
&salt("Password", verify)?, &salt(q, verify)?,
authenticator.await_time, authenticator.await_time,
pin.as_deref(), pin.as_deref(),
) )
@ -190,7 +190,7 @@ pub fn run_cli() -> Fido2LuksResult<()> {
match &args.command { match &args.command {
Command::AddKey { exclusive, .. } => { Command::AddKey { exclusive, .. } => {
let (existing_secret, _) = other_secret("Current password", false)?; let (existing_secret, _) = other_secret("Current password", false)?;
let (new_secret, cred) = secret(true)?; let (new_secret, cred) = secret("Password to be added", true)?;
let added_slot = luks_dev.add_key( let added_slot = luks_dev.add_key(
&new_secret, &new_secret,
&existing_secret[..], &existing_secret[..],
@ -215,7 +215,7 @@ pub fn run_cli() -> Fido2LuksResult<()> {
Ok(()) Ok(())
} }
Command::ReplaceKey { add_password, .. } => { Command::ReplaceKey { add_password, .. } => {
let (existing_secret, _) = secret(false)?; let (existing_secret, _) = secret("Current password", false)?;
let (replacement_secret, cred) = other_secret("Replacement password", true)?; let (replacement_secret, cred) = other_secret("Replacement password", true)?;
let slot = if *add_password { let slot = if *add_password {
luks_dev.add_key( luks_dev.add_key(