Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 17 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,23 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

[Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.6.0-rc.4...HEAD
[Unreleased]: https://github.com/trussed-dev/ctap-types/compare/0.6.0-rc.5...HEAD

-

## [0.6.0-rc.5] 2026-06-08

[0.6.0-rc.5]: https://github.com/trussed-dev/ctap-types/compare/0.6.0-rc.4...0.6.0-rc.5

- Remove unused `Rpc` trait.
- Remove `cbor-smol` re-export as `serde`.
- Make `ctap2::CtapMappingError` private.
- Set `#[repr(u8)]` for `ctap2::Error` and implement `From<ctap2::Error>` for `u8`.
- `ctap2::get_info`: Use `ByteArray<16>` instead of `Bytes<16>` for AAGUID.
- Remove re-exports for `heapless` and `heapless-bytes` as the relevant types are already re-exported.
- `ctap2::get_info`: Use subcommand enum for `authenticator_config_commands`.
- `webauthn`: Make `KnownPublicKeyCredentialParameters` an enum.
- `authenticator`: Move `Authenticator`, `Request` and `Response` to the crate root.

## [0.6.0-rc.4] 2026-06-01

Expand Down
3 changes: 2 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "ctap-types"
version = "0.6.0-rc.4"
version = "0.6.0-rc.5"
authors = ["Nicolas Stalder <n@stalder.io>", "The Trussed developers"]
edition = "2021"
license = "Apache-2.0 OR MIT"
Expand All @@ -27,6 +27,7 @@ ciborium = "0.2"
hex = "0.4"
hex-literal = "0.4.1"
serde_test = "1.0.176"
strum = { version = "0.28", features = ["derive"] }

[features]
std = []
Expand Down
8 changes: 0 additions & 8 deletions src/arbitrary.rs
Original file line number Diff line number Diff line change
Expand Up @@ -235,14 +235,6 @@ impl<'a> Arbitrary<'a> for webauthn::FilteredPublicKeyCredentialParameters {
}
}

// cannot be derived because we want to make sure that we have valid values
impl<'a> Arbitrary<'a> for webauthn::KnownPublicKeyCredentialParameters {
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
let alg = *u.choose(&webauthn::KNOWN_ALGS)?;
Ok(Self { alg })
}
}

// cannot be derived because of missing impl for serde_bytes::Bytes
impl<'a> Arbitrary<'a> for webauthn::PublicKeyCredentialDescriptorRef<'a> {
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self> {
Expand Down
3 changes: 0 additions & 3 deletions src/authenticator.rs
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,6 @@
use crate::ctap1;
use crate::ctap2;

pub use ctap1::Authenticator as Ctap1Authenticator;
pub use ctap2::Authenticator as Ctap2Authenticator;

#[derive(Clone, Debug, PartialEq)]
#[cfg_attr(feature = "arbitrary", derive(arbitrary::Arbitrary))]
// clippy says (2022-02-26): large size difference
Expand Down
7 changes: 0 additions & 7 deletions src/ctap1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,13 +255,6 @@ pub trait Authenticator {
}
}

impl<A: Authenticator> crate::Rpc<Error, Request<'_>, Response> for A {
/// Dispatches the enum of possible requests into the appropriate trait method.
fn call(&mut self, request: &Request<'_>) -> Result<Response> {
self.call_ctap1(request)
}
}

#[cfg(test)]
mod tests {
use super::*;
Expand Down
12 changes: 8 additions & 4 deletions src/ctap2.rs
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ pub enum Request<'a> {
Vendor(crate::operation::VendorOperation),
}

pub enum CtapMappingError {
enum CtapMappingError {
InvalidCommand(u8),
ParsingError(cbor_smol::Error),
}
Expand Down Expand Up @@ -444,6 +444,7 @@ impl<'de> Deserialize<'de> for AttestationFormatsPreference {

#[derive(Clone, Copy, Debug, Eq, PartialEq)]
#[non_exhaustive]
#[repr(u8)]
pub enum Error {
Success = 0x00,
InvalidCommand = 0x01,
Expand Down Expand Up @@ -502,10 +503,13 @@ pub enum Error {
VendorLast = 0xFF,
}

impl From<Error> for u8 {
fn from(error: Error) -> u8 {
error as _
}
}

/// CTAP2 authenticator API
///
/// Note that all Authenticators automatically implement [`crate::Rpc`] with [`Request`] and
/// [`Response`].
pub trait Authenticator {
fn get_info(&mut self) -> get_info::Response;

Expand Down
2 changes: 1 addition & 1 deletion src/ctap2/client_pin.rs
Original file line number Diff line number Diff line change
Expand Up @@ -512,7 +512,7 @@ mod tests {
// The following test would then fail, as [1] != [2]
let mut buf = [0u8; 64];
let example = PinV1Subcommand::GetKeyAgreement;
let ser = crate::serde::cbor_serialize(&example, &mut buf).unwrap();
let ser = cbor_smol::cbor_serialize(&example, &mut buf).unwrap();
assert_eq!(ser, &[0x02]);
}
}
Loading
Loading