mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-30 20:59:14 +00:00
ASN1: rm unused method (decodeLength)
This commit is contained in:
parent
bf537059b1
commit
0ac8b5d5ed
@ -1348,27 +1348,6 @@ abstract class ASN1
|
|||||||
return $temp != false ? $temp : $str;
|
return $temp != false ? $temp : $str;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* 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 paragraph 8.1.3} for more information.
|
|
||||||
*
|
|
||||||
* @access public
|
|
||||||
* @param string $string
|
|
||||||
* @return int
|
|
||||||
*/
|
|
||||||
public static function decodeLength(&$string)
|
|
||||||
{
|
|
||||||
$length = ord(Strings::shift($string));
|
|
||||||
if ($length & 0x80) { // definite length, long form
|
|
||||||
$length&= 0x7F;
|
|
||||||
$temp = Strings::shift($string, $length);
|
|
||||||
list(, $length) = unpack('N', substr(str_pad($temp, 4, chr(0), STR_PAD_LEFT), -4));
|
|
||||||
}
|
|
||||||
return $length;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* DER-encode the length
|
* DER-encode the length
|
||||||
*
|
*
|
||||||
|
Loading…
Reference in New Issue
Block a user