Skip to content

F7859: wolfx509: honor BasicConstraintsValid and mark it critical - #57

Merged
mattia-moffa merged 2 commits into
wolfSSL:masterfrom
lealem47:F7859
Aug 25, 2026
Merged

F7859: wolfx509: honor BasicConstraintsValid and mark it critical#57
mattia-moffa merged 2 commits into
wolfSSL:masterfrom
lealem47:F7859

Conversation

@lealem47

Copy link
Copy Markdown
Contributor

Fix for F7859

And adding a testing matrix that validates BasicConstraintsValid and IsCA permutations

@lealem47 lealem47 self-assigned this Aug 22, 2026
Copilot AI lite review requested due to automatic review settings August 22, 2026 02:56

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates wolfx509 certificate generation to align BasicConstraints behavior with crypto/x509: only emit BasicConstraints when BasicConstraintsValid is set, and mark the emitted extension as critical, with tests covering BasicConstraintsValid/IsCA permutations.

Changes:

  • Forward Certificate.BasicConstraintsValid into the internal cert build options.
  • Gate CA/basic constraints encoding on BasicConstraintsValid, and ensure the BasicConstraints extension is marked critical when emitted.
  • Add a BasicConstraints test matrix validating presence, criticality, and encoded value across flag permutations.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
wolfx509/certgen.go Propagates BasicConstraintsValid from the template into cert build options.
wolfx509/certgen_wolfcrypt.go Updates wolfCrypt-backed cert generation to honor BasicConstraintsValid and force critical BasicConstraints when emitted.
wolfx509/certgen_test.go Adds a test matrix pinning BasicConstraints presence/criticality/value for BasicConstraintsValid + IsCA combinations.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread wolfx509/certgen_wolfcrypt.go Outdated
Comment thread wolfx509/certgen_test.go Outdated
@lealem47 lealem47 assigned mattia-moffa and unassigned lealem47 Aug 25, 2026
@mattia-moffa
mattia-moffa merged commit bca16d9 into wolfSSL:master Aug 25, 2026
5 checks passed
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.

3 participants