'The final errback in the authentication chain.  If the reason is
error.IgnoreAuthentication, we simply return; the authentication
method has sent its own response.  Otherwise, send a failure message
and (if the method is not \'none\') increment the number of login
attempts.
@type reason: L{twisted.python.failure.Failure}'

def _ebBadAuth(self, reason):

    if reason.check(error.IgnoreAuthentication):
        return
    if (self.method != 'none'):
        log.msg(('%r    failed    auth    %r' % (self.user, self.method)))
        if reason.check(UnauthorizedLogin):
            log.msg(('unauthorized    login:    %s' % reason.getErrorMessage()))
        elif reason.check(error.ConchError):
            log.msg(('reason:    %s' % reason.getErrorMessage()))
        else:
            log.msg(reason.getTraceback())
        self.loginAttempts += 1
        if (self.loginAttempts > self.attemptsBeforeDisconnect):
            self.transport.sendDisconnect(transport.DISCONNECT_NO_MORE_AUTH_METHODS_AVAILABLE, 'too    many    bad    auths')
            return
    self.transport.sendPacket(MSG_USERAUTH_FAILURE, (NS(','.join(self.supportedAuthentications)) + '\x00'))
