Skip to content

Commit

Permalink
Fix fake composite device code to use a fixed order
Browse files Browse the repository at this point in the history
The value static_interface shall be incremented only for composite devices.
Otherwise any other reader would increase the value and the next
composite reader connected will have its interfaces enumerated in a
different order.

The problem occurs only on Mac OS X (pcscd) that still does not support
composite CCID devices. The CCID driver has to be configured with
--enable-composite-as-multislot and composite CCID devices are
"emulated" as a multi-slot device.

Thanks to Godfrey Chung for the patch
#19
  • Loading branch information
godfreychung authored and LudovicRousseau committed Jun 23, 2016
1 parent 32c8a42 commit 6123a4c
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions src/ccid_usb.c
Original file line number Diff line number Diff line change
Expand Up @@ -622,12 +622,17 @@ status_t OpenUSBByName(unsigned int reader_index, /*@null@*/ char *device)
}

#ifdef USE_COMPOSITE_AS_MULTISLOT
/* use the next interface for the next "slot" */
static_interface++;
if ((GEMALTOPROXDU == readerID)
|| (GEMALTOPROXSU == readerID)
|| (FEITIANR502DUAL == readerID))
{
/* use the next interface for the next "slot" */
static_interface++;

/* reset for a next reader */
if (static_interface > 2)
static_interface = (FEITIANR502DUAL == readerID) ? 0: 1;
/* reset for a next reader */
if (static_interface > 2)
static_interface = (FEITIANR502DUAL == readerID) ? 0: 1;
}
#endif

/* Get Endpoints values*/
Expand Down

0 comments on commit 6123a4c

Please sign in to comment.