aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-01-10 20:14:47 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-01-10 20:14:47 +0500
commit9015fd411c49a058828dec19e0935405d8f57c55 (patch)
tree4beb9872e7df8bb183e1a376434b0c79a0714904 /util
parent962ab41be7c3f2377ba4dabf7b9061dcdb1139a7 (diff)
downloadprosody-9015fd411c49a058828dec19e0935405d8f57c55.tar.gz
prosody-9015fd411c49a058828dec19e0935405d8f57c55.zip
sasl: Set realm to be the current realm when the client didn't send a realm, or sent an empty one
Diffstat (limited to 'util')
-rw-r--r--util/sasl.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index ee2ba035..7e4d9ea8 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -176,9 +176,9 @@ local function new_digest_md5(realm, password_handler)
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