mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-12-27 03:42:40 +00:00
ASN1: explicit application tags didn't work (although implicit ones did)
This commit is contained in:
parent
dfa583b9ea
commit
a478b74860
@ -1085,7 +1085,12 @@ class File_ASN1
|
||||
}
|
||||
|
||||
if (isset($mapping['cast'])) {
|
||||
$tag = ($mapping['class'] << 6) | ($tag & 0x20) | $mapping['cast'];
|
||||
if (isset($mapping['explicit']) || $mapping['type'] == FILE_ASN1_TYPE_CHOICE) {
|
||||
$value = chr($tag) . $this->_encodeLength(strlen($value)) . $value;
|
||||
$tag = ($mapping['class'] << 6) | 0x20 | $mapping['cast'];
|
||||
} else {
|
||||
$tag = ($mapping['class'] << 6) | (ord($temp[0]) & 0x20) | $mapping['cast'];
|
||||
}
|
||||
}
|
||||
|
||||
return chr($tag) . $this->_encodeLength(strlen($value)) . $value;
|
||||
|
Loading…
Reference in New Issue
Block a user