From 9b27d49521f4bd68e5d828aa41770e8a7400da6c Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Feb 2016 19:25:39 +0100 Subject: util.sasl.anonymous: Remove unused locals [luacheck] --- util/sasl/anonymous.lua | 2 -- 1 file changed, 2 deletions(-) (limited to 'util/sasl') diff --git a/util/sasl/anonymous.lua b/util/sasl/anonymous.lua index af05c0e7..6201db32 100644 --- a/util/sasl/anonymous.lua +++ b/util/sasl/anonymous.lua @@ -11,9 +11,7 @@ -- -- THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -local s_match = string.match; -local log = require "util.logger".init("sasl"); local generate_uuid = require "util.uuid".generate; local _ENV = nil; -- cgit v1.2.3 From cedba44c5ae12f0241b576ab7415e18935e50a9b Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Feb 2016 19:26:14 +0100 Subject: util.sasl.scram: Rename variable to avoid name clash [luacheck] --- util/sasl/scram.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'util/sasl') diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua index a1b5117a..b3c4edc8 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 @@ -170,8 +170,8 @@ local function scram_gen(hash_name, H_f, HMAC_f) 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 -- cgit v1.2.3 From e5cf84bdcdae02d49a983d210e7d02409ff28b70 Mon Sep 17 00:00:00 2001 From: Kim Alvefur Date: Sun, 28 Feb 2016 19:26:45 +0100 Subject: util.sasl.scram: Remove unused initial value [luacheck] --- util/sasl/scram.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/sasl') diff --git a/util/sasl/scram.lua b/util/sasl/scram.lua index b3c4edc8..febbc639 100644 --- a/util/sasl/scram.lua +++ b/util/sasl/scram.lua @@ -163,7 +163,7 @@ 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); -- cgit v1.2.3