util.sasl.digest-md5: Fixing some variable access.
authorTobias Markmann <tm@ayena.de>
Sat, 28 Nov 2009 17:58:58 +0000 (18:58 +0100)
committerTobias Markmann <tm@ayena.de>
Sat, 28 Nov 2009 17:58:58 +0000 (18:58 +0100)
util/sasl/digest-md5.lua

index a14e875bdbba632d5de5c1fde4249bf7d7172a56..c4507d11bf642b7e1a29ea29e4c071d3e3ebb103 100644 (file)
@@ -166,13 +166,14 @@ local function digest(self, message)
 
                --TODO maybe realm support
                self.username = response["username"];
+               local Y, state;
                if self.profile.plain then
                        local password, state = self.profile.plain(response["username"], self.realm)
                        if state == nil then return "failure", "not-authorized"
                        elseif state == false then return "failure", "account-disabled" end
-                       local Y = md5(response["username"]..":"..response["realm"]..":"..password);
+                       Y = md5(response["username"]..":"..response["realm"]..":"..password);
                elseif self.profile["digest-md5"] then
-                       local Y, state = self.profile["digest-md5"](response["username"], self.realm, response["realm"], response["charset"])
+                       Y, state = self.profile["digest-md5"](response["username"], self.realm, response["realm"], response["charset"])
                        if state == nil then return "failure", "not-authorized"
                        elseif state == false then return "failure", "account-disabled" end
                elseif self.profile["digest-md5-test"] then