aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl/scram.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-05-06 15:19:20 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-05-06 15:19:20 +0500
commite1b9d33130e9eda7c9dc656880f2aaf25f7b22cc (patch)
tree5e723711a4d4db13ea82cc288be11e0db90cd981 /util/sasl/scram.lua
parent1d5c54a2f55c1e60313c6aa4cc411edd7c7578c5 (diff)
downloadprosody-e1b9d33130e9eda7c9dc656880f2aaf25f7b22cc.tar.gz
prosody-e1b9d33130e9eda7c9dc656880f2aaf25f7b22cc.zip
util.sasl.scram: Fixed global access.
Diffstat (limited to 'util/sasl/scram.lua')
-rw-r--r--util/sasl/scram.lua8
1 files changed, 4 insertions, 4 deletions
diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua
index 14fb8beb..ed7d7bc3 100644
--- a/util/sasl/scram.lua
+++ b/util/sasl/scram.lua
@@ -117,7 +117,7 @@ local function scram_gen(hash_name, H_f, HMAC_f)
-- retreive credentials
if self.profile.plain then
- password, state = self.profile.plain(self.state.name, self.realm)
+ local password, state = self.profile.plain(self.state.name, self.realm)
if state == nil then return "failure", "not-authorized"
elseif state == false then return "failure", "account-disabled" end
@@ -129,8 +129,8 @@ local function scram_gen(hash_name, H_f, HMAC_f)
self.state.salt = generate_uuid();
self.state.iteration_count = default_i;
self.state.salted_password = Hi(HMAC_f, password, self.state.salt, default_i);
- elseif self.profile["scram-"..hash_name] then
- salted_password, iteration_count, salt, state = self.profile["scram-"..hash_name](self.state.name, self.realm);
+ elseif self.profile["scram_"..hash_name] then
+ local salted_password, iteration_count, salt, state = self.profile["scram-"..hash_name](self.state.name, self.realm);
if state == nil then return "failure", "not-authorized"
elseif state == false then return "failure", "account-disabled" end
@@ -177,7 +177,7 @@ end
function init(registerMechanism)
local function registerSCRAMMechanism(hash_name, hash, hmac_hash)
- registerMechanism("SCRAM-"..hash_name, {"plain", "scram-"..(hash_name:lower())}, scram_gen(hash_name:lower(), hash, hmac_hash));
+ registerMechanism("SCRAM-"..hash_name, {"plain", "scram_"..(hash_name:lower())}, scram_gen(hash_name:lower(), hash, hmac_hash));
end
registerSCRAMMechanism("SHA-1", sha1, hmac_sha1);