aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2009-11-13 11:24:22 +0100
committerTobias Markmann <tm@ayena.de>2009-11-13 11:24:22 +0100
commit8c36b99f27aaa438ce12c8183df357d3c6bd916d (patch)
tree524600269833bfb23de181747f891f12689eec81
parent8e7427e70d551a051ae178c882c179dec1d891dc (diff)
downloadprosody-8c36b99f27aaa438ce12c8183df357d3c6bd916d.tar.gz
prosody-8c36b99f27aaa438ce12c8183df357d3c6bd916d.zip
Adding support for digest-md5 profile in DIGEST-MD5 implementation.
-rw-r--r--util/sasl.lua2
-rw-r--r--util/sasl/digest-md5.lua4
2 files changed, 4 insertions, 2 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index b07f878b..c7aa050b 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -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
]]
diff --git a/util/sasl/digest-md5.lua b/util/sasl/digest-md5.lua
index df0a5b47..3f50e232 100644
--- a/util/sasl/digest-md5.lua
+++ b/util/sasl/digest-md5.lua
@@ -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