@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | if ($this->continuousBuffer) { |
1138 | 1138 | $this->encryptIV = $xor; |
1139 | 1139 | if ($start = strlen($plaintext) & 7) { |
1140 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1140 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1141 | 1141 | } |
1142 | 1142 | } |
1143 | 1143 | } |
@@ -1332,7 +1332,7 @@ discard block |
||
1332 | 1332 | if ($this->continuousBuffer) { |
1333 | 1333 | $this->decryptIV = $xor; |
1334 | 1334 | if ($start = strlen($ciphertext) % 8) { |
1335 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1335 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1336 | 1336 | } |
1337 | 1337 | } |
1338 | 1338 | } |
@@ -1518,13 +1518,13 @@ discard block |
||
1518 | 1518 | $t = unpack('Nl/Nr', $block); |
1519 | 1519 | list($l, $r) = array($t['l'], $t['r']); |
1520 | 1520 | $block = ($shuffle[$ipmap[$r & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x80") | |
1521 | - ($shuffle[$ipmap[($r >> 8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x40") | |
|
1522 | - ($shuffle[$ipmap[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x20") | |
|
1523 | - ($shuffle[$ipmap[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x10") | |
|
1524 | - ($shuffle[$ipmap[$l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x08") | |
|
1525 | - ($shuffle[$ipmap[($l >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x04") | |
|
1526 | - ($shuffle[$ipmap[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x02") | |
|
1527 | - ($shuffle[$ipmap[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x01"); |
|
1521 | + ($shuffle[$ipmap[($r >> 8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x40") | |
|
1522 | + ($shuffle[$ipmap[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x20") | |
|
1523 | + ($shuffle[$ipmap[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x10") | |
|
1524 | + ($shuffle[$ipmap[$l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x08") | |
|
1525 | + ($shuffle[$ipmap[($l >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x04") | |
|
1526 | + ($shuffle[$ipmap[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x02") | |
|
1527 | + ($shuffle[$ipmap[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x01"); |
|
1528 | 1528 | |
1529 | 1529 | // Extract L0 and R0. |
1530 | 1530 | $t = unpack('Nl/Nr', $block); |
@@ -1540,9 +1540,9 @@ discard block |
||
1540 | 1540 | |
1541 | 1541 | // S-box indexing. |
1542 | 1542 | $t = $sbox1[($b1 >> 24) & 0x3F] ^ $sbox2[($b2 >> 24) & 0x3F] ^ |
1543 | - $sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^ |
|
1544 | - $sbox5[($b1 >> 8) & 0x3F] ^ $sbox6[($b2 >> 8) & 0x3F] ^ |
|
1545 | - $sbox7[$b1 & 0x3F] ^ $sbox8[$b2 & 0x3F] ^ $l; |
|
1543 | + $sbox3[($b1 >> 16) & 0x3F] ^ $sbox4[($b2 >> 16) & 0x3F] ^ |
|
1544 | + $sbox5[($b1 >> 8) & 0x3F] ^ $sbox6[($b2 >> 8) & 0x3F] ^ |
|
1545 | + $sbox7[$b1 & 0x3F] ^ $sbox8[$b2 & 0x3F] ^ $l; |
|
1546 | 1546 | // end of "the Feistel (F) function" |
1547 | 1547 | |
1548 | 1548 | $l = $r; |
@@ -1551,13 +1551,13 @@ discard block |
||
1551 | 1551 | |
1552 | 1552 | // Perform the inverse IP permutation. |
1553 | 1553 | return ($shuffle[$invipmap[($l >> 24) & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x80") | |
1554 | - ($shuffle[$invipmap[($r >> 24) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x40") | |
|
1555 | - ($shuffle[$invipmap[($l >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x20") | |
|
1556 | - ($shuffle[$invipmap[($r >> 16) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x10") | |
|
1557 | - ($shuffle[$invipmap[($l >> 8) & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x08") | |
|
1558 | - ($shuffle[$invipmap[($r >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x04") | |
|
1559 | - ($shuffle[$invipmap[$l & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x02") | |
|
1560 | - ($shuffle[$invipmap[$r & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x01"); |
|
1554 | + ($shuffle[$invipmap[($r >> 24) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x40") | |
|
1555 | + ($shuffle[$invipmap[($l >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x20") | |
|
1556 | + ($shuffle[$invipmap[($r >> 16) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x10") | |
|
1557 | + ($shuffle[$invipmap[($l >> 8) & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x08") | |
|
1558 | + ($shuffle[$invipmap[($r >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x04") | |
|
1559 | + ($shuffle[$invipmap[$l & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x02") | |
|
1560 | + ($shuffle[$invipmap[$r & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x01"); |
|
1561 | 1561 | } |
1562 | 1562 | |
1563 | 1563 | /** |
@@ -2025,13 +2025,13 @@ discard block |
||
2025 | 2025 | $t = unpack('Nl/Nr', $key); |
2026 | 2026 | list($l, $r) = array($t['l'], $t['r']); |
2027 | 2027 | $key = ($this->shuffle[$pc1map[$r & 0xFF]] & "\x80\x80\x80\x80\x80\x80\x80\x00") | |
2028 | - ($this->shuffle[$pc1map[($r >> 8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") | |
|
2029 | - ($this->shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") | |
|
2030 | - ($this->shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") | |
|
2031 | - ($this->shuffle[$pc1map[$l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") | |
|
2032 | - ($this->shuffle[$pc1map[($l >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") | |
|
2033 | - ($this->shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") | |
|
2034 | - ($this->shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00"); |
|
2028 | + ($this->shuffle[$pc1map[($r >> 8) & 0xFF]] & "\x40\x40\x40\x40\x40\x40\x40\x00") | |
|
2029 | + ($this->shuffle[$pc1map[($r >> 16) & 0xFF]] & "\x20\x20\x20\x20\x20\x20\x20\x00") | |
|
2030 | + ($this->shuffle[$pc1map[($r >> 24) & 0xFF]] & "\x10\x10\x10\x10\x10\x10\x10\x00") | |
|
2031 | + ($this->shuffle[$pc1map[$l & 0xFF]] & "\x08\x08\x08\x08\x08\x08\x08\x00") | |
|
2032 | + ($this->shuffle[$pc1map[($l >> 8) & 0xFF]] & "\x04\x04\x04\x04\x04\x04\x04\x00") | |
|
2033 | + ($this->shuffle[$pc1map[($l >> 16) & 0xFF]] & "\x02\x02\x02\x02\x02\x02\x02\x00") | |
|
2034 | + ($this->shuffle[$pc1map[($l >> 24) & 0xFF]] & "\x01\x01\x01\x01\x01\x01\x01\x00"); |
|
2035 | 2035 | $key = unpack('Nc/Nd', $key); |
2036 | 2036 | $c = ($key['c'] >> 4) & 0x0FFFFFFF; |
2037 | 2037 | $d = (($key['d'] >> 4) & 0x0FFFFFF0) | ($key['c'] & 0x0F); |
@@ -2045,9 +2045,9 @@ discard block |
||
2045 | 2045 | |
2046 | 2046 | // Perform the PC-2 transformation. |
2047 | 2047 | $cp = $pc2mapc1[$c >> 24] | $pc2mapc2[($c >> 16) & 0xFF] | |
2048 | - $pc2mapc3[($c >> 8) & 0xFF] | $pc2mapc4[$c & 0xFF]; |
|
2048 | + $pc2mapc3[($c >> 8) & 0xFF] | $pc2mapc4[$c & 0xFF]; |
|
2049 | 2049 | $dp = $pc2mapd1[$d >> 24] | $pc2mapd2[($d >> 16) & 0xFF] | |
2050 | - $pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[$d & 0xFF]; |
|
2050 | + $pc2mapd3[($d >> 8) & 0xFF] | $pc2mapd4[$d & 0xFF]; |
|
2051 | 2051 | |
2052 | 2052 | // Reorder: odd bytes/even bytes. Push the result in key schedule. |
2053 | 2053 | $keys[] = array( |
@@ -703,15 +703,15 @@ discard block |
||
703 | 703 | return false; |
704 | 704 | } |
705 | 705 | return "<RSAKeyValue>\r\n" . |
706 | - ' <Modulus>' . base64_encode($raw['modulus']) . "</Modulus>\r\n" . |
|
707 | - ' <Exponent>' . base64_encode($raw['publicExponent']) . "</Exponent>\r\n" . |
|
708 | - ' <P>' . base64_encode($raw['prime1']) . "</P>\r\n" . |
|
709 | - ' <Q>' . base64_encode($raw['prime2']) . "</Q>\r\n" . |
|
710 | - ' <DP>' . base64_encode($raw['exponent1']) . "</DP>\r\n" . |
|
711 | - ' <DQ>' . base64_encode($raw['exponent2']) . "</DQ>\r\n" . |
|
712 | - ' <InverseQ>' . base64_encode($raw['coefficient']) . "</InverseQ>\r\n" . |
|
713 | - ' <D>' . base64_encode($raw['privateExponent']) . "</D>\r\n" . |
|
714 | - '</RSAKeyValue>'; |
|
706 | + ' <Modulus>' . base64_encode($raw['modulus']) . "</Modulus>\r\n" . |
|
707 | + ' <Exponent>' . base64_encode($raw['publicExponent']) . "</Exponent>\r\n" . |
|
708 | + ' <P>' . base64_encode($raw['prime1']) . "</P>\r\n" . |
|
709 | + ' <Q>' . base64_encode($raw['prime2']) . "</Q>\r\n" . |
|
710 | + ' <DP>' . base64_encode($raw['exponent1']) . "</DP>\r\n" . |
|
711 | + ' <DQ>' . base64_encode($raw['exponent2']) . "</DQ>\r\n" . |
|
712 | + ' <InverseQ>' . base64_encode($raw['coefficient']) . "</InverseQ>\r\n" . |
|
713 | + ' <D>' . base64_encode($raw['privateExponent']) . "</D>\r\n" . |
|
714 | + '</RSAKeyValue>'; |
|
715 | 715 | break; |
716 | 716 | case CRYPT_RSA_PRIVATE_FORMAT_PUTTY: |
717 | 717 | if ($num_primes != 2) { |
@@ -725,8 +725,8 @@ discard block |
||
725 | 725 | strlen('ssh-rsa'), 'ssh-rsa', strlen($raw['publicExponent']), $raw['publicExponent'], strlen($raw['modulus']), $raw['modulus'] |
726 | 726 | ); |
727 | 727 | $source = pack('Na*Na*Na*Na*', |
728 | - strlen('ssh-rsa'), 'ssh-rsa', strlen($encryption), $encryption, |
|
729 | - strlen($this->comment), $this->comment, strlen($public), $public |
|
728 | + strlen('ssh-rsa'), 'ssh-rsa', strlen($encryption), $encryption, |
|
729 | + strlen($this->comment), $this->comment, strlen($public), $public |
|
730 | 730 | ); |
731 | 731 | $public = base64_encode($public); |
732 | 732 | $key.= "Public-Lines: " . ((strlen($public) + 32) >> 6) . "\r\n"; |
@@ -810,15 +810,15 @@ discard block |
||
810 | 810 | $des->setIV($iv); |
811 | 811 | $iv = strtoupper(bin2hex($iv)); |
812 | 812 | $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . |
813 | - "Proc-Type: 4,ENCRYPTED\r\n" . |
|
814 | - "DEK-Info: DES-EDE3-CBC,$iv\r\n" . |
|
815 | - "\r\n" . |
|
816 | - chunk_split(base64_encode($des->encrypt($RSAPrivateKey)), 64) . |
|
817 | - '-----END RSA PRIVATE KEY-----'; |
|
813 | + "Proc-Type: 4,ENCRYPTED\r\n" . |
|
814 | + "DEK-Info: DES-EDE3-CBC,$iv\r\n" . |
|
815 | + "\r\n" . |
|
816 | + chunk_split(base64_encode($des->encrypt($RSAPrivateKey)), 64) . |
|
817 | + '-----END RSA PRIVATE KEY-----'; |
|
818 | 818 | } else { |
819 | 819 | $RSAPrivateKey = "-----BEGIN RSA PRIVATE KEY-----\r\n" . |
820 | - chunk_split(base64_encode($RSAPrivateKey), 64) . |
|
821 | - '-----END RSA PRIVATE KEY-----'; |
|
820 | + chunk_split(base64_encode($RSAPrivateKey), 64) . |
|
821 | + '-----END RSA PRIVATE KEY-----'; |
|
822 | 822 | } |
823 | 823 | |
824 | 824 | return $RSAPrivateKey; |
@@ -843,9 +843,9 @@ discard block |
||
843 | 843 | return array('e' => $e->copy(), 'n' => $n->copy()); |
844 | 844 | case CRYPT_RSA_PUBLIC_FORMAT_XML: |
845 | 845 | return "<RSAKeyValue>\r\n" . |
846 | - ' <Modulus>' . base64_encode($modulus) . "</Modulus>\r\n" . |
|
847 | - ' <Exponent>' . base64_encode($publicExponent) . "</Exponent>\r\n" . |
|
848 | - '</RSAKeyValue>'; |
|
846 | + ' <Modulus>' . base64_encode($modulus) . "</Modulus>\r\n" . |
|
847 | + ' <Exponent>' . base64_encode($publicExponent) . "</Exponent>\r\n" . |
|
848 | + '</RSAKeyValue>'; |
|
849 | 849 | break; |
850 | 850 | case CRYPT_RSA_PUBLIC_FORMAT_OPENSSH: |
851 | 851 | // from <http://tools.ietf.org/html/rfc4253#page-15>: |
@@ -884,8 +884,8 @@ discard block |
||
884 | 884 | } |
885 | 885 | |
886 | 886 | $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . |
887 | - chunk_split(base64_encode($RSAPublicKey), 64) . |
|
888 | - '-----END PUBLIC KEY-----'; |
|
887 | + chunk_split(base64_encode($RSAPublicKey), 64) . |
|
888 | + '-----END PUBLIC KEY-----'; |
|
889 | 889 | |
890 | 890 | return $RSAPublicKey; |
891 | 891 | } |
@@ -538,7 +538,7 @@ discard block |
||
538 | 538 | if ($this->continuousBuffer) { |
539 | 539 | $this->encryptIV = $xor; |
540 | 540 | if ($start = strlen($plaintext) & 7) { |
541 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
541 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
542 | 542 | } |
543 | 543 | } |
544 | 544 | } |
@@ -757,7 +757,7 @@ discard block |
||
757 | 757 | if ($this->continuousBuffer) { |
758 | 758 | $this->decryptIV = $xor; |
759 | 759 | if ($start = strlen($ciphertext) & 7) { |
760 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
760 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
761 | 761 | } |
762 | 762 | } |
763 | 763 | } |
@@ -917,7 +917,7 @@ discard block |
||
917 | 917 | if ($this->continuousBuffer) { |
918 | 918 | $this->encryptIV = $xor; |
919 | 919 | if ($start = strlen($plaintext) % $block_size) { |
920 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
920 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
921 | 921 | } |
922 | 922 | } |
923 | 923 | } |
@@ -1058,7 +1058,7 @@ discard block |
||
1058 | 1058 | if ($this->continuousBuffer) { |
1059 | 1059 | $this->decryptIV = $xor; |
1060 | 1060 | if ($start = strlen($ciphertext) % $block_size) { |
1061 | - $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1061 | + $buffer['xor'] = substr($key, $start) . $buffer['xor']; |
|
1062 | 1062 | } |
1063 | 1063 | } |
1064 | 1064 | } |
@@ -1137,7 +1137,7 @@ discard block |
||
1137 | 1137 | ($state[$j] & 0x00FF0000) ^ |
1138 | 1138 | ($state[$k] & 0x0000FF00) ^ |
1139 | 1139 | ($state[$l] & 0x000000FF) ^ |
1140 | - $w[$Nr][$i]; |
|
1140 | + $w[$Nr][$i]; |
|
1141 | 1141 | ++$i; |
1142 | 1142 | $j = ($j + 1) % $Nb; |
1143 | 1143 | $k = ($k + 1) % $Nb; |
@@ -1223,9 +1223,9 @@ discard block |
||
1223 | 1223 | while ($i < $Nb) { |
1224 | 1224 | $temp[$i] = $dw[0][$i] ^ |
1225 | 1225 | $this->_invSubWord(($state[$i] & 0xFF000000) | |
1226 | - ($state[$j] & 0x00FF0000) | |
|
1227 | - ($state[$k] & 0x0000FF00) | |
|
1228 | - ($state[$l] & 0x000000FF)); |
|
1226 | + ($state[$j] & 0x00FF0000) | |
|
1227 | + ($state[$k] & 0x0000FF00) | |
|
1228 | + ($state[$l] & 0x000000FF)); |
|
1229 | 1229 | ++$i; |
1230 | 1230 | $j = ($j + 1) % $Nb; |
1231 | 1231 | $k = ($k + 1) % $Nb; |
@@ -1393,9 +1393,9 @@ discard block |
||
1393 | 1393 | $sbox = $this->sbox; |
1394 | 1394 | |
1395 | 1395 | return $sbox[$word & 0x000000FF] | |
1396 | - ($sbox[$word >> 8 & 0x000000FF] << 8) | |
|
1397 | - ($sbox[$word >> 16 & 0x000000FF] << 16) | |
|
1398 | - ($sbox[$word >> 24 & 0x000000FF] << 24); |
|
1396 | + ($sbox[$word >> 8 & 0x000000FF] << 8) | |
|
1397 | + ($sbox[$word >> 16 & 0x000000FF] << 16) | |
|
1398 | + ($sbox[$word >> 24 & 0x000000FF] << 24); |
|
1399 | 1399 | } |
1400 | 1400 | |
1401 | 1401 | /** |
@@ -1408,9 +1408,9 @@ discard block |
||
1408 | 1408 | $isbox = $this->isbox; |
1409 | 1409 | |
1410 | 1410 | return $isbox[$word & 0x000000FF] | |
1411 | - ($isbox[$word >> 8 & 0x000000FF] << 8) | |
|
1412 | - ($isbox[$word >> 16 & 0x000000FF] << 16) | |
|
1413 | - ($isbox[$word >> 24 & 0x000000FF] << 24); |
|
1411 | + ($isbox[$word >> 8 & 0x000000FF] << 8) | |
|
1412 | + ($isbox[$word >> 16 & 0x000000FF] << 16) | |
|
1413 | + ($isbox[$word >> 24 & 0x000000FF] << 24); |
|
1414 | 1414 | } |
1415 | 1415 | |
1416 | 1416 | /** |
@@ -678,13 +678,13 @@ discard block |
||
678 | 678 | list ($s3, $s2, $s1, $s0) = $this->mds_rem($le_longs[3], $le_longs[4]); |
679 | 679 | for ($i = 0, $j = 1; $i < 40; $i+= 2,$j+= 2) { |
680 | 680 | $A = $m0[$q0[$q0[$i] ^ $key[ 9]] ^ $key[1]] ^ |
681 | - $m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^ |
|
682 | - $m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^ |
|
683 | - $m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]]; |
|
681 | + $m1[$q0[$q1[$i] ^ $key[10]] ^ $key[2]] ^ |
|
682 | + $m2[$q1[$q0[$i] ^ $key[11]] ^ $key[3]] ^ |
|
683 | + $m3[$q1[$q1[$i] ^ $key[12]] ^ $key[4]]; |
|
684 | 684 | $B = $m0[$q0[$q0[$j] ^ $key[13]] ^ $key[5]] ^ |
685 | - $m1[$q0[$q1[$j] ^ $key[14]] ^ $key[6]] ^ |
|
686 | - $m2[$q1[$q0[$j] ^ $key[15]] ^ $key[7]] ^ |
|
687 | - $m3[$q1[$q1[$j] ^ $key[16]] ^ $key[8]]; |
|
685 | + $m1[$q0[$q1[$j] ^ $key[14]] ^ $key[6]] ^ |
|
686 | + $m2[$q1[$q0[$j] ^ $key[15]] ^ $key[7]] ^ |
|
687 | + $m3[$q1[$q1[$j] ^ $key[16]] ^ $key[8]]; |
|
688 | 688 | $B = ($B << 8) | ($B >> 24 & 0xff); |
689 | 689 | $K[] = $A+= $B; |
690 | 690 | $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff); |
@@ -702,13 +702,13 @@ discard block |
||
702 | 702 | list ($s3, $s2, $s1, $s0) = $this->mds_rem($le_longs[5], $le_longs[6]); |
703 | 703 | for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) { |
704 | 704 | $A = $m0[$q0[$q0[$q1[$i] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^ |
705 | - $m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^ |
|
706 | - $m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^ |
|
707 | - $m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]]; |
|
705 | + $m1[$q0[$q1[$q1[$i] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^ |
|
706 | + $m2[$q1[$q0[$q0[$i] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^ |
|
707 | + $m3[$q1[$q1[$q0[$i] ^ $key[20]] ^ $key[12]] ^ $key[4]]; |
|
708 | 708 | $B = $m0[$q0[$q0[$q1[$j] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^ |
709 | - $m1[$q0[$q1[$q1[$j] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^ |
|
710 | - $m2[$q1[$q0[$q0[$j] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^ |
|
711 | - $m3[$q1[$q1[$q0[$j] ^ $key[24]] ^ $key[16]] ^ $key[8]]; |
|
709 | + $m1[$q0[$q1[$q1[$j] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^ |
|
710 | + $m2[$q1[$q0[$q0[$j] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^ |
|
711 | + $m3[$q1[$q1[$q0[$j] ^ $key[24]] ^ $key[16]] ^ $key[8]]; |
|
712 | 712 | $B = ($B << 8) | ($B >> 24 & 0xff); |
713 | 713 | $K[] = $A+= $B; |
714 | 714 | $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff); |
@@ -727,13 +727,13 @@ discard block |
||
727 | 727 | list ($s3, $s2, $s1, $s0) = $this->mds_rem($le_longs[7], $le_longs[8]); |
728 | 728 | for ($i = 0, $j = 1; $i < 40; $i+= 2, $j+= 2) { |
729 | 729 | $A = $m0[$q0[$q0[$q1[$q1[$i] ^ $key[25]] ^ $key[17]] ^ $key[ 9]] ^ $key[1]] ^ |
730 | - $m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^ |
|
731 | - $m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^ |
|
732 | - $m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]]; |
|
730 | + $m1[$q0[$q1[$q1[$q0[$i] ^ $key[26]] ^ $key[18]] ^ $key[10]] ^ $key[2]] ^ |
|
731 | + $m2[$q1[$q0[$q0[$q0[$i] ^ $key[27]] ^ $key[19]] ^ $key[11]] ^ $key[3]] ^ |
|
732 | + $m3[$q1[$q1[$q0[$q1[$i] ^ $key[28]] ^ $key[20]] ^ $key[12]] ^ $key[4]]; |
|
733 | 733 | $B = $m0[$q0[$q0[$q1[$q1[$j] ^ $key[29]] ^ $key[21]] ^ $key[13]] ^ $key[5]] ^ |
734 | - $m1[$q0[$q1[$q1[$q0[$j] ^ $key[30]] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^ |
|
735 | - $m2[$q1[$q0[$q0[$q0[$j] ^ $key[31]] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^ |
|
736 | - $m3[$q1[$q1[$q0[$q1[$j] ^ $key[32]] ^ $key[24]] ^ $key[16]] ^ $key[8]]; |
|
734 | + $m1[$q0[$q1[$q1[$q0[$j] ^ $key[30]] ^ $key[22]] ^ $key[14]] ^ $key[6]] ^ |
|
735 | + $m2[$q1[$q0[$q0[$q0[$j] ^ $key[31]] ^ $key[23]] ^ $key[15]] ^ $key[7]] ^ |
|
736 | + $m3[$q1[$q1[$q0[$q1[$j] ^ $key[32]] ^ $key[24]] ^ $key[16]] ^ $key[8]]; |
|
737 | 737 | $B = ($B << 8) | ($B >> 24 & 0xff); |
738 | 738 | $K[] = $A+= $B; |
739 | 739 | $K[] = (($A+= $B) << 9 | $A >> 23 & 0x1ff); |
@@ -394,10 +394,10 @@ discard block |
||
394 | 394 | 'children' => array( |
395 | 395 | 'extnId' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
396 | 396 | 'critical' => array( |
397 | - 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
398 | - 'optional' => true, |
|
399 | - 'default' => false |
|
400 | - ), |
|
397 | + 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
398 | + 'optional' => true, |
|
399 | + 'default' => false |
|
400 | + ), |
|
401 | 401 | 'extnValue' => array('type' => FILE_ASN1_TYPE_OCTET_STRING) |
402 | 402 | ) |
403 | 403 | ); |
@@ -452,11 +452,11 @@ discard block |
||
452 | 452 | // technically, default implies optional, but we'll define it as being optional, none-the-less, just to |
453 | 453 | // reenforce that fact |
454 | 454 | 'version' => array( |
455 | - 'constant' => 0, |
|
456 | - 'optional' => true, |
|
457 | - 'explicit' => true, |
|
458 | - 'default' => 'v1' |
|
459 | - ) + $Version, |
|
455 | + 'constant' => 0, |
|
456 | + 'optional' => true, |
|
457 | + 'explicit' => true, |
|
458 | + 'default' => 'v1' |
|
459 | + ) + $Version, |
|
460 | 460 | 'serialNumber' => $CertificateSerialNumber, |
461 | 461 | 'signature' => $AlgorithmIdentifier, |
462 | 462 | 'issuer' => $this->Name, |
@@ -465,31 +465,31 @@ discard block |
||
465 | 465 | 'subjectPublicKeyInfo' => $SubjectPublicKeyInfo, |
466 | 466 | // implicit means that the T in the TLV structure is to be rewritten, regardless of the type |
467 | 467 | 'issuerUniqueID' => array( |
468 | - 'constant' => 1, |
|
469 | - 'optional' => true, |
|
470 | - 'implicit' => true |
|
471 | - ) + $UniqueIdentifier, |
|
468 | + 'constant' => 1, |
|
469 | + 'optional' => true, |
|
470 | + 'implicit' => true |
|
471 | + ) + $UniqueIdentifier, |
|
472 | 472 | 'subjectUniqueID' => array( |
473 | - 'constant' => 2, |
|
474 | - 'optional' => true, |
|
475 | - 'implicit' => true |
|
476 | - ) + $UniqueIdentifier, |
|
473 | + 'constant' => 2, |
|
474 | + 'optional' => true, |
|
475 | + 'implicit' => true |
|
476 | + ) + $UniqueIdentifier, |
|
477 | 477 | // <http://tools.ietf.org/html/rfc2459#page-74> doesn't use the EXPLICIT keyword but if |
478 | 478 | // it's not IMPLICIT, it's EXPLICIT |
479 | 479 | 'extensions' => array( |
480 | - 'constant' => 3, |
|
481 | - 'optional' => true, |
|
482 | - 'explicit' => true |
|
483 | - ) + $this->Extensions |
|
480 | + 'constant' => 3, |
|
481 | + 'optional' => true, |
|
482 | + 'explicit' => true |
|
483 | + ) + $this->Extensions |
|
484 | 484 | ) |
485 | 485 | ); |
486 | 486 | |
487 | 487 | $this->Certificate = array( |
488 | 488 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
489 | 489 | 'children' => array( |
490 | - 'tbsCertificate' => $TBSCertificate, |
|
491 | - 'signatureAlgorithm' => $AlgorithmIdentifier, |
|
492 | - 'signature' => array('type' => FILE_ASN1_TYPE_BIT_STRING) |
|
490 | + 'tbsCertificate' => $TBSCertificate, |
|
491 | + 'signatureAlgorithm' => $AlgorithmIdentifier, |
|
492 | + 'signature' => array('type' => FILE_ASN1_TYPE_BIT_STRING) |
|
493 | 493 | ) |
494 | 494 | ); |
495 | 495 | |
@@ -512,14 +512,14 @@ discard block |
||
512 | 512 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
513 | 513 | 'children' => array( |
514 | 514 | 'cA' => array( |
515 | - 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
516 | - 'optional' => true, |
|
517 | - 'default' => false |
|
518 | - ), |
|
515 | + 'type' => FILE_ASN1_TYPE_BOOLEAN, |
|
516 | + 'optional' => true, |
|
517 | + 'default' => false |
|
518 | + ), |
|
519 | 519 | 'pathLenConstraint' => array( |
520 | - 'type' => FILE_ASN1_TYPE_INTEGER, |
|
521 | - 'optional' => true |
|
522 | - ) |
|
520 | + 'type' => FILE_ASN1_TYPE_INTEGER, |
|
521 | + 'optional' => true |
|
522 | + ) |
|
523 | 523 | ) |
524 | 524 | ); |
525 | 525 | |
@@ -536,29 +536,29 @@ discard block |
||
536 | 536 | 'type' => FILE_ASN1_TYPE_SET, |
537 | 537 | 'children' => array( |
538 | 538 | 'surname' => array( |
539 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
540 | - 'constant' => 0, |
|
541 | - 'optional' => true, |
|
542 | - 'implicit' => true |
|
543 | - ), |
|
539 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
540 | + 'constant' => 0, |
|
541 | + 'optional' => true, |
|
542 | + 'implicit' => true |
|
543 | + ), |
|
544 | 544 | 'given-name' => array( |
545 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
546 | - 'constant' => 1, |
|
547 | - 'optional' => true, |
|
548 | - 'implicit' => true |
|
549 | - ), |
|
545 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
546 | + 'constant' => 1, |
|
547 | + 'optional' => true, |
|
548 | + 'implicit' => true |
|
549 | + ), |
|
550 | 550 | 'initials' => array( |
551 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
552 | - 'constant' => 2, |
|
553 | - 'optional' => true, |
|
554 | - 'implicit' => true |
|
555 | - ), |
|
551 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
552 | + 'constant' => 2, |
|
553 | + 'optional' => true, |
|
554 | + 'implicit' => true |
|
555 | + ), |
|
556 | 556 | 'generation-qualifier' => array( |
557 | - 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
558 | - 'constant' => 3, |
|
559 | - 'optional' => true, |
|
560 | - 'implicit' => true |
|
561 | - ) |
|
557 | + 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
|
558 | + 'constant' => 3, |
|
559 | + 'optional' => true, |
|
560 | + 'implicit' => true |
|
561 | + ) |
|
562 | 562 | ) |
563 | 563 | ); |
564 | 564 | |
@@ -605,26 +605,26 @@ discard block |
||
605 | 605 | $AnotherName = array( |
606 | 606 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
607 | 607 | 'children' => array( |
608 | - 'type-id' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
|
609 | - 'value' => array( |
|
610 | - 'type' => FILE_ASN1_TYPE_ANY, |
|
611 | - 'constant' => 0, |
|
612 | - 'optional' => true, |
|
613 | - 'explicit' => true |
|
614 | - ) |
|
608 | + 'type-id' => array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER), |
|
609 | + 'value' => array( |
|
610 | + 'type' => FILE_ASN1_TYPE_ANY, |
|
611 | + 'constant' => 0, |
|
612 | + 'optional' => true, |
|
613 | + 'explicit' => true |
|
614 | + ) |
|
615 | 615 | ) |
616 | 616 | ); |
617 | 617 | |
618 | 618 | $ExtensionAttribute = array( |
619 | 619 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
620 | 620 | 'children' => array( |
621 | - 'extension-attribute-type' => array( |
|
621 | + 'extension-attribute-type' => array( |
|
622 | 622 | 'type' => FILE_ASN1_TYPE_PRINTABLE_STRING, |
623 | 623 | 'constant' => 0, |
624 | 624 | 'optional' => true, |
625 | 625 | 'implicit' => true |
626 | 626 | ), |
627 | - 'extension-attribute-value' => array( |
|
627 | + 'extension-attribute-value' => array( |
|
628 | 628 | 'type' => FILE_ASN1_TYPE_ANY, |
629 | 629 | 'constant' => 1, |
630 | 630 | 'optional' => true, |
@@ -643,8 +643,8 @@ discard block |
||
643 | 643 | $BuiltInDomainDefinedAttribute = array( |
644 | 644 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
645 | 645 | 'children' => array( |
646 | - 'type' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING), |
|
647 | - 'value' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING) |
|
646 | + 'type' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING), |
|
647 | + 'value' => array('type' => FILE_ASN1_TYPE_PRINTABLE_STRING) |
|
648 | 648 | ) |
649 | 649 | ); |
650 | 650 | |
@@ -661,63 +661,63 @@ discard block |
||
661 | 661 | 'country-name' => array('optional' => true) + $CountryName, |
662 | 662 | 'administration-domain-name' => array('optional' => true) + $AdministrationDomainName, |
663 | 663 | 'network-address' => array( |
664 | - 'constant' => 0, |
|
665 | - 'optional' => true, |
|
666 | - 'implicit' => true |
|
667 | - ) + $NetworkAddress, |
|
664 | + 'constant' => 0, |
|
665 | + 'optional' => true, |
|
666 | + 'implicit' => true |
|
667 | + ) + $NetworkAddress, |
|
668 | 668 | 'terminal-identifier' => array( |
669 | - 'constant' => 1, |
|
670 | - 'optional' => true, |
|
671 | - 'implicit' => true |
|
672 | - ) + $TerminalIdentifier, |
|
669 | + 'constant' => 1, |
|
670 | + 'optional' => true, |
|
671 | + 'implicit' => true |
|
672 | + ) + $TerminalIdentifier, |
|
673 | 673 | 'private-domain-name' => array( |
674 | - 'constant' => 2, |
|
675 | - 'optional' => true, |
|
676 | - 'explicit' => true |
|
677 | - ) + $PrivateDomainName, |
|
674 | + 'constant' => 2, |
|
675 | + 'optional' => true, |
|
676 | + 'explicit' => true |
|
677 | + ) + $PrivateDomainName, |
|
678 | 678 | 'organization-name' => array( |
679 | - 'constant' => 3, |
|
680 | - 'optional' => true, |
|
681 | - 'implicit' => true |
|
682 | - ) + $OrganizationName, |
|
679 | + 'constant' => 3, |
|
680 | + 'optional' => true, |
|
681 | + 'implicit' => true |
|
682 | + ) + $OrganizationName, |
|
683 | 683 | 'numeric-user-identifier' => array( |
684 | - 'constant' => 4, |
|
685 | - 'optional' => true, |
|
686 | - 'implicit' => true |
|
687 | - ) + $NumericUserIdentifier, |
|
684 | + 'constant' => 4, |
|
685 | + 'optional' => true, |
|
686 | + 'implicit' => true |
|
687 | + ) + $NumericUserIdentifier, |
|
688 | 688 | 'personal-name' => array( |
689 | - 'constant' => 5, |
|
690 | - 'optional' => true, |
|
691 | - 'implicit' => true |
|
692 | - ) + $PersonalName, |
|
689 | + 'constant' => 5, |
|
690 | + 'optional' => true, |
|
691 | + 'implicit' => true |
|
692 | + ) + $PersonalName, |
|
693 | 693 | 'organizational-unit-names' => array( |
694 | - 'constant' => 6, |
|
695 | - 'optional' => true, |
|
696 | - 'implicit' => true |
|
697 | - ) + $OrganizationalUnitNames |
|
694 | + 'constant' => 6, |
|
695 | + 'optional' => true, |
|
696 | + 'implicit' => true |
|
697 | + ) + $OrganizationalUnitNames |
|
698 | 698 | ) |
699 | 699 | ); |
700 | 700 | |
701 | 701 | $ORAddress = array( |
702 | 702 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
703 | 703 | 'children' => array( |
704 | - 'built-in-standard-attributes' => $BuiltInStandardAttributes, |
|
705 | - 'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes, |
|
706 | - 'extension-attributes' => array('optional' => true) + $ExtensionAttributes |
|
704 | + 'built-in-standard-attributes' => $BuiltInStandardAttributes, |
|
705 | + 'built-in-domain-defined-attributes' => array('optional' => true) + $BuiltInDomainDefinedAttributes, |
|
706 | + 'extension-attributes' => array('optional' => true) + $ExtensionAttributes |
|
707 | 707 | ) |
708 | 708 | ); |
709 | 709 | |
710 | 710 | $EDIPartyName = array( |
711 | 711 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
712 | 712 | 'children' => array( |
713 | - 'nameAssigner' => array( |
|
713 | + 'nameAssigner' => array( |
|
714 | 714 | 'constant' => 0, |
715 | 715 | 'optional' => true, |
716 | 716 | 'implicit' => true |
717 | 717 | ) + $this->DirectoryString, |
718 | - // partyName is technically required but File_ASN1 doesn't currently support non-optional constants and |
|
719 | - // setting it to optional gets the job done in any event. |
|
720 | - 'partyName' => array( |
|
718 | + // partyName is technically required but File_ASN1 doesn't currently support non-optional constants and |
|
719 | + // setting it to optional gets the job done in any event. |
|
720 | + 'partyName' => array( |
|
721 | 721 | 'constant' => 1, |
722 | 722 | 'optional' => true, |
723 | 723 | 'implicit' => true |
@@ -729,55 +729,55 @@ discard block |
||
729 | 729 | 'type' => FILE_ASN1_TYPE_CHOICE, |
730 | 730 | 'children' => array( |
731 | 731 | 'otherName' => array( |
732 | - 'constant' => 0, |
|
733 | - 'optional' => true, |
|
734 | - 'implicit' => true |
|
735 | - ) + $AnotherName, |
|
732 | + 'constant' => 0, |
|
733 | + 'optional' => true, |
|
734 | + 'implicit' => true |
|
735 | + ) + $AnotherName, |
|
736 | 736 | 'rfc822Name' => array( |
737 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
738 | - 'constant' => 1, |
|
739 | - 'optional' => true, |
|
740 | - 'implicit' => true |
|
741 | - ), |
|
737 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
738 | + 'constant' => 1, |
|
739 | + 'optional' => true, |
|
740 | + 'implicit' => true |
|
741 | + ), |
|
742 | 742 | 'dNSName' => array( |
743 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
744 | - 'constant' => 2, |
|
745 | - 'optional' => true, |
|
746 | - 'implicit' => true |
|
747 | - ), |
|
743 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
744 | + 'constant' => 2, |
|
745 | + 'optional' => true, |
|
746 | + 'implicit' => true |
|
747 | + ), |
|
748 | 748 | 'x400Address' => array( |
749 | - 'constant' => 3, |
|
750 | - 'optional' => true, |
|
751 | - 'implicit' => true |
|
752 | - ) + $ORAddress, |
|
749 | + 'constant' => 3, |
|
750 | + 'optional' => true, |
|
751 | + 'implicit' => true |
|
752 | + ) + $ORAddress, |
|
753 | 753 | 'directoryName' => array( |
754 | - 'constant' => 4, |
|
755 | - 'optional' => true, |
|
756 | - 'explicit' => true |
|
757 | - ) + $this->Name, |
|
754 | + 'constant' => 4, |
|
755 | + 'optional' => true, |
|
756 | + 'explicit' => true |
|
757 | + ) + $this->Name, |
|
758 | 758 | 'ediPartyName' => array( |
759 | - 'constant' => 5, |
|
760 | - 'optional' => true, |
|
761 | - 'implicit' => true |
|
762 | - ) + $EDIPartyName, |
|
759 | + 'constant' => 5, |
|
760 | + 'optional' => true, |
|
761 | + 'implicit' => true |
|
762 | + ) + $EDIPartyName, |
|
763 | 763 | 'uniformResourceIdentifier' => array( |
764 | - 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
765 | - 'constant' => 6, |
|
766 | - 'optional' => true, |
|
767 | - 'implicit' => true |
|
768 | - ), |
|
764 | + 'type' => FILE_ASN1_TYPE_IA5_STRING, |
|
765 | + 'constant' => 6, |
|
766 | + 'optional' => true, |
|
767 | + 'implicit' => true |
|
768 | + ), |
|
769 | 769 | 'iPAddress' => array( |
770 | - 'type' => FILE_ASN1_TYPE_OCTET_STRING, |
|
771 | - 'constant' => 7, |
|
772 | - 'optional' => true, |
|
773 | - 'implicit' => true |
|
774 | - ), |
|
770 | + 'type' => FILE_ASN1_TYPE_OCTET_STRING, |
|
771 | + 'constant' => 7, |
|
772 | + 'optional' => true, |
|
773 | + 'implicit' => true |
|
774 | + ), |
|
775 | 775 | 'registeredID' => array( |
776 | - 'type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER, |
|
777 | - 'constant' => 8, |
|
778 | - 'optional' => true, |
|
779 | - 'implicit' => true |
|
780 | - ) |
|
776 | + 'type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER, |
|
777 | + 'constant' => 8, |
|
778 | + 'optional' => true, |
|
779 | + 'implicit' => true |
|
780 | + ) |
|
781 | 781 | ) |
782 | 782 | ); |
783 | 783 | |
@@ -809,15 +809,15 @@ discard block |
||
809 | 809 | 'type' => FILE_ASN1_TYPE_CHOICE, |
810 | 810 | 'children' => array( |
811 | 811 | 'fullName' => array( |
812 | - 'constant' => 0, |
|
813 | - 'optional' => true, |
|
814 | - 'implicit' => true |
|
815 | - ) + $GeneralNames, |
|
812 | + 'constant' => 0, |
|
813 | + 'optional' => true, |
|
814 | + 'implicit' => true |
|
815 | + ) + $GeneralNames, |
|
816 | 816 | 'nameRelativeToCRLIssuer' => array( |
817 | - 'constant' => 1, |
|
818 | - 'optional' => true, |
|
819 | - 'implicit' => true |
|
820 | - ) + $this->RelativeDistinguishedName |
|
817 | + 'constant' => 1, |
|
818 | + 'optional' => true, |
|
819 | + 'implicit' => true |
|
820 | + ) + $this->RelativeDistinguishedName |
|
821 | 821 | ) |
822 | 822 | ); |
823 | 823 | |
@@ -825,20 +825,20 @@ discard block |
||
825 | 825 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
826 | 826 | 'children' => array( |
827 | 827 | 'distributionPoint' => array( |
828 | - 'constant' => 0, |
|
829 | - 'optional' => true, |
|
830 | - 'explicit' => true |
|
831 | - ) + $DistributionPointName, |
|
828 | + 'constant' => 0, |
|
829 | + 'optional' => true, |
|
830 | + 'explicit' => true |
|
831 | + ) + $DistributionPointName, |
|
832 | 832 | 'reasons' => array( |
833 | - 'constant' => 1, |
|
834 | - 'optional' => true, |
|
835 | - 'implicit' => true |
|
836 | - ) + $ReasonFlags, |
|
833 | + 'constant' => 1, |
|
834 | + 'optional' => true, |
|
835 | + 'implicit' => true |
|
836 | + ) + $ReasonFlags, |
|
837 | 837 | 'cRLIssuer' => array( |
838 | - 'constant' => 2, |
|
839 | - 'optional' => true, |
|
840 | - 'implicit' => true |
|
841 | - ) + $GeneralNames |
|
838 | + 'constant' => 2, |
|
839 | + 'optional' => true, |
|
840 | + 'implicit' => true |
|
841 | + ) + $GeneralNames |
|
842 | 842 | ) |
843 | 843 | ); |
844 | 844 | |
@@ -853,20 +853,20 @@ discard block |
||
853 | 853 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
854 | 854 | 'children' => array( |
855 | 855 | 'keyIdentifier' => array( |
856 | - 'constant' => 0, |
|
857 | - 'optional' => true, |
|
858 | - 'implicit' => true |
|
859 | - ) + $this->KeyIdentifier, |
|
856 | + 'constant' => 0, |
|
857 | + 'optional' => true, |
|
858 | + 'implicit' => true |
|
859 | + ) + $this->KeyIdentifier, |
|
860 | 860 | 'authorityCertIssuer' => array( |
861 | - 'constant' => 1, |
|
862 | - 'optional' => true, |
|
863 | - 'implicit' => true |
|
864 | - ) + $GeneralNames, |
|
861 | + 'constant' => 1, |
|
862 | + 'optional' => true, |
|
863 | + 'implicit' => true |
|
864 | + ) + $GeneralNames, |
|
865 | 865 | 'authorityCertSerialNumber' => array( |
866 | - 'constant' => 2, |
|
867 | - 'optional' => true, |
|
868 | - 'implicit' => true |
|
869 | - ) + $CertificateSerialNumber |
|
866 | + 'constant' => 2, |
|
867 | + 'optional' => true, |
|
868 | + 'implicit' => true |
|
869 | + ) + $CertificateSerialNumber |
|
870 | 870 | ) |
871 | 871 | ); |
872 | 872 | |
@@ -887,12 +887,12 @@ discard block |
||
887 | 887 | 'children' => array( |
888 | 888 | 'policyIdentifier' => $CertPolicyId, |
889 | 889 | 'policyQualifiers' => array( |
890 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
891 | - 'min' => 0, |
|
892 | - 'max' => -1, |
|
893 | - 'optional' => true, |
|
894 | - 'children' => $PolicyQualifierInfo |
|
895 | - ) |
|
890 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
891 | + 'min' => 0, |
|
892 | + 'max' => -1, |
|
893 | + 'optional' => true, |
|
894 | + 'children' => $PolicyQualifierInfo |
|
895 | + ) |
|
896 | 896 | ) |
897 | 897 | ); |
898 | 898 | |
@@ -908,12 +908,12 @@ discard block |
||
908 | 908 | 'min' => 1, |
909 | 909 | 'max' => -1, |
910 | 910 | 'children' => array( |
911 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
912 | - 'children' => array( |
|
913 | - 'issuerDomainPolicy' => $CertPolicyId, |
|
914 | - 'subjectDomainPolicy' => $CertPolicyId |
|
915 | - ) |
|
916 | - ) |
|
911 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
912 | + 'children' => array( |
|
913 | + 'issuerDomainPolicy' => $CertPolicyId, |
|
914 | + 'subjectDomainPolicy' => $CertPolicyId |
|
915 | + ) |
|
916 | + ) |
|
917 | 917 | ); |
918 | 918 | |
919 | 919 | $KeyPurposeId = array('type' => FILE_ASN1_TYPE_OBJECT_IDENTIFIER); |
@@ -946,15 +946,15 @@ discard block |
||
946 | 946 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
947 | 947 | 'children' => array( |
948 | 948 | 'notBefore' => array( |
949 | - 'constant' => 0, |
|
950 | - 'optional' => true, |
|
951 | - 'implicit' => true, |
|
952 | - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME), |
|
949 | + 'constant' => 0, |
|
950 | + 'optional' => true, |
|
951 | + 'implicit' => true, |
|
952 | + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME), |
|
953 | 953 | 'notAfter' => array( |
954 | - 'constant' => 1, |
|
955 | - 'optional' => true, |
|
956 | - 'implicit' => true, |
|
957 | - 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME) |
|
954 | + 'constant' => 1, |
|
955 | + 'optional' => true, |
|
956 | + 'implicit' => true, |
|
957 | + 'type' => FILE_ASN1_TYPE_GENERALIZED_TIME) |
|
958 | 958 | ) |
959 | 959 | ); |
960 | 960 | |
@@ -965,16 +965,16 @@ discard block |
||
965 | 965 | 'children' => array( |
966 | 966 | 'base' => $GeneralName, |
967 | 967 | 'minimum' => array( |
968 | - 'constant' => 0, |
|
969 | - 'optional' => true, |
|
970 | - 'implicit' => true, |
|
971 | - 'default' => new Math_BigInteger(0) |
|
972 | - ) + $BaseDistance, |
|
968 | + 'constant' => 0, |
|
969 | + 'optional' => true, |
|
970 | + 'implicit' => true, |
|
971 | + 'default' => new Math_BigInteger(0) |
|
972 | + ) + $BaseDistance, |
|
973 | 973 | 'maximum' => array( |
974 | - 'constant' => 1, |
|
975 | - 'optional' => true, |
|
976 | - 'implicit' => true, |
|
977 | - ) + $BaseDistance |
|
974 | + 'constant' => 1, |
|
975 | + 'optional' => true, |
|
976 | + 'implicit' => true, |
|
977 | + ) + $BaseDistance |
|
978 | 978 | ) |
979 | 979 | ); |
980 | 980 | |
@@ -989,15 +989,15 @@ discard block |
||
989 | 989 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
990 | 990 | 'children' => array( |
991 | 991 | 'permittedSubtrees' => array( |
992 | - 'constant' => 0, |
|
993 | - 'optional' => true, |
|
994 | - 'implicit' => true |
|
995 | - ) + $GeneralSubtrees, |
|
992 | + 'constant' => 0, |
|
993 | + 'optional' => true, |
|
994 | + 'implicit' => true |
|
995 | + ) + $GeneralSubtrees, |
|
996 | 996 | 'excludedSubtrees' => array( |
997 | - 'constant' => 1, |
|
998 | - 'optional' => true, |
|
999 | - 'implicit' => true |
|
1000 | - ) + $GeneralSubtrees |
|
997 | + 'constant' => 1, |
|
998 | + 'optional' => true, |
|
999 | + 'implicit' => true |
|
1000 | + ) + $GeneralSubtrees |
|
1001 | 1001 | ) |
1002 | 1002 | ); |
1003 | 1003 | |
@@ -1018,11 +1018,11 @@ discard block |
||
1018 | 1018 | 'children' => array( |
1019 | 1019 | 'organization' => $DisplayText, |
1020 | 1020 | 'noticeNumbers' => array( |
1021 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1022 | - 'min' => 1, |
|
1023 | - 'max' => 200, |
|
1024 | - 'children' => array('type' => FILE_ASN1_TYPE_INTEGER) |
|
1025 | - ) |
|
1021 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1022 | + 'min' => 1, |
|
1023 | + 'max' => 200, |
|
1024 | + 'children' => array('type' => FILE_ASN1_TYPE_INTEGER) |
|
1025 | + ) |
|
1026 | 1026 | ) |
1027 | 1027 | ); |
1028 | 1028 | |
@@ -1030,13 +1030,13 @@ discard block |
||
1030 | 1030 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1031 | 1031 | 'children' => array( |
1032 | 1032 | 'noticeRef' => array( |
1033 | - 'optional' => true, |
|
1034 | - 'implicit' => true |
|
1035 | - ) + $NoticeReference, |
|
1033 | + 'optional' => true, |
|
1034 | + 'implicit' => true |
|
1035 | + ) + $NoticeReference, |
|
1036 | 1036 | 'explicitText' => array( |
1037 | - 'optional' => true, |
|
1038 | - 'implicit' => true |
|
1039 | - ) + $DisplayText |
|
1037 | + 'optional' => true, |
|
1038 | + 'implicit' => true |
|
1039 | + ) + $DisplayText |
|
1040 | 1040 | ) |
1041 | 1041 | ); |
1042 | 1042 | |
@@ -1065,11 +1065,11 @@ discard block |
||
1065 | 1065 | 'children' => array( |
1066 | 1066 | 'type' => $AttributeType, |
1067 | 1067 | 'value'=> array( |
1068 | - 'type' => FILE_ASN1_TYPE_SET, |
|
1069 | - 'min' => 1, |
|
1070 | - 'max' => -1, |
|
1071 | - 'children' => $this->AttributeValue |
|
1072 | - ) |
|
1068 | + 'type' => FILE_ASN1_TYPE_SET, |
|
1069 | + 'min' => 1, |
|
1070 | + 'max' => -1, |
|
1071 | + 'children' => $this->AttributeValue |
|
1072 | + ) |
|
1073 | 1073 | ) |
1074 | 1074 | ); |
1075 | 1075 | |
@@ -1086,16 +1086,16 @@ discard block |
||
1086 | 1086 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1087 | 1087 | 'children' => array( |
1088 | 1088 | 'version' => array( |
1089 | - 'type' => FILE_ASN1_TYPE_INTEGER, |
|
1090 | - 'mapping' => array('v1') |
|
1091 | - ), |
|
1089 | + 'type' => FILE_ASN1_TYPE_INTEGER, |
|
1090 | + 'mapping' => array('v1') |
|
1091 | + ), |
|
1092 | 1092 | 'subject' => $this->Name, |
1093 | 1093 | 'subjectPKInfo' => $SubjectPublicKeyInfo, |
1094 | 1094 | 'attributes' => array( |
1095 | - 'constant' => 0, |
|
1096 | - 'optional' => true, |
|
1097 | - 'implicit' => true |
|
1098 | - ) + $Attributes, |
|
1095 | + 'constant' => 0, |
|
1096 | + 'optional' => true, |
|
1097 | + 'implicit' => true |
|
1098 | + ) + $Attributes, |
|
1099 | 1099 | ) |
1100 | 1100 | ); |
1101 | 1101 | |
@@ -1111,39 +1111,39 @@ discard block |
||
1111 | 1111 | $RevokedCertificate = array( |
1112 | 1112 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1113 | 1113 | 'children' => array( |
1114 | - 'userCertificate' => $CertificateSerialNumber, |
|
1115 | - 'revocationDate' => $Time, |
|
1116 | - 'crlEntryExtensions' => array( |
|
1117 | - 'optional' => true |
|
1118 | - ) + $this->Extensions |
|
1119 | - ) |
|
1114 | + 'userCertificate' => $CertificateSerialNumber, |
|
1115 | + 'revocationDate' => $Time, |
|
1116 | + 'crlEntryExtensions' => array( |
|
1117 | + 'optional' => true |
|
1118 | + ) + $this->Extensions |
|
1119 | + ) |
|
1120 | 1120 | ); |
1121 | 1121 | |
1122 | 1122 | $TBSCertList = array( |
1123 | 1123 | 'type' => FILE_ASN1_TYPE_SEQUENCE, |
1124 | 1124 | 'children' => array( |
1125 | 1125 | 'version' => array( |
1126 | - 'optional' => true, |
|
1127 | - 'default' => 'v1' |
|
1128 | - ) + $Version, |
|
1126 | + 'optional' => true, |
|
1127 | + 'default' => 'v1' |
|
1128 | + ) + $Version, |
|
1129 | 1129 | 'signature' => $AlgorithmIdentifier, |
1130 | 1130 | 'issuer' => $this->Name, |
1131 | 1131 | 'thisUpdate' => $Time, |
1132 | 1132 | 'nextUpdate' => array( |
1133 | - 'optional' => true |
|
1134 | - ) + $Time, |
|
1133 | + 'optional' => true |
|
1134 | + ) + $Time, |
|
1135 | 1135 | 'revokedCertificates' => array( |
1136 | - 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1137 | - 'optional' => true, |
|
1138 | - 'min' => 0, |
|
1139 | - 'max' => -1, |
|
1140 | - 'children' => $RevokedCertificate |
|
1141 | - ), |
|
1136 | + 'type' => FILE_ASN1_TYPE_SEQUENCE, |
|
1137 | + 'optional' => true, |
|
1138 | + 'min' => 0, |
|
1139 | + 'max' => -1, |
|
1140 | + 'children' => $RevokedCertificate |
|
1141 | + ), |
|
1142 | 1142 | 'crlExtensions' => array( |
1143 | - 'constant' => 0, |
|
1144 | - 'optional' => true, |
|
1145 | - 'explicit' => true |
|
1146 | - ) + $this->Extensions |
|
1143 | + 'constant' => 0, |
|
1144 | + 'optional' => true, |
|
1145 | + 'explicit' => true |
|
1146 | + ) + $this->Extensions |
|
1147 | 1147 | ) |
1148 | 1148 | ); |
1149 | 1149 | |
@@ -1159,7 +1159,7 @@ discard block |
||
1159 | 1159 | $this->CRLNumber = array('type' => FILE_ASN1_TYPE_INTEGER); |
1160 | 1160 | |
1161 | 1161 | $this->CRLReason = array('type' => FILE_ASN1_TYPE_ENUMERATED, |
1162 | - 'mapping' => array( |
|
1162 | + 'mapping' => array( |
|
1163 | 1163 | 'unspecified', |
1164 | 1164 | 'keyCompromise', |
1165 | 1165 | 'cACompromise', |
@@ -1214,7 +1214,7 @@ discard block |
||
1214 | 1214 | 'default' => false, |
1215 | 1215 | 'implicit' => true |
1216 | 1216 | ) |
1217 | - ) |
|
1217 | + ) |
|
1218 | 1218 | ); |
1219 | 1219 | |
1220 | 1220 | $this->InvalidityDate = array('type' => FILE_ASN1_TYPE_GENERALIZED_TIME); |
@@ -4132,7 +4132,7 @@ discard block |
||
4132 | 4132 | |
4133 | 4133 | $i = count($rclist); |
4134 | 4134 | $rclist[] = array('userCertificate' => $serial, |
4135 | - 'revocationDate' => array('generalTime' => @date('D, d M y H:i:s O'))); |
|
4135 | + 'revocationDate' => array('generalTime' => @date('D, d M y H:i:s O'))); |
|
4136 | 4136 | return $i; |
4137 | 4137 | } |
4138 | 4138 |
@@ -1662,8 +1662,8 @@ discard block |
||
1662 | 1662 | ); |
1663 | 1663 | |
1664 | 1664 | $RSAPublicKey = "-----BEGIN PUBLIC KEY-----\r\n" . |
1665 | - chunk_split(base64_encode($encapsulated)) . |
|
1666 | - '-----END PUBLIC KEY-----'; |
|
1665 | + chunk_split(base64_encode($encapsulated)) . |
|
1666 | + '-----END PUBLIC KEY-----'; |
|
1667 | 1667 | |
1668 | 1668 | $plaintext = str_pad($this->toBytes(), strlen($n->toBytes(true)) - 1, "\0", STR_PAD_LEFT); |
1669 | 1669 | |
@@ -3245,7 +3245,7 @@ discard block |
||
3245 | 3245 | |
3246 | 3246 | if (!$t) { |
3247 | 3247 | // see HAC 4.49 "Note (controlling the error probability)" |
3248 | - if ($length >= 163) { $t = 2; } // floor(1300 / 8) |
|
3248 | + if ($length >= 163) { $t = 2; } // floor(1300 / 8) |
|
3249 | 3249 | else if ($length >= 106) { $t = 3; } // floor( 850 / 8) |
3250 | 3250 | else if ($length >= 81 ) { $t = 4; } // floor( 650 / 8) |
3251 | 3251 | else if ($length >= 68 ) { $t = 5; } // floor( 550 / 8) |
@@ -822,7 +822,7 @@ discard block |
||
822 | 822 | array(60 => 'NET_SSH2_MSG_USERAUTH_PASSWD_CHANGEREQ'), |
823 | 823 | array(60 => 'NET_SSH2_MSG_USERAUTH_PK_OK'), |
824 | 824 | array(60 => 'NET_SSH2_MSG_USERAUTH_INFO_REQUEST', |
825 | - 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE') |
|
825 | + 61 => 'NET_SSH2_MSG_USERAUTH_INFO_RESPONSE') |
|
826 | 826 | ); |
827 | 827 | |
828 | 828 | $start = strtok(microtime(), ' ') + strtok(''); // http://php.net/microtime#61838 |
@@ -970,7 +970,7 @@ discard block |
||
970 | 970 | 'twofish192-cbc', // OPTIONAL Twofish with a 192-bit key |
971 | 971 | 'twofish256-cbc', |
972 | 972 | 'twofish-cbc', // OPTIONAL alias for "twofish256-cbc" |
973 | - // (this is being retained for historical reasons) |
|
973 | + // (this is being retained for historical reasons) |
|
974 | 974 | '3des-ctr', // RECOMMENDED Three-key 3DES in SDCTR mode |
975 | 975 | |
976 | 976 | '3des-cbc', // REQUIRED three-key 3DES in CBC mode |
@@ -1000,8 +1000,8 @@ discard block |
||
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | static $str_kex_algorithms, $str_server_host_key_algorithms, |
1003 | - $encryption_algorithms_server_to_client, $mac_algorithms_server_to_client, $compression_algorithms_server_to_client, |
|
1004 | - $encryption_algorithms_client_to_server, $mac_algorithms_client_to_server, $compression_algorithms_client_to_server; |
|
1003 | + $encryption_algorithms_server_to_client, $mac_algorithms_server_to_client, $compression_algorithms_server_to_client, |
|
1004 | + $encryption_algorithms_client_to_server, $mac_algorithms_client_to_server, $compression_algorithms_client_to_server; |
|
1005 | 1005 | |
1006 | 1006 | if (empty($str_kex_algorithms)) { |
1007 | 1007 | $str_kex_algorithms = implode(',', $kex_algorithms); |
@@ -1171,20 +1171,20 @@ discard block |
||
1171 | 1171 | // http://tools.ietf.org/html/rfc2412, appendex E |
1172 | 1172 | case 'diffie-hellman-group1-sha1': |
1173 | 1173 | $prime = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' . |
1174 | - '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1175 | - '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1176 | - 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF'; |
|
1174 | + '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1175 | + '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1176 | + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE65381FFFFFFFFFFFFFFFF'; |
|
1177 | 1177 | break; |
1178 | 1178 | // see http://tools.ietf.org/html/rfc3526#section-3 |
1179 | 1179 | case 'diffie-hellman-group14-sha1': |
1180 | 1180 | $prime = 'FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E088A67CC74' . |
1181 | - '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1182 | - '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1183 | - 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05' . |
|
1184 | - '98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB' . |
|
1185 | - '9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' . |
|
1186 | - 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718' . |
|
1187 | - '3995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF'; |
|
1181 | + '020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B302B0A6DF25F1437' . |
|
1182 | + '4FE1356D6D51C245E485B576625E7EC6F44C42E9A637ED6B0BFF5CB6F406B7ED' . |
|
1183 | + 'EE386BFB5A899FA5AE9F24117C4B1FE649286651ECE45B3DC2007CB8A163BF05' . |
|
1184 | + '98DA48361C55D39A69163FA8FD24CF5F83655D23DCA3AD961C62F356208552BB' . |
|
1185 | + '9ED529077096966D670C354E4ABC9804F1746C08CA18217C32905E462E36CE3B' . |
|
1186 | + 'E39E772C180E86039B2783A2EC07A28FB5C55DF06F4C52C9DE2BCBF695581718' . |
|
1187 | + '3995497CEA956AE515D2261898FA051015728E5A8AACAA68FFFFFFFFFFFFFFFF'; |
|
1188 | 1188 | break; |
1189 | 1189 | } |
1190 | 1190 | |
@@ -2413,7 +2413,7 @@ discard block |
||
2413 | 2413 | $current = strtok(microtime(), ' ') + strtok(''); |
2414 | 2414 | $message_number = isset($this->message_numbers[ord($payload[0])]) ? $this->message_numbers[ord($payload[0])] : 'UNKNOWN (' . ord($payload[0]) . ')'; |
2415 | 2415 | $message_number = '<- ' . $message_number . |
2416 | - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2416 | + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2417 | 2417 | $this->_append_log($message_number, $payload); |
2418 | 2418 | $this->last_packet = $current; |
2419 | 2419 | } |
@@ -2782,7 +2782,7 @@ discard block |
||
2782 | 2782 | $current = strtok(microtime(), ' ') + strtok(''); |
2783 | 2783 | $message_number = isset($this->message_numbers[ord($data[0])]) ? $this->message_numbers[ord($data[0])] : 'UNKNOWN (' . ord($data[0]) . ')'; |
2784 | 2784 | $message_number = '-> ' . $message_number . |
2785 | - ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2785 | + ' (since last: ' . round($current - $this->last_packet, 4) . ', network: ' . round($stop - $start, 4) . 's)'; |
|
2786 | 2786 | $this->_append_log($message_number, $data); |
2787 | 2787 | $this->last_packet = $current; |
2788 | 2788 | } |
@@ -3024,12 +3024,12 @@ discard block |
||
3024 | 3024 | } |
3025 | 3025 | $fragment = $this->_string_shift($current_log, $short_width); |
3026 | 3026 | $hex = substr( |
3027 | - preg_replace( |
|
3028 | - '#(.)#es', |
|
3029 | - '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
3030 | - $fragment), |
|
3031 | - strlen($boundary) |
|
3032 | - ); |
|
3027 | + preg_replace( |
|
3028 | + '#(.)#es', |
|
3029 | + '"' . $boundary . '" . str_pad(dechex(ord(substr("\\1", -1))), 2, "0", STR_PAD_LEFT)', |
|
3030 | + $fragment), |
|
3031 | + strlen($boundary) |
|
3032 | + ); |
|
3033 | 3033 | // replace non ASCII printable characters with dots |
3034 | 3034 | // http://en.wikipedia.org/wiki/ASCII#ASCII_printable_characters |
3035 | 3035 | // also replace < with a . since < messes up the output on web browsers |
@@ -413,8 +413,8 @@ discard block |
||
413 | 413 | if ($response === false) { |
414 | 414 | // from PuTTY's psftp.exe |
415 | 415 | $command = "test -x /usr/lib/sftp-server && exec /usr/lib/sftp-server\n" . |
416 | - "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" . |
|
417 | - "exec sftp-server"; |
|
416 | + "test -x /usr/local/lib/sftp-server && exec /usr/local/lib/sftp-server\n" . |
|
417 | + "exec sftp-server"; |
|
418 | 418 | // we don't do $this->exec($command, false) because exec() operates on a different channel and plus the SSH_MSG_CHANNEL_OPEN that exec() does |
419 | 419 | // is redundant |
420 | 420 | $packet = pack('CNNa*CNa*', |
@@ -2055,7 +2055,7 @@ discard block |
||
2055 | 2055 | |
2056 | 2056 | if (defined('NET_SFTP_LOGGING')) { |
2057 | 2057 | $packet_type = '-> ' . $this->packet_types[$type] . |
2058 | - ' (' . round($stop - $start, 4) . 's)'; |
|
2058 | + ' (' . round($stop - $start, 4) . 's)'; |
|
2059 | 2059 | if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) { |
2060 | 2060 | echo "<pre>\r\n" . $this->_format_log(array($data), array($packet_type)) . "\r\n</pre>\r\n"; |
2061 | 2061 | flush(); |
@@ -2131,7 +2131,7 @@ discard block |
||
2131 | 2131 | |
2132 | 2132 | if (defined('NET_SFTP_LOGGING')) { |
2133 | 2133 | $packet_type = '<- ' . $this->packet_types[$this->packet_type] . |
2134 | - ' (' . round($stop - $start, 4) . 's)'; |
|
2134 | + ' (' . round($stop - $start, 4) . 's)'; |
|
2135 | 2135 | if (NET_SFTP_LOGGING == NET_SFTP_LOG_REALTIME) { |
2136 | 2136 | echo "<pre>\r\n" . $this->_format_log(array($packet), array($packet_type)) . "\r\n</pre>\r\n"; |
2137 | 2137 | flush(); |