diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-11-27 23:36:49 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-11-27 23:36:49 +0000 |
commit | efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8 (patch) | |
tree | fbb36c13b7526cb3f7d79d364e8b338c4fc81b34 /core/usermanager.lua | |
parent | f588a0f5b0dd4c6b6d2c81a517594b50b45fc15b (diff) | |
parent | 631e249397fd7cd2a2c5a7cb4c1feba664a41b2e (diff) | |
download | prosody-efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8.tar.gz prosody-efd0ef64bb4cbf51ecbd51280b4cf42d7f6e6ed8.zip |
Merge from waqas
Diffstat (limited to 'core/usermanager.lua')
-rw-r--r-- | core/usermanager.lua | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/core/usermanager.lua b/core/usermanager.lua index 808faf71..a5229f38 100644 --- a/core/usermanager.lua +++ b/core/usermanager.lua @@ -19,15 +19,12 @@ function validate_credentials(host, username, password, method) end end -- must do md5 - if not hashes.md5 then - return nil, "Server misconfiguration, the md5 library is not available."; - end -- make credentials md5 local pwd = credentials.password; - if not pwd then pwd = credentials.md5; else pwd = hashes.md5(pwd); end + if not pwd then pwd = credentials.md5; else pwd = hashes.md5(pwd, true); end -- make password md5 if method == "PLAIN" then - password = hashes.md5(password or ""); + password = hashes.md5(password or "", true); elseif method ~= "DIGEST-MD5" then return nil, "Unsupported auth method"; end @@ -49,9 +46,7 @@ end function get_supported_methods(host) local methods = {["PLAIN"] = true}; -- TODO this should be taken from the config - if hashes.md5 then - methods["DIGEST-MD5"] = true; - end + methods["DIGEST-MD5"] = true; return methods; end |