Comparison

util/sasl.lua @ 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
parent 685:55d1bc45acf1
child 760:90ce865eebd8
comparison
equal deleted inserted replaced
687:a92d647624a1 702:d344860fdada
174 end 174 end
175 175
176 if not response["cnonce"] then return "failure", "malformed-request", "Missing entry for cnonce in SASL message." end 176 if not response["cnonce"] then return "failure", "malformed-request", "Missing entry for cnonce in SASL message." end
177 if not response["qop"] then response["qop"] = "auth" end 177 if not response["qop"] then response["qop"] = "auth" end
178 178
179 if response["realm"] == nil then 179 if response["realm"] == nil or response["realm"] == "" then
180 response["realm"] = ""; 180 response["realm"] = self.realm;
181 elseif response["realm"] ~= self.realm and response["realm"] ~= "" then 181 elseif response["realm"] ~= self.realm then
182 return "failure", "not-authorized", "Incorrect realm value"; 182 return "failure", "not-authorized", "Incorrect realm value";
183 end 183 end
184 184
185 local decoder; 185 local decoder;
186 if response["charset"] == nil then 186 if response["charset"] == nil then