Software /
code /
prosody
Diff
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 |
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