nPA: fixed resume PIN command
PACE with CAN followed by PACE with PIN in SM failed, because the eac_ctx holding the SM context was always cleared at the beginning of the second PACE run.
This commit is contained in:
@@ -172,9 +172,6 @@ class nPA_SE(Security_Environment):
|
|||||||
if tlv_data != []:
|
if tlv_data != []:
|
||||||
raise SwError(SW["WARN_NOINFO63"])
|
raise SwError(SW["WARN_NOINFO63"])
|
||||||
|
|
||||||
self.__eac_abort()
|
|
||||||
|
|
||||||
self.eac_ctx = pace.EAC_CTX_new()
|
|
||||||
if self.at.keyref_is_mrz():
|
if self.at.keyref_is_mrz():
|
||||||
self.sec = pace.PACE_SEC_new(self.sam.mrz, pace.PACE_MRZ)
|
self.sec = pace.PACE_SEC_new(self.sam.mrz, pace.PACE_MRZ)
|
||||||
elif self.at.keyref_is_can():
|
elif self.at.keyref_is_can():
|
||||||
@@ -198,9 +195,13 @@ class nPA_SE(Security_Environment):
|
|||||||
else:
|
else:
|
||||||
raise SwError(SW["ERR_INCORRECTPARAMETERS"])
|
raise SwError(SW["ERR_INCORRECTPARAMETERS"])
|
||||||
|
|
||||||
|
if not self.eac_ctx:
|
||||||
|
self.eac_ctx = pace.EAC_CTX_new()
|
||||||
|
|
||||||
ef_card_access = self.mf.select('fid', 0x011c)
|
ef_card_access = self.mf.select('fid', 0x011c)
|
||||||
ef_card_access_data = ef_card_access.data
|
ef_card_access_data = ef_card_access.data
|
||||||
pace.EAC_CTX_init_ef_cardaccess(ef_card_access_data, self.eac_ctx)
|
pace.EAC_CTX_init_ef_cardaccess(ef_card_access_data, self.eac_ctx)
|
||||||
|
|
||||||
ef_card_security = self.mf.select('fid', 0x011d)
|
ef_card_security = self.mf.select('fid', 0x011d)
|
||||||
ef_card_security_data = ef_card_security.data
|
ef_card_security_data = ef_card_security.data
|
||||||
ca_pubkey = pace.CA_get_pubkey(self.eac_ctx, ef_card_security_data)
|
ca_pubkey = pace.CA_get_pubkey(self.eac_ctx, ef_card_security_data)
|
||||||
|
|||||||
Reference in New Issue
Block a user