CCID_Receive() Can't read all data

Bug #1895509 reported by Vincent JARDIN
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
acsccid (Ubuntu)
Incomplete
Undecided
Godfrey Chung

Bug Description

Hi,

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.

A fix is already available within the github repo:
  https://github.com/acshk/acsccid/commit/e23befb5a80bf55bd817eca0102912aec90138ed
I guess an update of the package based on this github repo should be OK.

Vincent JARDIN (vjardin)
description: updated
Revision history for this message
Godfrey Chung (godfrey-chung) wrote :

Can you provide steps to reproduce the issue?

Revision history for this message
Vincent JARDIN (vjardin) wrote :

Stéps to reproduce it:
  - connect a french healthcare PKCS11 smart card,
  - read it using pkcs11-dump, it fails
  - enable the logs then you'll get this error message from the logs that helps to understand the failure from pkcs11-dump

Revision history for this message
Godfrey Chung (godfrey-chung) wrote :

Sorry, I don't have the card. It seems that any APDU can reproduce the issue.

Can you provide your testing environment?

Revision history for this message
Vincent JARDIN (vjardin) wrote :

Maybe any APDU can reproduce the issue, but beside plugging the card with an ACR reader, I do not have anything specific, I believe.

Revision history for this message
Godfrey Chung (godfrey-chung) wrote :

I saw that you mentioned virtual machines here.
https://github.com/LudovicRousseau/CCID/pull/67

Can you provide more details so that I can reproduce the issue?

Changed in acsccid (Ubuntu):
status: New → Incomplete
Changed in acsccid (Ubuntu):
assignee: nobody → Godfrey Chung (godfrey-chung)
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.