let MSE:Set AT distinguish between tags 83, 84

This commit is contained in:
Frank Morgner
2012-10-12 11:48:22 +02:00
parent fd4ed5162c
commit 5ab760e0c0
2 changed files with 13 additions and 9 deletions

View File

@@ -50,7 +50,9 @@ class ControlReferenceTemplate:
self.type = tag
self.iv = None
self.keyref = None
self.keyref_secret_key = None
self.keyref_public_key = None
self.keyref_private_key = None
self.key = None
self.fileref = None
self.DFref = None
@@ -105,9 +107,11 @@ class ControlReferenceTemplate:
self.fileref = value
elif tag == 0x82:
self.DFref = value
elif tag in (0x83, 0x84):
#Todo: Resolve reference
self.keyref = value
elif tag == 0x83:
self.keyref_secret_key = value
self.keyref_public_key = value
elif tag == 0x84:
self.keyref_private_key = value
def __set_iv(self, tag, length, value):
iv = None

View File

@@ -39,22 +39,22 @@ class nPA_AT_CRT(ControlReferenceTemplate):
self.chat = None
def keyref_is_mrz(self):
if self.keyref == '%c'% self.PACE_MRZ:
if self.keyref_secret_key == '%c'% self.PACE_MRZ:
return True
return False
def keyref_is_can(self):
if self.keyref == '%c'% self.PACE_CAN:
if self.keyref_secret_key == '%c'% self.PACE_CAN:
return True
return False
def keyref_is_pin(self):
if self.keyref == '%c'% self.PACE_PIN:
if self.keyref_secret_key == '%c'% self.PACE_PIN:
return True
return False
def keyref_is_puk(self):
if self.keyref == '%c'% self.PACE_PUK:
if self.keyref_secret_key == '%c'% self.PACE_PUK:
return True
return False
@@ -355,7 +355,7 @@ class nPA_SE(Security_Environment):
Authenticate the terminal to the card. Check whether Terminal correctly
encrypted the given challenge or not
"""
if self.dst.keyref: # TODO check if this is the correct CAR
if self.dst.keyref_public_key: # TODO check if this is the correct CAR
id_picc = pace.EAC_Comp(self.eac_ctx, pace.EAC_ID_PACE, self.my_pace_eph_pubkey)
# FIXME auxiliary_data might be from an older run of PACE