auto_credential -> generate_credential
This commit is contained in:
parent
d8aca91136
commit
543198a5fe
@ -315,11 +315,11 @@ pub fn run_cli() -> Fido2LuksResult<()> {
|
|||||||
match &args.command {
|
match &args.command {
|
||||||
Command::AddKey {
|
Command::AddKey {
|
||||||
exclusive,
|
exclusive,
|
||||||
auto_credential,
|
generate_credential,
|
||||||
..
|
..
|
||||||
} => {
|
} => {
|
||||||
let (existing_secret, _) = other_secret("Current password", false)?;
|
let (existing_secret, _) = other_secret("Current password", false)?;
|
||||||
let (new_secret, cred) = if *auto_credential && luks2 {
|
let (new_secret, cred) = if *generate_credential && luks2 {
|
||||||
let cred = make_credential_id(
|
let cred = make_credential_id(
|
||||||
Some(derive_credential_name(luks.device.as_path()).as_str()),
|
Some(derive_credential_name(luks.device.as_path()).as_str()),
|
||||||
(if authenticator.pin && may_require_pin()? {
|
(if authenticator.pin && may_require_pin()? {
|
||||||
@ -348,7 +348,7 @@ pub fn run_cli() -> Fido2LuksResult<()> {
|
|||||||
&existing_secret[..],
|
&existing_secret[..],
|
||||||
luks_mod.kdf_time.or(Some(10)),
|
luks_mod.kdf_time.or(Some(10)),
|
||||||
Some(&cred.id[..])
|
Some(&cred.id[..])
|
||||||
.filter(|_| !luks.disable_token || *auto_credential)
|
.filter(|_| !luks.disable_token || *generate_credential)
|
||||||
.filter(|_| luks2),
|
.filter(|_| luks2),
|
||||||
)?;
|
)?;
|
||||||
if *exclusive {
|
if *exclusive {
|
||||||
|
@ -197,8 +197,8 @@ pub enum Command {
|
|||||||
#[structopt(short = "e", long = "exclusive")]
|
#[structopt(short = "e", long = "exclusive")]
|
||||||
exclusive: bool,
|
exclusive: bool,
|
||||||
/// Will generate an credential while adding a new key to this LUKS device if supported
|
/// Will generate an credential while adding a new key to this LUKS device if supported
|
||||||
#[structopt(short = "a", long = "auto-cred")]
|
#[structopt(short = "g", long = "gen-cred")]
|
||||||
auto_credential: bool,
|
generate_credential: bool,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
existing_secret: OtherSecret,
|
existing_secret: OtherSecret,
|
||||||
#[structopt(flatten)]
|
#[structopt(flatten)]
|
||||||
|
Loading…
x
Reference in New Issue
Block a user