8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When a defined class has a component of himself, the decoder do wrong with the tags and looses the track for decoding. How it can be solved? Thanks
The example:
from pyasn1.codec.ber.decoder import decode # der o ber from pyasn1.codec.ber.encoder import encode # der o ber from hexdump import hexdump from pyasn1.type import univ, char, namedtype, namedval, tag, constraint, useful class FloatingPoint(univ.OctetString): pass class Data(univ.Choice): pass Data.componentType = namedtype.NamedTypes( namedtype.NamedType('array', univ.SequenceOf(componentType=Data()).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 1))), namedtype.NamedType('structure', univ.SequenceOf(componentType=Data()).subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 2))), namedtype.NamedType('floating-point', FloatingPoint().subtype(implicitTag=tag.Tag(tag.tagClassContext, tag.tagFormatSimple, 7))), ) dataO=Data() dataO['floating-point']=b"\x08\x40\xFF\xFF\xF5" bin=encode(dataO) hexdump(bin) #produces 87 05 08 40 FF FF F5 dataO2=decode(bin,Data())# OK bin=b"\xa2\x07\x87\x05\x08\x40\xFF\xFF\xF5" dataO2=decode(bin,Data()) # NOT OK. ERROR: #pyasn1.error.PyAsn1Error: <TagSet object, tags 128:0:7> not in asn1Spec: <Data schema object, tagSet=<TagSet object, untagged>, subtypeSpec=<ConstraintsIntersection object, consts <ValueSizeConstraint object, consts 1, 1>>, componentType=<NamedTypes object, types >, sizeSpec=<ConstraintsIntersection object>>
The text was updated successfully, but these errors were encountered:
No branches or pull requests
When a defined class has a component of himself, the decoder do wrong with the tags and looses the track for decoding.
How it can be solved?
Thanks
The example:
The text was updated successfully, but these errors were encountered: