Open majorcs opened 4 months ago
In my recollection, these specs rely heavily on WITH COMPONENTS, which is not perfectly supported within pycrate. This will need some more investigation...
When trying to reproduce, I get a different error:
pycrate_asn1c.err.ASN1ProcTextErr: Ieee1609Dot2Data-Unsecured: missing mandatory components in WITH COMPONENTS
That means pycrate is not happy when the WITH COMPONENTS sub-select CHOICE components, which seems legit according to ASN.1. This confirms this overall pattern is not properly implemented in pycrate. The code lies here: https://github.com/pycrate-org/pycrate/blob/4d58c2bb5f7d16bdb9b7c110f829aff856be49c0/pycrate_asn1c/asnobj.py#L4258
This will need a dive into the code for proper support...
I think I made some changes to the ASN1 and didn't revert it fully, so this is why I got a different error message.
I also tried to compile only the 1609.2 part which is the 1609.2.1 built on
$ pycrate_asn1compile.py -i asn1/1609.2.1/Ieee1609Dot2Asn/ -o python/1609_2
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2BaseTypes.asn] module Ieee1609Dot2BaseTypes (oid: [1, 3, 111, 2, 1609, 2, 1, 2, 2, 3]): 74 ASN.1 assignments found
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2Peer2Peer.asn] module Ieee1609Dot2Peer2Peer (oid: [1, 3, 111, 2, 1609, 2, 2, 1, 2, 2]): 3 ASN.1 assignments found
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2CrlSsp.asn] module Ieee1609Dot2CrlSsp (oid: [1, 3, 111, 2, 1609, 2, 3, 3, 2, 1]): 4 ASN.1 assignments found
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2Crl.asn] module Ieee1609Dot2Crl (oid: [1, 3, 111, 2, 1609, 2, 3, 3, 1]): 3 ASN.1 assignments found
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2CrlBaseTypes.asn] module Ieee1609Dot2CrlBaseTypes (oid: [1, 3, 111, 2, 1609, 2, 3, 2, 3, 1]): 17 ASN.1 assignments found
[proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2HeaderInfoExtensionBase.asn] module Ieee1609Dot2HeaderInfoExtensionBase (oid: [1, 3, 111, 2, 1609, 2, 1, 3, 2, 1]): 7 ASN.1 assignments found
Traceback (most recent call last):
File "/usr/bin/pycrate_asn1compile.py", line 264, in <module>
sys.exit(main())
^^^^^^
File "/usr/bin/pycrate_asn1compile.py", line 215, in main
compile_text(txt, **ckw)
File "/home/major/.local/lib/python3.11/site-packages/pycrate_asn1c/asnproc.py", line 234, in compile_text
mod_names.extend( _compile_text_pass(t, with_order, **kwargs) )
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/major/.local/lib/python3.11/site-packages/pycrate_asn1c/asnproc.py", line 389, in _compile_text_pass
raise(ASN1ProcTextErr('[proc]{0} module {1}: duplicate object, {2}'\
pycrate_asn1c.err.ASN1ProcTextErr: [proc] [asn1/1609.2.1/Ieee1609Dot2Asn/Ieee1609Dot2.asn] module Ieee1609Dot2: duplicate object, IEEE1609DOT2-HEADERINFO-CONTRIBUTED-EXTENSION
I don't have time currently to dive in the ASN.1 compiler code, so I'll keep this issue on hold unless someone volunteers to give it a try.
I'm trying to compile the IEEE 1609.2.1 ASN with pycrate. The ASN files could be downloaded from here: IEEE Download
The compilation cycle fails with an assertion. Could it be a bug or it is the limitation of pycrate?