mod_auth_internal_hashed: Empty hashpass after conversion to stored_key/server_key...
authorTobias Markmann <tm@ayena.de>
Wed, 9 Jun 2010 15:58:20 +0000 (17:58 +0200)
committerTobias Markmann <tm@ayena.de>
Wed, 9 Jun 2010 15:58:20 +0000 (17:58 +0200)
plugins/mod_auth_internal_hashed.lua

index 9025ab2e92399529d0d1618e1312b5f77f376cb2..4c9083aa67026ee0b07bb3da5266dea6ad906fcb 100644 (file)
@@ -66,6 +66,8 @@ function new_hashpass_provider(host)
                        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 @@ function new_hashpass_provider(host)
                                        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;