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/lib/php72compat.php

    r55699 r58752  
    1515    'BASE64_VARIANT_URLSAFE',
    1616    'BASE64_VARIANT_URLSAFE_NO_PADDING',
     17    'CRYPTO_AEAD_AES256GCM_KEYBYTES',
     18    'CRYPTO_AEAD_AES256GCM_NSECBYTES',
     19    'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
     20    'CRYPTO_AEAD_AES256GCM_ABYTES',
    1721    'CRYPTO_AEAD_CHACHA20POLY1305_KEYBYTES',
    1822    'CRYPTO_AEAD_CHACHA20POLY1305_NSECBYTES',
    1923    'CRYPTO_AEAD_CHACHA20POLY1305_NPUBBYTES',
    2024    'CRYPTO_AEAD_CHACHA20POLY1305_ABYTES',
    21     'CRYPTO_AEAD_AES256GCM_KEYBYTES',
    22     'CRYPTO_AEAD_AES256GCM_NSECBYTES',
    23     'CRYPTO_AEAD_AES256GCM_NPUBBYTES',
    24     'CRYPTO_AEAD_AES256GCM_ABYTES',
    2525    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_KEYBYTES',
    2626    'CRYPTO_AEAD_CHACHA20POLY1305_IETF_NSECBYTES',
     
    116116     * @throws SodiumException
    117117     */
    118     function sodium_add(&$string1, $string2)
    119     {
     118    function sodium_add(
     119        #[\SensitiveParameter]
     120        &$string1,
     121        #[\SensitiveParameter]
     122        $string2
     123    ) {
    120124        ParagonIE_Sodium_Compat::add($string1, $string2);
    121125    }
     
    131135     * @throws TypeError
    132136     */
    133     function sodium_base642bin($string, $variant, $ignore ='')
    134     {
     137    function sodium_base642bin(
     138        #[\SensitiveParameter]
     139        $string,
     140        $variant,
     141        $ignore =''
     142    ) {
    135143        return ParagonIE_Sodium_Compat::base642bin($string, $variant, $ignore);
    136144    }
     
    145153     * @throws TypeError
    146154     */
    147     function sodium_bin2base64($string, $variant)
    148     {
     155    function sodium_bin2base64(
     156        #[\SensitiveParameter]
     157        $string,
     158        $variant
     159    ) {
    149160        return ParagonIE_Sodium_Compat::bin2base64($string, $variant);
    150161    }
     
    158169     * @throws TypeError
    159170     */
    160     function sodium_bin2hex($string)
    161     {
     171    function sodium_bin2hex(
     172        #[\SensitiveParameter]
     173        $string
     174    ) {
    162175        return ParagonIE_Sodium_Compat::bin2hex($string);
    163176    }
     
    172185     * @throws TypeError
    173186     */
    174     function sodium_compare($string1, $string2)
    175     {
     187    function sodium_compare(
     188        #[\SensitiveParameter]
     189        $string1,
     190        #[\SensitiveParameter]
     191        $string2
     192    ) {
    176193        return ParagonIE_Sodium_Compat::compare($string1, $string2);
    177194    }
     
    186203     * @return string|bool
    187204     */
    188     function sodium_crypto_aead_aes256gcm_decrypt($ciphertext, $additional_data, $nonce, $key)
    189     {
     205    function sodium_crypto_aead_aes256gcm_decrypt(
     206        $ciphertext,
     207        $additional_data,
     208        $nonce,
     209        #[\SensitiveParameter]
     210        $key
     211    ) {
    190212        try {
    191213            return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt(
     
    216238     * @throws TypeError
    217239     */
    218     function sodium_crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key)
    219     {
     240    function sodium_crypto_aead_aes256gcm_encrypt(
     241        #[\SensitiveParameter]
     242        $message,
     243        $additional_data,
     244        $nonce,
     245        #[\SensitiveParameter]
     246        $key
     247    ) {
    220248        return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_encrypt($message, $additional_data, $nonce, $key);
    221249    }
     
    240268     * @return string|bool
    241269     */
    242     function sodium_crypto_aead_chacha20poly1305_decrypt($ciphertext, $additional_data, $nonce, $key)
    243     {
     270    function sodium_crypto_aead_chacha20poly1305_decrypt(
     271        $ciphertext,
     272        $additional_data,
     273        $nonce,
     274        #[\SensitiveParameter]
     275        $key
     276    ) {
    244277        try {
    245278            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt(
     
    267300     * @throws TypeError
    268301     */
    269     function sodium_crypto_aead_chacha20poly1305_encrypt($message, $additional_data, $nonce, $key)
    270     {
     302    function sodium_crypto_aead_chacha20poly1305_encrypt(
     303        #[\SensitiveParameter]
     304        $message,
     305        $additional_data,
     306        $nonce,
     307        #[\SensitiveParameter]
     308        $key
     309    ) {
    271310        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_encrypt(
    272311            $message,
     
    297336     * @return string|bool
    298337     */
    299     function sodium_crypto_aead_chacha20poly1305_ietf_decrypt($message, $additional_data, $nonce, $key)
    300     {
     338    function sodium_crypto_aead_chacha20poly1305_ietf_decrypt(
     339        $message,
     340        $additional_data,
     341        $nonce,
     342        #[\SensitiveParameter]
     343        $key
     344    ) {
    301345        try {
    302346            return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt(
     
    324368     * @throws TypeError
    325369     */
    326     function sodium_crypto_aead_chacha20poly1305_ietf_encrypt($message, $additional_data, $nonce, $key)
    327     {
     370    function sodium_crypto_aead_chacha20poly1305_ietf_encrypt(
     371        #[\SensitiveParameter]
     372        $message,
     373        $additional_data,
     374        $nonce,
     375        #[\SensitiveParameter]
     376        $key
     377    ) {
    328378        return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_encrypt(
    329379            $message,
     
    354404     * @return string|bool
    355405     */
    356     function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt($ciphertext, $additional_data, $nonce, $key)
    357     {
     406    function sodium_crypto_aead_xchacha20poly1305_ietf_decrypt(
     407        $ciphertext,
     408        $additional_data,
     409        $nonce,
     410        #[\SensitiveParameter]
     411        $key
     412    ) {
    358413        try {
    359414            return ParagonIE_Sodium_Compat::crypto_aead_xchacha20poly1305_ietf_decrypt(
     
    383438     */
    384439    function sodium_crypto_aead_xchacha20poly1305_ietf_encrypt(
     440        #[\SensitiveParameter]
    385441        $message,
    386442        $additional_data,
    387443        $nonce,
     444        #[\SensitiveParameter]
    388445        $key
    389446    ) {
     
    417474     * @throws TypeError
    418475     */
    419     function sodium_crypto_auth($message, $key)
    420     {
     476    function sodium_crypto_auth(
     477        $message,
     478        #[\SensitiveParameter]
     479        $key
     480    ) {
    421481        return ParagonIE_Sodium_Compat::crypto_auth($message, $key);
    422482    }
     
    443503     * @throws TypeError
    444504     */
    445     function sodium_crypto_auth_verify($mac, $message, $key)
    446     {
     505    function sodium_crypto_auth_verify(
     506        $mac,
     507        $message,
     508        #[\SensitiveParameter]
     509        $key
     510    ) {
    447511        return ParagonIE_Sodium_Compat::crypto_auth_verify($mac, $message, $key);
    448512    }
     
    458522     * @throws TypeError
    459523     */
    460     function sodium_crypto_box($message, $nonce, $key_pair)
    461     {
     524    function sodium_crypto_box(
     525        #[\SensitiveParameter]
     526        $message,
     527        $nonce,
     528        #[\SensitiveParameter]
     529        $key_pair
     530    ) {
    462531        return ParagonIE_Sodium_Compat::crypto_box($message, $nonce, $key_pair);
    463532    }
     
    484553     * @throws TypeError
    485554     */
    486     function sodium_crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key)
    487     {
     555    function sodium_crypto_box_keypair_from_secretkey_and_publickey(
     556        #[\SensitiveParameter]
     557        $secret_key,
     558        $public_key
     559    ) {
    488560        return ParagonIE_Sodium_Compat::crypto_box_keypair_from_secretkey_and_publickey($secret_key, $public_key);
    489561    }
     
    497569     * @return string|bool
    498570     */
    499     function sodium_crypto_box_open($ciphertext, $nonce, $key_pair)
    500     {
     571    function sodium_crypto_box_open(
     572        $ciphertext,
     573        $nonce,
     574        #[\SensitiveParameter]
     575        $key_pair
     576    ) {
    501577        try {
    502578            return ParagonIE_Sodium_Compat::crypto_box_open($ciphertext, $nonce, $key_pair);
     
    516592     * @throws TypeError
    517593     */
    518     function sodium_crypto_box_publickey($key_pair)
    519     {
     594    function sodium_crypto_box_publickey(
     595        #[\SensitiveParameter]
     596        $key_pair
     597    ) {
    520598        return ParagonIE_Sodium_Compat::crypto_box_publickey($key_pair);
    521599    }
     
    529607     * @throws TypeError
    530608     */
    531     function sodium_crypto_box_publickey_from_secretkey($secret_key)
    532     {
     609    function sodium_crypto_box_publickey_from_secretkey(
     610        #[\SensitiveParameter]
     611        $secret_key
     612    ) {
    533613        return ParagonIE_Sodium_Compat::crypto_box_publickey_from_secretkey($secret_key);
    534614    }
     
    543623     * @throws TypeError
    544624     */
    545     function sodium_crypto_box_seal($message, $public_key)
    546     {
     625    function sodium_crypto_box_seal(
     626        #[\SensitiveParameter]
     627        $message,
     628        $public_key
     629    ) {
    547630        return ParagonIE_Sodium_Compat::crypto_box_seal($message, $public_key);
    548631    }
     
    556639     * @throws SodiumException
    557640     */
    558     function sodium_crypto_box_seal_open($message, $key_pair)
    559     {
     641    function sodium_crypto_box_seal_open(
     642        $message,
     643        #[\SensitiveParameter]
     644        $key_pair
     645    ) {
    560646        try {
    561647            return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $key_pair);
     
    576662     * @throws TypeError
    577663     */
    578     function sodium_crypto_box_secretkey($key_pair)
    579     {
     664    function sodium_crypto_box_secretkey(
     665        #[\SensitiveParameter]
     666        $key_pair
     667    ) {
    580668        return ParagonIE_Sodium_Compat::crypto_box_secretkey($key_pair);
    581669    }
     
    589677     * @throws TypeError
    590678     */
    591     function sodium_crypto_box_seed_keypair($seed)
    592     {
     679    function sodium_crypto_box_seed_keypair(
     680        #[\SensitiveParameter]
     681        $seed
     682    ) {
    593683        return ParagonIE_Sodium_Compat::crypto_box_seed_keypair($seed);
    594684    }
     
    604694     * @throws TypeError
    605695     */
    606     function sodium_crypto_generichash($message, $key = null, $length = 32)
    607     {
     696    function sodium_crypto_generichash(
     697        $message,
     698        #[\SensitiveParameter]
     699        $key = null,
     700        $length = 32
     701    ) {
    608702        return ParagonIE_Sodium_Compat::crypto_generichash($message, $key, $length);
    609703    }
     
    632726     * @throws TypeError
    633727     */
    634     function sodium_crypto_generichash_init($key = null, $length = 32)
    635     {
     728    function sodium_crypto_generichash_init(
     729        #[\SensitiveParameter]
     730        $key = null,
     731        $length = 32
     732    ) {
    636733        return ParagonIE_Sodium_Compat::crypto_generichash_init($key, $length);
    637734    }
     
    657754     * @throws TypeError
    658755     */
    659     function sodium_crypto_generichash_update(&$state, $message = '')
    660     {
     756    function sodium_crypto_generichash_update(
     757        #[\SensitiveParameter]
     758        &$state,
     759        $message = ''
     760    ) {
    661761        ParagonIE_Sodium_Compat::crypto_generichash_update($state, $message);
    662762    }
     
    683783     * @throws Exception
    684784     */
    685     function sodium_crypto_kdf_derive_from_key($subkey_length, $subkey_id, $context, $key)
    686     {
     785    function sodium_crypto_kdf_derive_from_key(
     786        $subkey_length,
     787        $subkey_id,
     788        $context,
     789        #[\SensitiveParameter]
     790        $key
     791    ) {
    687792        return ParagonIE_Sodium_Compat::crypto_kdf_derive_from_key(
    688793            $subkey_length,
     
    704809     * @throws TypeError
    705810     */
    706     function sodium_crypto_kx($my_secret, $their_public, $client_public, $server_public)
    707     {
     811    function sodium_crypto_kx(
     812        #[\SensitiveParameter]
     813        $my_secret,
     814        $their_public,
     815        $client_public,
     816        $server_public
     817    ) {
    708818        return ParagonIE_Sodium_Compat::crypto_kx(
    709819            $my_secret,
     
    720830     * @throws Exception
    721831     */
    722     function sodium_crypto_kx_seed_keypair($seed)
    723     {
     832    function sodium_crypto_kx_seed_keypair(
     833        #[\SensitiveParameter]
     834        $seed
     835    ) {
    724836        return ParagonIE_Sodium_Compat::crypto_kx_seed_keypair($seed);
    725837    }
     
    742854     * @throws SodiumException
    743855     */
    744     function sodium_crypto_kx_client_session_keys($client_key_pair, $server_key)
    745     {
     856    function sodium_crypto_kx_client_session_keys(
     857        #[\SensitiveParameter]
     858        $client_key_pair,
     859        $server_key
     860    ) {
    746861        return ParagonIE_Sodium_Compat::crypto_kx_client_session_keys($client_key_pair, $server_key);
    747862    }
     
    754869     * @throws SodiumException
    755870     */
    756     function sodium_crypto_kx_server_session_keys($server_key_pair, $client_key)
    757     {
     871    function sodium_crypto_kx_server_session_keys(
     872        #[\SensitiveParameter]
     873        $server_key_pair,
     874        $client_key
     875    ) {
    758876        return ParagonIE_Sodium_Compat::crypto_kx_server_session_keys($server_key_pair, $client_key);
    759877    }
     
    765883     * @throws Exception
    766884     */
    767     function sodium_crypto_kx_secretkey($key_pair)
    768     {
     885    function sodium_crypto_kx_secretkey(
     886        #[\SensitiveParameter]
     887        $key_pair
     888    ) {
    769889        return ParagonIE_Sodium_Compat::crypto_kx_secretkey($key_pair);
    770890    }
     
    776896     * @throws Exception
    777897     */
    778     function sodium_crypto_kx_publickey($key_pair)
    779     {
     898    function sodium_crypto_kx_publickey(
     899        #[\SensitiveParameter]
     900        $key_pair
     901    ) {
    780902        return ParagonIE_Sodium_Compat::crypto_kx_publickey($key_pair);
    781903    }
     
    794916     * @throws TypeError
    795917     */
    796     function sodium_crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo = null)
    797     {
     918    function sodium_crypto_pwhash(
     919        $length,
     920        #[\SensitiveParameter]
     921        $passwd,
     922        $salt,
     923        $opslimit,
     924        $memlimit,
     925        $algo = null
     926    ) {
    798927        return ParagonIE_Sodium_Compat::crypto_pwhash($length, $passwd, $salt, $opslimit, $memlimit, $algo);
    799928    }
     
    809938     * @throws TypeError
    810939     */
    811     function sodium_crypto_pwhash_str($passwd, $opslimit, $memlimit)
    812     {
     940    function sodium_crypto_pwhash_str(
     941        #[\SensitiveParameter]
     942        $passwd,
     943        $opslimit,
     944        $memlimit
     945    ) {
    813946        return ParagonIE_Sodium_Compat::crypto_pwhash_str($passwd, $opslimit, $memlimit);
    814947    }
     
    824957     * @throws SodiumException
    825958     */
    826     function sodium_crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit)
    827     {
     959    function sodium_crypto_pwhash_str_needs_rehash(
     960        #[\SensitiveParameter]
     961        $hash,
     962        $opslimit,
     963        $memlimit
     964    ) {
    828965        return ParagonIE_Sodium_Compat::crypto_pwhash_str_needs_rehash($hash, $opslimit, $memlimit);
    829966    }
     
    838975     * @throws TypeError
    839976     */
    840     function sodium_crypto_pwhash_str_verify($passwd, $hash)
    841     {
     977    function sodium_crypto_pwhash_str_verify(
     978        #[\SensitiveParameter]
     979        $passwd,
     980        #[\SensitiveParameter]
     981        $hash
     982    ) {
    842983        return ParagonIE_Sodium_Compat::crypto_pwhash_str_verify($passwd, $hash);
    843984    }
     
    855996     * @throws TypeError
    856997     */
    857     function sodium_crypto_pwhash_scryptsalsa208sha256($length, $passwd, $salt, $opslimit, $memlimit)
    858     {
     998    function sodium_crypto_pwhash_scryptsalsa208sha256(
     999        $length,
     1000        #[\SensitiveParameter]
     1001        $passwd,
     1002        $salt,
     1003        $opslimit,
     1004        $memlimit
     1005    ) {
    8591006        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256(
    8601007            $length,
     
    8761023     * @throws TypeError
    8771024     */
    878     function sodium_crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit)
    879     {
     1025    function sodium_crypto_pwhash_scryptsalsa208sha256_str(
     1026        #[\SensitiveParameter]
     1027        $passwd,
     1028        $opslimit,
     1029        $memlimit
     1030    ) {
    8801031        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str($passwd, $opslimit, $memlimit);
    8811032    }
     
    8901041     * @throws TypeError
    8911042     */
    892     function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash)
    893     {
     1043    function sodium_crypto_pwhash_scryptsalsa208sha256_str_verify(
     1044        #[\SensitiveParameter]
     1045        $passwd,
     1046        #[\SensitiveParameter]
     1047        $hash
     1048    ) {
    8941049        return ParagonIE_Sodium_Compat::crypto_pwhash_scryptsalsa208sha256_str_verify($passwd, $hash);
    8951050    }
     
    9041059     * @throws TypeError
    9051060     */
    906     function sodium_crypto_scalarmult($n, $p)
    907     {
     1061    function sodium_crypto_scalarmult(
     1062        #[\SensitiveParameter]
     1063        $n,
     1064        $p
     1065    ) {
    9081066        return ParagonIE_Sodium_Compat::crypto_scalarmult($n, $p);
    9091067    }
     
    9171075     * @throws TypeError
    9181076     */
    919     function sodium_crypto_scalarmult_base($n)
    920     {
     1077    function sodium_crypto_scalarmult_base(
     1078        #[\SensitiveParameter]
     1079        $n
     1080    ) {
    9211081        return ParagonIE_Sodium_Compat::crypto_scalarmult_base($n);
    9221082    }
     
    9321092     * @throws TypeError
    9331093     */
    934     function sodium_crypto_secretbox($message, $nonce, $key)
    935     {
     1094    function sodium_crypto_secretbox(
     1095        #[\SensitiveParameter]
     1096        $message,
     1097        $nonce,
     1098        #[\SensitiveParameter]
     1099        $key
     1100    ) {
    9361101        return ParagonIE_Sodium_Compat::crypto_secretbox($message, $nonce, $key);
    9371102    }
     
    9561121     * @return string|bool
    9571122     */
    958     function sodium_crypto_secretbox_open($ciphertext, $nonce, $key)
    959     {
     1123    function sodium_crypto_secretbox_open(
     1124        $ciphertext,
     1125        $nonce,
     1126        #[\SensitiveParameter]
     1127        $key
     1128    ) {
    9601129        try {
    9611130            return ParagonIE_Sodium_Compat::crypto_secretbox_open($ciphertext, $nonce, $key);
     
    9731142     * @throws SodiumException
    9741143     */
    975     function sodium_crypto_secretstream_xchacha20poly1305_init_push($key)
    976     {
     1144    function sodium_crypto_secretstream_xchacha20poly1305_init_push(
     1145        #[\SensitiveParameter]
     1146        $key
     1147    ) {
    9771148        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_push($key);
    9781149    }
     
    9881159     */
    9891160    function sodium_crypto_secretstream_xchacha20poly1305_push(
     1161        #[\SensitiveParameter]
    9901162        &$state,
     1163        #[\SensitiveParameter]
    9911164        $message,
    9921165        $additional_data = '',
     
    10081181     * @throws Exception
    10091182     */
    1010     function sodium_crypto_secretstream_xchacha20poly1305_init_pull($header, $key)
    1011     {
     1183    function sodium_crypto_secretstream_xchacha20poly1305_init_pull(
     1184        $header,
     1185        #[\SensitiveParameter]
     1186        $key
     1187    ) {
    10121188        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_init_pull($header, $key);
    10131189    }
     
    10211197     * @throws SodiumException
    10221198     */
    1023     function sodium_crypto_secretstream_xchacha20poly1305_pull(&$state, $ciphertext, $additional_data = '')
    1024     {
     1199    function sodium_crypto_secretstream_xchacha20poly1305_pull(
     1200        #[\SensitiveParameter]
     1201        &$state,
     1202        $ciphertext,
     1203        $additional_data = ''
     1204    ) {
    10251205        return ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_pull(
    10261206            $state,
     
    10361216     * @throws SodiumException
    10371217     */
    1038     function sodium_crypto_secretstream_xchacha20poly1305_rekey(&$state)
    1039     {
     1218    function sodium_crypto_secretstream_xchacha20poly1305_rekey(
     1219        #[\SensitiveParameter]
     1220        &$state
     1221    ) {
    10401222        ParagonIE_Sodium_Compat::crypto_secretstream_xchacha20poly1305_rekey($state);
    10411223    }
     
    10601242     * @throws TypeError
    10611243     */
    1062     function sodium_crypto_shorthash($message, $key = '')
    1063     {
     1244    function sodium_crypto_shorthash(
     1245        $message,
     1246        #[\SensitiveParameter]
     1247        $key = ''
     1248    ) {
    10641249        return ParagonIE_Sodium_Compat::crypto_shorthash($message, $key);
    10651250    }
     
    10851270     * @throws TypeError
    10861271     */
    1087     function sodium_crypto_sign($message, $secret_key)
    1088     {
     1272    function sodium_crypto_sign(
     1273        $message,
     1274        #[\SensitiveParameter]
     1275        $secret_key
     1276    ) {
    10891277        return ParagonIE_Sodium_Compat::crypto_sign($message, $secret_key);
    10901278    }
     
    10991287     * @throws TypeError
    11001288     */
    1101     function sodium_crypto_sign_detached($message, $secret_key)
    1102     {
     1289    function sodium_crypto_sign_detached(
     1290        $message,
     1291        #[\SensitiveParameter]
     1292        $secret_key
     1293    ) {
    11031294        return ParagonIE_Sodium_Compat::crypto_sign_detached($message, $secret_key);
    11041295    }
     
    11131304     * @throws TypeError
    11141305     */
    1115     function sodium_crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key)
    1116     {
     1306    function sodium_crypto_sign_keypair_from_secretkey_and_publickey(
     1307        #[\SensitiveParameter]
     1308        $secret_key,
     1309        $public_key
     1310    ) {
    11171311        return ParagonIE_Sodium_Compat::crypto_sign_keypair_from_secretkey_and_publickey($secret_key, $public_key);
    11181312    }
     
    11561350     * @throws TypeError
    11571351     */
    1158     function sodium_crypto_sign_publickey($key_pair)
    1159     {
     1352    function sodium_crypto_sign_publickey(
     1353        #[\SensitiveParameter]
     1354        $key_pair
     1355    ) {
    11601356        return ParagonIE_Sodium_Compat::crypto_sign_publickey($key_pair);
    11611357    }
     
    11691365     * @throws TypeError
    11701366     */
    1171     function sodium_crypto_sign_publickey_from_secretkey($secret_key)
    1172     {
     1367    function sodium_crypto_sign_publickey_from_secretkey(
     1368        #[\SensitiveParameter]
     1369        $secret_key
     1370    ) {
    11731371        return ParagonIE_Sodium_Compat::crypto_sign_publickey_from_secretkey($secret_key);
    11741372    }
     
    11821380     * @throws TypeError
    11831381     */
    1184     function sodium_crypto_sign_secretkey($key_pair)
    1185     {
     1382    function sodium_crypto_sign_secretkey(
     1383        #[\SensitiveParameter]
     1384        $key_pair
     1385    ) {
    11861386        return ParagonIE_Sodium_Compat::crypto_sign_secretkey($key_pair);
    11871387    }
     
    11951395     * @throws TypeError
    11961396     */
    1197     function sodium_crypto_sign_seed_keypair($seed)
    1198     {
     1397    function sodium_crypto_sign_seed_keypair(
     1398        #[\SensitiveParameter]
     1399        $seed
     1400    ) {
    11991401        return ParagonIE_Sodium_Compat::crypto_sign_seed_keypair($seed);
    12001402    }
     
    12361438     * @throws TypeError
    12371439     */
    1238     function sodium_crypto_sign_ed25519_sk_to_curve25519($secret_key)
    1239     {
     1440    function sodium_crypto_sign_ed25519_sk_to_curve25519(
     1441        #[\SensitiveParameter]
     1442        $secret_key
     1443    ) {
    12401444        return ParagonIE_Sodium_Compat::crypto_sign_ed25519_sk_to_curve25519($secret_key);
    12411445    }
     
    12511455     * @throws TypeError
    12521456     */
    1253     function sodium_crypto_stream($length, $nonce, $key)
    1254     {
     1457    function sodium_crypto_stream(
     1458        $length,
     1459        $nonce,
     1460        #[\SensitiveParameter]
     1461        $key
     1462    ) {
    12551463        return ParagonIE_Sodium_Compat::crypto_stream($length, $nonce, $key);
    12561464    }
     
    12771485     * @throws TypeError
    12781486     */
    1279     function sodium_crypto_stream_xor($message, $nonce, $key)
    1280     {
     1487    function sodium_crypto_stream_xor(
     1488        #[\SensitiveParameter]
     1489        $message,
     1490        $nonce,
     1491        #[\SensitiveParameter]
     1492        $key
     1493    ) {
    12811494        return ParagonIE_Sodium_Compat::crypto_stream_xor($message, $nonce, $key);
    12821495    }
     
    12921505     * @throws TypeError
    12931506     */
    1294     function sodium_hex2bin($string, $ignore = '')
    1295     {
     1507    function sodium_hex2bin(
     1508        #[\SensitiveParameter]
     1509        $string,
     1510        $ignore = ''
     1511    ) {
    12961512        return ParagonIE_Sodium_Compat::hex2bin($string, $ignore);
    12971513    }
     
    13051521     * @throws TypeError
    13061522     */
    1307     function sodium_increment(&$string)
    1308     {
     1523    function sodium_increment(
     1524        #[\SensitiveParameter]
     1525        &$string
     1526    ) {
    13091527        ParagonIE_Sodium_Compat::increment($string);
    13101528    }
     
    13491567     * @throws TypeError
    13501568     */
    1351     function sodium_memcmp($string1, $string2)
    1352     {
     1569    function sodium_memcmp(
     1570        #[\SensitiveParameter]
     1571        $string1,
     1572        #[\SensitiveParameter]
     1573        $string2
     1574    ) {
    13531575        return ParagonIE_Sodium_Compat::memcmp($string1, $string2);
    13541576    }
     
    13641586     * @psalm-suppress ReferenceConstraintViolation
    13651587     */
    1366     function sodium_memzero(&$string)
    1367     {
     1588    function sodium_memzero(
     1589        #[\SensitiveParameter]
     1590        &$string
     1591    ) {
    13681592        ParagonIE_Sodium_Compat::memzero($string);
    13691593    }
     
    13781602     * @throws TypeError
    13791603     */
    1380     function sodium_pad($unpadded, $block_size)
    1381     {
     1604    function sodium_pad(
     1605        #[\SensitiveParameter]
     1606        $unpadded,
     1607        $block_size
     1608    ) {
    13821609        return ParagonIE_Sodium_Compat::pad($unpadded, $block_size, true);
    13831610    }
     
    13921619     * @throws TypeError
    13931620     */
    1394     function sodium_unpad($padded, $block_size)
    1395     {
     1621    function sodium_unpad(
     1622        #[\SensitiveParameter]
     1623        $padded,
     1624        $block_size
     1625    ) {
    13961626        return ParagonIE_Sodium_Compat::unpad($padded, $block_size, true);
    13971627    }
Note: See TracChangeset for help on using the changeset viewer.