1
0
mirror of git://git.gnupg.org/gnupg.git synced 2024-12-24 10:39:57 +01:00

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.
This commit is contained in:
NIIBE Yutaka 2013-03-26 12:43:24 +09:00
parent 247bec6a6f
commit c3495209ee
2 changed files with 10 additions and 6 deletions

View File

@ -914,9 +914,11 @@ pcsc_get_status_direct (int slot, unsigned int *status)
*status = 0; *status = 0;
if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) ) if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) )
{
*status |= APDU_CARD_PRESENT; *status |= APDU_CARD_PRESENT;
if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
*status |= APDU_CARD_ACTIVE; *status |= APDU_CARD_ACTIVE;
}
#ifndef HAVE_W32_SYSTEM #ifndef HAVE_W32_SYSTEM
/* We indicate a useful card if it is not in use by another /* We indicate a useful card if it is not in use by another
application. This is because we only use exclusive access application. This is because we only use exclusive access

View File

@ -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_UNKNOWN) )
{ {
if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) ) if ( (rdrstates[0].event_state & PCSC_STATE_PRESENT) )
{
status |= 2; status |= 2;
if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) ) if ( !(rdrstates[0].event_state & PCSC_STATE_MUTE) )
status |= 4; status |= 4;
}
/* We indicate a useful card if it is not in use by another /* We indicate a useful card if it is not in use by another
application. This is because we only use exclusive access application. This is because we only use exclusive access
mode. */ mode. */