mirror of
https://github.com/phpseclib/phpseclib.git
synced 2024-11-17 10:45:11 +00:00
Merge branch '2.0'
This commit is contained in:
commit
7eb0712a01
@ -826,10 +826,10 @@ class ASN1
|
|||||||
case self::TYPE_SET: // Children order is not important, thus process in sequence.
|
case self::TYPE_SET: // Children order is not important, thus process in sequence.
|
||||||
case self::TYPE_SEQUENCE:
|
case self::TYPE_SEQUENCE:
|
||||||
$tag|= 0x20; // set the constructed bit
|
$tag|= 0x20; // set the constructed bit
|
||||||
$value = '';
|
|
||||||
|
|
||||||
// ignore the min and max
|
// ignore the min and max
|
||||||
if (isset($mapping['min']) && isset($mapping['max'])) {
|
if (isset($mapping['min']) && isset($mapping['max'])) {
|
||||||
|
$value = array();
|
||||||
$child = $mapping['children'];
|
$child = $mapping['children'];
|
||||||
|
|
||||||
foreach ($source as $content) {
|
foreach ($source as $content) {
|
||||||
@ -837,11 +837,21 @@ class ASN1
|
|||||||
if ($temp === false) {
|
if ($temp === false) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
$value.= $temp;
|
$value[]= $temp;
|
||||||
}
|
}
|
||||||
|
/* "The encodings of the component values of a set-of value shall appear in ascending order, the encodings being compared
|
||||||
|
as octet strings with the shorter components being padded at their trailing end with 0-octets.
|
||||||
|
NOTE - The padding octets are for comparison purposes only and do not appear in the encodings."
|
||||||
|
|
||||||
|
-- sec 11.6 of http://www.itu.int/ITU-T/studygroups/com17/languages/X.690-0207.pdf */
|
||||||
|
if ($mapping['type'] == FILE_ASN1_TYPE_SET) {
|
||||||
|
sort($value);
|
||||||
|
}
|
||||||
|
$value = implode($value, '');
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$value = '';
|
||||||
foreach ($mapping['children'] as $key => $child) {
|
foreach ($mapping['children'] as $key => $child) {
|
||||||
if (!array_key_exists($key, $source)) {
|
if (!array_key_exists($key, $source)) {
|
||||||
if (!isset($child['optional'])) {
|
if (!isset($child['optional'])) {
|
||||||
|
Loading…
Reference in New Issue
Block a user