ASN1: _encode_der(): do not encode optional fields with value set to default.

This commit is contained in:
monnerat 2012-10-12 01:07:01 +01:00
parent a75de60478
commit 2c8ad5ee72

View File

@ -728,6 +728,11 @@ class File_ASN1 {
return $source->element;
}
// do not encode optional fields with value set to default
if (!empty($mapping['optional']) && isset($mapping['default']) && $source === $mapping['default']) {
return '';
}
if (isset($idx)) {
$this->location[] = $idx;
}