I'm using v0.9.24.

I'm trying to build a decoder for the CMS structures specified in RFC 6268 (https://tools.ietf.org/html/rfc6268). So I download the RFC's .txt, I run examples/crfc2asn1.pl rfc6268.txt, then I run asn1c rfc6268-CryptographicMessageSyntax-2010.asn1, but the program chokes on line 6:

ASN.1 grammar parse error near line 6 (token "{"): syntax error, unexpected '{', expecting TOK_typereference or TOK_capitalreference
Cannot parse "rfc6268-CryptographicMessageSyntax-2010.asn1"

The file looks like this:

-- 
-- ASN.1 module found by ../asn1c-0.9.24/examples/crfc2asn1.pl in ./rfc6268.txt at line 1018
--

       { iso(1) member-body(2) us(840) rsadsi(113549)
          pkcs(1) pkcs-9(9) smime(16) modules(0) id-mod-cms-2009(58) }
   DEFINITIONS IMPLICIT TAGS ::=
   BEGIN
   IMPORTS

Based on the examples I figured I'd try to add some name before '{' (like "CMS2010"). This time the program choked on double square brackets:

ASN.1 grammar parse error near line 126 (token "[["): syntax error, unexpected TOK_VBracketLeft
Cannot parse "rfc6268-CryptographicMessageSyntax-2010.asn1"

The file around line 126 looks like this:

123:   SignerIdentifier ::= CHOICE {
124:     issuerAndSerialNumber IssuerAndSerialNumber,
125:     ...,
126:     [[3: subjectKeyIdentifier [0] SubjectKeyIdentifier ]] }

What exactly am I supposed to do from here?

Thanks in advance.

 

Last edit: Kévin Le Gouguec 2014-05-02