def indefLenValueDecoder(self, fullSubstrate, substrate, asn1Spec, tagSet,
length, state, decodeFun, substrateFun):
asn1Object = self._createComponent(asn1Spec, tagSet)
if substrateFun:
return substrateFun(asn1Object, substrate, length)
if asn1Object.tagSet == tagSet: # explicitly tagged Choice
component, substrate = decodeFun(substrate, asn1Object.componentType.tagMapUnique)
# eat up EOO marker
eooMarker, substrate = decodeFun(substrate, allowEoo=True)
if eooMarker is not eoo.endOfOctets:
raise error.PyAsn1Error('No EOO seen before substrate ends')
else:
component, substrate = decodeFun(
substrate, asn1Object.componentType.tagMapUnique, tagSet, length, state
)
effectiveTagSet = component.effectiveTagSet
asn1Object.setComponentByType(
effectiveTagSet, component,
verifyConstraints=False,
matchTags=False, matchConstraints=False,
innerFlag=False
)
return asn1Object, substrate
评论列表
文章目录