Clean up log output.
This commit is contained in:
parent
f1f4533332
commit
a276c1fcd0
1 changed files with 13 additions and 38 deletions
|
@ -77,9 +77,7 @@ impl<'b> TxClient<'b> {
|
||||||
// A transaction has been successfully started
|
// A transaction has been successfully started
|
||||||
|
|
||||||
if was_reset {
|
if was_reset {
|
||||||
log::debug!(
|
log::debug!("start_tx: card was reset, select!");
|
||||||
"start_tx: card was reset, select() openpgp"
|
|
||||||
);
|
|
||||||
|
|
||||||
let mut txc = Self {
|
let mut txc = Self {
|
||||||
tx,
|
tx,
|
||||||
|
@ -483,7 +481,7 @@ impl PcscCard {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
log::debug!("readers: {:?}", readers);
|
log::debug!(" readers: {:?}", readers);
|
||||||
|
|
||||||
let mut found_reader = false;
|
let mut found_reader = false;
|
||||||
|
|
||||||
|
@ -540,38 +538,21 @@ impl PcscCard {
|
||||||
Self::raw_pcsc_cards(mode).map_err(|sce| Error::Smartcard(sce))?
|
Self::raw_pcsc_cards(mode).map_err(|sce| Error::Smartcard(sce))?
|
||||||
{
|
{
|
||||||
log::debug!("cards_filter: next card");
|
log::debug!("cards_filter: next card");
|
||||||
|
log::debug!(" status: {:x?}", card.status2_owned());
|
||||||
let stat = card.status2_owned();
|
|
||||||
log::debug!("cards_filter, status2: {:x?}", stat);
|
|
||||||
|
|
||||||
let mut store_card = false;
|
let mut store_card = false;
|
||||||
{
|
{
|
||||||
// start transaction
|
// start transaction
|
||||||
log::debug!("1");
|
|
||||||
let mut p = PcscCard::new(card, mode);
|
let mut p = PcscCard::new(card, mode);
|
||||||
let mut txc = TxClient::new(&mut p, false)?;
|
let mut txc = TxClient::new(&mut p, false)?;
|
||||||
|
|
||||||
log::debug!("3");
|
|
||||||
{
|
{
|
||||||
if let Err(e) = TxClient::select(&mut txc) {
|
if let Err(e) = TxClient::select(&mut txc) {
|
||||||
log::debug!("4a");
|
log::debug!(" select error: {:?}", e);
|
||||||
log::debug!(
|
|
||||||
"cards_filter: error during select: {:?}",
|
|
||||||
e
|
|
||||||
);
|
|
||||||
} else {
|
} else {
|
||||||
log::debug!(
|
|
||||||
"4b: opened the OpenPGP application, will read ARD"
|
|
||||||
);
|
|
||||||
// successfully opened the OpenPGP application
|
// successfully opened the OpenPGP application
|
||||||
|
log::debug!(" select ok, will read ARD");
|
||||||
// -- debug: status --
|
log::debug!(" status: {:x?}", txc.tx.status2_owned());
|
||||||
log::debug!(
|
|
||||||
"4b card status: {:x?}",
|
|
||||||
txc.tx.status2_owned()
|
|
||||||
);
|
|
||||||
|
|
||||||
// -- /debug: status --
|
|
||||||
|
|
||||||
if let Some(ident) = ident {
|
if let Some(ident) = ident {
|
||||||
if let Ok(ard) =
|
if let Ok(ard) =
|
||||||
|
@ -581,24 +562,18 @@ impl PcscCard {
|
||||||
|
|
||||||
if aid.ident() == ident.to_ascii_uppercase() {
|
if aid.ident() == ident.to_ascii_uppercase() {
|
||||||
// FIXME: handle multiple cards with matching ident
|
// FIXME: handle multiple cards with matching ident
|
||||||
log::debug!(
|
log::debug!(" will use: {:?}", ident);
|
||||||
"open_by_ident: Opened and selected {:?}",
|
|
||||||
ident
|
|
||||||
);
|
|
||||||
|
|
||||||
// we want to return this one card
|
// we want to return this one card
|
||||||
store_card = true;
|
store_card = true;
|
||||||
} else {
|
} else {
|
||||||
log::debug!(
|
log::debug!(
|
||||||
"open_by_ident: Found, but won't use {:?}",
|
" won't use {:?}",
|
||||||
aid.ident()
|
aid.ident()
|
||||||
);
|
);
|
||||||
|
|
||||||
// FIXME: end transaction
|
|
||||||
// txc.end();
|
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
// couldn't read ARD for this card ...
|
// couldn't read ARD for this card.
|
||||||
// ignore and move on
|
// ignore and move on
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
@ -676,12 +651,12 @@ impl PcscCard {
|
||||||
// Get Features from reader (pinpad verify/modify)
|
// Get Features from reader (pinpad verify/modify)
|
||||||
if let Ok(feat) = txc.features() {
|
if let Ok(feat) = txc.features() {
|
||||||
for tlv in feat {
|
for tlv in feat {
|
||||||
log::debug!("Found reader feature {:?}", tlv);
|
log::debug!(" Found reader feature {:?}", tlv);
|
||||||
h.insert(tlv.tag().into(), tlv);
|
h.insert(tlv.tag().into(), tlv);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Initalize CardClient (set CardCaps from ARD)
|
// Initialize CardClient (set CardCaps from ARD)
|
||||||
<dyn CardClient>::initialize(&mut txc)?;
|
<dyn CardClient>::initialize(&mut txc)?;
|
||||||
|
|
||||||
let cc = txc.card_caps().cloned();
|
let cc = txc.card_caps().cloned();
|
||||||
|
|
Loading…
Reference in a new issue