sasl: Set realm to be the current realm when the client didn't send a realm, or sent an empty one
--- 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