From 999c96d3c59d7485a660fcfb8782686edbe5406b Mon Sep 17 00:00:00 2001 From: Nick Zana Date: Tue, 16 May 2023 18:49:25 -0400 Subject: [PATCH] ctap2-proto: Add CTAP Command enum Adds ctap2_proto::Command enum to represent the CTAP command codes for the authenticator commands. --- crates/ctap2-proto/src/lib.rs | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/crates/ctap2-proto/src/lib.rs b/crates/ctap2-proto/src/lib.rs index 842d3d6..11d56db 100644 --- a/crates/ctap2-proto/src/lib.rs +++ b/crates/ctap2-proto/src/lib.rs @@ -6,7 +6,7 @@ pub mod prelude { credential::{make, management}, device, reset, selection, }, - Ctap2_2Authenticator, + Command, Ctap2_2Authenticator, }; pub use fido_common::Sha256Hash; } @@ -73,3 +73,20 @@ pub trait Ctap2_2Authenticator { // fn authenticator_config(request: config::Request) -> Result<(), // config::Error>; } + +#[repr(u8)] +pub enum Command { + AuthenticatorMakeCredential = 0x01, + AuthenticatorGetAssertion = 0x02, + AuthenticatorGetNextAssertion = 0x08, + AuthenticatorGetInfo = 0x04, + AuthenticatorClientPin = 0x06, + AuthenticatorReset = 0x07, + AuthenticatorBioEnrollment = 0x09, + AuthenticatorCredentialManagement = 0x0A, + AuthenticatorSelection = 0x0B, + AuthenticatorLargeBlobs = 0x0C, + AuthenticatorConfig = 0x0D, + PrototypeAuthenticatorBioEnrollment = 0x40, + PrototypeAuthenticatorCredentialmanagement = 0x41, +}