mod_sasl2: Fix <challenge> generation
- We are just adding child text data, so the correct method is :text()
- The data should be base64-encoded, but it was being sent raw
--- a/mod_sasl2/mod_sasl2.lua Sun Aug 28 11:11:50 2022 +0100
+++ b/mod_sasl2/mod_sasl2.lua Sun Aug 28 11:12:52 2022 +0100
@@ -82,7 +82,7 @@
module:hook("sasl2/c2s/challenge", function (event)
local session = event.session;
session.send(st.stanza("challenge", { xmlns = xmlns_sasl2 })
- :text_tag(event.message));
+ :text(base64.encode(event.message)));
end);
module:hook("sasl2/c2s/success", function (event)