aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-16 02:10:01 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-16 02:10:01 +0500
commit7c9ca1658aaf8e41dc59a2be30ca62fbfe3975fb (patch)
treec48a29b7787881a271f82bc34b1cfde9bdf0f260
parenta055e3c41b0b378079678c733ccbf424f36140f6 (diff)
downloadprosody-7c9ca1658aaf8e41dc59a2be30ca62fbfe3975fb.tar.gz
prosody-7c9ca1658aaf8e41dc59a2be30ca62fbfe3975fb.zip
base64 encode the sasl responses
-rw-r--r--plugins/mod_saslauth.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua
index 5f7438d2..9df39228 100644
--- a/plugins/mod_saslauth.lua
+++ b/plugins/mod_saslauth.lua
@@ -20,12 +20,12 @@ local new_sasl = require "util.sasl".new;
local function build_reply(status, ret, err_msg)
local reply = st.stanza(status, {xmlns = xmlns_sasl});
if status == "challenge" then
- reply:text(ret or "");
+ reply:text(base64.encode(ret or ""));
elseif status == "failure" then
reply:tag(ret):up();
- if err_msg then reply:tag("text"); end
+ if err_msg then reply:tag("text"):text(err_msg); end
elseif status == "success" then
- reply:text(ret or "");
+ reply:text(base64.encode(ret or ""));
else
error("Unknown sasl status: "..status);
end