fix: prevent creation of rk credential

This commit is contained in:
shimun 2022-06-15 01:16:06 +02:00
parent 1f0d555cea
commit b566af46f7
Signed by: shimun
GPG Key ID: E81D8382DC2F971B
2 changed files with 3 additions and 2 deletions

View File

@ -181,7 +181,8 @@ pub fn run_cli() -> Fido2LuksResult<()> {
} else { } else {
None None
}; };
let cred = make_credential_id(Some(name.as_ref()), pin, &[])?; let cred =
make_credential_id(Some(name.as_str()).filter(|name| name.len() > 0), pin, &[])?;
println!("{}", hex::encode(&cred.id)); println!("{}", hex::encode(&cred.id));
Ok(()) Ok(())
} }

View File

@ -257,7 +257,7 @@ pub enum Command {
#[structopt(flatten)] #[structopt(flatten)]
authenticator: AuthenticatorParameters, authenticator: AuthenticatorParameters,
/// Name to be displayed on the authenticator display /// Name to be displayed on the authenticator display
#[structopt(env = "FIDO2LUKS_CREDENTIAL_NAME", default_value = "fido2luks")] #[structopt(env = "FIDO2LUKS_CREDENTIAL_NAME", default_value = "")]
name: String, name: String,
}, },
/// Check if an authenticator is connected /// Check if an authenticator is connected