From 231192f7e0b32793711695ed047842f11260fc92 Mon Sep 17 00:00:00 2001 From: Reedy Date: Wed, 10 Feb 2016 21:27:24 +0000 Subject: [PATCH] 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 --- includes/utils/MWCryptRand.php | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) 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 ) { -- 2.20.1