plugins/mod_auth_internal_hashed.lua

changeset 3454
8cf30367aa4f
parent 3395
e736f68c1047
child 3981
2b0b8fe68df2
equal deleted inserted replaced
3453:fba130c16818 3454:8cf30367aa4f
123 end 123 end
124 return true; 124 return true;
125 end 125 end
126 126
127 function provider.create_user(username, password) 127 function provider.create_user(username, password)
128 if password == nil then
129 return datamanager.store(username, host, "accounts", {});
130 end
128 local salt = generate_uuid(); 131 local salt = generate_uuid();
129 local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, iteration_count); 132 local valid, stored_key, server_key = getAuthenticationDatabaseSHA1(password, salt, iteration_count);
130 local stored_key_hex = to_hex(stored_key); 133 local stored_key_hex = to_hex(stored_key);
131 local server_key_hex = to_hex(server_key); 134 local server_key_hex = to_hex(server_key);
132 return datamanager.store(username, host, "accounts", {stored_key = stored_key_hex, server_key = server_key_hex, salt = salt, iteration_count = iteration_count}); 135 return datamanager.store(username, host, "accounts", {stored_key = stored_key_hex, server_key = server_key_hex, salt = salt, iteration_count = iteration_count});

mercurial