Merge pull request #586 from nyuszika7h/update-sasl

Some updates to SASL
This commit is contained in:
Valentin Lorentz 2014-04-10 19:07:46 +02:00
commit e9e4bf30c3

View File

@ -939,9 +939,9 @@ class Irc(IrcCommandDispatcher):
]).encode('utf-8')).decode('utf-8')
log.debug('Sending CAP REQ command, requesting capability \'sasl\'.')
self.queueMsg(ircmsgs.IrcMsg(command="CAP", args=('REQ', 'sasl')))
log.debug('Sending AUTHENTICATE command, using mechanism PLAIN.')
log.debug('Using SASL mechanism PLAIN.')
self.queueMsg(ircmsgs.IrcMsg(command="AUTHENTICATE", args=('PLAIN',)))
log.info('Sending AUTHENTICATE command, not logging the password.')
log.info('Authenticating using SASL.')
self.queueMsg(ircmsgs.IrcMsg(command="AUTHENTICATE", args=(auth_string,)))
if self.password:
log.info('Sending PASS command, not logging the password.')
@ -954,14 +954,29 @@ class Irc(IrcCommandDispatcher):
def do903(self, msg):
log.info('%s: SASL authentication successful' % self.network)
log.debug('Sending CAP END command.')
self.queueMsg(ircmsgs.IrcMsg(command="CAP", args=('END',)))
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))
def do904(self, msg):
log.warning('%s: SASL authentication failed' % self.network)
log.debug('Aborting authentication.')
log.debug('Sending CAP END command.')
self.queueMsg(ircmsgs.IrcMsg(command="CAP", args=('END',)))
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))
def do905(self, msg):
log.warning(('%s: SASL authentication failed because your username '
'or password is too long.') % self.network)
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))
def do906(self, msg):
log.warning('%s: SASL authentication aborted' % self.network)
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))
def do907(self, msg):
log.warning(('%s: Attempted SASL authentication when we were already '
'authenticated.') % self.network)
self.queueMsg(ircmsgs.IrcMsg(command='CAP', args=('END',)))
def do908(self, msg):
log.info('%s: Supported SASL mechanisms: %s' %
(self.network, msg.args[1]))
def _getNextNick(self):
if self.alternateNicks: