# HG changeset patch # User Matthew Wild # Date 1228325060 0 # Node ID 22ef9bab0834163b095717db72992ed071d795d4 # Parent 631e7d16d22b56568502eb769a794143b1fdec0c# Parent 5fabb5aeed9dfa3ba50fbd960ade3a5a6da1f6bf Automated merge with http://waqas.ath.cx/ diff -r 5fabb5aeed9d -r 22ef9bab0834 plugins/mod_saslauth.lua --- a/plugins/mod_saslauth.lua Wed Dec 03 16:44:03 2008 +0000 +++ b/plugins/mod_saslauth.lua Wed Dec 03 17:24:20 2008 +0000 @@ -64,14 +64,14 @@ end end -local function password_callback(node, host, mechanism) +local function password_callback(node, host, mechanism, raw_host) local password = (datamanager.load(node, host, "accounts") or {}).password; -- FIXME handle hashed passwords local func = function(x) return x; end; if password then if mechanism == "PLAIN" then return func, password; elseif mechanism == "DIGEST-MD5" then - return func, md5(node..":"..host..":"..password); + return func, md5(node..":"..raw_host..":"..password); end end return func, nil; diff -r 5fabb5aeed9d -r 22ef9bab0834 util/sasl.lua --- a/util/sasl.lua Wed Dec 03 16:44:03 2008 +0000 +++ b/util/sasl.lua Wed Dec 03 17:24:20 2008 +0000 @@ -144,6 +144,7 @@ if not response["qop"] then response["qop"] = "auth" end if response["realm"] == nil then response["realm"] = "" end + local raw_realm = response["realm"]; if response["charset"] == nil then response["username"] = latin1toutf8(response["username"]) @@ -163,7 +164,7 @@ --TODO maybe realm support self.username = response["username"] - local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5") + local password_encoding, Y = self.password_handler(response["username"], response["realm"], "DIGEST-MD5", raw_realm) if Y == nil then return "failure", "not-authorized" elseif Y == false then return "failure", "account-disabled" end