-
Notifications
You must be signed in to change notification settings - Fork 141
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
der: Correct context-specific skipping algorithm #1723
Comments
I can't find a citation in ITU X.690, which includes surprisingly little information on context-specific fields in general. Perhaps there's a different document I should be consulting. This situation arises when there are lower-numbered unknown context-specific tags, which seems like a somewhat odd situation to be in to begin with. |
I would send to the lamps@ietf.org mailing list, that's where the ASN1 folks mostly hang out. x.690 would have been my guess too. |
Sorry, it’s ***@***.******@***.***> name-change isues.
|
X.680 is likely what you want. |
Tony looked at couldn’t find it. If anyone wants to play along, here’s the spec: https://www.itu.int/rec/dologin_pub.asp?lang=e&id=T-REC-X.680-202102-I!!PDF-E&type=items
|
Perhaps we're not finding anything because there is no special algorithm, and they should be handled like any other tag, in which case the special logic around them should just be removed |
What was the rationale for skipping them in the first place? |
Looks like entire philisophy of So it ignores the |
Looks like currently tag numbers lower than requested are skipped.
Decoder breaks only on higher than expected tag numbers:
if !tag.is_context_specific() || tag.number() > tag_number { break }
Commit history:
448d5fb?diff=unified#diff-7bb94c63666ed02733ba218c24281358f540200bd845b247f1a84a0f95021234R90
https://github.com/RustCrypto/formats/blame/d87ed96b253e1af95533234804a224cbb408099d/der/src/decoder.rs#L195
However, python
asn1tools
would not skip lower tags when decoding.In my example the decoder just stops on tag
[1]
and does not decode[4]
.foo.asn
And btw it works when
SequenceA
is decoded asSequenceA
:So there are 2 possible algorithms:
tag.number() > tag_number
tag.number() != tag_number
Which one is correct?
The text was updated successfully, but these errors were encountered: