implements the AuthenticatorSelection command
This commit is contained in:
@@ -37,6 +37,8 @@ pub enum Command {
|
||||
AuthenticatorClientPin(AuthenticatorClientPinParameters),
|
||||
AuthenticatorReset,
|
||||
AuthenticatorGetNextAssertion,
|
||||
#[cfg(feature = "with_ctap2_1")]
|
||||
AuthenticatorSelection,
|
||||
// TODO(kaczmarczyck) implement FIDO 2.1 commands (see below consts)
|
||||
}
|
||||
|
||||
@@ -101,6 +103,11 @@ impl Command {
|
||||
// Parameters are ignored.
|
||||
Ok(Command::AuthenticatorGetNextAssertion)
|
||||
}
|
||||
#[cfg(feature = "with_ctap2_1")]
|
||||
Command::AUTHENTICATOR_SELECTION => {
|
||||
// Parameters are ignored.
|
||||
Ok(Command::AuthenticatorSelection)
|
||||
}
|
||||
_ => Err(Ctap2StatusCode::CTAP1_ERR_INVALID_COMMAND),
|
||||
}
|
||||
}
|
||||
@@ -484,4 +491,12 @@ mod test {
|
||||
let command = Command::deserialize(&cbor_bytes);
|
||||
assert_eq!(command, Ok(Command::AuthenticatorGetNextAssertion));
|
||||
}
|
||||
|
||||
#[cfg(feature = "with_ctap2_1")]
|
||||
#[test]
|
||||
fn test_deserialize_selection() {
|
||||
let cbor_bytes = [Command::AUTHENTICATOR_SELECTION];
|
||||
let command = Command::deserialize(&cbor_bytes);
|
||||
assert_eq!(command, Ok(Command::AuthenticatorSelection));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user