aboutsummaryrefslogtreecommitdiffstats
path: root/cards/iso_7816_4_card.py
diff options
context:
space:
mode:
authorhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-06-16 23:14:14 +0000
committerhploetz <hploetz@f711b948-2313-0410-aaa9-d29f33439f0b>2006-06-16 23:14:14 +0000
commit54c53d262cd730c8b34d0c7de3fe98e15efe6886 (patch)
tree9b4140beea5815b799c4a4d3eaafb81c84ba8338 /cards/iso_7816_4_card.py
parent68960b8c8ba67f251fde55355680058982e50ec6 (diff)
Make it possible to override tags
Replace the "= object()" with a proper class and explanation git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@93 f711b948-2313-0410-aaa9-d29f33439f0b
Diffstat (limited to 'cards/iso_7816_4_card.py')
-rw-r--r--cards/iso_7816_4_card.py8
1 files changed, 5 insertions, 3 deletions
diff --git a/cards/iso_7816_4_card.py b/cards/iso_7816_4_card.py
index 4b5b854..ffeff3d 100644
--- a/cards/iso_7816_4_card.py
+++ b/cards/iso_7816_4_card.py
@@ -36,7 +36,7 @@ class ISO_7816_4_Card(Card):
if len(result.data) > 0:
print utils.hexdump(result.data)
- print TLV_utils.decode(result.data)
+ print TLV_utils.decode(result.data,tags=self.TLV_OBJECTS)
def open_file(self, fid):
"Open an EF under the current DF"
@@ -49,7 +49,7 @@ class ISO_7816_4_Card(Card):
result = self.open_file(fid)
if len(result.data) > 0:
print utils.hexdump(result.data)
- print TLV_utils.decode(result.data)
+ print TLV_utils.decode(result.data,tags=self.TLV_OBJECTS)
def read_binary_file(self, offset = 0):
"""Read from the currently selected EF.
@@ -93,7 +93,7 @@ class ISO_7816_4_Card(Card):
result = self.select_file(p1, p2, fid)
if len(result.data) > 0:
print utils.hexdump(result.data)
- print TLV_utils.decode(result.data)
+ print TLV_utils.decode(result.data,tags=self.TLV_OBJECTS)
ATRS = list(Card.ATRS)
ATRS.extend( [
@@ -162,3 +162,5 @@ class ISO_7816_4_Card(Card):
"6A87": "Wrong parameter(s) P1-P2, Lc inconsistent with P1-P2",
"6A88": "Wrong parameter(s) P1-P2, Referenced data not found",
} )
+
+ TLV_OBJECTS = TLV_utils.tags