Merge pull request #39 from Nitrokey/adpu-dispatch-020

Update apdu-dispatch and reject NFC requests
This commit is contained in:
sosthene-nitrokey
2023-11-08 17:14:36 +01:00
committed by GitHub
3 changed files with 21 additions and 7 deletions
+6
View File
@@ -1,5 +1,11 @@
# Changelog
## Unreleased
- Reject NFC requests ([#39][])
[#39]: https://github.com/Nitrokey/piv-authenticator/pull/39
## [v0.3.2][] (2023-06-13)
- Fix P-256 signature ([#33][])
+1
View File
@@ -78,6 +78,7 @@ trussed = { git = "https://github.com/trussed-dev/trussed" , rev = "55ea391367fc
trussed-auth = { git = "https://github.com/trussed-dev/trussed-auth.git", tag = "v0.2.2"}
trussed-rsa-alloc = { git = "https://github.com/trussed-dev/trussed-rsa-backend.git", tag = "v0.1.0"}
trussed-staging = { git = "https://github.com/trussed-dev/trussed-staging", tag = "v0.1.0" }
apdu-dispatch = { git = "https://github.com/trussed-dev/apdu-dispatch.git", rev = "915fc237103fcecc29d0f0b73391f19abf6576de" }
[profile.dev.package.rsa]
opt-level = 2
+14 -7
View File
@@ -1,13 +1,22 @@
use crate::{reply::Reply, Authenticator, /*constants::PIV_AID,*/ Result};
use apdu_dispatch::{app::App, command, response, Command};
use iso7816::{Interface, Status};
#[cfg(feature = "apdu-dispatch")]
impl<T> App<{ command::SIZE }, { response::SIZE }> for Authenticator<T>
where
T: crate::Client,
{
fn select(&mut self, _apdu: &Command, reply: &mut response::Data) -> Result {
fn select(
&mut self,
interface: Interface,
_apdu: &Command,
reply: &mut response::Data,
) -> Result {
if interface != Interface::Contact {
return Err(Status::ConditionsOfUseNotSatisfied);
}
self.select(Reply(reply))
}
@@ -15,12 +24,10 @@ where
self.deselect()
}
fn call(
&mut self,
_: iso7816::Interface,
apdu: &Command,
reply: &mut response::Data,
) -> Result {
fn call(&mut self, interface: Interface, apdu: &Command, reply: &mut response::Data) -> Result {
if interface != Interface::Contact {
return Err(Status::ConditionsOfUseNotSatisfied);
}
self.respond(apdu, &mut Reply(reply))
}
}