diff mod_sasl2/mod_sasl2.lua @ 5019:c83ce822f105

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
author Matthew Wild <mwild1@gmail.com>
date Sun, 28 Aug 2022 11:12:52 +0100
parents ed2a9a4c4f01
children 6a36dae4a88d
line wrap: on
line diff
--- 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)