Make WordPress Core


Ignore:
Timestamp:
07/18/2024 12:58:40 PM (2 years 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/lib/ristretto255.php

    r54310 r58752  
    4848     * @throws SodiumException
    4949     */
    50     function sodium_crypto_core_ristretto255_add($p, $q)
    51     {
     50    function sodium_crypto_core_ristretto255_add(
     51        #[\SensitiveParameter]
     52        $p,
     53        #[\SensitiveParameter]
     54        $q
     55    ) {
    5256        return ParagonIE_Sodium_Compat::ristretto255_add($p, $q, true);
    5357    }
     
    6165     * @throws SodiumException
    6266     */
    63     function sodium_crypto_core_ristretto255_from_hash($s)
    64     {
     67    function sodium_crypto_core_ristretto255_from_hash(
     68        #[\SensitiveParameter]
     69        $s
     70    ) {
    6571        return ParagonIE_Sodium_Compat::ristretto255_from_hash($s, true);
    6672    }
     
    7480     * @throws SodiumException
    7581     */
    76     function sodium_crypto_core_ristretto255_is_valid_point($s)
    77     {
     82    function sodium_crypto_core_ristretto255_is_valid_point(
     83        #[\SensitiveParameter]
     84        $s
     85    ) {
    7886        return ParagonIE_Sodium_Compat::ristretto255_is_valid_point($s, true);
    7987    }
     
    100108     * @throws SodiumException
    101109     */
    102     function sodium_crypto_core_ristretto255_scalar_add($x, $y)
    103     {
     110    function sodium_crypto_core_ristretto255_scalar_add(
     111        #[\SensitiveParameter]
     112        $x,
     113        #[\SensitiveParameter]
     114        $y
     115    ) {
    104116        return ParagonIE_Sodium_Compat::ristretto255_scalar_add($x, $y, true);
    105117    }
     
    113125     * @throws SodiumException
    114126     */
    115     function sodium_crypto_core_ristretto255_scalar_complement($s)
    116     {
     127    function sodium_crypto_core_ristretto255_scalar_complement(
     128        #[\SensitiveParameter]
     129        $s
     130    ) {
    117131        return ParagonIE_Sodium_Compat::ristretto255_scalar_complement($s, true);
    118132    }
     
    126140     * @throws SodiumException
    127141     */
    128     function sodium_crypto_core_ristretto255_scalar_invert($p)
    129     {
     142    function sodium_crypto_core_ristretto255_scalar_invert(
     143        #[\SensitiveParameter]
     144        $p
     145    ) {
    130146        return ParagonIE_Sodium_Compat::ristretto255_scalar_invert($p, true);
    131147    }
     
    140156     * @throws SodiumException
    141157     */
    142     function sodium_crypto_core_ristretto255_scalar_mul($x, $y)
    143     {
     158    function sodium_crypto_core_ristretto255_scalar_mul(
     159        #[\SensitiveParameter]
     160        $x,
     161        #[\SensitiveParameter]
     162        $y
     163    ) {
    144164        return ParagonIE_Sodium_Compat::ristretto255_scalar_mul($x, $y, true);
    145165    }
     
    153173     * @throws SodiumException
    154174     */
    155     function sodium_crypto_core_ristretto255_scalar_negate($s)
    156     {
     175    function sodium_crypto_core_ristretto255_scalar_negate(
     176        #[\SensitiveParameter]
     177        $s
     178    ) {
    157179        return ParagonIE_Sodium_Compat::ristretto255_scalar_negate($s, true);
    158180    }
     
    178200     * @throws SodiumException
    179201     */
    180     function sodium_crypto_core_ristretto255_scalar_reduce($s)
    181     {
     202    function sodium_crypto_core_ristretto255_scalar_reduce(
     203        #[\SensitiveParameter]
     204        $s
     205    ) {
    182206        return ParagonIE_Sodium_Compat::ristretto255_scalar_reduce($s, true);
    183207    }
     
    192216     * @throws SodiumException
    193217     */
    194     function sodium_crypto_core_ristretto255_scalar_sub($x, $y)
    195     {
     218    function sodium_crypto_core_ristretto255_scalar_sub(
     219        #[\SensitiveParameter]
     220        $x,
     221        #[\SensitiveParameter]
     222        $y
     223    ) {
    196224        return ParagonIE_Sodium_Compat::ristretto255_scalar_sub($x, $y, true);
    197225    }
     
    206234     * @throws SodiumException
    207235     */
    208     function sodium_crypto_core_ristretto255_sub($p, $q)
    209     {
     236    function sodium_crypto_core_ristretto255_sub(
     237        #[\SensitiveParameter]
     238        $p,
     239        #[\SensitiveParameter]
     240        $q
     241    ) {
    210242        return ParagonIE_Sodium_Compat::ristretto255_sub($p, $q, true);
    211243    }
     
    220252     * @throws TypeError
    221253     */
    222     function sodium_crypto_scalarmult_ristretto255($n, $p)
    223     {
     254    function sodium_crypto_scalarmult_ristretto255(
     255        #[\SensitiveParameter]
     256        $n,
     257        #[\SensitiveParameter]
     258        $p
     259    ) {
    224260        return ParagonIE_Sodium_Compat::scalarmult_ristretto255($n, $p, true);
    225261    }
     
    233269     * @throws TypeError
    234270     */
    235     function sodium_crypto_scalarmult_ristretto255_base($n)
    236     {
     271    function sodium_crypto_scalarmult_ristretto255_base(
     272        #[\SensitiveParameter]
     273        $n
     274    ) {
    237275        return ParagonIE_Sodium_Compat::scalarmult_ristretto255_base($n, true);
    238276    }
Note: See TracChangeset for help on using the changeset viewer.