mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
Update PasswordHash.php
This commit is contained in:
@@ -48,10 +48,17 @@ class PasswordHash {
|
|||||||
function get_random_bytes($count)
|
function get_random_bytes($count)
|
||||||
{
|
{
|
||||||
$output = '';
|
$output = '';
|
||||||
if (is_readable('/dev/urandom') &&
|
|
||||||
($fh = @fopen('/dev/urandom', 'rb'))) {
|
$output = openssl_random_pseudo_bytes($count,$strong);
|
||||||
$output = fread($fh, $count);
|
|
||||||
fclose($fh);
|
if(empty($count))
|
||||||
|
{
|
||||||
|
if (is_readable('/dev/urandom') &&
|
||||||
|
($fh = @fopen('/dev/urandom', 'rb')))
|
||||||
|
{
|
||||||
|
$output = fread($fh, $count);
|
||||||
|
fclose($fh);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (strlen($output) < $count) {
|
if (strlen($output) < $count) {
|
||||||
|
Reference in New Issue
Block a user