diff --git a/cards/passport_application.py b/cards/passport_application.py index 943038f..9e5280f 100644 --- a/cards/passport_application.py +++ b/cards/passport_application.py @@ -53,7 +53,7 @@ class Passport_Security_Environment(TCOS_Security_Environment): new_apdu.append("8E()00") new_apdu_string = "".join(new_apdu) - apdu = C_APDU.parse_fancy_apdu(new_apdu_string) + apdu = C_APDU.parse_fancy(new_apdu_string) return TCOS_Security_Environment.before_send(self, apdu) diff --git a/cyberflex-shell.py b/cyberflex-shell.py index db561c4..9ff3339 100755 --- a/cyberflex-shell.py +++ b/cyberflex-shell.py @@ -216,7 +216,7 @@ class Cyberflex_Shell(Shell): def cmd_fancy(self, *args): "Parse a fancy APDU and print the result" - apdu = utils.C_APDU.parse_fancy_apdu(*args) + apdu = utils.C_APDU.parse_fancy(*args) data = apdu.render() if hasattr(self, "card"): self.card.last_result = utils.R_APDU(data+"\x00\x00") @@ -233,7 +233,7 @@ class Cyberflex_Shell(Shell): "Parse and transmit a fancy APDU" apdu = None try: - apdu = utils.C_APDU.parse_fancy_apdu(*args) + apdu = utils.C_APDU.parse_fancy(*args) except ValueError: raise NotImplementedError diff --git a/utils.py b/utils.py index 00533dc..0352447 100644 --- a/utils.py +++ b/utils.py @@ -319,7 +319,7 @@ class C_APDU(Command_Frame,APDU): _apduregex = re.compile(r'^\s*([0-9a-f]{2}\s*){4,}$', re.I) _fancyapduregex = re.compile(r'^\s*([0-9a-f]{2}\s*){4,}\s*((xx|yy)\s*)?(([0-9a-f]{2}|:|\)|\(|\[|\])\s*)*$', re.I) @staticmethod - def parse_fancy_apdu(*args): + def parse_fancy(*args): apdu_string = " ".join(args) if not C_APDU._fancyapduregex.match(apdu_string): raise ValueError