Software /
code /
prosody
Changeset
10522:b1ca849b8e3a 0.11
mod_auth_internal_hashed: Pass on errors from password hash function (fixes #1477)
author | Kim Alvefur <zash@zash.se> |
---|---|
date | Mon, 23 Dec 2019 22:42:39 +0100 |
parents | 10520:225fade2ab4d |
children | 10523:86422db90e02 |
files | plugins/mod_auth_internal_hashed.lua |
diffstat | 1 files changed, 6 insertions(+), 0 deletions(-) [+] |
line wrap: on
line diff
--- a/plugins/mod_auth_internal_hashed.lua Mon Jun 10 13:57:09 2019 +0200 +++ b/plugins/mod_auth_internal_hashed.lua Mon Dec 23 22:42:39 2019 +0100 @@ -68,6 +68,9 @@ account.salt = generate_uuid(); account.iteration_count = max(account.iteration_count or 0, default_iteration_count); local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, account.salt, account.iteration_count); + if not valid then + return valid, stored_key; + end local stored_key_hex = to_hex(stored_key); local server_key_hex = to_hex(server_key); @@ -99,6 +102,9 @@ end local salt = generate_uuid(); local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, default_iteration_count); + if not valid then + return valid, stored_key; + end local stored_key_hex = to_hex(stored_key); local server_key_hex = to_hex(server_key); return accounts:set(username, {