From 1f27240777a15c966a40af83f5bd114170125260 Mon Sep 17 00:00:00 2001 From: mich Date: Fri, 22 Feb 2019 17:20:07 +0100 Subject: [PATCH] asn1rt: fix value filter for extended group in constructed objects --- pycrate_asn1rt/asnobj_construct.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/pycrate_asn1rt/asnobj_construct.py b/pycrate_asn1rt/asnobj_construct.py index f7d9035..2102246 100644 --- a/pycrate_asn1rt/asnobj_construct.py +++ b/pycrate_asn1rt/asnobj_construct.py @@ -618,12 +618,14 @@ class _CONSTRUCT(ASN1Obj): ext = [k for k in val if k in self._ext] for e in ext: if e in self._ext_ident: - for ident in self._ext_group[self._ext_ident[e]]: - if ident not in ext: - raise(ASN1ObjErr('{0}: missing extended value, {1!r}'\ - .format(self.fullname(), val))) - else: - ext.remove(ident) + grp_id = self._ext_ident[e] + for ident, grp_comp in self._ext_group_obj[grp_id]._cont.items(): + if not grp_comp._opt: + if ident not in ext: + raise(ASN1ObjErr('{0}: missing extended value for group {1}, {2!r}'\ + .format(self.fullname(), grp_id, val))) + else: + ext.remove(ident) def _safechk_bnd(self, val): # TODO: