prevent traceback when password is not entered. Fixes #4912

This commit is contained in:
Yann Leboulanger 2009-03-17 19:35:52 +00:00
parent 9b5c8db2ce
commit cfd0b4835a
1 changed files with 8 additions and 2 deletions

View File

@ -319,7 +319,10 @@ class SASL(PlugIn):
raise NodeProcessed
def set_password(self, password):
self.password = password
if password is None:
self.password = ''
else:
self.password = password
if self.mechanism == 'DIGEST-MD5':
A1 = C([H(C([self.resp['username'], self.resp['realm'],
self.password])), self.resp['nonce'], self.resp['cnonce']])
@ -356,7 +359,10 @@ class NonBlockingNonSASL(PlugIn):
''' Caches username, password and resource for auth. '''
PlugIn.__init__(self)
self.user = user
self.password= password
if self.password is None:
self.password = ''
else:
self.password = password
self.resource = resource
self.on_auth = on_auth