Explore shutting down scdaemon when accessing cards via pcsc.
This commit is contained in:
parent
897847cb46
commit
1af3a4b5ee
2 changed files with 7 additions and 1 deletions
|
@ -15,4 +15,5 @@ openpgp-card-scdc = { path = "../scdc" }
|
||||||
sequoia-openpgp = "1.3"
|
sequoia-openpgp = "1.3"
|
||||||
anyhow = "1"
|
anyhow = "1"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
env_logger = "0.8"
|
env_logger = "0.8"
|
||||||
|
log = "0.4"
|
|
@ -49,6 +49,11 @@ impl TestCard {
|
||||||
fn open(&self) -> Result<CardApp> {
|
fn open(&self) -> Result<CardApp> {
|
||||||
match self {
|
match self {
|
||||||
Self::Pcsc(ident) => {
|
Self::Pcsc(ident) => {
|
||||||
|
// Attempt to shutdown SCD, if it is running.
|
||||||
|
// Ignore any errors that occur during that shutdown attempt.
|
||||||
|
let res = ScdClient::shutdown_scd(None);
|
||||||
|
log::trace!(" Attempt to shutdown scd: {:?}", res);
|
||||||
|
|
||||||
for card in PcscClient::list_cards()? {
|
for card in PcscClient::list_cards()? {
|
||||||
let card_client = Box::new(card) as CardClientBox;
|
let card_client = Box::new(card) as CardClientBox;
|
||||||
let mut ca = CardApp::new(card_client);
|
let mut ca = CardApp::new(card_client);
|
||||||
|
|
Loading…
Reference in a new issue