# HG changeset patch # User Kim Alvefur # Date 1456684033 -3600 # Node ID c12c9b9c1949b480d289827fae6ac468e0c54396 # Parent a927edfb54abb7bff3bb3debd417b643ba5fb6b4# Parent 0a43b7ffa3af255979efa442931ed211e0fd4b8e Merge 0.10->trunk diff -r a927edfb54ab -r c12c9b9c1949 util/sasl/anonymous.lua --- a/util/sasl/anonymous.lua Sun Feb 28 18:47:32 2016 +0100 +++ b/util/sasl/anonymous.lua Sun Feb 28 19:27:13 2016 +0100 @@ -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; diff -r a927edfb54ab -r c12c9b9c1949 util/sasl/scram.lua --- a/util/sasl/scram.lua Sun Feb 28 18:47:32 2016 +0100 +++ b/util/sasl/scram.lua Sun Feb 28 19:27:13 2016 +0100 @@ -150,9 +150,9 @@ -- 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 @@ 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