Exemple #1
0
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
Exemple #2
0
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
Exemple #3
0
    def verify_certificate(self, p1, p2, data):
        if (p1, p2) != (0x00, 0xbe):
            raise SwError(SW["ERR_INCORRECTPARAMETERS"])

        cert = bertlv_pack([[0x7f21, len(data), data]])
        if 1 != eac.TA_STEP2_import_certificate(self.eac_ctx, cert):
            eac.print_ossl_err()
            raise SwError(SW["ERR_NOINFO69"])

        print("Imported Certificate")

        return b""