Remove unused imports; Lints.
This commit is contained in:
parent
77e32e02c2
commit
f59a8a948c
7 changed files with 11 additions and 16 deletions
|
@ -33,7 +33,7 @@ use sequoia_openpgp::Cert;
|
||||||
|
|
||||||
use openpgp_card::apdu::PcscClient;
|
use openpgp_card::apdu::PcscClient;
|
||||||
use openpgp_card::card_app::CardApp;
|
use openpgp_card::card_app::CardApp;
|
||||||
use openpgp_card::{CardClientBox, KeyType, Sex};
|
use openpgp_card::{CardClientBox, Sex};
|
||||||
|
|
||||||
mod util;
|
mod util;
|
||||||
|
|
||||||
|
@ -141,7 +141,7 @@ fn test_keygen() {
|
||||||
}
|
}
|
||||||
|
|
||||||
fn test_reset(ca: &mut CardApp) -> Result<TestOutput> {
|
fn test_reset(ca: &mut CardApp) -> Result<TestOutput> {
|
||||||
let res = ca.factory_reset()?;
|
let _res = ca.factory_reset()?;
|
||||||
Ok(vec![])
|
Ok(vec![])
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@ pub(crate) fn upload_subkeys(
|
||||||
cert: &Cert,
|
cert: &Cert,
|
||||||
) -> Result<Vec<(String, u32)>> {
|
) -> Result<Vec<(String, u32)>> {
|
||||||
let mut out = vec![];
|
let mut out = vec![];
|
||||||
let mut gentime = 0;
|
|
||||||
|
|
||||||
for kt in [
|
for kt in [
|
||||||
KeyType::Signing,
|
KeyType::Signing,
|
||||||
|
@ -39,7 +38,7 @@ pub(crate) fn upload_subkeys(
|
||||||
|
|
||||||
// upload key
|
// upload key
|
||||||
let cuk = vka_as_uploadable_key(vka, None);
|
let cuk = vka_as_uploadable_key(vka, None);
|
||||||
let res = ca.upload_key(cuk, kt)?;
|
let _ = ca.upload_key(cuk, kt)?;
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(out)
|
Ok(out)
|
||||||
|
|
|
@ -25,8 +25,8 @@ use crate::parse::{
|
||||||
};
|
};
|
||||||
use crate::tlv::{tag::Tag, Tlv, TlvEntry};
|
use crate::tlv::{tag::Tag, Tlv, TlvEntry};
|
||||||
use crate::{
|
use crate::{
|
||||||
apdu, key_upload, parse, tlv, CardCaps, CardClientBox, CardUploadableKey,
|
apdu, key_upload, CardCaps, CardClientBox, CardUploadableKey, DecryptMe,
|
||||||
DecryptMe, Hash, KeyType, Sex,
|
Hash, KeyType, Sex,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub struct CardApp {
|
pub struct CardApp {
|
||||||
|
|
|
@ -67,7 +67,7 @@ pub(crate) fn upload_key(
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
let caps: Option<CardCaps> = card_app.card_caps().map(|c| c.clone());
|
let caps: Option<CardCaps> = card_app.card_caps().copied();
|
||||||
|
|
||||||
copy_key_to_card(
|
copy_key_to_card(
|
||||||
card_app.card(),
|
card_app.card(),
|
||||||
|
|
|
@ -2,9 +2,8 @@
|
||||||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||||
|
|
||||||
use anyhow::{anyhow, Result};
|
use anyhow::{anyhow, Result};
|
||||||
use pcsc::*;
|
|
||||||
|
|
||||||
use apdu::{commands, response::Response};
|
use apdu::response::Response;
|
||||||
use parse::{
|
use parse::{
|
||||||
algo_attrs::Algo, algo_info::AlgoInfo, application_id::ApplicationId,
|
algo_attrs::Algo, algo_info::AlgoInfo, application_id::ApplicationId,
|
||||||
cardholder::CardHolder, extended_cap::ExtendedCap, extended_cap::Features,
|
cardholder::CardHolder, extended_cap::ExtendedCap, extended_cap::Features,
|
||||||
|
|
|
@ -2,14 +2,11 @@
|
||||||
// SPDX-License-Identifier: MIT OR Apache-2.0
|
// SPDX-License-Identifier: MIT OR Apache-2.0
|
||||||
|
|
||||||
use anyhow::anyhow;
|
use anyhow::anyhow;
|
||||||
use nom::{
|
use chrono::{DateTime, NaiveDateTime, Utc};
|
||||||
bytes::complete as bytes, combinator, number::complete as number, sequence,
|
use nom::{combinator, number::complete as number, sequence};
|
||||||
};
|
|
||||||
use std::fmt;
|
|
||||||
|
|
||||||
use crate::errors::OpenpgpCardError;
|
use crate::errors::OpenpgpCardError;
|
||||||
use crate::parse::KeySet;
|
use crate::parse::KeySet;
|
||||||
use chrono::{DateTime, NaiveDateTime, Utc};
|
|
||||||
|
|
||||||
#[derive(Clone, Eq, PartialEq, Debug)]
|
#[derive(Clone, Eq, PartialEq, Debug)]
|
||||||
pub struct KeyGeneration(u32);
|
pub struct KeyGeneration(u32);
|
||||||
|
|
|
@ -57,7 +57,7 @@ impl ScdClient {
|
||||||
let mut rt = RT.lock().unwrap();
|
let mut rt = RT.lock().unwrap();
|
||||||
|
|
||||||
while let Some(response) = rt.block_on(self.client.next()) {
|
while let Some(response) = rt.block_on(self.client.next()) {
|
||||||
if let Err(_) = response {
|
if response.is_err() {
|
||||||
return Err(anyhow!("Card not found"));
|
return Err(anyhow!("Card not found"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ impl CardClient for ScdClient {
|
||||||
|
|
||||||
while let Some(response) = rt.block_on(self.client.next()) {
|
while let Some(response) = rt.block_on(self.client.next()) {
|
||||||
log::trace!("res: {:x?}", response);
|
log::trace!("res: {:x?}", response);
|
||||||
if let Err(_) = response {
|
if response.is_err() {
|
||||||
unimplemented!();
|
unimplemented!();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue