Fix make check

This commit is contained in:
Sosthène Guédon
2022-12-16 11:34:28 +01:00
parent 07bd2dc41a
commit 15a34f3626
5 changed files with 17 additions and 10 deletions
+7
View File
@@ -0,0 +1,7 @@
Format: https://www.debian.org/doc/packaging-manuals/copyright-format/1.0/
Upstream-Name: piv-authenticator
Source: https://github.com/Nitrokey/piv-authenticator
Files: tests/default_admin_key
Copyright: 2022 Nitrokey GmbH
License: LGPL-3.0-only
+3 -3
View File
@@ -1,7 +1,7 @@
// Copyright (C) 2022 Nicolas Stalder AND Nitrokey GmbH
// SPDX-License-Identifier: LGPL-3.0-only
use crate::{Authenticator, /*constants::PIV_AID,*/ Result};
use crate::{reply::Reply, Authenticator, /*constants::PIV_AID,*/ Result};
use apdu_dispatch::{app::App, command, response, Command};
use trussed::client;
@@ -12,7 +12,7 @@ where
T: client::Client + client::Ed255 + client::Tdes,
{
fn select(&mut self, _apdu: &Command, reply: &mut response::Data) -> Result {
self.select(reply)
self.select(Reply(reply))
}
fn deselect(&mut self) {
@@ -25,6 +25,6 @@ where
apdu: &Command,
reply: &mut response::Data,
) -> Result {
self.respond(apdu, reply)
self.respond(apdu, &mut Reply(reply))
}
}
+1 -1
View File
@@ -497,7 +497,7 @@ impl<'a, T: trussed::Client + trussed::client::Ed255> LoadedAuthenticator<'a, T>
}
_ => {
warn!("Response without a challenge or a witness");
return Err(Status::ConditionsOfUseNotSatisfied);
Err(Status::ConditionsOfUseNotSatisfied)
}
}
}
+2 -2
View File
@@ -214,7 +214,7 @@ impl Runtime {
pub fn take_witness(&mut self) -> Option<Bytes<16>> {
match self.command_cache.take() {
Some(CommandCache::WitnessChallenge(b)) => return Some(b),
old @ _ => self.command_cache = old,
old => self.command_cache = old,
};
None
}
@@ -222,7 +222,7 @@ impl Runtime {
pub fn take_challenge(&mut self) -> Option<Bytes<16>> {
match self.command_cache.take() {
Some(CommandCache::AuthenticateChallenge(b)) => return Some(b),
old @ _ => self.command_cache = old,
old => self.command_cache = old,
};
None
}
+4 -4
View File
@@ -29,7 +29,7 @@ fn admin_mutual() {
let mut command = Command::new("piv-tool");
command
.env("PIV_EXT_AUTH_KEY", "tests/default_admin_key")
.args(&["-A", "M:9B:03"]);
.args(["-A", "M:9B:03"]);
let mut p = expectrl::session::Session::spawn(command).unwrap();
p.check("Using reader with a card: Virtual PCD 00 00")
.unwrap();
@@ -47,7 +47,7 @@ fn admin_card() {
let mut command = Command::new("piv-tool");
command
.env("PIV_EXT_AUTH_KEY", "tests/default_admin_key")
.args(&["-A", "A:9B:03"]);
.args(["-A", "A:9B:03"]);
let mut p = expectrl::session::Session::spawn(command).unwrap();
p.check("Using reader with a card: Virtual PCD 00 00")
.unwrap();
@@ -63,7 +63,7 @@ fn generate_key() {
let mut command = Command::new("piv-tool");
command
.env("PIV_EXT_AUTH_KEY", "tests/default_admin_key")
.args(&["-A", "M:9B:03", "-G", "9A:11"]);
.args(["-A", "M:9B:03", "-G", "9A:11"]);
let mut p = expectrl::session::Session::spawn(command).unwrap();
p.check("Using reader with a card: Virtual PCD 00 00")
.unwrap();
@@ -75,7 +75,7 @@ fn generate_key() {
let mut command = Command::new("piv-tool");
command
.env("PIV_EXT_AUTH_KEY", "tests/default_admin_key")
.args(&["-A", "M:9B:03", "-G", "9A:07"]);
.args(["-A", "M:9B:03", "-G", "9A:07"]);
let mut p = expectrl::session::Session::spawn(command).unwrap();
p.check("Using reader with a card: Virtual PCD 00 00")
.unwrap();