diff options
author | Frederic Guillot <fred@kanboard.net> | 2016-01-05 20:31:15 -0500 |
---|---|---|
committer | Frederic Guillot <fred@kanboard.net> | 2016-01-05 20:31:15 -0500 |
commit | e62779e26781c849bdc24f40e94330bec97f8069 (patch) | |
tree | fe72ffad1e8da07684d1400753ad6a2c794c21f5 /app/Core/Security/Token.php | |
parent | 811254ba93592de2470aee54cd21096d082b45ce (diff) |
Improve 2FA
Diffstat (limited to 'app/Core/Security/Token.php')
-rw-r--r-- | app/Core/Security/Token.php | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/app/Core/Security/Token.php b/app/Core/Security/Token.php index 9fd2d02b..cbd784a8 100644 --- a/app/Core/Security/Token.php +++ b/app/Core/Security/Token.php @@ -21,15 +21,7 @@ class Token extends Base */ public static function getToken() { - if (function_exists('random_bytes')) { - return bin2hex(random_bytes(30)); - } elseif (function_exists('openssl_random_pseudo_bytes')) { - return bin2hex(openssl_random_pseudo_bytes(30)); - } elseif (ini_get('open_basedir') === '' && strtoupper(substr(PHP_OS, 0, 3)) !== 'WIN') { - return hash('sha256', file_get_contents('/dev/urandom', false, null, 0, 30)); - } - - return hash('sha256', uniqid(mt_rand(), true)); + return bin2hex(random_bytes(30)); } /** |