Comparison

util/sasl/digest-md5.lua @ 4049:fe6f4a255fd8

util.sasl.*, mod_auth_*, mod_saslauth: Pass SASL handler as first parameter to SASL profile callbacks.
author Waqas Hussain <waqas20@gmail.com>
date Mon, 27 Dec 2010 19:57:04 +0500
parent 3124:21e60658767d
child 4113:65482a852c4d
comparison
equal deleted inserted replaced
4048:c64b0aefb922 4049:fe6f4a255fd8
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