Implement context-specific tags on #[derive(Sequence)]#349
Implement context-specific tags on #[derive(Sequence)]#349tarcieri merged 1 commit intoRustCrypto:masterfrom
Conversation
|
@bstrie I think you mean context specific, not context sensitive. |
Thanks to the Chomsky Hierarchy I have made this mistake several times myself 😅 |
|
@bstrie I think you need to fix the commit message wording too. |
|
@bstrie Also, one of the tests is failing. |
|
One of the errors is on impl ::der::Sequence<'_> for IssuingDistributionPointExample {
fn fields<F, T>(&self, f: F) -> ::der::Result<T>
where
F: FnOnce(&[&dyn der::Encodable]) -> ::der::Result<T>,
{
()
}
}...not sure what's happening there but the empty tuple is definitely not the right result. Looks like something similar on the other error: impl<'a> ::der::Sequence<'a> for OneAsymmetricKey<'a> {
fn fields<F, T>(&self, f: F) -> ::der::Result<T>
where
F: FnOnce(&[&dyn der::Encodable]) -> ::der::Result<T>,
{
()
}
}Perhaps the unparseable tokens are being lost? |
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
9e1ef3e to
b79f7ac
Compare
|
Code updated to pass all the tests (sorry about not doing so the first time, I forgot to test with |
|
|
||
| #[derive(Sequence)] | ||
| #[asn1(tag_mode = "IMPLICIT")] | ||
| pub struct TypeCheckExpandedSequenceFieldAttributeCombinations<'a> { |
There was a problem hiding this comment.
We call that "self-documenting code". :P
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
This also adds a context-specific tag test to the code for #[derive(Choice)], and cleans up the tests in these files.
If you'd like I would be happy to add more tests to cover the interactions between the various options, but I admit that I'm not an ASN.1 expert so I would need some guidance as to how these options interact so that I could formulate the correct desugaring.
Closes #322.