# HG changeset patch # User Tobias Markmann # Date 1276099100 -7200 # Node ID c85bba8bd41ae23a44430e42486479c43bdda8f8 # Parent e416b9185c6b85fd08385913d87179341869ddd1 mod_auth_internal_hashed: Empty hashpass after conversion to stored_key/server_key and store new authentication database. diff -r e416b9185c6b -r c85bba8bd41a plugins/mod_auth_internal_hashed.lua --- a/plugins/mod_auth_internal_hashed.lua Wed Jun 09 17:55:04 2010 +0200 +++ b/plugins/mod_auth_internal_hashed.lua Wed Jun 09 17:58:20 2010 +0200 @@ -66,6 +66,8 @@ local salted_password = credentials.hashpass:gsub("..", function(x) return string.char(tonumber(x, 16)); end); credentials.stored_key = sha1(hmac_sha1(salted_password, "Client Key")):gsub(".", function (c) return ("%02x"):format(c:byte()); end); credentials.server_key = hmac_sha1(salted_password, "Server Key"):gsub(".", function (c) return ("%02x"):format(c:byte()); end); + credentials.hashpass = nil + datamanager.store(username, host, "accounts", credentials); end local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, credentials.salt, credentials.iteration_count); @@ -146,6 +148,8 @@ local salted_password = credentials.hashpass:gsub("..", function(x) return string.char(tonumber(x, 16)); end); credentials.stored_key = sha1(hmac_sha1(salted_password, "Client Key")):gsub(".", function (c) return ("%02x"):format(c:byte()); end); credentials.server_key = hmac_sha1(salted_password, "Server Key"):gsub(".", function (c) return ("%02x"):format(c:byte()); end); + credentials.hashpass = nil + datamanager.store(username, host, "accounts", credentials); end local stored_key, server_key, iteration_count, salt = credentials.stored_key, credentials.server_key, credentials.iteration_count, credentials.salt;