Esempio n. 1
0
    def test_bad_private_id(self):
        alice_key = YubiKey(unhexlify(b'2627dc624cbd'), 6, 0)
        otp = alice_key.generate()
        token = encode_otp(otp, self.alice_aes, self.alice_public)
        ok = self.alice_device.verify_token(token)

        self.assertFalse(ok)
Esempio n. 2
0
    def test_bad_private_id(self):
        alice_key = YubiKey(unhexlify(b'2627dc624cbd'), 6, 0)
        otp = alice_key.generate()
        token = encode_otp(otp, self.alice_aes, self.alice_public)
        ok = self.alice_device.verify_token(token)

        self.assertTrue(not ok)
Esempio n. 3
0
    def alice_token(self, session=None, counter=None):
        otp = self.alice_key.generate()

        if session is not None:
            otp.session = session

        if counter is not None:
            otp.counter = counter

        return otp, encode_otp(otp, self.alice_aes, self.alice_public)
Esempio n. 4
0
    def alice_token(self, session=None, counter=None):
        otp = self.alice_key.generate()

        if session is not None:
            otp.session = session

        if counter is not None:
            otp.counter = counter

        return otp, encode_otp(otp, self.alice_aes, self.alice_public)
Esempio n. 5
0
    def test_bad_decrypt(self):
        otp = self.alice_key.generate()
        token = encode_otp(otp, self.bob_aes, self.alice_public)
        ok = self.alice_device.verify_token(token)

        self.assertFalse(ok)
Esempio n. 6
0
    def test_bad_decrypt(self):
        otp = self.alice_key.generate()
        token = encode_otp(otp, self.bob_aes, self.alice_public)
        ok = self.alice_device.verify_token(token)

        self.assertTrue(not ok)