Make WordPress Core


Ignore:
Timestamp:
05/25/2021 01:54:12 PM (4 years ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.16.1.

The latest version of sodium_compat includes polyfills for new features slated to land in PHP 8.1:
https://paragonie.com/blog/2021/05/ristretto255-for-php-community

It also fixes a race condition with the autoloader that caused an "undefined constant" error on some systems:
https://github.com/paragonie/sodium_compat/issues/122

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

Follow-up to [49741].

Props paragoninitiativeenterprises, oxyrealm.
Fixes #53274.

File:
1 edited

Legend:

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

    r49741 r51002  
    598598
    599599        $hs = hash_init('sha512');
    600         hash_update($hs, self::substr($az, 32, 32));
     600        self::hash_update($hs, self::substr($az, 32, 32));
    601601        /** @var resource $hs */
    602602        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    617617
    618618        $hs = hash_init('sha512');
    619         hash_update($hs, self::substr($sig, 0, 32));
    620         hash_update($hs, self::substr($pk, 0, 32));
     619        self::hash_update($hs, self::substr($sig, 0, 32));
     620        self::hash_update($hs, self::substr($pk, 0, 32));
    621621        /** @var resource $hs */
    622622        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    729729
    730730        $hs = hash_init('sha512');
    731         hash_update($hs, self::substr($sig, 0, 32));
    732         hash_update($hs, self::substr($publicKey, 0, 32));
     731        self::hash_update($hs, self::substr($sig, 0, 32));
     732        self::hash_update($hs, self::substr($publicKey, 0, 32));
    733733        /** @var resource $hs */
    734734        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    10841084     * loading the entire file into memory.
    10851085     *
    1086      * @param resource|object $hash
     1086     * @param resource|HashContext $hash
    10871087     * @param resource $fp
    10881088     * @param int $size
     
    11341134            /** @var string $message */
    11351135            /** @psalm-suppress InvalidArgument */
    1136             hash_update($hash, $message);
     1136            self::hash_update($hash, $message);
    11371137        }
    11381138        // Reset file pointer's position
     
    11761176
    11771177        $hs = hash_init('sha512');
    1178         hash_update($hs, self::substr($az, 32, 32));
     1178        self::hash_update($hs, self::substr($az, 32, 32));
    11791179        /** @var resource $hs */
    11801180        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    11951195
    11961196        $hs = hash_init('sha512');
    1197         hash_update($hs, self::substr($sig, 0, 32));
    1198         hash_update($hs, self::substr($pk, 0, 32));
     1197        self::hash_update($hs, self::substr($sig, 0, 32));
     1198        self::hash_update($hs, self::substr($pk, 0, 32));
    11991199        /** @var resource $hs */
    12001200        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    12791279
    12801280        $hs = hash_init('sha512');
    1281         hash_update($hs, self::substr($sig, 0, 32));
    1282         hash_update($hs, self::substr($publicKey, 0, 32));
     1281        self::hash_update($hs, self::substr($sig, 0, 32));
     1282        self::hash_update($hs, self::substr($publicKey, 0, 32));
    12831283        /** @var resource $hs */
    12841284        $hs = self::updateHashWithFile($hs, $fp, $size);
     
    15281528        $pos = self::ftell($ifp);
    15291529
    1530         /** @var int $iter */
    1531         $iter = 1;
    1532 
    1533         /** @var int $incr */
    1534         $incr = self::BUFFER_SIZE >> 6;
    1535 
    15361530        while ($mlen > 0) {
    15371531            $blockSize = $mlen > self::BUFFER_SIZE
     
    15441538            $state->update($ciphertext);
    15451539            $mlen -= $blockSize;
    1546             $iter += $incr;
    15471540        }
    15481541        $res = ParagonIE_Sodium_Core32_Util::verify_16($tag, $state->finish());
Note: See TracChangeset for help on using the changeset viewer.