asn1c icon indicating copy to clipboard operation
asn1c copied to clipboard

Cannot parse PKIX1Explicit-2009.asn: (token "2"): syntax error, unexpected number

Open minfrin opened this issue 5 years ago • 5 comments

When trying to parse PKIX1Explicit-2009.asn from https://github.com/P1sec/pycrate/blob/master/pycrate_asn1dir/IETF_PKI_RFC5911/PKIX1Explicit-2009.asn, the following error is thrown:

[minfrin@bob asn1]$ ~/src/asn1/asn1c-trunk/asn1c/asn1c -E -F ./tmp/pycrate-master/pycrate_asn1dir/IETF_PKI_RFC5911/PKIX1Explicit-2009.asn ASN.1 grammar parse error near ./tmp/pycrate-master/pycrate_asn1dir/IETF_PKI_RFC5911/PKIX1Explicit-2009.asn:263 (token "2"): syntax error, unexpected number Cannot parse "./tmp/pycrate-master/pycrate_asn1dir/IETF_PKI_RFC5911/PKIX1Explicit-2009.asn"

Is this a known issue?

minfrin avatar Mar 02 '20 21:03 minfrin

You can read from asn1p_y.y, it does not support versionNumber: inside [[ ]]

brchiu avatar Mar 04 '20 01:03 brchiu

As a result of this bug, it is not possible for asn1c to parse the schemas from https://tools.ietf.org/html/rfc5912#section-14.

minfrin avatar Mar 05 '20 10:03 minfrin

I'm seeing the same problem here, which makes it difficult to use asn1c to handle anything that depends on RFC 5912 as well.

dkg avatar May 13 '21 19:05 dkg

To be specific, i'm running into this problem while trying to add support for x25519 and Ed25519 (from rfc 8410) to certlint, which depends on asn1c.

dkg avatar May 13 '21 19:05 dkg

@brchiu, do you have any suggestion for how to adapt asn1p_y.y to support versionNumber inside [[ and ]]?

Looks like it has to do with TOK_VBracketLeft and TOK_VBracketRight, those only look usable in conjunction with ComponentTypeLists, and i don't understand yacc/etc well enough to know how to add it.

dkg avatar May 14 '21 20:05 dkg