Rename parse_fancy_apdu to parse_fancy
This commit is contained in:
parent
20b8d8167e
commit
e343352675
|
@ -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)
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
2
utils.py
2
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
|
||||
|
|
Loading…
Reference in New Issue