wp/wp-includes/sodium_compat/src/Core32/Ed25519.php
changeset 16 a86126ab1dd4
parent 9 177826044cd9
child 18 be944660c56a
--- a/wp/wp-includes/sodium_compat/src/Core32/Ed25519.php	Tue Oct 22 16:11:46 2019 +0200
+++ b/wp/wp-includes/sodium_compat/src/Core32/Ed25519.php	Tue Dec 15 13:49:49 2020 +0100
@@ -278,7 +278,7 @@
         if (self::strlen($sig) < 64) {
             throw new SodiumException('Signature is too short');
         }
-        if (self::check_S_lt_L(self::substr($sig, 32, 32))) {
+        if ((self::chrToInt($sig[63]) & 240) && self::check_S_lt_L(self::substr($sig, 32, 32))) {
             throw new SodiumException('S < L - Invalid signature');
         }
         if (self::small_order($sig)) {
@@ -378,7 +378,7 @@
      */
     public static function small_order($R)
     {
-        static $blacklist = array(
+        static $blocklist = array(
             /* 0 (order 4) */
             array(
                 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
@@ -464,13 +464,13 @@
                 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff
             )
         );
-        /** @var array<int, array<int, int>> $blacklist */
-        $countBlacklist = count($blacklist);
+        /** @var array<int, array<int, int>> $blocklist */
+        $countBlocklist = count($blocklist);
 
-        for ($i = 0; $i < $countBlacklist; ++$i) {
+        for ($i = 0; $i < $countBlocklist; ++$i) {
             $c = 0;
             for ($j = 0; $j < 32; ++$j) {
-                $c |= self::chrToInt($R[$j]) ^ $blacklist[$i][$j];
+                $c |= self::chrToInt($R[$j]) ^ $blocklist[$i][$j];
             }
             if ($c === 0) {
                 return true;