From: Reedy Date: Wed, 10 Feb 2016 21:27:24 +0000 (+0000) Subject: Reduce conditional for calling openssl_random_pseudo_bytes X-Git-Tag: 1.31.0-rc.0~7998^2 X-Git-Url: http://git.cyclocoop.org/%27%20.%20url_absolue%28%24favicon%29%20.%20?a=commitdiff_plain;h=231192f7e0b32793711695ed047842f11260fc92;p=lhc%2Fweb%2Fwiklou.git Reduce conditional for calling openssl_random_pseudo_bytes We require a much higher PHP version now, so this isn't a problem for windows or otherwise Change-Id: I65511f00b50d12992d8883d5482867f5e0a850bc --- diff --git a/includes/utils/MWCryptRand.php b/includes/utils/MWCryptRand.php index 10606c16d0..c5112ffeb3 100644 --- a/includes/utils/MWCryptRand.php +++ b/includes/utils/MWCryptRand.php @@ -250,14 +250,7 @@ class MWCryptRand { } if ( strlen( $buffer ) < $bytes ) { - // If available make use of openssl's random_pseudo_bytes method to - // attempt to generate randomness. However don't do this on Windows - // with PHP < 5.3.4 due to a bug: - // http://stackoverflow.com/questions/1940168/openssl-random-pseudo-bytes-is-slow-php - // http://git.php.net/?p=php-src.git;a=commitdiff;h=cd62a70863c261b07f6dadedad9464f7e213cad5 - if ( function_exists( 'openssl_random_pseudo_bytes' ) - && ( !wfIsWindows() || version_compare( PHP_VERSION, '5.3.4', '>=' ) ) - ) { + if ( function_exists( 'openssl_random_pseudo_bytes' ) ) { $rem = $bytes - strlen( $buffer ); $openssl_bytes = openssl_random_pseudo_bytes( $rem, $openssl_strong ); if ( $openssl_bytes === false ) {