-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ACR33U - CCID_Receive() Can't read all data 49174kbytes #19
Comments
I guess, this trace is more explicit and it should help: |
Please use the following command to log CCID command/response: |
Enclosed an extract: Should you want the full log, I can direct mail it to you. I guess, the dwFeatures is relevant too: It is just a guess: it gets called for a short APDU:
instead of the EXTENDED one:
Since:
while: best regards, |
According to the log, the response should be correct but the reader added too many zeros to the response. The actual response APDU is Line 1674 in commands.c
After reviewing the code, I found that it may be too strict (
Can you try it and report the result? |
Currently, when some extended APDU are processed, we get the following error: CCID_Receive() Can't read all data 49174kbytes In fact, the processing of the length of the APDU is not correct. For example: 00000002 commands.c:1726:CmdXfrBlockAPDU_short() T=0: 9 bytes 00000003 -> 000000 6F 09 00 00 00 00 2D 00 00 00 00 A4 09 04 04 3F 00 D0 03 00033873 <- 000000 80 02 00 00 00 00 2D 00 00 00 61 27 00 00 00 00 00 00 00 [...] 00002330 commands.c:1682:CCID_Receive() Can't read all data (49174 out of 2 expected) According to the log, the response should be correct but the reader may add too many zeros to the response. The actual response APDU is 61 27. If we check the complete logs/dumps, all the payload till the end is full of 00 .. 00. In fact, the check of the length of the data should be less strict. Let's be tolerant as along as we get enough payload. Suggested-by: @godfreychung Fix: issue acshk#19
Thanks for your comment. Your fix solved the problem. I was able to run a full pkcs11-dump on the card. I hope my pull request is good enough. |
Yes, I merged your pull request. Thanks! |
Thanks. Please, can you streamline it for the Ubuntu 18.04 distributions ? |
Let me review the side effect of code modification before submitting a bug report to Ubuntu. In the meantime, can you provide your test environment to reproduce the issue? |
@godfreychung I rejected this patch in my driver because the problem happens only in a virtual machine host. I guess the problem comes for the virtualization software, not the CCID driver or the reader. |
Hi,
When using the:
00000024 hotplug_libudev.c:436:HPAddDevice() Adding USB device: ACS ACR33U-A1 3SAM ICC Reader
00000028 readerfactory.c:1075:RFInitializeReader() Attempting startup of ACS ACR33U-A1 3SAM ICC Reader 00 00 using /usr/lib/pcsc/drivers/ifd-acsccid.bundle/Contents/Linux/libacsccid.so
00072079 ccid_usb.c:754:OpenUSBByName() Found Vendor/Product: 072F/8300 (ACS ACR33U-A1 3SAM ICC Reader)
it cannot support some French pkcs11 card because of:
00000046 APDU: 00 A4 09 04 04 3F 00 D0 03
00000046 ifdhandler.c:1640:IFDHTransmitToICC() usb:072f/8300:libudev:0:/dev/bus/usb/001/011 (lun: 0)
00030608 commands.c:1678:CCID_Receive() Can't read all data (49174 out of 2 expected)
00000037 SW:
00000003 ifdwrapper.c:543:IFDTransmit() Card not transacted: 612
00000003 winscard.c:1620:SCardTransmit() Card not transacted: 0x80100016
It guess because the driver does not support some Extended APDU.
Should you need more log, feel free to ask.
Best regards,
Vincent
The text was updated successfully, but these errors were encountered: