mirror of
https://github.com/correl/SleekXMPP.git
synced 2024-11-24 03:00:15 +00:00
Use '=' as base64 value for empty string SASL results.
This commit is contained in:
parent
ca5145c210
commit
c1357717d9
3 changed files with 12 additions and 3 deletions
|
@ -41,7 +41,10 @@ class Auth(StanzaBase):
|
|||
|
||||
def set_value(self, values):
|
||||
if not self['mechanism'] in self.plain_mechs:
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
if values:
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
else:
|
||||
self.xml.text = '='
|
||||
else:
|
||||
self.xml.text = bytes(values).decode('utf-8')
|
||||
|
||||
|
|
|
@ -33,7 +33,10 @@ class Challenge(StanzaBase):
|
|||
return base64.b64decode(bytes(self.xml.text))
|
||||
|
||||
def set_value(self, values):
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
if values:
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
else:
|
||||
self.xml.text = '='
|
||||
|
||||
def del_value(self):
|
||||
self.xml.text = ''
|
||||
|
|
|
@ -33,7 +33,10 @@ class Response(StanzaBase):
|
|||
return base64.b64decode(bytes(self.xml.text))
|
||||
|
||||
def set_value(self, values):
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
if values:
|
||||
self.xml.text = bytes(base64.b64encode(values)).decode('utf-8')
|
||||
else:
|
||||
self.xml.text = '='
|
||||
|
||||
def del_value(self):
|
||||
self.xml.text = ''
|
||||
|
|
Loading…
Reference in a new issue