aboutsummaryrefslogtreecommitdiffstats
path: root/util/sasl
diff options
context:
space:
mode:
Diffstat (limited to 'util/sasl')
-rw-r--r--util/sasl/anonymous.lua2
-rw-r--r--util/sasl/plain.lua2
-rw-r--r--util/sasl/scram.lua6
3 files changed, 4 insertions, 6 deletions
diff --git a/util/sasl/anonymous.lua b/util/sasl/anonymous.lua
index f3e31a7f..6e6f0949 100644
--- a/util/sasl/anonymous.lua
+++ b/util/sasl/anonymous.lua
@@ -35,7 +35,7 @@ local function anonymous(self, message)
repeat
username = generate_uuid();
until self.profile.anonymous(username, self.realm);
- self["username"] = username;
+ self.username = username;
return "success"
end
diff --git a/util/sasl/plain.lua b/util/sasl/plain.lua
index 4359bb3f..1a2ba01e 100644
--- a/util/sasl/plain.lua
+++ b/util/sasl/plain.lua
@@ -58,7 +58,7 @@ local function plain(self, message)
if self.profile.plain then
local correct_password;
correct_password, state = self.profile.plain(authentication, self.realm);
- if correct_password == password then correct = true; else correct = false; end
+ correct = (correct_password == password);
elseif self.profile.plain_test then
correct, state = self.profile.plain_test(authentication, password, self.realm);
end
diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua
index 1340423c..c366a152 100644
--- a/util/sasl/scram.lua
+++ b/util/sasl/scram.lua
@@ -93,10 +93,8 @@ local function validate_username(username)
return username;
end
-local function hashprep( hashname )
- local hash = hashname:lower()
- hash = hash:gsub("-", "_")
- return hash
+local function hashprep(hashname)
+ return hashname:lower():gsub("-", "_");
end
function saltedPasswordSHA1(password, salt, iteration_count)