Skip to content

Fix IPv6 text rendering in X509_VERIFY_PARAM_set1_ip - #11946

Open
embhorn wants to merge 1 commit into
wolfSSL:masterfrom
embhorn:zd22726
Open

embhorn wants to merge 1 commit into
wolfSSL:masterfrom
embhorn:zd22726

Conversation

@embhorn

@embhorn embhorn commented Oct 30, 2026

Copy link
Copy Markdown
Member

Description

The binary to text conversion latched after the first zero group and dropped every later zero group, so an address with two zero runs such as 2001:db8:0:1::5 was stored as 2001:db8::1:5. Identity checks then matched the wrong address and rejected the correct one.

Render the address per RFC 5952: compress only the first longest run of two or more zero groups, write other zero groups as 0, and bound every write against the remaining buffer.

Fixes zd22726

Testing

Add regression cases with multiple zero runs.

Checklist

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

@embhorn embhorn self-assigned this Oct 30, 2026
Copilot AI balanced review requested due to automatic review settings October 30, 2026 19:43

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟢 Approval recommended

No active review issues remain for the change correcting IPv6 address rendering in certificate identity checks.

No open issues 🎉

What changed in this PR

Fixes IPv6 text rendering in X509_VERIFY_PARAM_set1_ip so certificate identity checks use the intended address when it contains multiple zero runs.

Changes:

  • Compresses only the first longest run of two or more zero groups, preserving all other groups.
  • Bounds formatted writes by the remaining buffer capacity and checks for truncation.
  • Adds regression cases for multiple zero runs, tied runs, isolated zeros, and all-zero addresses.
File Description
tests/​api/​test_ossl_x509_vp.c Adds IPv6 rendering regression cases with expected text output.
src/​x509.c Corrects zero-run compression and validates bounded buffer writes.

Review effort: Balanced

@github-actions

github-actions Bot commented Oct 30, 2026 •

Copy link
Copy Markdown

@embhorn

embhorn commented Oct 30, 2026

Copy link
Copy Markdown
Member Author

Fix confirmed by customer

@embhorn embhorn assigned wolfSSL-Bot and unassigned embhorn Oct 30, 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