From 54c53d262cd730c8b34d0c7de3fe98e15efe6886 Mon Sep 17 00:00:00 2001 From: hploetz Date: Fri, 16 Jun 2006 23:14:14 +0000 Subject: 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 --- cards/iso_7816_4_card.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'cards/iso_7816_4_card.py') 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 -- cgit v1.2.3