From 6800f4928bc49446c1d640d74efce5f2a5ce0dc2 Mon Sep 17 00:00:00 2001 From: Robin Krahl Date: Mon, 20 Nov 2023 13:33:42 +0100 Subject: [PATCH] Update ctap-types This patch updates the ctap-types dependency to pull in support for the largeBlobKey extension and the largeBlobs command. --- Cargo.toml | 2 +- src/ctap2.rs | 9 +++++++-- src/dispatch.rs | 2 ++ 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 9e82879..96b6516 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -45,7 +45,7 @@ trussed = { version = "0.1", features = ["virt"] } features = ["dispatch"] [patch.crates-io] -ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", tag = "v0.1.2-nitrokey.4" } +ctap-types = { git = "https://github.com/trussed-dev/ctap-types.git", rev = "785bcc52720ce2e2054ae32034a2a24c500e1043" } ctaphid-dispatch = { git = "https://github.com/trussed-dev/ctaphid-dispatch.git", rev = "57cb3317878a8593847595319aa03ef17c29ec5b" } apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" } trussed = { git = "https://github.com/trussed-dev/trussed.git", rev = "51e68500d7601d04f884f5e95567d14b9018a6cb" } diff --git a/src/ctap2.rs b/src/ctap2.rs index 0967846..8c93ae7 100644 --- a/src/ctap2.rs +++ b/src/ctap2.rs @@ -50,7 +50,7 @@ impl Authenticator for crate::Authenti .push(String::from_str("FIDO_2_1_PRE").unwrap()) .unwrap(); - let mut extensions = Vec::, 4>::new(); + let mut extensions = Vec::, 4>::new(); // extensions.push(String::from_str("credProtect").unwrap()).unwrap(); extensions .push(String::from_str("credProtect").unwrap()) @@ -444,6 +444,7 @@ impl Authenticator for crate::Authenti Some(ctap2::make_credential::Extensions { cred_protect: parameters.extensions.as_ref().unwrap().cred_protect, hmac_secret: parameters.extensions.as_ref().unwrap().hmac_secret, + large_blob_key: None, }) } else { None @@ -551,6 +552,8 @@ impl Authenticator for crate::Authenti fmt, auth_data: serialized_auth_data, att_stmt, + ep_att: None, + large_blob_key: None, }; Ok(attestation_object) @@ -1526,7 +1529,7 @@ impl crate::Authenticator { rp_id_hash, flags: { - let mut flags = Flags::EMPTY; + let mut flags = Flags::empty(); if data.up_performed { flags |= Flags::USER_PRESENCE; } @@ -1581,6 +1584,8 @@ impl crate::Authenticator { signature, user: None, number_of_credentials: num_credentials, + user_selected: None, + large_blob_key: None, }; // User with empty IDs are ignored for compatibility diff --git a/src/dispatch.rs b/src/dispatch.rs index 7aaf841..50849e6 100644 --- a/src/dispatch.rs +++ b/src/dispatch.rs @@ -211,6 +211,7 @@ fn request_operation(request: &ctap2::Request) -> ctap2::Operation { ctap2::Request::Reset => ctap2::Operation::Reset, ctap2::Request::CredentialManagement(_) => ctap2::Operation::CredentialManagement, ctap2::Request::Selection => ctap2::Operation::Selection, + ctap2::Request::LargeBlobs(_) => ctap2::Operation::LargeBlobs, ctap2::Request::Vendor(operation) => ctap2::Operation::Vendor(*operation), } } @@ -226,6 +227,7 @@ fn response_operation(request: &ctap2::Response) -> Option { ctap2::Response::Reset => Some(ctap2::Operation::Reset), ctap2::Response::CredentialManagement(_) => Some(ctap2::Operation::CredentialManagement), ctap2::Response::Selection => Some(ctap2::Operation::Selection), + ctap2::Response::LargeBlobs(_) => Some(ctap2::Operation::LargeBlobs), ctap2::Response::Vendor => None, } }