-
Notifications
You must be signed in to change notification settings - Fork 133
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: Generic custom-class long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION #1545
Open
dishmaker
wants to merge
8
commits into
RustCrypto:master
Choose a base branch
from
dishmaker:custom_class_long_tags
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dishmaker
force-pushed
the
custom_class_long_tags
branch
from
October 9, 2024 13:53
756ef5f
to
41fa980
Compare
dishmaker
changed the title
WIP: Custom long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION
Generic custom-class long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION
Oct 9, 2024
dishmaker
changed the title
Generic custom-class long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION
der: Generic custom-class long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION
Oct 9, 2024
…re stored in long form draft: CustomClass generic type feat: add decode_implicit and decode_explicit back fix: cargo test -p der now pass refactor: raname to Explicit struct refactor: TAG, T order docs: CustomClass feat: add ContextSpecificRef back (ContextSpecificExplicitRef) update der-derive to current der implementation feat: add tests for context-specific fix: dependency crates fixed for x509-cert cargo fmt fix: crates depending on context-specific and long TagNumber fix x509-cert
dishmaker
force-pushed
the
custom_class_long_tags
branch
from
October 10, 2024 06:53
02c666a
to
fd9b041
Compare
Sorry for not providing documentation on |
I've tested this PR with a prototype for parsing the Android key attestation X.509 extension that exclusively has tags >31. No issues discovered. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
PR support private tags and tag numbers >30 that are stored in long form #1416
Issue der: Encoding higher tag number #1381
Issue der: implementing other tag classes than Context-Specific #877
In this PR:
Allow the use of tag numbers >30. In the der representation they are stored in the long form as multiple bytes.
Allow APPLCATION and PRIVATE tags to be annotated like context specific ones in the derive macros
Merge application, private, context-specific tags into one generic codebase
CustomClass
.Split
EXPLICIT
andIMPLICIT
encoding into CustomClassExplicit/ImplicitAdd generic
TAG: u16
to eg.ContextSpecificExplicit
wrapper.Fix the need of implementing both
Decode
andDecodeValue
onCONTEXT-SPECIFIC
tags.EXPLICIT
tags only need to implementDecode<'a>
.IMPLICIT
tags only need to implementDecodeValue<'a>
andTagged
.Tagged
too - it is needed for checking constructed bit.Add
read_nested
forIMPLICIT
decoder (I had to fix x509-cert then tests, negative ones)In implicit
Decode
there was no read_nested before:formats/der/src/asn1/context_specific.rs
Lines 66 to 67 in c501837
Main breaking feature is here:
formats/der/src/asn1/context_specific.rs
Lines 9 to 23 in 756ef5f