Software /
code /
prosody-modules
Comparison
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 |
parent | 5018:ed2a9a4c4f01 |
child | 5020:6a36dae4a88d |
comparison
equal
deleted
inserted
replaced
5018:ed2a9a4c4f01 | 5019:c83ce822f105 |
---|---|
80 end); | 80 end); |
81 | 81 |
82 module:hook("sasl2/c2s/challenge", function (event) | 82 module:hook("sasl2/c2s/challenge", function (event) |
83 local session = event.session; | 83 local session = event.session; |
84 session.send(st.stanza("challenge", { xmlns = xmlns_sasl2 }) | 84 session.send(st.stanza("challenge", { xmlns = xmlns_sasl2 }) |
85 :text_tag(event.message)); | 85 :text(base64.encode(event.message))); |
86 end); | 86 end); |
87 | 87 |
88 module:hook("sasl2/c2s/success", function (event) | 88 module:hook("sasl2/c2s/success", function (event) |
89 local session = event.session | 89 local session = event.session |
90 local ok, err = sm_make_authenticated(session, session.sasl_handler.username); | 90 local ok, err = sm_make_authenticated(session, session.sasl_handler.username); |