Software /
code /
prosody
Diff
plugins/mod_saslauth.lua @ 565:3a49d85cafbc
Backed out changeset 099d8a102deb (committed too much)
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 05 Dec 2008 19:49:16 +0000 |
parent | 563:099d8a102deb |
child | 595:08ed4fa2f89d |
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua Fri Dec 05 19:24:01 2008 +0000 +++ b/plugins/mod_saslauth.lua Fri Dec 05 19:49:16 2008 +0000 @@ -24,8 +24,6 @@ local jid local base64 = require "util.encodings".base64; -local gettime = require "socket".gettime; - local usermanager_validate_credentials = require "core.usermanager".validate_credentials; local t_concat, t_insert = table.concat, table.insert; local tostring = tostring; @@ -66,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; @@ -144,8 +142,6 @@ :tag("bind", { xmlns = xmlns_bind}) :tag("jid"):text(session.full_jid)); end - - session.log("******", "Connection took "..tostring(session.conntimetotal).." seconds"); end); module:add_iq_handler("c2s", "urn:ietf:params:xml:ns:xmpp-session",