aboutsummaryrefslogtreecommitdiffstats
path: root/cards
diff options
context:
space:
mode:
Diffstat (limited to 'cards')
-rw-r--r--cards/passport_application.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/cards/passport_application.py b/cards/passport_application.py
index cc87c1b..7b595a4 100644
--- a/cards/passport_application.py
+++ b/cards/passport_application.py
@@ -230,6 +230,12 @@ class Passport_Application(Application):
def get_prompt(self):
return "(%s)%s" % (self.DRIVER_NAME, self.se and "[SM]" or "")
+
+ def check_sw(self, sw, purpose = None):
+ if purpose is not Card.PURPOSE_SM_OK:
+ return Card.check_sw(self, sw, purpose)
+ else:
+ return sw not in ("\x69\x87", "\x69\x88")
def _read_ef(self, fid):
result = self.open_file(fid, 0x0c)
@@ -307,6 +313,14 @@ class Passport_Application(Application):
0x5C: (decode_tag_list, "List of all data groups present")
}
+ def decode_mrz(value):
+ l = len(value)/2
+ return "\n" + value[:l] + "\n" + value[l:]
+
+ TLV_OBJECTS[context_EFdg1] = {
+ 0x5F1F: (decode_mrz, "Machine Readable Zone data"),
+ }
+
if __name__ == "__main__":
mrz1 = "P<UTOERIKSSON<<ANNA<MARIA<<<<<<<<<<<<<<<<<<<"