Changeset

702:d344860fdada

sasl: Set realm to be the current realm when the client didn't send a realm, or sent an empty one
author Waqas Hussain <waqas20@gmail.com>
date Sat, 10 Jan 2009 20:14:47 +0500
parents 687:a92d647624a1
children 703:f9909efed20c
files util/sasl.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/util/sasl.lua	Fri Jan 09 23:09:53 2009 +0500
+++ b/util/sasl.lua	Sat Jan 10 20:14:47 2009 +0500
@@ -176,9 +176,9 @@
 			if not response["cnonce"] then return "failure", "malformed-request", "Missing entry for cnonce in SASL message." end
 			if not response["qop"] then response["qop"] = "auth" end
 			
-			if response["realm"] == nil then
-				response["realm"] = "";
-			elseif response["realm"] ~= self.realm and response["realm"] ~= "" then
+			if response["realm"] == nil or response["realm"] == "" then
+				response["realm"] = self.realm;
+			elseif response["realm"] ~= self.realm then
 				return "failure", "not-authorized", "Incorrect realm value";
 			end