diff --git a/wp-includes/sodium_compat/composer.json b/wp-includes/sodium_compat/composer.json index 160d94490b..cf55d79042 100644 --- a/wp-includes/sodium_compat/composer.json +++ b/wp-includes/sodium_compat/composer.json @@ -54,7 +54,7 @@ "paragonie/random_compat": ">=1" }, "require-dev": { - "phpunit/phpunit": "^3|^4|^5|^6|^7" + "phpunit/phpunit": "^3|^4|^5|^6|^7|^8|^9" }, "suggest": { "ext-libsodium": "PHP < 7.0: Better performance, password hashing (Argon2i), secure memory management (memzero), and better security.", diff --git a/wp-includes/sodium_compat/src/Core/SipHash.php b/wp-includes/sodium_compat/src/Core/SipHash.php index 7d3981620e..542b4cc2e4 100644 --- a/wp-includes/sodium_compat/src/Core/SipHash.php +++ b/wp-includes/sodium_compat/src/Core/SipHash.php @@ -14,8 +14,9 @@ class ParagonIE_Sodium_Core_SipHash extends ParagonIE_Sodium_Core_Util /** * @internal You should not use this directly from another application * - * @param int[] $v - * @return int[] + * @param array $v + * @return array + * */ public static function sipRound(array $v) { @@ -26,27 +27,27 @@ class ParagonIE_Sodium_Core_SipHash extends ParagonIE_Sodium_Core_Util ); # v1=ROTL(v1,13); - list($v[2], $v[3]) = self::rotl_64($v[2], $v[3], 13); + list($v[2], $v[3]) = self::rotl_64((int) $v[2], (int) $v[3], 13); # v1 ^= v0; - $v[2] ^= $v[0]; - $v[3] ^= $v[1]; + $v[2] = (int) $v[2] ^ (int) $v[0]; + $v[3] = (int) $v[3] ^ (int) $v[1]; # v0=ROTL(v0,32); list($v[0], $v[1]) = self::rotl_64((int) $v[0], (int) $v[1], 32); # v2 += v3; list($v[4], $v[5]) = self::add( - array($v[4], $v[5]), - array($v[6], $v[7]) + array((int) $v[4], (int) $v[5]), + array((int) $v[6], (int) $v[7]) ); # v3=ROTL(v3,16); - list($v[6], $v[7]) = self::rotl_64($v[6], $v[7], 16); + list($v[6], $v[7]) = self::rotl_64((int) $v[6], (int) $v[7], 16); # v3 ^= v2; - $v[6] ^= $v[4]; - $v[7] ^= $v[5]; + $v[6] = (int) $v[6] ^ (int) $v[4]; + $v[7] = (int) $v[7] ^ (int) $v[5]; # v0 += v3; list($v[0], $v[1]) = self::add( @@ -58,8 +59,8 @@ class ParagonIE_Sodium_Core_SipHash extends ParagonIE_Sodium_Core_Util list($v[6], $v[7]) = self::rotl_64((int) $v[6], (int) $v[7], 21); # v3 ^= v0; - $v[6] ^= $v[0]; - $v[7] ^= $v[1]; + $v[6] = (int) $v[6] ^ (int) $v[0]; + $v[7] = (int) $v[7] ^ (int) $v[1]; # v2 += v1; list($v[4], $v[5]) = self::add( @@ -71,8 +72,8 @@ class ParagonIE_Sodium_Core_SipHash extends ParagonIE_Sodium_Core_Util list($v[2], $v[3]) = self::rotl_64((int) $v[2], (int) $v[3], 17); # v1 ^= v2;; - $v[2] ^= $v[4]; - $v[3] ^= $v[5]; + $v[2] = (int) $v[2] ^ (int) $v[4]; + $v[3] = (int) $v[3] ^ (int) $v[5]; # v2=ROTL(v2,32) list($v[4], $v[5]) = self::rotl_64((int) $v[4], (int) $v[5], 32); diff --git a/wp-includes/sodium_compat/src/Core/Util.php b/wp-includes/sodium_compat/src/Core/Util.php index aa93dfd044..3bb4dafb30 100644 --- a/wp-includes/sodium_compat/src/Core/Util.php +++ b/wp-includes/sodium_compat/src/Core/Util.php @@ -903,6 +903,9 @@ abstract class ParagonIE_Sodium_Core_Util * * @internal You should not use this directly from another application * + * Note: MB_OVERLOAD_STRING === 2, but we don't reference the constant + * (for nuisance-free PHP 8 support) + * * @return bool */ protected static function isMbStringOverride() @@ -913,7 +916,8 @@ abstract class ParagonIE_Sodium_Core_Util $mbstring = extension_loaded('mbstring') && defined('MB_OVERLOAD_STRING') && - ((int) (ini_get('mbstring.func_overload')) & MB_OVERLOAD_STRING); + ((int) (ini_get('mbstring.func_overload')) & 2); + // MB_OVERLOAD_STRING === 2 } /** @var bool $mbstring */ diff --git a/wp-includes/sodium_compat/src/File.php b/wp-includes/sodium_compat/src/File.php index b4948db36c..867da3b9a9 100644 --- a/wp-includes/sodium_compat/src/File.php +++ b/wp-includes/sodium_compat/src/File.php @@ -243,6 +243,7 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util ParagonIE_Sodium_Compat::memzero($nonce); ParagonIE_Sodium_Compat::memzero($ephKeypair); } catch (SodiumException $ex) { + /** @psalm-suppress PossiblyUndefinedVariable */ unset($ephKeypair); } return $res; @@ -541,6 +542,7 @@ class ParagonIE_Sodium_File extends ParagonIE_Sodium_Core_Util try { ParagonIE_Sodium_Compat::memzero($key); } catch (SodiumException $ex) { + /** @psalm-suppress PossiblyUndefinedVariable */ unset($key); } return $res; diff --git a/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php b/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php index 9279f60c1e..c333ad4fad 100644 --- a/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php +++ b/wp-includes/sodium_compat/src/PHP52/SplFixedArray.php @@ -102,6 +102,7 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable */ public function offsetGet($index) { + /** @psalm-suppress MixedReturnStatement */ return $this->internalArray[(int) $index]; } @@ -142,6 +143,7 @@ class SplFixedArray implements Iterator, ArrayAccess, Countable */ public function current() { + /** @psalm-suppress MixedReturnStatement */ return current($this->internalArray); } diff --git a/wp-includes/version.php b/wp-includes/version.php index a44d879497..a425ea1c0b 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -13,7 +13,7 @@ * * @global string $wp_version */ -$wp_version = '5.6-RC2-49740'; +$wp_version = '5.6-RC2-49742'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.