Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

parse parameterized Type failed #106

Open
EliotCao opened this issue Aug 1, 2022 · 2 comments
Open

parse parameterized Type failed #106

EliotCao opened this issue Aug 1, 2022 · 2 comments

Comments

@EliotCao
Copy link

EliotCao commented Aug 1, 2022

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

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

Thank you very much and look forward to your reply!

@mouse07410
Copy link
Owner

In general, this free ASN.1 compiler doesn't do too well with complicated kludgy twisted modern perversions of ASN.1 language.

I'll try to take a look at your example, but can tell you immediately that it's probably beyond my level of competence.

@DanyaFilatov
Copy link

Perhaps too late, but anyway. Just modify the Ieee1609Dot2Dot1Protocol.asn as

--***************************************************************************--
--                            Certificate Requests                           --
--***************************************************************************--

  ScmsPdu-RaAcaCertRequest ::= ScmsPdu-Scoped {
    AcaRaInterfacePdu (WITH COMPONENTS {
      raAcaCertRequest
    })
  }
  ScmsPdu-EeEcaCertRequest ::= ScmsPdu-Scoped {
    EcaEeInterfacePdu (WITH COMPONENTS {
      eeEcaCertRequest
    })
  } 
  ScmsPdu-EeRaCertRequest ::= ScmsPdu-Scoped {
    EeRaInterfacePdu (WITH COMPONENTS {
      eeRaCertRequest
    })
  }
  ScmsPdu-EeRaSuccessorEnrollmentCertRequest ::= ScmsPdu-Scoped {
    EeRaInterfacePdu (WITH COMPONENTS {
      eeRaSuccessorEnrollmentCertRequest
    })
  }


/**
 * @brief This structure defines the all certificate request structures as a
 * scoped version of the ScmsPdu.
 */
ScopedCertificateRequest ::= ScmsPdu (
  ScmsPdu-RaAcaCertRequest | ScmsPdu-EeEcaCertRequest | 
  ScmsPdu-EeRaCertRequest  | ScmsPdu-EeRaSuccessorEnrollmentCertRequest
)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants