diff --git a/crates/ctap2-proto/Cargo.toml b/crates/ctap2-proto/Cargo.toml index 5139203..64aa113 100644 --- a/crates/ctap2-proto/Cargo.toml +++ b/crates/ctap2-proto/Cargo.toml @@ -12,4 +12,4 @@ coset = "0.3.3" serde = { version = "1.0", features = ["derive"], optional = true } [features] -serde = ["dep:serde", "fido-common/serde"] +serde = ["dep:serde", "fido-common/serde", "bounded-integer/serde1"] diff --git a/crates/ctap2-proto/src/authenticator/device.rs b/crates/ctap2-proto/src/authenticator/device.rs index a861799..0fe6166 100644 --- a/crates/ctap2-proto/src/authenticator/device.rs +++ b/crates/ctap2-proto/src/authenticator/device.rs @@ -7,8 +7,12 @@ use std::collections::{BTreeMap, BTreeSet}; use std::num::NonZeroUsize; use std::usize; +#[cfg(feature = "serde")] +use serde::{Deserialize, Serialize}; + /// A usize with a minimum value of N #[derive(Debug, PartialEq, Eq)] +#[cfg_attr(feature = "serde", derive(Serialize, Deserialize))] pub struct UsizeN(bounded_integer::BoundedUsize); /// > data type byte string and identifying the authenticator model, i.e.