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

Add 'Wrap Input in SEQUENCE' to Parse ASN.1 hex string #1883

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

learn-more
Copy link

This will parse extra tags concatenated to the first tag.

For example, the following ASN.1 encoded public key consists of multiple top-level tags:

300d06092a864886f70d010101050003818d0030818902818100d88280e8d619027d1f85183925a2652be1bfd405d3bce6363baaf04c6c5bb6e7aa3c734555b2f1bdea9742ed9a340a15d4a95cf54025ddd907c132b2756cc4cabba3fe56277143aa63f5303e9328e5faf1093bf3b74d4e39f75c495ab8c11dd3b28afe70309542cbfe2b518b5a3c3af9224f90b202a7539c4f34e7ab04b27b6f0203010001

Without the option:
image

With the option enabled:
image

This will parse extra tags concatenated to the first tag.
@learn-more
Copy link
Author

Another solution would be to overload the substr function, capturing the last accessed offset by the library, and re-start parsing from that,
or to search if there is a 'length' function inside the library that can be used, and re-start parsing after that.

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.

1 participant