Repository navigation
Conversation
Contributor
There was a problem hiding this comment.
🟢 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
|
Member
Author
|
Fix confirmed by customer |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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