util/sasl.lua

changeset 685
55d1bc45acf1
parent 615
4ae3e81513f3
child 702
d344860fdada
--- a/util/sasl.lua	Thu Jan 08 02:04:06 2009 +0000
+++ b/util/sasl.lua	Fri Jan 09 20:49:39 2009 +0500
@@ -177,12 +177,12 @@
 			if not response["qop"] then response["qop"] = "auth" end
 			
 			if response["realm"] == nil then
-				response["realm"] = ""
-			elseif response["realm"] ~= self.realm then
+				response["realm"] = "";
+			elseif response["realm"] ~= self.realm and response["realm"] ~= "" then
 				return "failure", "not-authorized", "Incorrect realm value";
 			end
+			
 			local decoder;
-			
 			if response["charset"] == nil then
 				decoder = utf8tolatin1ifpossible;
 			elseif response["charset"] ~= "utf-8" then

mercurial