diff --git a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py index dc90e02..4b22c9d 100644 --- a/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py +++ b/virtualsmartcard/src/vpicc/virtualsmartcard/cards/ePass.py @@ -36,8 +36,7 @@ class ePass_SE(Security_Environment): def compute_cryptographic_checksum(self, p1, p2, data): """ Compute a cryptographic checksum (e.g. MAC) for the given data. - Algorithm and key are specified in the current (CAPDU) SE. The ePass - uses a Send Sequence Counter for MAC calculation + The ePass uses a Send Sequence Counter for MAC calculation """ if p1 != 0x8E or p2 != 0x80: raise SwError(SW["ERR_INCORRECTP1P2"]) @@ -104,7 +103,7 @@ class PassportSAM(SAM): #Receive Mutual Authenticate APDU from terminal #Decrypt data and check MAC Eifd = resp_data[:-8] - padded_Eifd = vsCrypto.append_padding("DES", Eifd) + padded_Eifd = vsCrypto.append_padding("DES", Eifd) Mifd = vsCrypto.crypto_checksum("CC", self.KMac, padded_Eifd) #Check the MAC if not Mifd == resp_data[-8:]: @@ -120,7 +119,7 @@ class PassportSAM(SAM): #Generate Answer data = plain[8:16] + plain[:8] + Kicc Eicc = vsCrypto.encrypt("DES3-CBC", self.KEnc, data) - padded_Eicc = vsCrypto.append_padding("DES", Eicc) + padded_Eicc = vsCrypto.append_padding("DES", Eicc) Micc = vsCrypto.crypto_checksum("CC", self.KMac, padded_Eicc) #Derive the final keys and set the current SE KSseed = vsCrypto.operation_on_string(Kicc, Kifd, lambda a, b: a^b)