From 7c9ca1658aaf8e41dc59a2be30ca62fbfe3975fb Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Sun, 16 Nov 2008 02:10:01 +0500 Subject: base64 encode the sasl responses --- plugins/mod_saslauth.lua | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3