diff --git a/phpseclib/Crypt/Random.php b/phpseclib/Crypt/Random.php index 170d1c37..6b29e751 100644 --- a/phpseclib/Crypt/Random.php +++ b/phpseclib/Crypt/Random.php @@ -62,7 +62,7 @@ class Random // method 1. prior to PHP 5.3 this would call rand() on windows hence the function_exists('class_alias') call. // ie. class_alias is a function that was introduced in PHP 5.3 if (extension_loaded('mcrypt') && function_exists('class_alias')) { - return mcrypt_create_iv($length); + return @mcrypt_create_iv($length); } // method 2. openssl_random_pseudo_bytes was introduced in PHP 5.3.0 but prior to PHP 5.3.4 there was, // to quote , "possible blocking behavior". as of 5.3.4 @@ -101,7 +101,7 @@ class Random // not doing. regardless, this'll only be called if this PHP script couldn't open /dev/urandom due to open_basedir // restrictions or some such if (extension_loaded('mcrypt')) { - return mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); + return @mcrypt_create_iv($length, MCRYPT_DEV_URANDOM); } } // at this point we have no choice but to use a pure-PHP CSPRNG