Skip to content

der crate fails to emit implicit context-specific tags on SET #322

@npmccallum

Description

@npmccallum

There is a bug with the generated DER somewhere in the der crate. I discovered this while writing a pkcs10 crate. This causes the encoding tests to fail. Specifically, it fails to correctly emit the IMPLICIT tag modification of the SET in CertReqInfo::attributes (see tagged PR). Decoding works correctly.

The fix is probably simple, but I don't know enough about the structure of the der crate to find it easily. And since I'm not sure you actually want this PR, I didn't spend a lot of time on it. I'm willing to produce a patch if you point me in the right direction.

The following code triggers the bug:

#[derive(Clone, Debug, PartialEq, Eq, Sequence)]
pub struct Foo {
    #[asn1(context_specific = "0", tag_mode = "IMPLICIT")]
    pub bar: SetOfVec<Baz>,
}

Decoding of the above code works correctly. But encoding causes SET to be emitted without the context-specific 0 tag.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions