Skip to content

Commit

Permalink
patch #2665440 Detect mcrypt initialization failure
Browse files Browse the repository at this point in the history
  • Loading branch information
helmo committed May 7, 2009
1 parent 99035b8 commit 9df074a
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ $HeadURL: https://phpmyadmin.svn.sourceforge.net/svnroot/phpmyadmin/trunk/phpMyA
thanks to Virsacer - virsacer
+ rfe #2657696 Automatically copy generated password
- bug #2787162 [interface] Table with name 'log_views' is incorrectly displayed as a view
+ patch #2665440 Detect mcrypt initialization failure

3.1.5.0 (not yet released)
- patch #2739001 [export] XML does not allow spaces in element names,
Expand Down
6 changes: 5 additions & 1 deletion libraries/auth/cookie.auth.lib.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@
if (empty($_COOKIE['pma_mcrypt_iv'])
|| false === ($iv = base64_decode($_COOKIE['pma_mcrypt_iv'], true))) {
srand((double) microtime() * 1000000);
$iv = mcrypt_create_iv(mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC), MCRYPT_RAND);
$td = mcrypt_module_open(MCRYPT_BLOWFISH, '', MCRYPT_MODE_CBC, '');
if ($td === false) {
trigger_error(PMA_sanitize(sprintf($strCantLoad, 'mcrypt')), E_USER_WARNING);
}
$iv = mcrypt_create_iv(mcrypt_enc_get_iv_size($td), MCRYPT_RAND);
PMA_setCookie('pma_mcrypt_iv', base64_encode($iv));
}

Expand Down

0 comments on commit 9df074a

Please sign in to comment.