Changeset 46859 for branches/5.3/src/wp-includes/sodium_compat/src/File.php
- Timestamp:
- 12/09/2019 04:44:58 PM (5 years ago)
- Location:
- branches/5.3
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/5.3
-
branches/5.3/src/wp-includes/sodium_compat/src/File.php
r45344 r46859 680 680 681 681 /* Security checks */ 682 if (ParagonIE_Sodium_Core_Ed25519::check_S_lt_L(self::substr($sig, 32, 32))) { 682 if ( 683 (ParagonIE_Sodium_Core_Ed25519::chrToInt($sig[63]) & 240) 684 && 685 ParagonIE_Sodium_Core_Ed25519::check_S_lt_L(self::substr($sig, 32, 32)) 686 ) { 683 687 throw new SodiumException('S < L - Invalid signature'); 684 688 } … … 842 846 throw new SodiumException('Could not read input file'); 843 847 } 844 $first32 = ftell($ifp);848 $first32 = self::ftell($ifp); 845 849 846 850 /** @var string $subkey */ … … 876 880 877 881 // Pre-write 16 blank bytes for the Poly1305 tag 878 $start = ftell($ofp);882 $start = self::ftell($ofp); 879 883 fwrite($ofp, str_repeat("\x00", 16)); 880 884 … … 927 931 $subkey = null; 928 932 } 929 $end = ftell($ofp);933 $end = self::ftell($ofp); 930 934 931 935 /* … … 1044 1048 ) { 1045 1049 /** @var int $pos */ 1046 $pos = ftell($ifp);1050 $pos = self::ftell($ifp); 1047 1051 1048 1052 /** @var int $iter */ … … 1107 1111 1108 1112 /** @var int $originalPosition */ 1109 $originalPosition = ftell($fp);1113 $originalPosition = self::ftell($fp); 1110 1114 1111 1115 // Move file pointer to beginning of file … … 1315 1319 throw new SodiumException('Could not read input file'); 1316 1320 } 1317 $first32 = ftell($ifp);1321 $first32 = self::ftell($ifp); 1318 1322 1319 1323 /** @var string $subkey */ … … 1349 1353 1350 1354 // Pre-write 16 blank bytes for the Poly1305 tag 1351 $start = ftell($ofp);1355 $start = self::ftell($ofp); 1352 1356 fwrite($ofp, str_repeat("\x00", 16)); 1353 1357 … … 1400 1404 $subkey = null; 1401 1405 } 1402 $end = ftell($ofp);1406 $end = self::ftell($ofp); 1403 1407 1404 1408 /* … … 1516 1520 ) { 1517 1521 /** @var int $pos */ 1518 $pos = ftell($ifp);1522 $pos = self::ftell($ifp); 1519 1523 1520 1524 /** @var int $iter */ … … 1541 1545 return $res; 1542 1546 } 1547 1548 /** 1549 * @param resource $resource 1550 * @return int 1551 * @throws SodiumException 1552 */ 1553 private static function ftell($resource) 1554 { 1555 $return = ftell($resource); 1556 if (!is_int($return)) { 1557 throw new SodiumException('ftell() returned false'); 1558 } 1559 return (int) $return; 1560 } 1543 1561 }
Note: See TracChangeset
for help on using the changeset viewer.