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

IllegalStateException while compiling EXTERNAL type definition #1

Open
rkosegi opened this issue Jul 31, 2017 · 1 comment
Open

IllegalStateException while compiling EXTERNAL type definition #1

rkosegi opened this issue Jul 31, 2017 · 1 comment

Comments

@rkosegi
Copy link

rkosegi commented Jul 31, 2017

I have following type definition:

XYZ02AccessControl ::= --xyzcc isPdu:"TRUE" -- EXTERNAL

which is causing this error:

Generating classes for module "XYZ02-ASN1"
Exception in thread "main" java.lang.IllegalStateException
	at org.openmuc.jasn1.compiler.BerClassWriter.followAndGetNextTaggedOrUniversalType(BerClassWriter.java:2491)
	at org.openmuc.jasn1.compiler.BerClassWriter.followAndGetNextTaggedOrUniversalType(BerClassWriter.java:2444)
	at org.openmuc.jasn1.compiler.BerClassWriter.getUniversalType(BerClassWriter.java:2536)
	at org.openmuc.jasn1.compiler.BerClassWriter.getUniversalType(BerClassWriter.java:2532)
	at org.openmuc.jasn1.compiler.BerClassWriter.writeRetaggingTypeClass(BerClassWriter.java:873)
	at org.openmuc.jasn1.compiler.BerClassWriter.translateModule(BerClassWriter.java:197)
	at org.openmuc.jasn1.compiler.BerClassWriter.translate(BerClassWriter.java:133)
	at org.openmuc.jasn1.compiler.Compiler.main(Compiler.java:89)

AFAIK this ASN1 file used to be compiled with binary notes compiler without any problems.
How can I make it work with JASN1?

JASN1 compiler version : 1.8.1

@sfeuerhahn
Copy link
Contributor

Yes, the EXTERNAL type is currently not correctly handled.

But you can avoid the problem by replacing your ASN.1 statement with this:

XYZ02AccessControl ::= MyExternal

MyExternal  ::=  [UNIVERSAL 8] IMPLICIT SEQUENCE
     {
      direct-reference  OBJECT IDENTIFIER OPTIONAL,
      indirect-reference  INTEGER OPTIONAL,
      data-value-descriptor  ObjectDescriptor  OPTIONAL,
      encoding  CHOICE
                  {single-ASN1-type  [0] ANY,
                   octet-aligned     [1] IMPLICIT OCTET STRING,
                   arbitrary         [2] IMPLICIT BIT STRING}
     }

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

2 participants