VMware Virtual CCID reader optimization problem
Problem description
A smart card works correctly when attached directly to a virtual machine, but fails when using the VMware Virtual USB CCID shared smart card reader.
Root cause analysis
An APDU trace with rohitab API Monitor shows that the card does not receive the same APDU from the host and from the VM.
The raw APDUs in API Monitor show the difference:
vmware-vmx.exe: last byte stripped
The last byte is stripped by VMware. VMware allocates a 258-byte buffer for APDU responses (256 bytes of data plus SW1/SW2) and drops the last byte of the command. Sending the same APDU from the host without its last byte gives the same wrong result as the VM.