Skip to content

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

Open
tuxmike wants to merge 1 commit intolapo-luchini:trunkfrom
tuxmike:errorOnMultitagsWithSmallTagNumber
Open

Throw error on parsing multi-octet tag number smaller with tag number 31#60
tuxmike wants to merge 1 commit intolapo-luchini:trunkfrom
tuxmike:errorOnMultitagsWithSmallTagNumber

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.

@lapo-luchini lapo-luchini force-pushed the trunk branch 3 times, most recently from fe54b93 to 8d5f51d Compare October 26, 2025 09:06
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