This commit is contained in:
Heiko Schaefer 2021-08-05 13:56:25 +02:00
parent 7541b2f493
commit f67501d0f9
7 changed files with 8 additions and 8 deletions

View file

@ -67,7 +67,7 @@ impl TestCard {
let ard = ca.get_app_data()?; let ard = ca.get_app_data()?;
let app_id = CardApp::get_aid(&ard)?; let app_id = CardApp::get_aid(&ard)?;
if &app_id.ident().as_str() == ident { if app_id.ident().as_str() == ident {
ca.init_caps(&ard)?; ca.init_caps(&ard)?;
// println!("opened pcsc card {}", ident); // println!("opened pcsc card {}", ident);

View file

@ -108,7 +108,7 @@ impl<'a> crypto::Decryptor for CardDecryptor<'a> {
DecryptMe::ECDH(&e.value()[1..]) DecryptMe::ECDH(&e.value()[1..])
} else { } else {
// NIST curves: ephemeral key with header byte // NIST curves: ephemeral key with header byte
DecryptMe::ECDH(&e.value()) DecryptMe::ECDH(e.value())
}; };
// Decryption operation on the card // Decryption operation on the card

View file

@ -211,7 +211,7 @@ impl EccKey for SqEccKey {
} }
fn get_scalar(&self) -> &[u8] { fn get_scalar(&self) -> &[u8] {
&self.scalar.value() self.scalar.value()
} }
fn get_type(&self) -> EccType { fn get_type(&self) -> EccType {

View file

@ -54,7 +54,7 @@ impl CardApp {
let mut ext_support = false; let mut ext_support = false;
let mut chaining_support = false; let mut chaining_support = false;
if let Ok(hist) = CardApp::get_historical(&ard) { if let Ok(hist) = CardApp::get_historical(ard) {
if let Some(cc) = hist.get_card_capabilities() { if let Some(cc) = hist.get_card_capabilities() {
chaining_support = cc.get_command_chaining(); chaining_support = cc.get_command_chaining();
ext_support = cc.get_extended_lc_le(); ext_support = cc.get_extended_lc_le();
@ -62,7 +62,7 @@ impl CardApp {
} }
let (max_cmd_bytes, max_rsp_bytes) = if let Ok(Some(eli)) = let (max_cmd_bytes, max_rsp_bytes) = if let Ok(Some(eli)) =
CardApp::get_extended_length_information(&ard) CardApp::get_extended_length_information(ard)
{ {
(eli.max_command_bytes, eli.max_response_bytes) (eli.max_command_bytes, eli.max_response_bytes)
} else { } else {

View file

@ -20,7 +20,7 @@ impl TryFrom<&[u8]> for CardHolder {
type Error = anyhow::Error; type Error = anyhow::Error;
fn try_from(data: &[u8]) -> Result<Self> { fn try_from(data: &[u8]) -> Result<Self> {
let entry = TlvEntry::from(&data, true)?; let entry = TlvEntry::from(data, true)?;
let tlv = Tlv(Tag(vec![0x65]), entry); let tlv = Tlv(Tag(vec![0x65]), entry);
let name: Option<String> = tlv let name: Option<String> = tlv

View file

@ -83,7 +83,7 @@ impl TlvEntry {
let mut input = data; let mut input = data;
while !input.is_empty() { while !input.is_empty() {
let (rest, tlv) = Tlv::parse(&input)?; let (rest, tlv) = Tlv::parse(input)?;
input = rest; input = rest;
c.push(tlv); c.push(tlv);
} }

View file

@ -86,7 +86,7 @@ impl ScdClient {
fn init(&mut self) -> Result<()> { fn init(&mut self) -> Result<()> {
let mut rt = RT.lock().unwrap(); let mut rt = RT.lock().unwrap();
let send = format!("SCD SERIALNO"); let send = "SCD SERIALNO";
self.agent.send(send)?; self.agent.send(send)?;
while let Some(response) = rt.block_on(self.agent.next()) { while let Some(response) = rt.block_on(self.agent.next()) {