From 5496c4e61b211206c6fbd90e50e41cf490a5da3e Mon Sep 17 00:00:00 2001 From: shimun Date: Wed, 14 Jul 2021 15:44:58 +0200 Subject: [PATCH] always set credential name --- Cargo.lock | 2 +- Cargo.toml | 2 +- src/cli.rs | 2 +- src/cli_args/mod.rs | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f3060d0..c836f13 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -377,7 +377,7 @@ dependencies = [ [[package]] name = "fido2luks" -version = "0.2.17" +version = "0.2.18" dependencies = [ "ctap_hmac", "failure", diff --git a/Cargo.toml b/Cargo.toml index 24d4598..7e885b2 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "fido2luks" -version = "0.2.17" +version = "0.2.18" authors = ["shimunn "] edition = "2018" diff --git a/src/cli.rs b/src/cli.rs index 5b248f4..02c4434 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -93,7 +93,7 @@ pub fn run_cli() -> Fido2LuksResult<()> { } else { None }; - let cred = make_credential_id(name.as_ref().map(|n| n.as_ref()), pin)?; + let cred = make_credential_id(Some(name.as_ref()), pin)?; println!("{}", hex::encode(&cred.id)); Ok(()) } diff --git a/src/cli_args/mod.rs b/src/cli_args/mod.rs index b02799f..048ae33 100644 --- a/src/cli_args/mod.rs +++ b/src/cli_args/mod.rs @@ -236,9 +236,9 @@ pub enum Command { Credential { #[structopt(flatten)] authenticator: AuthenticatorParameters, - /// Name to be displayed on the authenticator if it has a display - #[structopt(env = "FIDO2LUKS_CREDENTIAL_NAME")] - name: Option, + /// Name to be displayed on the authenticator display + #[structopt(env = "FIDO2LUKS_CREDENTIAL_NAME", default_value = "fido2luks")] + name: String, }, /// Check if an authenticator is connected #[structopt(name = "connected")]