Merge 0.10->trunk
[prosody.git] / plugins / mod_saslauth.lua
index 6cb3e3a7713a5732b9d68ff8d334b76c57fea2ea..bb36600b2e066641e59fc975c4a01281b90f23dd 100644 (file)
@@ -19,7 +19,7 @@ local tostring = tostring;
 local secure_auth_only = module:get_option_boolean("c2s_require_encryption", module:get_option_boolean("require_encryption", false));
 local allow_unencrypted_plain_auth = module:get_option_boolean("allow_unencrypted_plain_auth", false)
 local insecure_mechanisms = module:get_option_set("insecure_sasl_mechanisms", allow_unencrypted_plain_auth and {} or {"PLAIN", "LOGIN"});
-local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", {});
+local disabled_mechanisms = module:get_option_set("disable_sasl_mechanisms", { "DIGEST-MD5" });
 
 local log = module._log;
 
@@ -215,7 +215,7 @@ module:hook("stanza/urn:ietf:params:xml:ns:xmpp-sasl:abort", function(event)
 end);
 
 local function tls_unique(self)
-       return self.userdata:getpeerfinished();
+       return self.userdata["tls-unique"]:getpeerfinished();
 end
 
 local mechanisms_attr = { xmlns='urn:ietf:params:xml:ns:xmpp-sasl' };
@@ -237,7 +237,9 @@ module:hook("stream-features", function(event)
                                if socket.getpeerfinished then
                                        sasl_handler:add_cb_handler("tls-unique", tls_unique);
                                end
-                               sasl_handler["userdata"] = socket;
+                               sasl_handler["userdata"] = {
+                                       ["tls-unique"] = socket;
+                               };
                        end
                end
                local mechanisms = st.stanza("mechanisms", mechanisms_attr);