|
From: <lu...@us...> - 2012-09-29 12:09:45
|
Revision: 605
http://pyscard.svn.sourceforge.net/pyscard/?rev=605&view=rev
Author: ludov
Date: 2012-09-29 12:09:39 +0000 (Sat, 29 Sep 2012)
Log Message:
-----------
Catch a IndexError exception
Some ATR are bogus. For example: 3B EF 00 FF 81 31 00 45 65 63 is bogus.
If we pad the ATR with 00 we have:
ATR: 3B EF 00 FF 81 31 00 45 65 63 00 00 00 00 00 00 00 00 00 00 00 00 00
TS = 0x3B --> Direct Convention
T0 = 0xEF --> Y(1): b1110, K: 15 (historical bytes)
TB(1) = 0x00 --> VPP is not electrically connected
TC(1) = 0xFF --> Extra guard time: 255 (special value)
TD(1) = 0x81 --> Y(i+1) = b1000, Protocol T=1
----
TD(2) = 0x31 --> Y(i+1) = b0011, Protocol T=1
----
TA(3) = 0x00 --> IFSC: 0
TB(3) = 0x45 --> Block Waiting Integer: 4 - Character Waiting Integer: 5
----
Historical bytes --> 65 63 00 00 00 00 00 00 00 00 00 00 00 00 00
Category indicator byte: 0x65 --> (proprietary format) equivalent ASCII string: "c............."
TCK = 0x-1 --> WRONG CHECKSUM, expected 0xE3
Possibly identified card:
3B EF 00 FF 81 31 .. 45 65 63
Debit card (Germany): ec-cash, GeldKarte(DEM), Maestro, Cirrus
The ATR do NOT contain 15 of history.
Modified Paths:
--------------
trunk/contrib/parseATR/parseATR.py
Modified: trunk/contrib/parseATR/parseATR.py
===================================================================
--- trunk/contrib/parseATR/parseATR.py 2012-09-28 17:12:42 UTC (rev 604)
+++ trunk/contrib/parseATR/parseATR.py 2012-09-29 12:09:39 UTC (rev 605)
@@ -137,7 +137,10 @@
# Store TCK
last = pointer + 1 + hb_length
if "TCK" in atr:
- atr["TCK"] = atr_txt[last]
+ try:
+ atr["TCK"] = atr_txt[last]
+ except IndexError:
+ atr["TCK"] = -1;
last += 1
if len(atr_txt) > last:
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|