aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_internal_hashed.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-04-04 01:41:09 +0200
committerKim Alvefur <zash@zash.se>2017-04-04 01:41:09 +0200
commit5354e5645ec328120cadd24a7dfa7139fd07ec60 (patch)
tree0c04cc8be235f6105a1fd70380b87f3d7bb8b8b4 /plugins/mod_auth_internal_hashed.lua
parent8962d239ed6f606d2808c4fddae80553bc391107 (diff)
parentf94c56040c088f63efdcab886d8ffc311d2e4359 (diff)
downloadprosody-5354e5645ec328120cadd24a7dfa7139fd07ec60.tar.gz
prosody-5354e5645ec328120cadd24a7dfa7139fd07ec60.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_auth_internal_hashed.lua')
-rw-r--r--plugins/mod_auth_internal_hashed.lua12
1 files changed, 8 insertions, 4 deletions
diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua
index 78abe50d..53e345e5 100644
--- a/plugins/mod_auth_internal_hashed.lua
+++ b/plugins/mod_auth_internal_hashed.lua
@@ -101,7 +101,10 @@ function provider.create_user(username, password)
local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, default_iteration_count);
local stored_key_hex = to_hex(stored_key);
local server_key_hex = to_hex(server_key);
- return accounts:set(username, {stored_key = stored_key_hex, server_key = server_key_hex, salt = salt, iteration_count = default_iteration_count});
+ return accounts:set(username, {
+ stored_key = stored_key_hex, server_key = server_key_hex,
+ salt = salt, iteration_count = default_iteration_count
+ });
end
function provider.delete_user(username)
@@ -110,10 +113,10 @@ end
function provider.get_sasl_handler()
local testpass_authentication_profile = {
- plain_test = function(sasl, username, password, realm)
+ plain_test = function(_, username, password, realm)
return usermanager.test_password(username, realm, password), true;
end,
- scram_sha_1 = function(sasl, username, realm)
+ scram_sha_1 = function(_, username)
local credentials = accounts:get(username);
if not credentials then return; end
if credentials.password then
@@ -122,7 +125,8 @@ function provider.get_sasl_handler()
if not credentials then return; end
end
- local stored_key, server_key, iteration_count, salt = credentials.stored_key, credentials.server_key, credentials.iteration_count, credentials.salt;
+ local stored_key, server_key = credentials.stored_key, credentials.server_key;
+ local iteration_count, salt = credentials.iteration_count, credentials.salt;
stored_key = stored_key and from_hex(stored_key);
server_key = server_key and from_hex(server_key);
return stored_key, server_key, iteration_count, salt, true;