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

Throw error on parsing multi-octet tag number smaller with tag number 31 #60

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

Conversation

tuxmike
Copy link

@tuxmike tuxmike commented Feb 21, 2023

ITU X.690-0270

8.1.2.2 For tags with a number ranging from zero to 30 (inclusive), the identifier octets shall comprise a single octet
encoded as follows:

8.1.2.4 For tags with a number greater than or equal to 31, the identifier shall comprise a leading octet followed by
one or more subsequent octets.

@lapo-luchini
Copy link
Owner

Mhh, there are a few places where asn1js is taking a "permissive" approach, others where it is not.
This patch takes the "being precise" approach instead of accepting possibly existing but invalid data… I should probably add a boolean "strict vs permissive" in the parser so that the user can choose.
I'll think about 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

Successfully merging this pull request may close these issues.

2 participants