pycrate_asn1rt: enable empty list for SEQ OF / SET OF value to be PER-encoded

This commit is contained in:
mitshell 2017-07-12 22:42:27 +02:00
parent b97609e996
commit bbdbcc31e6
1 changed files with 4 additions and 0 deletions

View File

@ -2214,6 +2214,8 @@ class _CONSTRUCT_OF(ASN1Obj):
#self._cont._val = None
def _to_per_ws(self):
if not self._val:
return []
GEN, ldet = [], len(self._val)
if self._const_sz:
if self._const_sz.ext is not None:
@ -2302,6 +2304,8 @@ class _CONSTRUCT_OF(ASN1Obj):
self._struct = Envelope(self._name, GEN=tuple(GEN))
def _to_per(self):
if not self._val:
return []
GEN, ldet = [], len(self._val)
if self._const_sz:
if self._const_sz.ext is not None: