mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-29 18:18:39 +00:00
Make all sources 7-bit ASCII.
This commit is contained in:
parent
1daf5b57d6
commit
90ff746ad1
@ -1582,7 +1582,7 @@ class Crypt_RSA {
|
||||
* DER-decode the length
|
||||
*
|
||||
* DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 § 8.1.3} for more information.
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
|
||||
*
|
||||
* @access private
|
||||
* @param String $string
|
||||
@ -1603,7 +1603,7 @@ class Crypt_RSA {
|
||||
* DER-encode the length
|
||||
*
|
||||
* DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 § 8.1.3} for more information.
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
|
||||
*
|
||||
* @access private
|
||||
* @param Integer $length
|
||||
@ -1872,7 +1872,7 @@ class Crypt_RSA {
|
||||
*
|
||||
* Protects against a particular type of timing attack described.
|
||||
*
|
||||
* See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don’t use MessageDigest.isEquals)}
|
||||
* See {@link http://codahale.com/a-lesson-in-timing-attacks/ A Lesson In Timing Attacks (or, Don't use MessageDigest.isEquals)}
|
||||
*
|
||||
* Thanks for the heads up singpolyma!
|
||||
*
|
||||
|
@ -304,12 +304,12 @@ class File_ASN1 {
|
||||
} while ( $loop );
|
||||
}
|
||||
|
||||
// Length, as discussed in § 8.1.3 of X.690-0207.pdf#page=13
|
||||
// Length, as discussed in paragraph 8.1.3 of X.690-0207.pdf#page=13
|
||||
$length = ord($this->_string_shift($encoded));
|
||||
$start++;
|
||||
if ( $length == 0x80 ) { // indefinite length
|
||||
// "[A sender shall] use the indefinite form (see 8.1.3.6) if the encoding is constructed and is not all
|
||||
// immediately available." -- § 8.1.3.2.c
|
||||
// immediately available." -- paragraph 8.1.3.2.c
|
||||
//if ( !$constructed ) {
|
||||
// return false;
|
||||
//}
|
||||
@ -323,7 +323,7 @@ class File_ASN1 {
|
||||
extract(unpack('Nlength', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4)));
|
||||
}
|
||||
|
||||
// End-of-content, see §§ 8.1.1.3, 8.1.3.2, 8.1.3.6, 8.1.5, and (for an example) 8.6.4.2
|
||||
// End-of-content, see paragraphs 8.1.1.3, 8.1.3.2, 8.1.3.6, 8.1.5, and (for an example) 8.6.4.2
|
||||
if (!$type && !$length) {
|
||||
return $decoded;
|
||||
}
|
||||
@ -357,7 +357,7 @@ class File_ASN1 {
|
||||
// decode UNIVERSAL tags
|
||||
switch ($tag) {
|
||||
case FILE_ASN1_TYPE_BOOLEAN:
|
||||
// "The contents octets shall consist of a single octet." -- § 8.2.1
|
||||
// "The contents octets shall consist of a single octet." -- paragraph 8.2.1
|
||||
//if (strlen($content) != 1) {
|
||||
// return false;
|
||||
//}
|
||||
@ -410,7 +410,7 @@ class File_ASN1 {
|
||||
}
|
||||
break;
|
||||
case FILE_ASN1_TYPE_NULL:
|
||||
// "The contents octets shall not contain any octets." -- § 8.8.2
|
||||
// "The contents octets shall not contain any octets." -- paragraph 8.8.2
|
||||
//if (strlen($content)) {
|
||||
// return false;
|
||||
//}
|
||||
@ -441,7 +441,7 @@ class File_ASN1 {
|
||||
/* Each character string type shall be encoded as if it had been declared:
|
||||
[UNIVERSAL x] IMPLICIT OCTET STRING
|
||||
|
||||
-- X.690-0207.pdf#page=23 (§ 8.21.3)
|
||||
-- X.690-0207.pdf#page=23 (paragraph 8.21.3)
|
||||
|
||||
Per that, we're not going to do any validation. If there are any illegal characters in the string,
|
||||
we don't really care */
|
||||
@ -1055,7 +1055,7 @@ class File_ASN1 {
|
||||
* DER-encode the length
|
||||
*
|
||||
* DER supports lengths up to (2**8)**127, however, we'll only support lengths up to (2**8)**4. See
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 § 8.1.3} for more information.
|
||||
* {@link http://itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf#p=13 X.690 paragraph 8.1.3} for more information.
|
||||
*
|
||||
* @access private
|
||||
* @param Integer $length
|
||||
|
@ -2425,12 +2425,12 @@ class Math_BigInteger {
|
||||
}
|
||||
|
||||
/**
|
||||
* Calculates the greatest common divisor and Bézout's identity.
|
||||
* Calculates the greatest common divisor and Bezout's identity.
|
||||
*
|
||||
* Say you have 693 and 609. The GCD is 21. Bézout's identity states that there exist integers x and y such that
|
||||
* Say you have 693 and 609. The GCD is 21. Bezout's identity states that there exist integers x and y such that
|
||||
* 693*x + 609*y == 21. In point of fact, there are actually an infinite number of x and y combinations and which
|
||||
* combination is returned is dependant upon which mode is in use. See
|
||||
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bézout's identity - Wikipedia} for more information.
|
||||
* {@link http://en.wikipedia.org/wiki/B%C3%A9zout%27s_identity Bezout's identity - Wikipedia} for more information.
|
||||
*
|
||||
* Here's an example:
|
||||
* <code>
|
||||
@ -3653,4 +3653,4 @@ class Math_BigInteger {
|
||||
$temp = ltrim(pack('N', $length), chr(0));
|
||||
return pack('Ca*', 0x80 | strlen($temp), $temp);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -935,7 +935,7 @@ class Net_SSH1 {
|
||||
* Returns the output of an interactive shell when no more output is available.
|
||||
*
|
||||
* Requires PHP 4.3.0 or later due to the use of the stream_select() function. If you see stuff like
|
||||
* "[00m", you're seeing ANSI escape codes. According to
|
||||
* "^[[00m", you're seeing ANSI escape codes. According to
|
||||
* {@link http://support.microsoft.com/kb/101875 How to Enable ANSI.SYS in a Command Window}, "Windows NT
|
||||
* does not support ANSI escape sequences in Win32 Console applications", so if you're a Windows user,
|
||||
* there's not going to be much recourse.
|
||||
@ -1574,4 +1574,4 @@ class Net_SSH1 {
|
||||
fputs($this->realtime_log_file, $entry);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user