Make WordPress Core


Ignore:
Timestamp:
07/18/2024 12:58:40 PM (21 months ago)
Author:
SergeyBiryukov
Message:

Upgrade/Install: Update sodium_compat to v1.21.1.

The latest version of sodium_compat includes support for AEGIS and preliminary support for PHP 8.4.

Additionally, the PHP 8.2+ SensitiveParameter attribute is now applied where appropriate to functions in the public API. This attribute is used to mark parameters that are sensitive and should be redacted from stack traces.

References:

Follow-up to [49741], [51002], [51591], [52988], [54150], [54310], [55699].

Props jrf, dd32, paragoninitiativeenterprises.
Fixes #61686.

File:
1 edited

Legend:

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

    r54310 r58752  
    1010abstract class ParagonIE_Sodium_Core_Util
    1111{
     12    const U32_MAX = 0xFFFFFFFF;
     13
    1214    /**
    1315     * @param int $integer
     
    3234            (($negative >> $realSize) & 1)
    3335        );
     36    }
     37
     38    /**
     39     * @param string $a
     40     * @param string $b
     41     * @return string
     42     * @throws SodiumException
     43     */
     44    public static function andStrings($a, $b)
     45    {
     46        /* Type checks: */
     47        if (!is_string($a)) {
     48            throw new TypeError('Argument 1 must be a string');
     49        }
     50        if (!is_string($b)) {
     51            throw new TypeError('Argument 2 must be a string');
     52        }
     53        $len = self::strlen($a);
     54        if (self::strlen($b) !== $len) {
     55            throw new SodiumException('Both strings must be of equal length to combine with bitwise AND');
     56        }
     57        return $a & $b;
    3458    }
    3559
Note: See TracChangeset for help on using the changeset viewer.