- Timestamp:
- 05/17/2019 05:19:21 PM (5 years ago)
- Location:
- branches/5.2
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.2
-
branches/5.2/src/wp-includes/sodium_compat/lib/sodium_compat.php
r44953 r45355 46 46 * @param string $key 47 47 * @return string|bool 48 * @throws \SodiumException49 * @throws \TypeError50 48 */ 51 49 function crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key) … … 53 51 try { 54 52 return ParagonIE_Sodium_Compat::crypto_aead_aes256gcm_decrypt($message, $assocData, $nonce, $key); 55 } catch ( Error $ex) {56 return false; 57 } catch ( Exception $ex) {53 } catch (\TypeError $ex) { 54 return false; 55 } catch (\SodiumException $ex) { 58 56 return false; 59 57 } … … 94 92 * @param string $key 95 93 * @return string|bool 96 * @throws \SodiumException97 * @throws \TypeError98 94 */ 99 95 function crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key) … … 101 97 try { 102 98 return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_decrypt($message, $assocData, $nonce, $key); 103 } catch ( Error $ex) {104 return false; 105 } catch ( Exception $ex) {99 } catch (\TypeError $ex) { 100 return false; 101 } catch (\SodiumException $ex) { 106 102 return false; 107 103 } … … 132 128 * @param string $key 133 129 * @return string|bool 134 * @throws \SodiumException135 * @throws \TypeError136 130 */ 137 131 function crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key) … … 139 133 try { 140 134 return ParagonIE_Sodium_Compat::crypto_aead_chacha20poly1305_ietf_decrypt($message, $assocData, $nonce, $key); 141 } catch ( Error $ex) {142 return false; 143 } catch ( Exception $ex) {135 } catch (\TypeError $ex) { 136 return false; 137 } catch (\SodiumException $ex) { 144 138 return false; 145 139 } … … 239 233 * @param string $kp 240 234 * @return string|bool 241 * @throws \SodiumException242 * @throws \TypeError243 235 */ 244 236 function crypto_box_open($message, $nonce, $kp) … … 246 238 try { 247 239 return ParagonIE_Sodium_Compat::crypto_box_open($message, $nonce, $kp); 248 } catch ( Error $ex) {249 return false; 250 } catch ( Exception $ex) {240 } catch (\TypeError $ex) { 241 return false; 242 } catch (\SodiumException $ex) { 251 243 return false; 252 244 } … … 299 291 * @param string $kp 300 292 * @return string|bool 301 * @throws \TypeError302 293 */ 303 294 function crypto_box_seal_open($message, $kp) … … 305 296 try { 306 297 return ParagonIE_Sodium_Compat::crypto_box_seal_open($message, $kp); 307 } catch (\ Error $ex) {308 return false; 309 } catch (\ Exception $ex) {298 } catch (\TypeError $ex) { 299 return false; 300 } catch (\SodiumException $ex) { 310 301 return false; 311 302 } … … 544 535 * @param string $key 545 536 * @return string|bool 546 * @throws \SodiumException547 * @throws \TypeError548 537 */ 549 538 function crypto_secretbox_open($message, $nonce, $key) … … 551 540 try { 552 541 return ParagonIE_Sodium_Compat::crypto_secretbox_open($message, $nonce, $key); 553 } catch ( Error $ex) {554 return false; 555 } catch ( Exception $ex) {542 } catch (\TypeError $ex) { 543 return false; 544 } catch (\SodiumException $ex) { 556 545 return false; 557 546 } … … 623 612 try { 624 613 return ParagonIE_Sodium_Compat::crypto_sign_open($signedMessage, $pk); 625 } catch (\ Error $ex) {626 return false; 627 } catch (\ Exception $ex) {614 } catch (\TypeError $ex) { 615 return false; 616 } catch (\SodiumException $ex) { 628 617 return false; 629 618 } … … 811 800 * @param int $upperLimit 812 801 * @return int 813 * @throws \ Exception802 * @throws \SodiumException 814 803 * @throws \Error 815 804 */
Note: See TracChangeset
for help on using the changeset viewer.