diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index b7874ea1..6230a55e 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -106,7 +106,7 @@ if (!function_exists('crypt_random_string')) { } if ($fp !== true && $fp !== false) { // surprisingly faster than !is_bool() or is_resource() $temp = fread($fp, $length); - if (strlen($temp) != $length) { + if (strlen($temp) == $length) { return $temp; } }