Adding support for digest-md5 profile in DIGEST-MD5 implementation.
authorTobias Markmann <tm@ayena.de>
Fri, 13 Nov 2009 10:24:22 +0000 (11:24 +0100)
committerTobias Markmann <tm@ayena.de>
Fri, 13 Nov 2009 10:24:22 +0000 (11:24 +0100)
util/sasl.lua
util/sasl/digest-md5.lua

index b07f878b20b04b96907ea07611a4d04855fdd638..c7aa050b8e4b9e310af3eb3589afde8afb2c856d 100644 (file)
@@ -61,7 +61,7 @@ digest-md5:
        end
 
 digest-md5-test:
-       function(username, realm, encoding, digesthash)
+       function(username, domain, realm, encoding, digesthash)
                return true or false, state;
        end
 ]]
index df0a5b476af80028b689d24f5c3a25fd2dedad6a..3f50e232ef0c2700d5b2417ab28748943eb145fb 100644 (file)
@@ -175,7 +175,9 @@ local function digest(self, message)
                        elseif state == false then return "failure", "account-disabled" end
                        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["charset"])
+                       local 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
                        -- TODO
                end