Skip to content
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

CCID: Fix misleading read length #67

Closed
wants to merge 3 commits into from

Commits on Mar 27, 2020

  1. CCID: Fix misleading read length

    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.
    
    This fix has been tested with:
      - Gemalto (was Gemplus) GemPC Twin
      - Alcor Micro Corp. AU9540
      - Feitian R502
    
    Suggested-by: @godfreychung
    Fix: issue LudovicRousseau#66
    vjardin committed Mar 27, 2020
    Configuration menu
    Copy the full SHA
    d068376 View commit details
    Browse the repository at this point in the history

Commits on Aug 3, 2020

  1. CCID: Fix misleading read length

    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.
    
    This fix has been tested with:
      - Gemalto (was Gemplus) GemPC Twin
      - Alcor Micro Corp. AU9540
      - Feitian R502
    
    Suggested-by: @godfreychung
    Fix: issue LudovicRousseau#66
    vjardin committed Aug 3, 2020
    Configuration menu
    Copy the full SHA
    bd30d97 View commit details
    Browse the repository at this point in the history
  2. Configuration menu
    Copy the full SHA
    5ab6da9 View commit details
    Browse the repository at this point in the history