Skip to content
This repository has been archived by the owner on Jan 29, 2020. It is now read-only.

Commit

Permalink
Merge branch 'hotfix/2878'
Browse files Browse the repository at this point in the history
  • Loading branch information
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 15 deletions.
10 changes: 5 additions & 5 deletions src/BlockCipher.php
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ public function __construct(SymmetricInterface $cipher)
*/
public static function factory($adapter, $options = array())
{
$plugins = self::getSymmetricPluginManager();
$plugins = static::getSymmetricPluginManager();
$adapter = $plugins->get($adapter, (array) $options);
return new self($adapter);
}
Expand All @@ -106,11 +106,11 @@ public static function factory($adapter, $options = array())
*/
public static function getSymmetricPluginManager()
{
if (self::$symmetricPlugins === null) {
self::setSymmetricPluginManager(new SymmetricPluginManager());
if (static::$symmetricPlugins === null) {
static::setSymmetricPluginManager(new SymmetricPluginManager());
}

return self::$symmetricPlugins;
return static::$symmetricPlugins;
}

/**
Expand All @@ -137,7 +137,7 @@ public static function setSymmetricPluginManager($plugins)
(is_object($plugins) ? get_class($plugins) : gettype($plugins))
));
}
self::$symmetricPlugins = $plugins;
static::$symmetricPlugins = $plugins;
}

/**
Expand Down
4 changes: 2 additions & 2 deletions src/Key/Derivation/SaltedS2k.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,12 +56,12 @@ class SaltedS2k
*/
public static function calc($hash, $password, $salt, $bytes)
{
if (!in_array($hash, array_keys(self::$supportedMhashAlgos))) {
if (!in_array($hash, array_keys(static::$supportedMhashAlgos))) {
throw new Exception\InvalidArgumentException("The hash algorihtm $hash is not supported by " . __CLASS__);
}
if (strlen($salt)<8) {
throw new Exception\InvalidArgumentException('The salt size must be at least of 8 bytes');
}
return mhash_keygen_s2k(self::$supportedMhashAlgos[$hash], $password, $salt, $bytes);
return mhash_keygen_s2k(static::$supportedMhashAlgos[$hash], $password, $salt, $bytes);
}
}
6 changes: 3 additions & 3 deletions src/PublicKey/DiffieHellman.php
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ public function __construct($prime, $generator, $privateKey = null, $privateKeyF
*/
public static function useOpensslExtension($flag = true)
{
self::$useOpenssl = (boolean) $flag;
static::$useOpenssl = (boolean) $flag;
}

/**
Expand All @@ -132,7 +132,7 @@ public static function useOpensslExtension($flag = true)
*/
public function generateKeys()
{
if (function_exists('openssl_dh_compute_key') && self::$useOpenssl !== false) {
if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) {
$details = array(
'p' => $this->convert($this->getPrime(), self::FORMAT_NUMBER, self::FORMAT_BINARY),
'g' => $this->convert($this->getGenerator(), self::FORMAT_NUMBER, self::FORMAT_BINARY)
Expand Down Expand Up @@ -229,7 +229,7 @@ public function getPublicKey($format = self::FORMAT_NUMBER)
public function computeSecretKey($publicKey, $publicKeyFormat = self::FORMAT_NUMBER,
$secretKeyFormat = self::FORMAT_NUMBER)
{
if (function_exists('openssl_dh_compute_key') && self::$useOpenssl !== false) {
if (function_exists('openssl_dh_compute_key') && static::$useOpenssl !== false) {
$publicKey = $this->convert($publicKey, $publicKeyFormat, self::FORMAT_BINARY);
$secretKey = openssl_dh_compute_key($publicKey, $this->opensslKeyResource);
if (false === $secretKey) {
Expand Down
10 changes: 5 additions & 5 deletions src/Symmetric/Mcrypt.php
Original file line number Diff line number Diff line change
Expand Up @@ -143,7 +143,7 @@ public function __construct($options = array())
$this->setSalt($value);
break;
case 'padding':
$plugins = self::getPaddingPluginManager();
$plugins = static::getPaddingPluginManager();
$padding = $plugins->get($value);
$this->padding = $padding;
break;
Expand All @@ -165,7 +165,7 @@ protected function setDefaultOptions($options = array())
return;
}
if (!isset($options['padding'])) {
$plugins = self::getPaddingPluginManager();
$plugins = static::getPaddingPluginManager();
$padding = $plugins->get(self::DEFAULT_PADDING);
$this->padding = $padding;
}
Expand All @@ -178,11 +178,11 @@ protected function setDefaultOptions($options = array())
*/
public static function getPaddingPluginManager()
{
if (self::$paddingPlugins === null) {
if (static::$paddingPlugins === null) {
self::setPaddingPluginManager(new PaddingPluginManager());
}

return self::$paddingPlugins;
return static::$paddingPlugins;
}

/**
Expand Down Expand Up @@ -210,7 +210,7 @@ public static function setPaddingPluginManager($plugins)
(is_object($plugins) ? get_class($plugins) : gettype($plugins))
));
}
self::$paddingPlugins = $plugins;
static::$paddingPlugins = $plugins;
}

/**
Expand Down

0 comments on commit 3419ed9

Please sign in to comment.