def after_send(self, result): if (self.last_vanilla_c_apdu.cla & 0x80 != 0x80) and (self.last_vanilla_c_apdu.CLA & 0x0C != 0x0C): # Inject fake response descriptor so that TCOS_Security_Environment.after_send sees the need to authenticate/decrypt response_descriptor = "\x99\x00\x8e\x00" if self.last_vanilla_c_apdu.case() in (2,4): response_descriptor = "\x87\x00" + response_descriptor response_descriptor = "\xba" + chr(len(response_descriptor)) + response_descriptor self.last_c_apdu.data = self.last_c_apdu.data + response_descriptor return TCOS_Security_Environment.after_send(self, result)
def after_send(self, result): if (self.last_vanilla_c_apdu.cla & 0x80 != 0x80) and (self.last_vanilla_c_apdu.CLA & 0x0C != 0x0C): # Inject fake response descriptor so that TCOS_Security_Environment.after_send sees the need to authenticate/decrypt response_descriptor = "\x99\x00\x8e\x00" if self.last_vanilla_c_apdu.case() in (2, 4): response_descriptor = "\x87\x00" + response_descriptor response_descriptor = "\xba" + chr( len(response_descriptor)) + response_descriptor self.last_c_apdu.data = self.last_c_apdu.data + response_descriptor return TCOS_Security_Environment.after_send(self, result)