Skip to content
Snippets Groups Projects
Commit 36f1c9b0 authored by Lukas Reschke's avatar Lukas Reschke
Browse files

rand() + uniqid() are not from cryptographic quality

parent 578aa4e4
No related branches found
No related tags found
No related merge requests found
......@@ -13,7 +13,7 @@ require_once '../../lib/base.php';
// Someone lost their password:
if (isset($_POST['user'])) {
if (OC_User::userExists($_POST['user'])) {
$token = sha1($_POST['user'].md5(uniqid(rand(), true)));
$token = hash("sha256", $_POST['user'].openssl_random_pseudo_bytes(10, $cstrong));
OC_Preferences::setValue($_POST['user'], 'owncloud', 'lostpassword', $token);
$email = OC_Preferences::getValue($_POST['user'], 'settings', 'email', '');
if (!empty($email)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment