-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
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
Automatic tags not working #40
Comments
Could you post the ASN.1 snippit with the problem? |
ASN.1 descriptions: I used sample from ASN.1 Playground as a baseline:
Message on above rewritten in code I used to test it.
My blanket fix I did yesterday (prepare the bucket :D ): I used https://lapo.it/asn1js/ to compare the results |
Thanks I will take a look |
Using ETSI CAM 1.4.1 the Automatic tags are not respected (context_specific class is not used) and the message fails to validate against
ASN1 Playground
Please note that I have no real understanding of ASN.1 and BER encoding. So my fixes might seem naive. Anyways:
I have managed in somewhat uneducated way fix the encoder with generating context_specific id when the tagging_mode is automatic and the component in collection / choice is a SequenceType or ChoiceType. This "fix" somehow broke encoded_size as the returned value is 204 and real message size is actually 210. This encoding might also work only for my use case as I haven't tested anything else. However the generated bytes are same as the message from ASN1 Playground.
I also fixed the decoder in similar way as the encoder. "create_collection_decode_functions" for optional types is another sort of hack by collecting all ids from all components and generating that huge "if" statement for them. I only tested that on decoding the message I previously encoded.
The text was updated successfully, but these errors were encountered: