Hi Holger,<div><br></div><div>ATR of that card from a pcsc reader:</div><div><br></div><div><div>Reader 0: Gemalto GemPC Twin 00 00</div><div>Card state: Card inserted, </div><div>ATR: 3B 16 95 D0 00 45 F7 01 00</div></div>
<div><br></div><div>seems to be much shorter than usual ATR I've seen, but _all_ o2-cz and o2-sk, postpaid, prepaid have that same ATR (since like 2-3 yrs old till few months ago - meaning bought from o2).</div><div><br>
</div><div>wasn't so sure where to stick the hex-dump so I've put it into main.c, process_usb_msg, diff is below just in case you need to be sure about the exact location.</div><div>trace i got is attached, it seems some of the APDU data are getting marked as part of ATR with SIMTRACE_FLAG_ATR flag and since then all the data don't make sense to the parser anymore (imho).</div>
<div><br></div><div>Cheers,</div><div>Lukas</div><div><br></div><div><div>diff --git a/host/main.c b/host/main.c</div><div>index 4fbac8d..377868a 100644</div><div>--- a/host/main.c</div><div>+++ b/host/main.c</div><div>@@ -92,6 +92,7 @@ static int process_usb_msg(uint8_t *buf, int len)</div>
<div> </div><div> switch (sh->cmd) {</div><div> case SIMTRACE_MSGT_DATA:</div><div>+ printf("dump: %s\n", osmo_hexdump(payload, payload_len));</div><div> /* special treatment for ATR */</div>
<div> if (sh->flags & SIMTRACE_FLAG_ATR) {</div><div> printf("ATR ");</div></div><div><br></div><div><br></div><div><br></div><div><br></div><div><div class="gmail_quote">
On Thu, Dec 15, 2011 at 10:48 PM, Holger Hans Peter Freyther <span dir="ltr"><<a href="mailto:holger@freyther.de">holger@freyther.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On 12/15/2011 10:24 PM, Lukas Kuzmiak wrote:<br>
<br>
><br>
> - I've put one printf() into the apdu_split_in method, it seems the buffer is<br>
> somehow getting scrambled from the beginning, it shows something like:<br>
<br>
</div>Hi,<br>
so let me claim the issue is in our split method... could you generate the<br>
hexdump of the bytes added? we could then feed APDU split ourselves. The other<br>
part would be, do you have a PCSC Card reader? you could send us the ATR as<br>
reportede by pcsc_scan.<br>
<br>
<br>
<br>
</blockquote></div><br></div>