mirror of
https://github.com/phpseclib/phpseclib.git
synced 2025-01-13 18:02:58 +00:00
ASN1: _encode_der(): do not encode optional fields with value set to default.
This commit is contained in:
parent
a75de60478
commit
2c8ad5ee72
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user