prevent traceback when password is not entered. Fixes #4912
This commit is contained in:
parent
9b5c8db2ce
commit
cfd0b4835a
|
@ -319,7 +319,10 @@ class SASL(PlugIn):
|
||||||
raise NodeProcessed
|
raise NodeProcessed
|
||||||
|
|
||||||
def set_password(self, password):
|
def set_password(self, password):
|
||||||
self.password = password
|
if password is None:
|
||||||
|
self.password = ''
|
||||||
|
else:
|
||||||
|
self.password = password
|
||||||
if self.mechanism == 'DIGEST-MD5':
|
if self.mechanism == 'DIGEST-MD5':
|
||||||
A1 = C([H(C([self.resp['username'], self.resp['realm'],
|
A1 = C([H(C([self.resp['username'], self.resp['realm'],
|
||||||
self.password])), self.resp['nonce'], self.resp['cnonce']])
|
self.password])), self.resp['nonce'], self.resp['cnonce']])
|
||||||
|
@ -356,7 +359,10 @@ class NonBlockingNonSASL(PlugIn):
|
||||||
''' Caches username, password and resource for auth. '''
|
''' Caches username, password and resource for auth. '''
|
||||||
PlugIn.__init__(self)
|
PlugIn.__init__(self)
|
||||||
self.user = user
|
self.user = user
|
||||||
self.password= password
|
if self.password is None:
|
||||||
|
self.password = ''
|
||||||
|
else:
|
||||||
|
self.password = password
|
||||||
self.resource = resource
|
self.resource = resource
|
||||||
self.on_auth = on_auth
|
self.on_auth = on_auth
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue