Skip to content

Tag validation#23

Open
masihyeganeh wants to merge 5 commits into
kellerkindt:der-supportfrom
masihyeganeh:der-support
Open

Tag validation#23
masihyeganeh wants to merge 5 commits into
kellerkindt:der-supportfrom
masihyeganeh:der-support

Conversation

@masihyeganeh

@masihyeganeh masihyeganeh commented Oct 15, 2020

Copy link
Copy Markdown

It now validates tags.
It shows that C::TAG is wrong sometimes. we need to work on that.
simple_der now panics with Got unexpected tag Universal(2) instead of ContextSpecific(0) error.
It needs to parse a Number (Universal(2)) but C::TAG says it needs to see ContextSpecific(0) that is wrong.

And by the way, I added more default tags and implemented Display for it if you don't mind.

@masihyeganeh

Copy link
Copy Markdown
Author

Correct me if I'm wrong, but based on this example:

Data-Structures DEFINITIONS ::=
BEGIN
  DataStructures ::= SEQUENCE
  {
     int              INTEGER,
     limitedString    UTF8String (SIZE(1..16)),
     optionalString   UTF8String OPTIONAL,
     enumerated       ENUMERATED {value1, value2, value3},
     optionalChoice   CHOICE
     {
        int1   [0] INTEGER,
        int2   [1] INTEGER
     }  OPTIONAL,
     sequenceOfString SEQUENCE OF UTF8String
  }
END

in places such as choice that there are [0] and [1], the C::TAG should be ContextSpecific(0) and ContextSpecific(1).
Also if there was AUTOMATIC TAGS after DEFINITIONS, then all Tags should be ContextSpecific(index of the element).

Other than that, it should always be Universal.

@masihyeganeh

Copy link
Copy Markdown
Author

OK, I just added ability to parse AUTOMATIC TAGS and saving it as a boolean automatic_tags on model.
I see that you already extracting tag number in next_with_opt_tag.
Please help me with this.
if automatic_tags is true, this function should return increasing number for each tag.

@kellerkindt

kellerkindt commented Feb 15, 2021

Copy link
Copy Markdown
Owner

FYI: as long as (existing) tests do not pass, I do not consider a PR as ready

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

Successfully merging this pull request may close these issues.

2 participants