-
Notifications
You must be signed in to change notification settings - Fork 171
der: Generic custom-class long > 30 tags PRIVATE, CONTEXT-SPECIFIC, APPLICATION #1545
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
Conversation
756ef5f to
41fa980
Compare
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. |
[Spoiler] Wondering about constructed bit...Currently, formats/der/src/asn1/custom_class.rs Line 184 in 116ce15
I think it might be useful for some types to implement But if impl<T: FixedTag> IsConstructed for T {
/// ASN.1 constructed bit, used for CONTEXT-SPECIFIC IMPLICIT encoding
const CONSTRUCTED: bool = T::TAG.is_constructed();
} |
…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
21e723f to
6d607c0
Compare
|
PR is ready for review 😃 |
|
@dishmaker as I noted in #1416, I would prefer a much more minimal PR which only changes the handling of the We can circle back on those types once the support is added in |
|
Well, I agree the PR is huge. But these features are needed anyway - here's an independent impl of generic |
|
@dishmaker I agree the higher-level functionality is eventually needed to make the changes useful, but because this PR is so large, I think it would be helpful for me as a reviewer to split it up into a set of breaking changes to the That would allow more focus on both PRs, to ensure the breaking changes are being done correctly, and separately allowing more debate around the higher level API without blocking another release of the |
|
Maybe there is a chance tag numbers can be made |
|
@turbocool3r what are the specific requirements there? |
|
Okay, so it needs |
|
yep |
|
@dishmaker can re-evaluate something like this after #1651 is merged |
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
EXPLICITandIMPLICITencoding into CustomClassExplicit/ImplicitAdd generic
TAG: u16to eg.ContextSpecificExplicitwrapper.Fix the need of implementing both
DecodeandDecodeValueonCONTEXT-SPECIFICtags.EXPLICITtags only need to implementDecode<'a>.IMPLICITtags only need to implementDecodeValue<'a>andTagged.Taggedtoo - it is needed for checking constructed bitAdd
read_nestedforIMPLICITdecoder (I had to fix x509-cert tests, negative ones)In implicit
Decodethere 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