diff options
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_saslauth.lua | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 24b19cfb..2a1485d0 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -7,6 +7,7 @@ local jid local usermanager_validate_credentials = require "core.usermanager".validate_credentials; local t_concat, t_insert = table.concat, table.insert; local tostring = tostring; +local jid_split = require "util.jid".split local log = require "util.logger".init("mod_saslauth"); @@ -67,7 +68,9 @@ function do_sasl(session, stanza) end local status, ret = session.sasl_handler:feed(text); handle_status(session, status); - session.send(build_reply(status, ret)); + local s = build_reply(status, ret); + log("debug", "sasl reply: "..tostring(s)); + session.send(s); end add_handler("c2s_unauthed", "auth", xmlns_sasl, @@ -96,7 +99,9 @@ add_event_hook("stream-features", function (session, features) if not session.username then t_insert(features, "<mechanisms xmlns='urn:ietf:params:xml:ns:xmpp-sasl'>"); + -- TODO: Provide PLAIN only if TLS is active, this is a SHOULD from the introduction of RFC 4616. This behavior could be overridden via configuration but will issuing a warning or so. t_insert(features, "<mechanism>PLAIN</mechanism>"); + t_insert(features, "<mechanism>DIGEST-MD5</mechanism>"); t_insert(features, "</mechanisms>"); else t_insert(features, "<bind xmlns='urn:ietf:params:xml:ns:xmpp-bind'><required/></bind>"); |