Skip to content

Fix wolfSSL_sk_X509_OBJECT_deep_copy to check CTC_MAX_SKID_SIZE#10178

Open
embhorn wants to merge 4 commits intowolfSSL:masterfrom
embhorn:zd21575
Open

Fix wolfSSL_sk_X509_OBJECT_deep_copy to check CTC_MAX_SKID_SIZE#10178
embhorn wants to merge 4 commits intowolfSSL:masterfrom
embhorn:zd21575

Conversation

@embhorn
Copy link
Copy Markdown
Member

@embhorn embhorn commented Apr 9, 2026

Description

Fixed the CSR SKID issue in ReqCertFromX509()

Fixes zd21575

Testing

Added test_x509_CertFromX509_akid_overflow

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@embhorn embhorn self-assigned this Apr 9, 2026
Copilot AI review requested due to automatic review settings April 9, 2026 15:07
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

Fixes CSR re-encoding behavior in ReqCertFromX509() by rejecting oversized SubjectKeyIdentifier (SKID) values (bounded by CTC_MAX_SKID_SIZE) and adds a regression test to ensure encoding fails when SKID exceeds the max.

Changes:

  • Add bounds checking for SKID copy during X509 object deep copy to prevent overflow and fail cleanly.
  • Add a new regression test that constructs a CSR with SKID size CTC_MAX_SKID_SIZE + 1 and asserts re-encoding fails.
  • Register the new test in the x509 API test suite.

Reviewed changes

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

File Description
tests/api/test_x509.h Declares and registers the new SKID overflow regression test.
tests/api/test_x509.c Adds DER construction + assertions ensuring oversized SKID causes encode failure.
src/x509.c Enforces CTC_MAX_SKID_SIZE when copying SKID from CSR into certificate during deep copy.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copilot AI review requested due to automatic review settings April 9, 2026 19:13
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

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


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@embhorn
Copy link
Copy Markdown
Member Author

embhorn commented Apr 10, 2026

Jenkins retest this please

@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Apr 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.

3 participants