frankmorgner / vsmartcard

umbrella project for emulation of smart card readers or smart cards
http://frankmorgner.github.io/vsmartcard/
684 stars 197 forks source link

TCP network trace raises questions #253

Closed amalg closed 1 year ago

amalg commented 1 year ago

Capturing packets between Android Smart Card reader app and the VPCD driver running on Windows 11, I noticed some traffic that raised questions. Here is the first few packets of traffic. The data is listed in numbered sequence where > indicates an outbound packet from VPCD to reader and < indicates an inbound packet from reader to VPCD;

01 >00 01 04
02 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
03 >00 01 04
04 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
05 >00 01 02 00 01 04
06 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
07 >00 01 02 00 01 04
08 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
09 >00 01 04
10 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
11 >00 01 02 00 01 04
12 <00 0F 3B 8A 80 01 00 31  C1 73 C8 40 00 00 90 00 90
13 >00 10 00 A4 04 00 0B A0  00 00 03 97 43 49 44 5F 01 00
14 <00 02 6A 82

I am noticing two things;

My questions are;

amalg commented 1 year ago

@mildsunrise this is data captured from virtualsmartcard release version 0.8 (prior to your recent contribution). Considering your changes to calculating and sending the length (size) bytes and payload in a single call to sendall(), do you think this may have inadvertently solved this problem? I have no tools nor skill enough to compile and test or I would :/

amalg commented 1 year ago

Oh wow.. when I said I didn't have the skill, I was dead on.

This is not an issue. There are simply two separate control codes sent;

00 01 02 - reset, which generates no response from the remote reader 00 01 04 - get atr

Sorry. I wish github allowed reverting back the complete history of the universe to pretend like I never posted this issue.