diff options
| author | 2019-02-06 15:37:24 +0000 | |
|---|---|---|
| committer | 2019-02-06 15:37:34 +0000 | |
| commit | 0e6370076196eecb8ea3bb547e3697fca3f52dd3 (patch) | |
| tree | 49f7d812b3551e98de45a15fa391e33ad2c65bcd | |
| parent | `auth_text` would not be present in a failure scenario (diff) | |
| signature | ||
Only send `auth_text` if it's not None (sasl)
| -rw-r--r-- | modules/sasl/__init__.py | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/modules/sasl/__init__.py b/modules/sasl/__init__.py index 70e6367a..415b1abe 100644 --- a/modules/sasl/__init__.py +++ b/modules/sasl/__init__.py @@ -89,10 +89,11 @@ class Module(ModuleManager.BaseModule): else: raise ValueError("unknown sasl mechanism '%s'" % mechanism) - if not auth_text == "+": - auth_text = base64.b64encode(auth_text) - auth_text = auth_text.decode("utf8") - event["server"].send_authenticate(auth_text) + if not auth_text == None: + if not auth_text == "+": + auth_text = base64.b64encode(auth_text) + auth_text = auth_text.decode("utf8") + event["server"].send_authenticate(auth_text) def _end_sasl(self, server): server.capability_done("sasl") |
