diff --git a/phpseclib/File/ASN1.php b/phpseclib/File/ASN1.php index b225e953..c4b983b5 100644 --- a/phpseclib/File/ASN1.php +++ b/phpseclib/File/ASN1.php @@ -440,6 +440,9 @@ abstract class ASN1 break; case self::TYPE_OBJECT_IDENTIFIER: $current['content'] = self::decodeOID(substr($content, $content_pos)); + if ($current['content'] === false) { + return false; + } break; /* Each character string type shall be encoded as if it had been declared: [UNIVERSAL x] IMPLICIT OCTET STRING @@ -1143,6 +1146,11 @@ abstract class ASN1 $oid = []; $pos = 0; $len = strlen($content); + + if (ord($content[$len - 1]) & 0x80) { + return false; + } + $n = new BigInteger(); while ($pos < $len) { $temp = ord($content[$pos++]);