Closed vjardin closed 1 year ago
https://github.com/LudovicRousseau/PCSC/blob/4f7bf5c9a3acb80d6d8dea7256376a759e270b57/src/hotplug_libusb.c#L166
According to pcsc-lite, it uses readdir()
to return the directory name. The readdir()
does not guarantee any ordering.
I agree with your analysis, but then, how to make sure that the ccid driver skips the ACS devices so only the acsccid ones get used ?
For instance, from the code your are pointing, https://github.com/LudovicRousseau/PCSC/blob/4f7bf5c9a3acb80d6d8dea7256376a759e270b57/src/hotplug_libusb.c#L206 I understand that only the acsccid driver should be loaded for the ACS devices, doesn't it ?
It can use scandir()
instead of readdir()
so that the directory name is returned in alphanumeric order.
I am not sure that it is the "spirit" of the design from @LudovicRousseau ; I can try to post a pull request in order to get some feedbacks about it.
pcscd has a priority check. If the driver is defined as a class driver CCIDCLASSDRIVER
then another driver for the same device wll have a higher priority.
https://github.com/LudovicRousseau/PCSC/blob/master/src/hotplug_libudev.c#L313
It looks like the acsccid driver is configured as NOT a class driver https://github.com/acshk/acsccid/blob/master/configure.ac#L220
So it should work fine, if pcscd uses hotplug_libudev
.
From the traces above I see that pcscd has been configured to use hotplug_libusb.c
instead of hotplug_libudev.c
(default choice).
Thanks @LudovicRousseau for the followup. hotplug_libusb.c
has to be used because of the constraints from openwrt environment (small footprint). Do you have any tip in order to have a proper patch to start with ? I do not have much experience with this environment of pcscd/libusb.
I may try to add support of multi driver and priority in hotplug_libusb.c
. But not before a few days.
I had a look at the source code and this change will involve "complex" changes.
If you want to do it yourself I suggest to examine how it is done in hotplug_libudev.c
.
You may also open a new issue for the project https://github.com/LudovicRousseau/PCSC since the problem is not with acsccid but PCSC.
Yes please, I would be interested in performing some tests of your patches on openwrt using hotplug_libusb.c
. ping me whenever you want.
This should now be fixed in https://github.com/LudovicRousseau/PCSC/commit/113f74a1d7189ced85038b890253f2f3b477c3f0
Please test this code and report if your problem is fixed or not.
Hi,
using the acsccid from:
it can probe properly an ACR33U-A1:
but if there are both ccid and acsccid, then the wrong one is selected:
The same, but of a Ubuntu 20.04 works fine. The proper acsccid is used.
I am not a deep expert in this framework: what could be wrong ? Which traces should I gather in order to isolate the root cause ?
thank you,