summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Gohr <andi@splitbrain.org>2013-05-31 14:43:31 +0200
committerAndreas Gohr <andi@splitbrain.org>2013-05-31 14:43:31 +0200
commit183a7b8845875e4a6b67e466cfff9f5163da3f17 (patch)
tree817a1ce3da26c9c52dd0de85f69f359ac6c0745b
parent8fcfc7abfd65ccd920753bee341c6bfdebcecd99 (diff)
downloadrpg-183a7b8845875e4a6b67e466cfff9f5163da3f17.tar.gz
rpg-183a7b8845875e4a6b67e466cfff9f5163da3f17.tar.bz2
make password reset token completely random
No need for HMAC here because there's no length attack vector here. We only care for the existance of the file and each reset request is completely (random) independent from each other.
-rw-r--r--inc/auth.php2
1 files changed, 1 insertions, 1 deletions
diff --git a/inc/auth.php b/inc/auth.php
index dac67bcb7..1f8489f03 100644
--- a/inc/auth.php
+++ b/inc/auth.php
@@ -993,7 +993,7 @@ function act_resendpwd() {
}
// generate auth token
- $token = PassHash::hmac('md5', $user, auth_cookiesalt()); //secret but user based
+ $token = md5(uniqid(mt_rand(), true)); // random secret
$tfile = $conf['cachedir'].'/'.$token{0}.'/'.$token.'.pwauth';
$url = wl('', array('do'=> 'resendpwd', 'pwauth'=> $token), true, '&');