minor tweaks

git-svn-id: svn+ssh://localhost/home/henryk/svn/cyberflex-shell/trunk@120 f711b948-2313-0410-aaa9-d29f33439f0b
This commit is contained in:
hploetz 2006-10-25 13:31:43 +00:00
parent b3ea921b2f
commit db5f07df04
2 changed files with 6 additions and 6 deletions

View File

@ -159,7 +159,7 @@ class TCOS_Card(ISO_7816_4_Card,building_blocks.Card_with_80_aa):
elif len(secrets) == 1:
partresponse.append(" needs " + secrets[0])
elif len(secrets) == 0:
partresponse.append(" is always allowed")
partresponse.append(" always allowed")
def decode_key(value):
partresponse.append( (value&0x80) and "local" or "global" )

View File

@ -123,7 +123,7 @@ class Cyberflex_Shell(Shell):
def parse_fancy_apdu(*args):
apdu_string = " ".join(args)
if not Cyberflex_Shell._fancyapduregex.match(apdu_string):
raise NotImplementedError
raise ValueError
apdu_string = apdu_string.lower()
have_le = False
@ -139,7 +139,7 @@ class Cyberflex_Shell(Shell):
apdu_tail = apdu_string[pos+2:]
if apdu_head.strip() != "" and not Cyberflex_Shell._apduregex.match(apdu_head):
raise NotImplementedError
raise ValueError
stack = [""]
for char in apdu_tail:
@ -147,7 +147,7 @@ class Cyberflex_Shell(Shell):
stack[-1] = stack[-1] + char
elif char == ")":
if len(stack) == 1:
raise NotImplementedError
raise ValueError
else:
inner_content = stack.pop()
l = len("".join(inner_content.split()))
@ -158,10 +158,10 @@ class Cyberflex_Shell(Shell):
elif char == "(":
stack.append("")
else:
raise NotImplementedError
raise ValueError
if len(stack) > 1:
raise NotImplementedError
raise ValueError
apdu_string = stack[0]