ASN1: correctly handle long tags

This commit is contained in:
terrafrost 2019-05-26 03:18:06 -05:00
parent 3d7acde183
commit 70c0a0ddf4

View File

@ -326,9 +326,10 @@ class File_ASN1
$tag = 0;
// process septets (since the eighth bit is ignored, it's not an octet)
do {
$loop = ord($encoded[0]) >> 7;
$temp = ord($encoded[$encoded_pos++]);
$loop = $temp >> 7;
$tag <<= 7;
$tag |= ord($encoded[$encoded_pos++]) & 0x7F;
$tag |= $temp & 0x7F;
$start++;
} while ($loop);
}