Changeset

685:55d1bc45acf1

sasl: Don't fail for realm=""
author Waqas Hussain <waqas20@gmail.com>
date Fri, 09 Jan 2009 20:49:39 +0500
parents 678:1859edec2237
children 686:13ed38531f69
files util/sasl.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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