Skip to content
Snippets Groups Projects
Commit ee5d0f32 authored by Michael Göhler's avatar Michael Göhler
Browse files

improve token security

switched from time() to internal method OC_Util::generate_random_bytes()
parent 4b799a69
No related branches found
No related tags found
Loading
......@@ -566,7 +566,7 @@ class OC{
if(defined("DEBUG") && DEBUG) {
OC_Log::write('core', 'Setting remember login to cookie', OC_Log::DEBUG);
}
$token = md5($_POST["user"].time().$_POST['password']);
$token = md5($_POST["user"].OC_Util::generate_random_bytes(10).$_POST['password']);
OC_Preferences::setValue($_POST['user'], 'login_token', $token, time());
OC_User::setMagicInCookie($_POST["user"], $token);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment