Diff

plugins/mod_saslauth.lua @ 599:30655c5cc531

Latin1 support for SASL DIGEST-MD5 (second, and possibly final commit)
author Waqas Hussain <waqas20@gmail.com>
date Mon, 08 Dec 2008 00:18:01 +0500
parent 595:08ed4fa2f89d
child 615:4ae3e81513f3
line wrap: on
line diff
--- a/plugins/mod_saslauth.lua	Sun Dec 07 23:43:08 2008 +0500
+++ b/plugins/mod_saslauth.lua	Mon Dec 08 00:18:01 2008 +0500
@@ -66,15 +66,14 @@
 	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