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).
CertificateBuilderalways returnsCertificate, regardless of itsP: Profile:formats/x509-cert/src/builder.rs
Lines 339 to 343 in e0c3e08
Certificateis currently by definition always interpreted using the RFC 5280 profile:formats/x509-cert/src/certificate.rs
Line 183 in e0c3e08
This means that anyone building with an alternate
Profilewill be given aCertificatethat claims to have been built using the RFC 5280 profile, which is a very problematic bug.The builder impl should instead be:
I expect this bug went unnoticed because the
ProfileonCertificatecurrently provides zero guarantees (#1486).