Comparison

util/sasl.lua @ 685:55d1bc45acf1

sasl: Don't fail for realm=""
author Waqas Hussain <waqas20@gmail.com>
date Fri, 09 Jan 2009 20:49:39 +0500
parent 615:4ae3e81513f3
child 702:d344860fdada
comparison
equal deleted inserted replaced
678:1859edec2237 685:55d1bc45acf1
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 then
180 response["realm"] = "" 180 response["realm"] = "";
181 elseif response["realm"] ~= self.realm then 181 elseif response["realm"] ~= self.realm and response["realm"] ~= "" then
182 return "failure", "not-authorized", "Incorrect realm value"; 182 return "failure", "not-authorized", "Incorrect realm value";
183 end 183 end
184
184 local decoder; 185 local decoder;
185
186 if response["charset"] == nil then 186 if response["charset"] == nil then
187 decoder = utf8tolatin1ifpossible; 187 decoder = utf8tolatin1ifpossible;
188 elseif response["charset"] ~= "utf-8" then 188 elseif response["charset"] ~= "utf-8" then
189 return "failure", "incorrect-encoding", "The client's response uses "..response["charset"].." for encoding with isn't supported by sasl.lua. Supported encodings are latin or utf-8." 189 return "failure", "incorrect-encoding", "The client's response uses "..response["charset"].." for encoding with isn't supported by sasl.lua. Supported encodings are latin or utf-8."
190 end 190 end