Don't fail to open the card when GET_FEATURE_REQUEST returns with an error (this is a problem when running on jcardsim).

This commit is contained in:
Heiko Schaefer 2021-12-10 17:51:21 +01:00
parent c643397989
commit 953ee58120
No known key found for this signature in database
GPG key ID: 4A849A1904CCBD7D

View file

@ -77,11 +77,12 @@ impl PcscClient {
/// Obtain and store feature lists from reader (pinpad functionality). /// Obtain and store feature lists from reader (pinpad functionality).
fn into_card_app(mut self) -> Result<CardApp> { fn into_card_app(mut self) -> Result<CardApp> {
// Get Features from reader (pinpad verify/modify) // Get Features from reader (pinpad verify/modify)
let feat = self.features()?; if let Ok(feat) = self.features() {
for tlv in feat { for tlv in feat {
log::debug!("Found reader feature {:?}", tlv); log::debug!("Found reader feature {:?}", tlv);
self.reader_caps.insert(tlv.tag().into(), tlv); self.reader_caps.insert(tlv.tag().into(), tlv);
} }
}
// Get initalized CardApp // Get initalized CardApp
CardApp::initialize(Box::new(self)) CardApp::initialize(Box::new(self))