Make WordPress Core


Ignore:
Timestamp:
03/24/2022 03:18:31 PM (3 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.17.1.

The latest version of sodium_compat includes further improvements for PHP 8.1 compatibility.

Release notes:
https://github.com/paragonie/sodium_compat/releases/tag/v1.17.1

A full list of changes in this update can be found on GitHub:
https://github.com/paragonie/sodium_compat/compare/v1.17.0...v1.17.1

Follow-up to [49741], [51002], [51591].

Props jrf, paragoninitiativeenterprises.
Fixes #55453.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/sodium_compat/src/File.php

    r51002 r52988  
    11551155    private static function sign_core32($filePath, $secretKey)
    11561156    {
    1157         /** @var int|bool $size */
    11581157        $size = filesize($filePath);
    11591158        if (!is_int($size)) {
    11601159            throw new SodiumException('Could not obtain the file size');
    11611160        }
    1162         /** @var int $size */
    1163 
    1164         /** @var resource|bool $fp */
     1161
    11651162        $fp = fopen($filePath, 'rb');
    11661163        if (!is_resource($fp)) {
    11671164            throw new SodiumException('Could not open input file for reading');
    11681165        }
    1169         /** @var resource $fp */
    11701166
    11711167        /** @var string $az */
     
    11801176        $hs = self::updateHashWithFile($hs, $fp, $size);
    11811177
    1182         /** @var string $nonceHash */
    11831178        $nonceHash = hash_final($hs, true);
    1184 
    1185         /** @var string $pk */
    11861179        $pk = self::substr($secretKey, 32, 32);
    1187 
    1188         /** @var string $nonce */
    11891180        $nonce = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($nonceHash) . self::substr($nonceHash, 32);
    1190 
    1191         /** @var string $sig */
    11921181        $sig = ParagonIE_Sodium_Core32_Ed25519::ge_p3_tobytes(
    11931182            ParagonIE_Sodium_Core32_Ed25519::ge_scalarmult_base($nonce)
     
    12001189        $hs = self::updateHashWithFile($hs, $fp, $size);
    12011190
    1202         /** @var string $hramHash */
    12031191        $hramHash = hash_final($hs, true);
    12041192
    1205         /** @var string $hram */
    12061193        $hram = ParagonIE_Sodium_Core32_Ed25519::sc_reduce($hramHash);
    12071194
    1208         /** @var string $sigAfter */
    12091195        $sigAfter = ParagonIE_Sodium_Core32_Ed25519::sc_muladd($hram, $az, $nonce);
    12101196
     
    12441230            throw new SodiumException('Signature is on too small of an order');
    12451231        }
     1232
    12461233        if ((self::chrToInt($sig[63]) & 224) !== 0) {
    12471234            throw new SodiumException('Invalid signature');
Note: See TracChangeset for help on using the changeset viewer.