diff --git a/CHANGELOG.md b/CHANGELOG.md index 89f83b2..0e53702 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,7 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 [Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.6.0-rc.1...HEAD -- +- Rename `authenticator_config` to `config`. ## [0.6.0-rc.1] 2026-05-21 diff --git a/src/arbitrary.rs b/src/arbitrary.rs index ae04757..25e6561 100644 --- a/src/arbitrary.rs +++ b/src/arbitrary.rs @@ -322,7 +322,7 @@ impl<'a> Arbitrary<'a> for ctap2::make_credential::ExtensionsInput<'a> { } // cannot be derived because of missing impl for Vec<&'a str, N> (rp ID list). -impl<'a> Arbitrary<'a> for ctap2::authenticator_config::SubcommandParameters<'a> { +impl<'a> Arbitrary<'a> for ctap2::config::SubcommandParameters<'a> { fn arbitrary(u: &mut Unstructured<'a>) -> Result { let new_min_pin_length = u.arbitrary()?; let min_pin_length_rp_ids = arbitrary_option(u, arbitrary_vec)?; @@ -337,7 +337,7 @@ impl<'a> Arbitrary<'a> for ctap2::authenticator_config::SubcommandParameters<'a> // cannot be derived because of missing impl for &'a serde_bytes::Bytes (pin_auth) // + Vec<_> in SubcommandParameters. -impl<'a> Arbitrary<'a> for ctap2::authenticator_config::Request<'a> { +impl<'a> Arbitrary<'a> for ctap2::config::Request<'a> { fn arbitrary(u: &mut Unstructured<'a>) -> Result { let sub_command = u.arbitrary()?; let sub_command_params = u.arbitrary()?; diff --git a/src/ctap2.rs b/src/ctap2.rs index ddf32e8..ae1fbf1 100644 --- a/src/ctap2.rs +++ b/src/ctap2.rs @@ -11,8 +11,8 @@ use crate::{sizes::*, Bytes, TryFromStrError}; pub use crate::operation::{Operation, VendorOperation}; -pub mod authenticator_config; pub mod client_pin; +pub mod config; pub mod credential_management; pub mod get_assertion; pub mod get_info; @@ -47,7 +47,7 @@ pub enum Request<'a> { // 0xC LargeBlobs(large_blobs::Request<'a>), // 0xD - AuthenticatorConfig(authenticator_config::Request<'a>), + Config(config::Request<'a>), // vendor, to be embellished // Q: how to handle the associated CBOR structures Vendor(crate::operation::VendorOperation), @@ -121,9 +121,9 @@ impl<'a> Request<'a> { Request::LargeBlobs(cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?) } - Operation::Config => Request::AuthenticatorConfig( - cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?, - ), + Operation::Config => { + Request::Config(cbor_deserialize(data).map_err(CtapMappingError::ParsingError)?) + } // NB: FIDO Alliance "stole" 0x40 and 0x41, so these are not available Operation::Vendor(vendor_operation) => Request::Vendor(vendor_operation), @@ -150,7 +150,7 @@ pub enum Response { Selection, CredentialManagement(credential_management::Response), LargeBlobs(large_blobs::Response), - AuthenticatorConfig, + Config, // Q: how to handle the associated CBOR structures Vendor, } @@ -169,7 +169,7 @@ impl Response { GetAssertion(response) | GetNextAssertion(response) => cbor_serialize(response, data), CredentialManagement(response) => cbor_serialize(response, data), LargeBlobs(response) => cbor_serialize(response, data), - Reset | Selection | AuthenticatorConfig | Vendor => Ok([].as_slice()), + Reset | Selection | Config | Vendor => Ok([].as_slice()), }; if let Ok(slice) = outcome { *status = 0; @@ -453,7 +453,7 @@ pub trait Authenticator { Err(Error::InvalidCommand) } - fn authenticator_config(&mut self, request: &authenticator_config::Request) -> Result<()> { + fn config(&mut self, request: &config::Request) -> Result<()> { let _ = request; Err(Error::InvalidCommand) } @@ -547,12 +547,12 @@ pub trait Authenticator { } // 0xD - Request::AuthenticatorConfig(request) => { + Request::Config(request) => { debug_now!("CTAP2.CFG"); - self.authenticator_config(request).inspect_err(|_e| { + self.config(request).inspect_err(|_e| { debug!("error: {:?}", _e); })?; - Ok(Response::AuthenticatorConfig) + Ok(Response::Config) } // Not stable diff --git a/src/ctap2/authenticator_config.rs b/src/ctap2/config.rs similarity index 100% rename from src/ctap2/authenticator_config.rs rename to src/ctap2/config.rs