From 2e6fcdb2d0126ddf6dac449d950ffbf5c7c523ba Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Mon, 8 Dec 2008 00:18:01 +0500 Subject: Latin1 support for SASL DIGEST-MD5 (second, and possibly final commit) --- plugins/mod_saslauth.lua | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'plugins') diff --git a/plugins/mod_saslauth.lua b/plugins/mod_saslauth.lua index 9884ec5c..bea1012a 100644 --- a/plugins/mod_saslauth.lua +++ b/plugins/mod_saslauth.lua @@ -66,15 +66,14 @@ local function handle_status(session, status) end end -local function password_callback(node, host, mechanism, raw_host) - log("host", host); - log("raw_host", raw_host); - local password = (datamanager.load(node, raw_host, "accounts") or {}).password; -- FIXME handle hashed passwords +local function password_callback(node, host, mechanism, decoder) + 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 + if decoder then node, host, password = decoder(node), decoder(host), decoder(password); end return func, md5(node..":"..host..":"..password); end end -- cgit v1.2.3