Skip to content

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

Open
learn-more wants to merge 1 commit intogchq:masterfrom
learn-more:asn1_wrap
Open

Add 'Wrap Input in SEQUENCE' to Parse ASN.1 hex string#1883
learn-more wants to merge 1 commit intogchq:masterfrom
learn-more:asn1_wrap

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

@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.

This will parse extra tags concatenated to the first tag.
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

Comments