diff --git a/src/lib.rs b/src/lib.rs index 163cfe4..7896207 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -89,39 +89,7 @@ where reply: &mut Data, ) -> Result { info!("PIV responding to {:?}", command); - let last_or_only = command.class().chain().last_or_only(); - - // TODO: avoid owned copy? - let entire_command = match self.state.runtime.chained_command.as_mut() { - Some(command_so_far) => { - // TODO: make sure the header matches, e.g. '00 DB 3F FF' - command_so_far - .data_mut() - .extend_from_slice(command.data()) - .unwrap(); - - if last_or_only { - let entire_command = command_so_far.clone(); - self.state.runtime.chained_command = None; - entire_command - } else { - return Ok(()); - } - } - - None => { - if last_or_only { - // iso7816::Command - command.clone() - } else { - self.state.runtime.chained_command = Some(command.clone()); - return Ok(()); - } - } - }; - - // parse Iso7816Command as PivCommand - let command: Command = (&entire_command).try_into()?; + let command: Command = command.try_into()?; info!("parsed: {:?}", &command); match command { diff --git a/src/state.rs b/src/state.rs index e456a25..9c16c63 100644 --- a/src/state.rs +++ b/src/state.rs @@ -250,7 +250,6 @@ pub struct Runtime { // pub currently_selected_application: SelectableAid, pub app_security_status: AppSecurityStatus, pub command_cache: Option, - pub chained_command: Option>, } // pub trait Aid {