feat: v0.1.3
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -2221,7 +2221,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "webauthn-cli"
|
name = "webauthn-cli"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"authenticator",
|
"authenticator",
|
||||||
"base64 0.13.0",
|
"base64 0.13.0",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "webauthn-cli"
|
name = "webauthn-cli"
|
||||||
version = "0.1.2"
|
version = "0.1.3"
|
||||||
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
authors = ["Hatter Jiang <jht5945@gmail.com>"]
|
||||||
edition = "2018"
|
edition = "2018"
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ impl Command for CommandImpl {
|
|||||||
SubCommand::with_name(self.name()).about("YubiKey challenge-response HMAC config")
|
SubCommand::with_name(self.name()).about("YubiKey challenge-response HMAC config")
|
||||||
.arg(Arg::with_name("secret").short("s").long("secret").takes_value(true).help("Secret"))
|
.arg(Arg::with_name("secret").short("s").long("secret").takes_value(true).help("Secret"))
|
||||||
.arg(Arg::with_name("secret-hex").short("x").long("secret-hex").takes_value(true).help("Secret HEX"))
|
.arg(Arg::with_name("secret-hex").short("x").long("secret-hex").takes_value(true).help("Secret HEX"))
|
||||||
|
.arg(Arg::with_name("button-press").long("button-press").help("Require button press"))
|
||||||
.arg(Arg::with_name("yes-config-chall").long("yes-config-chall").help("Config challenge-response key"))
|
.arg(Arg::with_name("yes-config-chall").long("yes-config-chall").help("Config challenge-response key"))
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -45,9 +46,10 @@ impl Command for CommandImpl {
|
|||||||
.set_command(yubico_manager::config::Command::Configuration2);
|
.set_command(yubico_manager::config::Command::Configuration2);
|
||||||
|
|
||||||
let hmac_key: HmacKey = HmacKey::from_slice(&secret_bytes);
|
let hmac_key: HmacKey = HmacKey::from_slice(&secret_bytes);
|
||||||
|
let button_press = sub_arg_matches.is_present("button-press");
|
||||||
|
|
||||||
let mut device_config = DeviceModeConfig::default();
|
let mut device_config = DeviceModeConfig::default();
|
||||||
device_config.challenge_response_hmac(&hmac_key, false, false);
|
device_config.challenge_response_hmac(&hmac_key, false, button_press);
|
||||||
|
|
||||||
if let Err(err) = yubi.write_config(config, &mut device_config) {
|
if let Err(err) = yubi.write_config(config, &mut device_config) {
|
||||||
failure!("Config device failed: {:?}", err);
|
failure!("Config device failed: {:?}", err);
|
||||||
|
|||||||
Reference in New Issue
Block a user