mirror of
https://github.com/danog/phpseclib.git
synced 2025-01-22 04:51:19 +01:00
ASN1: don't allow last octet in OID to have MSB set
This commit is contained in:
parent
2d6705dfbd
commit
b90c33200e
@ -517,6 +517,9 @@ class File_ASN1
|
||||
break;
|
||||
case FILE_ASN1_TYPE_OBJECT_IDENTIFIER:
|
||||
$current['content'] = $this->_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
|
||||
@ -1228,6 +1231,11 @@ class File_ASN1
|
||||
$oid = array();
|
||||
$pos = 0;
|
||||
$len = strlen($content);
|
||||
|
||||
if (ord($content[$len - 1]) & 0x80) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$n = new Math_BigInteger();
|
||||
while ($pos < $len) {
|
||||
$temp = ord($content[$pos++]);
|
||||
|
Loading…
x
Reference in New Issue
Block a user