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)
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)
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)
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)
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)