Skip to content

Automatic tags not working #40

Description

@Thiesius

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.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions