mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-04 20:47:54 +00:00
ASN1: constructed context-specific tags can have x sub elements
previously it only worked for when there was one sub element.
This commit is contained in:
parent
e3d251ac57
commit
d3a5398fe4
@ -357,14 +357,21 @@ class File_ASN1
|
||||
}
|
||||
|
||||
$newcontent = array();
|
||||
if (strlen($content)) {
|
||||
$newcontent = $this->_decode_ber($content, $start);
|
||||
$length = $newcontent['length'];
|
||||
$remainingLength = $length;
|
||||
while ($remainingLength) {
|
||||
$temp = $this->_decode_ber($content, $start);
|
||||
$length = $temp['length'];
|
||||
// end-of-content octets - see paragraph 8.1.5
|
||||
if (substr($content, $length, 2) == "\0\0") {
|
||||
$length+= 2;
|
||||
$start+= $length;
|
||||
$newcontent[] = $temp;
|
||||
break;
|
||||
}
|
||||
$start+= $length;
|
||||
$newcontent = array($newcontent);
|
||||
$remainingLength-= $length;
|
||||
$newcontent[] = $temp;
|
||||
$this->_string_shift($content, $length);
|
||||
}
|
||||
|
||||
return array(
|
||||
|
Loading…
Reference in New Issue
Block a user