Skip to content

Commit

Permalink
Add unsigned extension outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
robin-nitrokey committed Jun 22, 2024
1 parent 0ac0529 commit 8133c72
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 3 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Add support for CTAP 2.2 ([#38](https://github.com/trussed-dev/ctap-types/issues/38))
- Add support for the `thirdPartyPayment` extension
- Add new fields to `get_info`
- Add unsigned extension outputs to `make_credential` and `get_assertion`

## [0.2.0] - 2024-06-21

Expand Down
7 changes: 7 additions & 0 deletions src/ctap2/get_assertion.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,8 @@ pub struct Response {
/// See https://fidoalliance.org/specs/fido-v2.1-ps-20210615/fido-client-to-authenticator-protocol-v2.1-ps-20210615.html#sctn-getAssert-authnr-alg
#[serde(skip_serializing_if = "Option::is_none")]
pub large_blob_key: Option<ByteArray<32>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unsigned_extension_outputs: Option<UnsignedExtensionOutputs>,
}

#[derive(Debug)]
Expand All @@ -142,6 +144,11 @@ impl ResponseBuilder {
number_of_credentials: None,
user_selected: None,
large_blob_key: None,
unsigned_extension_outputs: None,
}
}
}

#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[non_exhaustive]
pub struct UnsignedExtensionOutputs {}
2 changes: 1 addition & 1 deletion src/ctap2/get_info.rs
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ pub struct Response {
// FIDO_2_2
#[cfg(feature = "get-info-full")]
#[serde(skip_serializing_if = "Option::is_none")]
pub attestation_formats: Option<()>,
pub attestation_formats: Option<Vec<super::make_credential::AttestationStatementFormat, 2>>,

// 0x17
// FIDO_2_2
Expand Down
11 changes: 9 additions & 2 deletions src/ctap2/make_credential.rs
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,8 @@ pub struct Response {
pub ep_att: Option<bool>,
#[serde(skip_serializing_if = "Option::is_none")]
pub large_blob_key: Option<ByteArray<32>>,
#[serde(skip_serializing_if = "Option::is_none")]
pub unsigned_extension_outputs: Option<UnsignedExtensionOutputs>,
}

#[derive(Debug)]
Expand All @@ -135,6 +137,7 @@ impl ResponseBuilder {
att_stmt: None,
ep_att: None,
large_blob_key: None,
unsigned_extension_outputs: None,
}
}
}
Expand All @@ -148,9 +151,9 @@ pub enum AttestationStatement {
Packed(PackedAttestationStatement),
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[derive(Clone, Debug, Eq, PartialEq, Deserialize, Serialize)]
#[non_exhaustive]
#[serde(untagged)]
#[serde(rename_all = "lowercase")]
pub enum AttestationStatementFormat {
None,
Packed,
Expand All @@ -167,6 +170,10 @@ pub struct PackedAttestationStatement {
pub x5c: Option<Vec<Bytes<1024>, 1>>,
}

#[derive(Clone, Debug, Eq, PartialEq, Serialize)]
#[non_exhaustive]
pub struct UnsignedExtensionOutputs {}

#[cfg(test)]
mod tests {
use super::*;
Expand Down

0 comments on commit 8133c72

Please sign in to comment.