Merge branch 'master' into develop

This commit is contained in:
Pierre Goiffon
2019-04-29 11:26:52 +02:00
2 changed files with 25 additions and 22 deletions

View File

@@ -45,7 +45,7 @@ class iTopMutex
static protected $aAcquiredLocks = array(); // Number of instances of the Mutex, having the lock, in this page static protected $aAcquiredLocks = array(); // Number of instances of the Mutex, having the lock, in this page
public function __construct( public function __construct(
$sName, $sDBHost = null, $sDBUser = null, $sDBPwd = null, $bDBTlsEnabled = false, $sDBTlsCA = null $sName, $sDBHost = null, $sDBUser = null, $sDBPwd = null, $bDBTlsEnabled = null, $sDBTlsCA = null
) )
{ {
// Compute the name of a lock for mysql // Compute the name of a lock for mysql

View File

@@ -261,7 +261,10 @@ class SimpleCryptMcryptEngine implements CryptEngine
public function Encrypt($key, $sString) public function Encrypt($key, $sString)
{ {
$iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($this->td), MCRYPT_RAND_URANDOM); // MCRYPT_RAND_URANDOM is now useable since itop requires php >= 5.6 $iv = mcrypt_create_iv (mcrypt_enc_get_iv_size($this->td), MCRYPT_DEV_URANDOM); // MCRYPT_DEV_URANDOM is now useable since itop requires php >= 5.6
if (false === $iv) {
throw new Exception('IV generation failed');
}
mcrypt_generic_init($this->td, $key, $iv); mcrypt_generic_init($this->td, $key, $iv);
if (empty($sString)) if (empty($sString))
{ {