Formatting
This commit is contained in:
@@ -19,11 +19,13 @@ extern crate lang_items;
|
|||||||
use arrayref::array_ref;
|
use arrayref::array_ref;
|
||||||
use core::convert::TryFrom;
|
use core::convert::TryFrom;
|
||||||
use crypto::rng256::ThreadRng256;
|
use crypto::rng256::ThreadRng256;
|
||||||
use ctap2::ctap::command::{ AuthenticatorMakeCredentialParameters,
|
use ctap2::ctap::command::{
|
||||||
AuthenticatorGetAssertionParameters, AuthenticatorClientPinParameters};
|
AuthenticatorClientPinParameters, AuthenticatorGetAssertionParameters,
|
||||||
|
AuthenticatorMakeCredentialParameters,
|
||||||
|
};
|
||||||
use ctap2::ctap::hid::receive::MessageAssembler;
|
use ctap2::ctap::hid::receive::MessageAssembler;
|
||||||
use ctap2::ctap::hid::send::HidPacketIterator;
|
use ctap2::ctap::hid::send::HidPacketIterator;
|
||||||
use ctap2::ctap::hid::{HidPacket, ChannelID, CtapHid, Message};
|
use ctap2::ctap::hid::{ChannelID, CtapHid, HidPacket, Message};
|
||||||
use ctap2::ctap::status_code::Ctap2StatusCode;
|
use ctap2::ctap::status_code::Ctap2StatusCode;
|
||||||
use ctap2::ctap::CtapState;
|
use ctap2::ctap::CtapState;
|
||||||
use libtock_drivers::timer::{ClockValue, Timestamp};
|
use libtock_drivers::timer::{ClockValue, Timestamp};
|
||||||
@@ -97,20 +99,18 @@ fn is_type(data: &[u8], input_type: InputType) -> bool {
|
|||||||
}
|
}
|
||||||
match cbor::read(data) {
|
match cbor::read(data) {
|
||||||
Err(_) => false,
|
Err(_) => false,
|
||||||
Ok(decoded_cbor) => {
|
Ok(decoded_cbor) => match input_type {
|
||||||
match input_type {
|
InputType::CborMakeCredentialParameter => {
|
||||||
InputType::CborMakeCredentialParameter => {
|
AuthenticatorMakeCredentialParameters::try_from(decoded_cbor).is_ok()
|
||||||
AuthenticatorMakeCredentialParameters::try_from(decoded_cbor).is_ok()
|
|
||||||
}
|
|
||||||
InputType::CborGetAssertionParameter => {
|
|
||||||
AuthenticatorGetAssertionParameters::try_from(decoded_cbor).is_ok()
|
|
||||||
}
|
|
||||||
InputType::CborClientPinParameter => {
|
|
||||||
AuthenticatorClientPinParameters::try_from(decoded_cbor).is_ok()
|
|
||||||
}
|
|
||||||
_ => true
|
|
||||||
}
|
}
|
||||||
}
|
InputType::CborGetAssertionParameter => {
|
||||||
|
AuthenticatorGetAssertionParameters::try_from(decoded_cbor).is_ok()
|
||||||
|
}
|
||||||
|
InputType::CborClientPinParameter => {
|
||||||
|
AuthenticatorClientPinParameters::try_from(decoded_cbor).is_ok()
|
||||||
|
}
|
||||||
|
_ => true,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user