Comparison

plugins/mod_auth_internal_hashed.lua @ 3212:e416b9185c6b

mod_auth_internal_hashed: Remove debugging output.
author Tobias Markmann <tm@ayena.de>
date Wed, 09 Jun 2010 17:55:04 +0200
parent 3211:d69e90ffbc09
child 3213:c85bba8bd41a
comparison
equal deleted inserted replaced
3211:d69e90ffbc09 3212:e416b9185c6b
62 -- convert hexpass to stored_key and server_key 62 -- convert hexpass to stored_key and server_key
63 -- TODO: remove this in near future 63 -- TODO: remove this in near future
64 if credentials.hashpass then 64 if credentials.hashpass then
65 valid = true; 65 valid = true;
66 local salted_password = credentials.hashpass:gsub("..", function(x) return string.char(tonumber(x, 16)); end); 66 local salted_password = credentials.hashpass:gsub("..", function(x) return string.char(tonumber(x, 16)); end);
67 log("debug", "salted_password in bin: %s", tostring(salted_password));
68 credentials.stored_key = sha1(hmac_sha1(salted_password, "Client Key")):gsub(".", function (c) return ("%02x"):format(c:byte()); end); 67 credentials.stored_key = sha1(hmac_sha1(salted_password, "Client Key")):gsub(".", function (c) return ("%02x"):format(c:byte()); end);
69 credentials.server_key = hmac_sha1(salted_password, "Server Key"):gsub(".", function (c) return ("%02x"):format(c:byte()); end); 68 credentials.server_key = hmac_sha1(salted_password, "Server Key"):gsub(".", function (c) return ("%02x"):format(c:byte()); end);
70 end 69 end
71 70
72 local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, credentials.salt, credentials.iteration_count); 71 local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, credentials.salt, credentials.iteration_count);