util/sasl/digest-md5.lua

changeset 3981
2b0b8fe68df2
parent 3124
21e60658767d
equal deleted inserted replaced
3980:6b2fac6602b3 3981:2b0b8fe68df2
179 179
180 --TODO maybe realm support 180 --TODO maybe realm support
181 self.username = response["username"]; 181 self.username = response["username"];
182 local Y, state; 182 local Y, state;
183 if self.profile.plain then 183 if self.profile.plain then
184 local password, state = self.profile.plain(response["username"], self.realm) 184 local password, state = self.profile.plain(self, response["username"], self.realm)
185 if state == nil then return "failure", "not-authorized" 185 if state == nil then return "failure", "not-authorized"
186 elseif state == false then return "failure", "account-disabled" end 186 elseif state == false then return "failure", "account-disabled" end
187 Y = md5(response["username"]..":"..response["realm"]..":"..password); 187 Y = md5(response["username"]..":"..response["realm"]..":"..password);
188 elseif self.profile["digest-md5"] then 188 elseif self.profile["digest-md5"] then
189 Y, state = self.profile["digest-md5"](response["username"], self.realm, response["realm"], response["charset"]) 189 Y, state = self.profile["digest-md5"](self, response["username"], self.realm, response["realm"], response["charset"])
190 if state == nil then return "failure", "not-authorized" 190 if state == nil then return "failure", "not-authorized"
191 elseif state == false then return "failure", "account-disabled" end 191 elseif state == false then return "failure", "account-disabled" end
192 elseif self.profile["digest-md5-test"] then 192 elseif self.profile["digest-md5-test"] then
193 -- TODO 193 -- TODO
194 end 194 end

mercurial