Changeset

1658:0baa849761b6

Merge with Tobias
author Matthew Wild <mwild1@gmail.com>
date Mon, 10 Aug 2009 14:29:28 +0100
parents 1655:dc42bf326713 (current diff) 1657:1fe566011e2b (diff)
children 1659:6092fc9b078b
files
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/util/sasl.lua	Sun Aug 09 17:47:26 2009 +0500
+++ b/util/sasl.lua	Mon Aug 10 14:29:28 2009 +0100
@@ -70,11 +70,11 @@
 		if type(message) ~= "table" then error("serialize needs an argument of type table.") end
 
 		-- testing all possible values
+		if message["realm"] then data = data..[[realm="]]..message.realm..[[",]] end
 		if message["nonce"] then data = data..[[nonce="]]..message.nonce..[[",]] end
 		if message["qop"] then data = data..[[qop="]]..message.qop..[[",]] end
 		if message["charset"] then data = data..[[charset=]]..message.charset.."," end
 		if message["algorithm"] then data = data..[[algorithm=]]..message.algorithm.."," end
-		if message["realm"] then data = data..[[realm="]]..message.realm..[[",]] end
 		if message["rspauth"] then data = data..[[rspauth=]]..message.rspauth.."," end
 		data = data:gsub(",$", "")
 		return data
@@ -198,7 +198,7 @@
 
 			--TODO maybe realm support
 			self.username = response["username"];
-			local password_encoding, Y = self.credentials_handler("DIGEST-MD5", response["username"], to_unicode(domain), response["realm"], decoder);
+			local password_encoding, Y = self.credentials_handler("DIGEST-MD5", response["username"], self.realm, response["realm"], decoder);
 			if Y == nil then return "failure", "not-authorized"
 			elseif Y == false then return "failure", "account-disabled" end
 			local A1 = "";