Skip to content

x509-cert: Constructed Certificate profile is always RFC 5280, ignoring the CertificateBuilder profile #1487

Description

@str4d

CertificateBuilder always returns Certificate, regardless of its P: Profile:

impl<P> Builder for CertificateBuilder<P>
where
P: Profile,
{
type Output = Certificate;

Certificate is currently by definition always interpreted using the RFC 5280 profile:

pub type Certificate = CertificateInner<Rfc5280>;

This means that anyone building with an alternate Profile will be given a Certificate that claims to have been built using the RFC 5280 profile, which is a very problematic bug.

The builder impl should instead be:

impl<P> Builder for CertificateBuilder<P>
where
    P: Profile,
{
    type Output = CertificateInner<P>;

I expect this bug went unnoticed because the Profile on Certificate currently provides zero guarantees (#1486).

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Fields

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