def test_credentials_invalid_signature(self): """ Calling L{SSHPublicKeyChecker.requestAvatarId} with credentials that are incorrectly signed fails with L{UnauthorizedLogin} """ self.credentials.signature = ( Key.fromString(privateDSA_openssh).sign('foo')) self.failureResultOf(self.checker.requestAvatarId(self.credentials), UnauthorizedLogin)
def setUp(self): self.credentials = SSHPrivateKey( 'alice', 'ssh-rsa', publicRSA_openssh, 'foo', Key.fromString(privateRSA_openssh).sign('foo')) self.keydb = _KeyDB(lambda _: [Key.fromString(publicRSA_openssh)]) self.checker = SSHPublicKeyChecker(self.keydb)