Update apdu-dispatch

This allows rejecting calls to `Select` over CCID
This commit is contained in:
Sosthène Guédon
2023-11-08 14:46:33 +01:00
parent 2f49017eec
commit 288fc030d1
2 changed files with 9 additions and 2 deletions
+1
View File
@@ -47,5 +47,6 @@ features = ["dispatch"]
[patch.crates-io]
ctap-types = { git = "https://github.com/nitrokey/ctap-types.git", tag = "v0.1.2-nitrokey.4" }
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" }
serde-indexed = { git = "https://github.com/sosthene-nitrokey/serde-indexed.git", rev = "5005d23cb4ee8622e62188ea0f9466146f851f0d" }
+8 -2
View File
@@ -1,4 +1,4 @@
use apdu_dispatch::{app as apdu, response::Data, Command};
use apdu_dispatch::{app as apdu, dispatch::Interface, response::Data, Command};
use ctap_types::{serde::error::Error as SerdeError, Error};
use ctaphid_dispatch::app as ctaphid;
use iso7816::Status;
@@ -28,7 +28,13 @@ where
UP: UserPresence,
T: TrussedRequirements,
{
fn select(&mut self, _: &Command, reply: &mut Data) -> apdu::Result {
fn select(&mut self, interface: Interface, _: &Command, reply: &mut Data) -> apdu::Result {
// FIDO-over-CCID does not seem to officially be a thing; we don't support it.
// If we would, need to review the following cases catering to semi-documented U2F legacy.
if interface != apdu::Interface::Contactless {
return Err(Status::ConditionsOfUseNotSatisfied);
}
reply.extend_from_slice(b"U2F_V2").unwrap();
Ok(())
}