def _set_SE(self, p2, data): sw, resp = Security_Environment._set_SE(self, p2, data) if self.at.algorithm == "PACE": self.eac_step = 0 elif self.at.algorithm == "TA": if self.eac_step != 4: SwError(SW["ERR_AUTHBLOCKED"]) elif self.at.algorithm == "CA": if self.eac_step != 5: SwError(SW["ERR_AUTHBLOCKED"]) return sw, resp
def _set_SE(self, p2, data): sw, resp = Security_Environment._set_SE(self, p2, data) if self.at.algorithm == "PACE": if self.at.keyref_is_pin(): if self.sam.counter <= 0: print "Must use PUK to unblock" return 0x63c0, "" if self.sam.counter == 1 and not self.sam.active: print "Must use CAN to activate" return 0x63c1, "" self.eac_step = 0 elif self.at.algorithm == "TA": if self.eac_step != 4: SwError(SW["ERR_AUTHBLOCKED"]) elif self.at.algorithm == "CA": if self.eac_step != 5: SwError(SW["ERR_AUTHBLOCKED"]) return sw, resp
def _set_SE(self, p2, data): sw, resp = Security_Environment._set_SE(self, p2, data) if self.at.algorithm == "PACE": if self.at.keyref_is_pin(): if self.sam.counter <= 0: print("Must use PUK to unblock") return 0x63c0, "" if self.sam.counter == 1 and not self.sam.active: print("Must use CAN to activate") return 0x63c1, "" self.eac_step = 0 elif self.at.algorithm == "TA": if self.eac_step != 4: raise SwError(SW["ERR_AUTHBLOCKED"]) elif self.at.algorithm == "CA": if self.eac_step != 5: raise SwError(SW["ERR_AUTHBLOCKED"]) return sw, resp