aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_auth_internal_hashed.lua
diff options
context:
space:
mode:
authorFlorian Zeitz <florob@babelmonkeys.de>2013-08-09 17:48:21 +0200
committerFlorian Zeitz <florob@babelmonkeys.de>2013-08-09 17:48:21 +0200
commit1d833bb80779ed9c9e1d7ec6c7fab231ebf48182 (patch)
tree8031ff6fd0e32a78a157f8e6542a954e7e634c5d /plugins/mod_auth_internal_hashed.lua
parent96ec63e3c3bbd7e5f6056a5eeeaaa292b4b4da8d (diff)
downloadprosody-1d833bb80779ed9c9e1d7ec6c7fab231ebf48182.tar.gz
prosody-1d833bb80779ed9c9e1d7ec6c7fab231ebf48182.zip
Remove all trailing whitespace
Diffstat (limited to 'plugins/mod_auth_internal_hashed.lua')
-rw-r--r--plugins/mod_auth_internal_hashed.lua12
1 files changed, 6 insertions, 6 deletions
diff --git a/plugins/mod_auth_internal_hashed.lua b/plugins/mod_auth_internal_hashed.lua
index 2b041e43..57396731 100644
--- a/plugins/mod_auth_internal_hashed.lua
+++ b/plugins/mod_auth_internal_hashed.lua
@@ -62,12 +62,12 @@ function provider.test_password(username, password)
if credentials.iteration_count == nil or credentials.salt == nil or string.len(credentials.salt) == 0 then
return nil, "Auth failed. Stored salt and iteration count information is not complete.";
end
-
+
local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, credentials.salt, credentials.iteration_count);
-
+
local stored_key_hex = to_hex(stored_key);
local server_key_hex = to_hex(server_key);
-
+
if valid and stored_key_hex == credentials.stored_key and server_key_hex == credentials.server_key then
return true;
else
@@ -83,7 +83,7 @@ function provider.set_password(username, password)
local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, account.salt, account.iteration_count);
local stored_key_hex = to_hex(stored_key);
local server_key_hex = to_hex(server_key);
-
+
account.stored_key = stored_key_hex
account.server_key = server_key_hex
@@ -134,7 +134,7 @@ function provider.get_sasl_handler()
credentials = accounts:get(username);
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;
stored_key = stored_key and from_hex(stored_key);
server_key = server_key and from_hex(server_key);
@@ -143,6 +143,6 @@ function provider.get_sasl_handler()
};
return new_sasl(host, testpass_authentication_profile);
end
-
+
module:provides("auth", provider);