112 Commits (main)
 

Author SHA1 Message Date
Nick Zana 49dfb44ea7 ctap2-proto: Derive serde traits for authenticator::credential::get::OptionKey 1 year ago
Nick Zana 50bdffbe08 ctap2-proto: Derive Deserialize for authenticator::credential::make::Response 1 year ago
Nick Zana 9d46ecf75b ctap2-proto: Add attestation_statement field to credential::make::Response 1 year ago
Nick Zana 54d8ffc2bf ctap2-proto: Derive Serialize for credential::make::Request
Enables cfg_eval feature because serde_as does not support cfg_attr for
conditional compilation.
1 year ago
Nick Zana ea1df60e74 ctap2-proto: Make make::Request::pin_uv_auth_param optional
the `pin_uv_auth_param` field is an optional field in the CTAP spec.
1 year ago
Nick Zana 573069afad ctap2-proto: Derive serde traits for credential::make::OptionKey 1 year ago
Nick Zana 12d6f7fe51 ctap2-proto: Derive common traits for credential::{make, get}
Derives Debug and other common traits for the credential::{make, get}
types.
1 year ago
Nick Zana 754fc51510 ctap2-proto: Include all of fido-common in prelude 1 year ago
Nick Zana 166fe1bca6 ctap2-proto: Add serde_with
Required for serializing and deserializing Vec<u8>s as byte strings
instead of sequences of bytes in CTAP request/response types.
1 year ago
Nick Zana 7f98c2779a fido-common: Fix serde_with version to support serde fork 1 year ago
Nick Zana cfc7856894 Patch serde to github.com/AndrewScull/serde fork
serde_derive does not currently support using integer values as map
keys. CTAP uses integer values for various CBOR map keys. In order to
properly serialize and deserialize types for the CTAP protocol, a forked
version of serde from a pull request that adds support for renaming
field keys as integer types is used.

Tracked in <https://github.com/serde-rs/serde/pull/2209>
1 year ago
Nick Zana d4a94b83af ctap2-proto: Derive serde for device::Info
Serde renames are integers because CTAP uses integer keys in CBOR maps
1 year ago
Nick Zana 76cec18d0a ctap2-proto: Add missing device::Option CredentialManagementPreview 1 year ago
Nick Zana 38bd34becc ctap2-proto: Rename device::Options to proper serde names
Enum names are full names for clarity and readability. Serde renamed to
compressed CTAP protocol names.
1 year ago
Nick Zana 4670954e0d ctap2-proto: Derive serde for authenticator certification levels 1 year ago
Nick Zana 2434c8602a ctap2-proto: rename authenticator::device::Version to proper serde names
Renamed every value to screaming snake case manually to ensure that the
large number of acronyms and numbers don't cause an accidentally
incorrect value to be derived.
1 year ago
Nick Zana 542a3b9b77 ctap2-proto: Derive serde types for UsizeN
Just a wrapper struct around bounded_integer::BoundedUsize the
bounded_integer/serde1 feature needs to be enabled.
1 year ago
Nick Zana 3f61a17784 ctap2-proto: Derive Debug for helper type UsizeN 1 year ago
Nick Zana 1ca1793a24 ctap2-proto: Add new CTAP 2.2 device::Info fields 1 year ago
Nick Zana 502fe2b176 ctap2-proto: Implement serde for authentciator::client_pin::AuthProtocolVersion 1 year ago
Nick Zana 282a7518ec ctap2-proto: Ctap2_2Authenticator::get_assertion requires self param 1 year ago
Nick Zana e1b8a49f0e ctap2-proto: Replace HashMap with BTreeMap for make::Request 1 year ago
Nick Zana 5bc9e57c11 ctap2-proto: formatting 1 year ago
Nick Zana 999c96d3c5 ctap2-proto: Add CTAP Command enum
Adds ctap2_proto::Command enum to represent the CTAP command codes for
the authenticator commands.
1 year ago
Nick Zana 5803ed02c2 ctap2-proto: Remove bounded_vec dependency
bounded_vec does not correctly handle collections with a lower bound of
0.
1 year ago
Nick Zana 5c0d6e391a webauthn3-proto: remove incomplete serialization code 1 year ago
Nick Zana 6ef8cee4de fido-common: Add attestation::Statement data type
Attestation statements are returned as part of the CBOR maps returned by
authenticators in response to authenticatorMakeCredential and
authenticatorGetAssertion commands.

The attestation statements defined by WebAuthn come in various formats.
However, the format identifier is not part of the attestation statement
field in the CBOR map (0x03 attStmt), but rather as a distinct format
field (fmt 0x01).

Normally, this could be worked around with an externally tagged enum,
but using integer tags is not currently supported by serde. By marking
the enum instead as untagged, this should ideally mean that serde can
differentiate between the enum variants by the fields of the attestation
statement, which is itself a CBOR map.

Otherwise, we could always revert to just raw byte sequences for the
attestation statements during (de)serialization and push validating
these statements onto another part of the code.
1 year ago
Nick Zana a0bd1c9e01 fido-common: De/serialize credential::public_key::UserEntity::id as bytes
Uses serde_with to serialize and deseriailze the UserEntity::id field as
a byte string instead of a sequence (array) of bytes.
1 year ago
Nick Zana 42044f2a46 fido-common: Implement serde for credential::public_key::Descriptor
Adds serde_with as a dependency in order to serialize Descriptor::id as
bytes instead of as a sequence.

Enables cfg_eval feature to enable conditional usage of serde_with
behind the "serde" feature flag for the fido-common crate.
1 year ago
Nick Zana 576addac1f fido-common: Implement Deserialize for authenticator::Data
Requires bitflags to parse CTAP "flags" field of AuthenticatorData.

Implements Deserialize for custom CTAP format for authenticator::Data
byte layout.
1 year ago
Nick Zana 90f75b88d8 fido-common: Implement Deserialize for attestation::CredentialData
Relies on ciborium as a dependency because coset requires one of
ciborium's error types. It should be possible to remove this type's
dependence on ciborium.
1 year ago
Nick Zana ce4150d184 fido-common: Add new backup flags to authenticator::Data
As of the CTAP 2.2 revision, authenticator::Data now contains the
backup_eligibility and backup_state flags.
1 year ago
Nick Zana 6e7d134b6d fido-common: Replace authenticator data bools with enums
Replaces authenticator::Data's user_is_verified and user_is_present
boolean flags with clearer UserVerification and UserPresence enums.
1 year ago
Nick Zana e362a5c237 fido-common: Move attestation::enterprise to its own file 1 year ago
Nick Zana 39a5759d12 fido-common: fix credential::public_key::Parameters signature type
The credential::public_key::Parameters field algorithm designates the
public key algorithm represented by the parameter. This replaces the
incorrect registry::algorithms::Signature type with the correct
coset::iana::Algorithm type and adds Serialization/Deserialization
methods for this type.
1 year ago
Nick Zana 1e8a4f21cf fido_common: derive ordering for UserVerify
Necessary to include UserVerify in the BTreeSet specifying the available
user verification modalities.
1 year ago
Nick Zana 8e1b175136 remove bounded_vec from fido_common crate
bounded_vec crate was used to enforce constraints on size of various
fields as defined by webauthn or ctap specs. However, it does not
properly support zero-sized lower bounds.
1 year ago
Nick Zana c1c95bafc1 fido-common: Make extensions::Identifier de/serializable 1 year ago
Nick Zana 2bb574e62b fido-common: add enums for credential backup
Used in by the authenticator in authenticator::Data to convey
information about the backup state of credentials.
1 year ago
Nick Zana 9351d6ea6c format fido-common/Cargo.toml 1 year ago
Nick Zana 0fb2487154
Move several types from ctap2-proto to fido-common 1 year ago
Nick Zana 186d017d07
Update Cargo.lock 1 year ago
Nick Zana 0b03bda84b
replace usage of Hash{Set, Map} with BTree 1 year ago
Nick Zana 852b1ef57d
add Cargo.lock 1 year ago
Nick Zana 12ce6070e0
ctap2-proto: Make Sha256Hash inner array public 1 year ago
Nick Zana 508011230c
ctap2-proto: Add optional AuthenticatorData fields 1 year ago
Nick Zana 04b37d73a4
ctap2-proto: Add unsigned_extension_outputs to make::Response 1 year ago
Nick Zana 5f87584176
ctap2-proto: Replace unecessary owned types with references in make::Request
Remove IndexMap in favor of borrowed slices for make::Request fields
Update imports
1 year ago
Nick Zana 5cc976afbd
ctap2_proto: Add a from method to Aaguid type 1 year ago
Nick Zana 749e7cf2ae
ctap2-proto: Add derives for AuthProtocolVersion 1 year ago