diff --git a/src/container.rs b/src/container.rs index 1ac9a09..5870edb 100644 --- a/src/container.rs +++ b/src/container.rs @@ -1,5 +1,5 @@ use core::convert::TryFrom; -use flexiber::{Decodable, Encodable}; +// use flexiber::{Decodable, Encodable}; pub struct Tag<'a>(&'a [u8]); impl<'a> Tag<'a> { diff --git a/src/dispatch.rs b/src/dispatch.rs index d8ac091..77c6d13 100644 --- a/src/dispatch.rs +++ b/src/dispatch.rs @@ -1,6 +1,6 @@ -use crate::{Authenticator, constants::PIV_AID, Result}; +use crate::{Authenticator, /*constants::PIV_AID,*/ Result}; -use apdu_dispatch::{app::App, command, Command, response, Response}; +use apdu_dispatch::{app::App, command, Command, response}; use trussed::client; #[cfg(feature = "apdu-dispatch")] diff --git a/src/lib.rs b/src/lib.rs index 05ef46b..373faf7 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -343,7 +343,7 @@ where // - 9000, 61XX for success // - 6982 security status // - 6A80, 6A86 for data, P1/P2 issue - fn general_authenticate(&mut self, command: &iso7816::Command, reply: &mut Data) -> Result + pub fn general_authenticate(&mut self, command: &iso7816::Command, reply: &mut Data) -> Result { // For "SSH", we need implement A.4.2 in SP-800-73-4 Part 2, ECDSA signatures @@ -454,7 +454,7 @@ where Ok(()) } - fn request_for_challenge(&mut self, command: &iso7816::Command, remaining_data: &[u8], reply: &mut Data) -> Result + pub fn request_for_challenge(&mut self, command: &iso7816::Command, remaining_data: &[u8], reply: &mut Data) -> Result { // - data is of the form // 00 87 03 9B 16 7C 14 80 08 99 6D 71 40 E7 05 DF 7F 81 08 6E EF 9C 02 00 69 73 E8 @@ -506,7 +506,7 @@ where Ok(()) } - fn request_for_witness(&mut self, command: &iso7816::Command, remaining_data: &[u8], reply: &mut Data) -> Result + pub fn request_for_witness(&mut self, command: &iso7816::Command, remaining_data: &[u8], reply: &mut Data) -> Result { // invariants: parsed data was '7C L1 80 00' + remaining_data @@ -682,7 +682,7 @@ where // } //} - fn generate_asymmetric_keypair(&mut self, command: &iso7816::Command, reply: &mut Data) -> Result + pub fn generate_asymmetric_keypair(&mut self, command: &iso7816::Command, reply: &mut Data) -> Result { if !self.state.runtime.app_security_status.management_verified { return Err(Status::SecurityStatusNotSatisfied); @@ -806,7 +806,7 @@ where Ok(()) } - fn put_data(&mut self, command: &iso7816::Command) -> Result { + pub fn put_data(&mut self, command: &iso7816::Command) -> Result { info_now!("PutData"); if command.p1 != 0x3f || command.p2 != 0xff { return Err(Status::IncorrectP1OrP2Parameter); @@ -973,7 +973,7 @@ where Ok(()) } - fn yubico_piv_extension(&mut self, command: &iso7816::Command, instruction: YubicoPivExtension, reply: &mut Data) -> Result + pub fn yubico_piv_extension(&mut self, command: &iso7816::Command, instruction: YubicoPivExtension, reply: &mut Data) -> Result { info_now!("yubico extension: {:?}", &instruction); match instruction {