From 0e6370076196eecb8ea3bb547e3697fca3f52dd3 Mon Sep 17 00:00:00 2001 From: jesopo Date: Wed, 6 Feb 2019 15:37:24 +0000 Subject: [PATCH] Only send `auth_text` if it's not None (sasl) --- modules/sasl/__init__.py | 9 +++++---- 1 file 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")