Wassan.anmol has uploaded a new change for review. ( 
https://gerrit.wikimedia.org/r/372364 )

Change subject: Replaced mt_rand() with MWCryptRand
......................................................................

Replaced mt_rand() with MWCryptRand

When creating a random temp directory, SecurePoll should use MWCryptRand 
instead of mt_rand().

Bug: T173390
Change-Id: I582dffaba09ac31454f514a869940ed75cc7159a
---
M includes/crypt/Crypt.php
1 file changed, 1 insertion(+), 1 deletion(-)


  git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/SecurePoll 
refs/changes/64/372364/1

diff --git a/includes/crypt/Crypt.php b/includes/crypt/Crypt.php
index 6bb5761..826c293 100644
--- a/includes/crypt/Crypt.php
+++ b/includes/crypt/Crypt.php
@@ -162,7 +162,7 @@
                }
 
                # Create the directory
-               $this->homeDir = $wgSecurePollTempDir . '/securepoll-' . sha1( 
mt_rand() . mt_rand() );
+               $this->homeDir = $wgSecurePollTempDir . '/securepoll-' . 
MWCryptRand::generateHex( 32 );
                if ( !mkdir( $this->homeDir ) ) {
                        $this->homeDir = null;
                        return Status::newFatal( 'securepoll-no-gpg-home' );

-- 
To view, visit https://gerrit.wikimedia.org/r/372364
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I582dffaba09ac31454f514a869940ed75cc7159a
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/SecurePoll
Gerrit-Branch: master
Gerrit-Owner: Wassan.anmol <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to