예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)
예제 #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)