Implemented decodeString method in BerOctetString#54
Open
elFarto wants to merge 1 commit intobeanit:masterfrom
Open
Implemented decodeString method in BerOctetString#54elFarto wants to merge 1 commit intobeanit:masterfrom
elFarto wants to merge 1 commit intobeanit:masterfrom
Conversation
The decodeString method is introduced to allow the decoding of constructed strings. This method requires that a tag is passed in so that it can be determined at runtime whether this string is constructed or not.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A decodeString method is introduced to allow the decoding of constructed strings. This method requires that a tag is passed in so that it can be determined at runtime whether the string is constructed or not.
Obviously this method needs changes to the compiler to make use of it. I have those changes, but they're intermingled with all the other changes I had to make to get the X.400 ASN1 files I have compiling. This is the only change I needed to make to the parsing library itself.
The changes to the compiler I have produce code like this:
This isn't a particually nice way to solve this issue, but I didn't see any easier solution given how this library is architected (i.e. assuming a single tag for a value). I'm not an expert in ASN.1, but it's possible that the
primitivefield in the BerTag shouldn't be apart of the equals method, but we'd still need to pass the tag into the decode method so it knows what it's decoding.