def tatest(): ta = PACEEntity("123456") assert eac.EAC_CTX_init_ca(ta.ctx, eac.OBJ_txt2nid("id-CA-ECDH-AES-CBC-CMAC-128"), 11) == 1 # our certificates aren't up to date eac.TA_disable_checks(ta.ctx) assert eac.EAC_CTX_init_ta(ta.ctx, None, CVCA) == 1 assert eac.TA_STEP2_import_certificate(ta.ctx, DVCA) == 1 assert eac.TA_STEP2_import_certificate(ta.ctx, CHAIN_CVC) == 1 nonce = eac.TA_STEP4_get_nonce(ta.ctx) assert nonce is not None
def tatest(): ta = PACEEntity("123456") assert eac.EAC_CTX_init_ca(ta.ctx, eac.id_CA_ECDH_AES_CBC_CMAC_128, 11) == 1 # our certificates aren't up to date eac.TA_disable_checks(ta.ctx) assert eac.EAC_CTX_init_ta(ta.ctx, None, CVCA) == 1 assert eac.TA_STEP2_import_certificate(ta.ctx, DVCA) == 1 assert eac.TA_STEP2_import_certificate(ta.ctx, CHAIN_CVC) == 1 nonce = eac.TA_STEP4_get_nonce(ta.ctx) assert nonce is not None
def get_challenge(self, p1, p2, data): if self.current_SE.eac_step == 4: # TA if (p1 != 0x00 or p2 != 0x00): raise SwError(SW["ERR_INCORRECTP1P2"]) self.last_challenge = \ eac.TA_STEP4_get_nonce(self.current_SE.eac_ctx) if not self.last_challenge: eac.print_ossl_err() raise SwError(SW["ERR_NOINFO69"]) else: SAM.get_challenge(self, p1, p2, data) return SW["NORMAL"], self.last_challenge