Closed KenWhitesell closed 4 years ago
Could you please provide the complete textual definition you try to compile ? So that I can reproduce exactly your issue.
I've attached a file which is a terminal session walking through the complete set of steps to recreate the problem identified here. Please let me know if you have any questions or need any further information.
OK, thanks. This is related to passing ASN.1 BIT STRING values as named offsets. Here, the bug is that an empty set of offsets is not accepted by the runtime. A patch should be done somewhere here: https://github.com/P1sec/pycrate/blob/5e7406d99346c2130b0e01f23c7c39a4756e857b/pycrate_asn1rt/asnobj_str.py#L223 When setting the BIT STRING value from the named offsets, we should also take care to set a correct bit length according to any potential SIZE constraint.
I will work on it when I have some time, maybe next week or so.
This commit should solve the issue: https://github.com/P1sec/pycrate/commit/afc9849c4c895ef8924c7c9dc77d0274bc6e735b
Fantastic This commit addresses both issues I reported, and now allows me to encode/decode UPER-encoded J2735 TIM MessageFrames. (At least my three test cases.) Thank you!
Sample asn.1 file (greatly reduced from J2735):
This asn text compiles and works fine:
{ directionalUse {ingressPath} }
This text
{ directionalUse {} }
generates this error: