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

Objects set members are not parsed at all #154

Open
hodossy opened this issue Jul 4, 2022 · 2 comments
Open

Objects set members are not parsed at all #154

hodossy opened this issue Jul 4, 2022 · 2 comments

Comments

@hodossy
Copy link

hodossy commented Jul 4, 2022

I have a structure similar to the following in a file test.asn, whihc I parse with parse_files('test.asn'):

DATA-Descriptions DEFINITIONS AUTOMATIC TAGS ::=
BEGIN

DATA-ID-AND-TYPE ::= CLASS {
  &id DataId UNIQUE,
  &Type
} WITH SYNTAX {&Type IDENTIFIED BY &id}

DataId ::= INTEGER (0..255)

Data DATA-ID-AND-TYPE ::= {
    {ADataType IDENTIFIED BY aDataId} |
    {BDataType IDENTIFIED BY bDataId},
    ...
}

aDataId DataId ::= 1
bDataId DataId ::= 2

END

The outcome of the parsing is the following:

{
  "DATA-Descriptions": {
    "imports": {},
    "types": {
      "DataId": {
        "type": "INTEGER",
        "restricted-to": [(0, 255)]
      }
    },
    "values": {
      "aDataId": {
        "type": "DataId",
        "value": 1
      },
      "bDataId": {
        "type": "DataId",
        "value": 2
      }
    },
    "object-classes": {
      "DATA-ID-AND-TYPE": {
        "members": [{
          "type": "DataId",
          "name": "&id"
        }, {
          "type": "OpenType",
          "name": "&Type"
        }]
      }
    },
    "object-sets": {
      "Data": {
        "class": "DATA-ID-AND-TYPE",
        "members": []
      }
    },
    "extensibility-implied": False,
    "tags": "AUTOMATIC"
  }
}

The members of the Data object set is an empty array, but there should be two members. I think this is partially related to the CLASS keyword, and its support is in the known limitations list, but that is parsed correctly. Are object sets supported? Is this due to the fact, that the objects are a CLASS?

@eerimoq
Copy link
Owner

eerimoq commented Jul 4, 2022

This part of the ASN.1 spec is not implemented and likely will never be, unless someone helps me implementing it.

@hodossy
Copy link
Author

hodossy commented Jul 5, 2022

I have suspected, that is the case. I do not have enough time to implement full support, but if you could describe what structure the above should be parsed into, I may come up with a partial solution for the grammar. It is a small step, and I understand if you are not interested in it.

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