librasn / compiler

An ASN1 compiler producing Rust bindings for the rasn framework
Other
13 stars 7 forks source link

Parse error on sequence constraint #59

Open yodang opened 2 weeks ago

yodang commented 2 weeks ago

Hello !

I have encountered a parsing issue with this ASN.1 module: https://forge.etsi.org/rep/ITS/asn1/sec_ts103097/-/blob/release2/EtsiTs103097Module.asn

I narrowed it down to the following expressions which both try to set a constraint on a list of elements. On line 41: certificate ((WITH COMPONENT (EtsiTs103097Certificate))^(SIZE(1))) On line 45:

recipients  (WITH COMPONENT (
        (WITH COMPONENTS {..., 
          pskRecipInfo ABSENT,
          symmRecipInfo ABSENT,
          rekRecipInfo ABSENT
        })
      ))

As far as I can tell, this occurs before any of the imported modules are needed.

Cheers

kurkpitaine commented 6 days ago

I had those issues on the same standard. These constraints are safe to ignore at compile stage, but you need to implement them yourself. Example of what I have done available here.