aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl/scram.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2016-02-28 19:27:13 +0100
committerKim Alvefur <zash@zash.se>2016-02-28 19:27:13 +0100
commitffc455a307546e590923e3df6848bec2bc8fce17 (patch)
tree7f984e40e2046c1e5531857f92b671bd4dea3bb2 /util/sasl/scram.lua
parent6f31f27a762f5f0bda723059e2dfa4c77aadb438 (diff)
parente5cf84bdcdae02d49a983d210e7d02409ff28b70 (diff)
downloadprosody-ffc455a307546e590923e3df6848bec2bc8fce17.tar.gz
prosody-ffc455a307546e590923e3df6848bec2bc8fce17.zip
Merge 0.10->trunk
Diffstat (limited to 'util/sasl/scram.lua')
-rw-r--r--util/sasl/scram.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua
index a1b5117a..febbc639 100644
--- a/util/sasl/scram.lua
+++ b/util/sasl/scram.lua
@@ -150,9 +150,9 @@ local function scram_gen(hash_name, H_f, HMAC_f)
-- retreive credentials
local stored_key, server_key, salt, iteration_count;
if self.profile.plain then
- local password, state = self.profile.plain(self, username, self.realm)
- if state == nil then return "failure", "not-authorized"
- elseif state == false then return "failure", "account-disabled" end
+ local password, status = self.profile.plain(self, username, self.realm)
+ if status == nil then return "failure", "not-authorized"
+ elseif status == false then return "failure", "account-disabled" end
password = saslprep(password);
if not password then
@@ -163,15 +163,15 @@ local function scram_gen(hash_name, H_f, HMAC_f)
salt = generate_uuid();
iteration_count = default_i;
- local succ = false;
+ local succ;
succ, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, iteration_count);
if not succ then
log("error", "Generating authentication database failed. Reason: %s", stored_key);
return "failure", "temporary-auth-failure";
end
elseif self.profile[profile_name] then
- local state;
- stored_key, server_key, iteration_count, salt, state = self.profile[profile_name](self, username, self.realm);
+ local status;
+ stored_key, server_key, iteration_count, salt, status = self.profile[profile_name](self, username, self.realm);
if state == nil then return "failure", "not-authorized"
elseif state == false then return "failure", "account-disabled" end
end