vlm / asn1c

The ASN.1 Compiler
http://lionet.info/asn1c/
BSD 2-Clause "Simplified" License
1.03k stars 551 forks source link

parse parameterized Type failed #400

Open BalrogMithrandir opened 3 years ago

BalrogMithrandir commented 3 years ago

I use asn1c to generate C code from an asn file, but I got such warning and errors:

FATAL: Type ScmsPdu-Scoped expects specialization from ScmsPdu-Scoped at line 33 in ./test3.asn
FATAL: Cannot find type "<Type>" in constraints at line 38 in ./test3.asn
FATAL: Type ScmsPdu-Scoped expects specialization from ScmsPdu-Scoped at line 33 in ./test3.asn
FATAL: Cannot find type "<Type>" in constraints at line 38 in ./test3.asn
FATAL: Type ScmsPdu-Scoped expects specialization from ScmsPdu-Scoped at line 33 in ./test3.asn
FATAL: Cannot find type "<Type>" in constraints at line 38 in ./test3.asn

And these is my asn content:

TEST3
DEFINITIONS AUTOMATIC TAGS ::= BEGIN

  Uint8  ::= INTEGER (0..255)                  -- (hex)

  RaAcaCertRequest ::= OCTET STRING(SIZE(32))
  AcaRaCertResponse ::= OCTET STRING(SIZE(48))

  AcaRaInterfacePdu ::= CHOICE {
    raAcaCertRequest   RaAcaCertRequest,
    acaRaCertResponse  AcaRaCertResponse,
    ...
  }

  ScmsPdu ::= SEQUENCE {
    version  Uint8 (1),
    content  CHOICE {
      aca-ra  AcaRaInterfacePdu,
      ...
    }
  }

  ScmsPdu-Scoped {Pdu} ::= ScmsPdu (WITH COMPONENTS {
    ...,
    content (CONSTRAINED BY {
      Pdu
    })
  })

  ScopedCertificateRequest ::= ScmsPdu (
    ScmsPdu-Scoped {
      AcaRaInterfacePdu (WITH COMPONENTS {
        raAcaCertRequest
      })
    }
  )

END

These asn can be parse well by other asn to c compiler, such as ossasn1c and eclipse asn compiler.

Thank you very much and look forward to your reply!

EliotCao commented 2 years ago

hey, bro. have you solved it? I'm having the same trouble, any advice would be greatly appreciated.

subhashishanand commented 1 year ago

Hello, did you able to resolve this issue? Even I have same problem.

zambe-ste commented 2 months ago

Hello, i have the same trouble. Some solution?