diff options
author | NIIBE Yutaka <[email protected]> | 2013-03-26 03:43:24 +0000 |
---|---|---|
committer | NIIBE Yutaka <[email protected]> | 2013-03-26 03:43:24 +0000 |
commit | c3495209ee6bdac6d6c631ded632fd540596f6e4 (patch) | |
tree | e12cee722b378d7dd398e9a6ef2279219cde1a44 | |
parent | scd: PC/SC cleanup (more). (diff) | |
download | gnupg-c3495209ee6bdac6d6c631ded632fd540596f6e4.tar.gz gnupg-c3495209ee6bdac6d6c631ded632fd540596f6e4.zip |
scd: PC/SC status fix.
* scd/apdu.c (pcsc_get_status_direct): Check PCSC_STATE_MUTE only when
PCSC_STATE_PRESENT.
* scd/pcsc-wrapper.c (handle_status): Ditto.
-rw-r--r-- | scd/apdu.c | 8 | ||||
-rw-r--r-- | scd/pcsc-wrapper.c | 8 |
2 files changed, 10 insertions, 6 deletions
diff --git a/scd/apdu.c b/scd/apdu.c index d8f7c5fd9..4f40a6958 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -914,9 +914,11 @@ pcsc_get_status_direct (int slot, unsigned int *status) *status = 0; if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) ) - *status |= APDU_CARD_PRESENT; - if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) - *status |= APDU_CARD_ACTIVE; + { + *status |= APDU_CARD_PRESENT; + if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) + *status |= APDU_CARD_ACTIVE; + } #ifndef HAVE_W32_SYSTEM /* We indicate a useful card if it is not in use by another application. This is because we only use exclusive access diff --git a/scd/pcsc-wrapper.c b/scd/pcsc-wrapper.c index 04d08a134..7d9415ad1 100644 --- a/scd/pcsc-wrapper.c +++ b/scd/pcsc-wrapper.c @@ -602,9 +602,11 @@ handle_status (unsigned char *argbuf, size_t arglen) if ( !(rdrstates[0].event_state & PCSC_STATE_UNKNOWN) ) { if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) ) - status |= 2; - if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) - status |= 4; + { + status |= 2; + if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) + status |= 4; + } /* We indicate a useful card if it is not in use by another application. This is because we only use exclusive access mode. */ |