aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl.lua
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 /util/sasl.lua
parent85a3bc344309ecd4c1db4dfa5a86c115f7d28cbd (diff)
downloadprosody-631e249397fd7cd2a2c5a7cb4c1feba664a41b2e.tar.gz
prosody-631e249397fd7cd2a2c5a7cb4c1feba664a41b2e.zip
Completely switched to new hashes library from the old md5 library
Diffstat (limited to 'util/sasl.lua')
-rw-r--r--util/sasl.lua14
1 files changed, 7 insertions, 7 deletions
diff --git a/util/sasl.lua b/util/sasl.lua
index 7cabd8b3..001f40fb 100644
--- a/util/sasl.lua
+++ b/util/sasl.lua
@@ -1,5 +1,5 @@
-local md5 = require "md5"
+local md5 = require "util.hashes".md5;
local log = require "util.logger".init("sasl");
local tostring = tostring;
local st = require "util.stanza";
@@ -132,21 +132,21 @@ local function new_digest_md5(realm, password_handler)
local A1 = Y..":"..response["nonce"]..":"..response["cnonce"]--:authzid
local A2 = "AUTHENTICATE:"..protocol.."/"..domain
- local HA1 = md5.sumhexa(A1)
- local HA2 = md5.sumhexa(A2)
+ local HA1 = md5(A1, true)
+ local HA2 = md5(A2, true)
local KD = HA1..":"..response["nonce"]..":"..response["nc"]..":"..response["cnonce"]..":"..response["qop"]..":"..HA2
- local response_value = md5.sumhexa(KD)
+ local response_value = md5(KD, true)
if response_value == response["response"] then
-- calculate rspauth
A2 = ":"..protocol.."/"..domain
- HA1 = md5.sumhexa(A1)
- HA2 = md5.sumhexa(A2)
+ HA1 = md5(A1, true)
+ HA2 = md5(A2, true)
KD = HA1..":"..response["nonce"]..":"..response["nc"]..":"..response["cnonce"]..":"..response["qop"]..":"..HA2
- local rspauth = md5.sumhexa(KD)
+ local rspauth = md5(KD, true)
self.authenticated = true
return "challenge", serialize({rspauth = rspauth})
else