Skip to content

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

Merged
cpu merged 4 commits into
mainfrom
default-no-ca
Aug 10, 2026
Merged

Omit default cA flag value as required by spec#444
cpu merged 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.

@djc

djc commented Aug 10, 2026

Copy link
Copy Markdown
Member Author

@ctz @cpu hope you don't mind the short ping interval -- would like a re-review after I substantially changed the PR to deduplicate a bunch of code.

@cpu cpu left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for picking this up & doing the extra tidying.

Comment thread rcgen/src/certificate.rs Outdated
Comment thread rcgen/src/certificate.rs Outdated
@cpu
cpu added this pull request to the merge queue Aug 10, 2026
Merged via the queue into main with commit 7ca88d2 Aug 10, 2026
17 checks passed
@cpu
cpu deleted the default-no-ca branch August 10, 2026 18:14
@cpu

cpu commented Aug 10, 2026

Copy link
Copy Markdown
Member

@cpu cpu mentioned this pull request Aug 10, 2026
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