Changeset

2191:e79c0ce6cf54 sasl

Adding support for digest-md5 profile in DIGEST-MD5 implementation.
author Tobias Markmann <tm@ayena.de>
date Fri, 13 Nov 2009 11:24:22 +0100
parents 2190:9657276387af
children 2192:fa46d158c95f
files util/sasl.lua util/sasl/digest-md5.lua
diffstat 2 files changed, 4 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/sasl.lua	Fri Nov 13 11:21:21 2009 +0100
+++ b/util/sasl.lua	Fri Nov 13 11:24:22 2009 +0100
@@ -61,7 +61,7 @@
 	end
 
 digest-md5-test:
-	function(username, realm, encoding, digesthash)
+	function(username, domain, realm, encoding, digesthash)
 		return true or false, state;
 	end
 ]]
--- a/util/sasl/digest-md5.lua	Fri Nov 13 11:21:21 2009 +0100
+++ b/util/sasl/digest-md5.lua	Fri Nov 13 11:24:22 2009 +0100
@@ -175,7 +175,9 @@
 			elseif state == false then return "failure", "account-disabled" end
 			Y = md5(response["username"]..":"..response["realm"]..":"..password);
 		elseif self.profile["digest-md5"] then
-			--local Y, state = self.profile["digest-md5"](response["username"], self.realm, response["charset"])
+			local Y, state = self.profile["digest-md5"](response["username"], self.realm, response["realm"] response["charset"])
+			if state == nil then return "failure", "not-authorized"
+			elseif state == false then return "failure", "account-disabled" end
 		elseif self.profile["digest-md5-test"] then
 			-- TODO
 		end