Make WordPress Core


Ignore:
Timestamp:
07/18/2024 12:58:40 PM (6 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/File.php

    r52988 r58752  
    2626     * @throws TypeError
    2727     */
    28     public static function box($inputFile, $outputFile, $nonce, $keyPair)
    29     {
     28    public static function box(
     29        $inputFile,
     30        $outputFile,
     31        $nonce,
     32        #[\SensitiveParameter]
     33        $keyPair
     34    ) {
    3035        /* Type checks: */
    3136        if (!is_string($inputFile)) {
     
    9297     * @throws TypeError
    9398     */
    94     public static function box_open($inputFile, $outputFile, $nonce, $keypair)
    95     {
     99    public static function box_open(
     100        $inputFile,
     101        $outputFile,
     102        $nonce,
     103        #[\SensitiveParameter]
     104        $keypair
     105    ) {
    96106        /* Type checks: */
    97107        if (!is_string($inputFile)) {
     
    162172     * @throws TypeError
    163173     */
    164     public static function box_seal($inputFile, $outputFile, $publicKey)
    165     {
     174    public static function box_seal(
     175        $inputFile,
     176        $outputFile,
     177        #[\SensitiveParameter]
     178        $publicKey
     179    ) {
    166180        /* Type checks: */
    167181        if (!is_string($inputFile)) {
     
    266280     * @throws TypeError
    267281     */
    268     public static function box_seal_open($inputFile, $outputFile, $ecdhKeypair)
    269     {
     282    public static function box_seal_open(
     283        $inputFile,
     284        $outputFile,
     285        #[\SensitiveParameter]
     286        $ecdhKeypair
     287    ) {
    270288        /* Type checks: */
    271289        if (!is_string($inputFile)) {
     
    351369     * @psalm-suppress FailedTypeResolution
    352370     */
    353     public static function generichash($filePath, $key = '', $outputLength = 32)
    354     {
     371    public static function generichash(
     372        $filePath,
     373        #[\SensitiveParameter]
     374        $key = '',
     375        $outputLength = 32
     376    ) {
    355377        /* Type checks: */
    356378        if (!is_string($filePath)) {
     
    429451     * @throws TypeError
    430452     */
    431     public static function secretbox($inputFile, $outputFile, $nonce, $key)
    432     {
     453    public static function secretbox(
     454        $inputFile,
     455        $outputFile,
     456        $nonce,
     457        #[\SensitiveParameter]
     458        $key
     459    ) {
    433460        /* Type checks: */
    434461        if (!is_string($inputFile)) {
     
    494521     * @throws TypeError
    495522     */
    496     public static function secretbox_open($inputFile, $outputFile, $nonce, $key)
    497     {
     523    public static function secretbox_open(
     524        $inputFile,
     525        $outputFile,
     526        $nonce,
     527        #[\SensitiveParameter]
     528        $key
     529    ) {
    498530        /* Type checks: */
    499531        if (!is_string($inputFile)) {
     
    561593     * @throws TypeError
    562594     */
    563     public static function sign($filePath, $secretKey)
    564     {
     595    public static function sign(
     596        $filePath,
     597        #[\SensitiveParameter]
     598        $secretKey
     599    ) {
    565600        /* Type checks: */
    566601        if (!is_string($filePath)) {
     
    657692     * @throws Exception
    658693     */
    659     public static function verify($sig, $filePath, $publicKey)
    660     {
     694    public static function verify(
     695        $sig,
     696        $filePath,
     697        $publicKey
     698    ) {
    661699        /* Type checks: */
    662700        if (!is_string($sig)) {
Note: See TracChangeset for help on using the changeset viewer.