From b5cc6621068bb67c87f88c08f3bcb72fe80a16d4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sosth=C3=A8ne=20Gu=C3=A9don?= Date: Wed, 8 Nov 2023 11:52:00 +0100 Subject: [PATCH] Update apdu-dispatch This allows rejecting calls to `select` over NFC over NFC --- Cargo.toml | 8 ++++---- src/lib/ctap_app.rs | 5 +++++ 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fded9e1..9558efa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -91,15 +91,15 @@ ctaphid-dispatch = { git = "https://github.com/Nitrokey/ctaphid-dispatch", tag = #apdu-dispatch = { git = "https://github.com/Nitrokey/apdu-dispatch.git", branch="sz-multiple-apps" } # forked -admin-app = { git = "https://github.com/Nitrokey/admin-app", tag = "v0.1.0-nitrokey.3" } -ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", tag = "v0.1.2-nitrokey.4" } -fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", tag = "v0.1.1-nitrokey.7" } +admin-app = { git = "https://github.com/Nitrokey/admin-app", rev = "dfd54a67d40f32e47f0a43711c46510a89e20ea8" } +ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", rev = "de8aa1f3dc4f773160f427680e854759bed869d7" } +fido-authenticator = { git = "https://github.com/Nitrokey/fido-authenticator.git", rev = "aa769b243bce8490a361f51de62761255ab561c6" } trussed = { git = "https://github.com/Nitrokey/trussed", tag = "v0.1.0-nitrokey.12" } serde-indexed = { git = "https://github.com/sosthene-nitrokey/serde-indexed.git", rev = "5005d23cb4ee8622e62188ea0f9466146f851f0d" } # unreleased upstream changes usbd-ctaphid = { git = "https://github.com/Nitrokey/usbd-ctaphid", tag = "v0.1.0-nitrokey.1" } -apdu-dispatch = { git = "https://github.com/Nitrokey/apdu-dispatch", tag = "v0.1.2-nitrokey.1" } +apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" } # unreleased crates trussed-auth = { git = "https://github.com/Nitrokey/trussed-auth", tag = "v0.2.2-nitrokey.1" } diff --git a/src/lib/ctap_app.rs b/src/lib/ctap_app.rs index 4a12436..65e93b0 100644 --- a/src/lib/ctap_app.rs +++ b/src/lib/ctap_app.rs @@ -304,9 +304,14 @@ where { fn select( &mut self, + interface: Interface, _apdu: &apdu::Command<{ SIZE }>, reply: &mut apdu::Data<{ apdu_dispatch::response::SIZE }>, ) -> apdu::Result { + if interface != Interface::Contactless { + return Err(Status::ConditionsOfUseNotSatisfied); + } + reply.extend_from_slice(b"U2F_V2").unwrap(); Ok(()) }