Skip to content

Omit default cA flag value as required by spec - #444

Open
djc wants to merge 4 commits into
mainfrom
default-no-ca
Open

Omit default cA flag value as required by spec#444
djc wants to merge 4 commits into
mainfrom
default-no-ca

Conversation

@djc

@djc djc commented Aug 9, 2026

Copy link
Copy Markdown
Member

Proposed release notes

Previous versions generated DER that is strictly incompatible with the spec, writing an explicit false value for IsCa::ExplicitNoCa where this should be omitted (as it's the default).

Fixes #443.

@djc
djc requested review from cpu and est31 August 9, 2026 12:12
Comment thread rcgen/src/certificate.rs Outdated
@djc djc changed the title Default no ca Omit default cA flag value as required by spec Aug 9, 2026
@GermanCoding

GermanCoding commented Aug 9, 2026

Copy link
Copy Markdown

I'm not familar with the codebase, but doesn't this line have the same problem?

writer.next().write_bool(is_ca.is_some()); // cA flag

(Looks like this is the CSR path - I didn't do any verification for CSRs, but I assume it's a similar story there?)

@djc
djc requested review from cpu and ctz August 9, 2026 13:18
@djc

djc commented Aug 9, 2026

Copy link
Copy Markdown
Member Author

I'm not familar with the codebase, but doesn't this line have the same problem?

writer.next().write_bool(is_ca.is_some()); // cA flag

(Looks like this is the CSR path - I didn't do any verification for CSRs, but I assume it's a similar story there?)

Thanks for flagging that! Reworked this to avoid duplicating logic between CSR and certificate encoding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

IsCa::ExplicitNoCA flag produces invalid DER

4 participants