aboutsummaryrefslogtreecommitdiffstats
path: root/core
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-11-28 01:16:26 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-11-28 01:16:26 +0500
commit631e249397fd7cd2a2c5a7cb4c1feba664a41b2e (patch)
tree97381a92a65cde13d065e519bdd7d66fe68ba0ba /core
parent85a3bc344309ecd4c1db4dfa5a86c115f7d28cbd (diff)
downloadprosody-631e249397fd7cd2a2c5a7cb4c1feba664a41b2e.tar.gz
prosody-631e249397fd7cd2a2c5a7cb4c1feba664a41b2e.zip
Completely switched to new hashes library from the old md5 library
Diffstat (limited to 'core')
-rw-r--r--core/usermanager.lua11
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