Fix CN fallback handling in name constraints checking#3107
Merged
samuel40791765 merged 1 commit intoaws:mainfrom Mar 19, 2026
Merged
Fix CN fallback handling in name constraints checking#3107samuel40791765 merged 1 commit intoaws:mainfrom
samuel40791765 merged 1 commit intoaws:mainfrom
Conversation
|
|
||
| // Normalize absolute DNS names by removing the trailing dot, if any. | ||
| if (ends_with_byte(&dns_cbs, '.')) { | ||
| uint8_t unused; |
Contributor
There was a problem hiding this comment.
warning: variable 'unused' is not initialized [cppcoreguidelines-init-variables]
Suggested change
| uint8_t unused; | |
| = 0 |
| CBS_get_last_u8(&dns_cbs, &unused); | ||
| } | ||
| if (ends_with_byte(&base_cbs, '.')) { | ||
| uint8_t unused; |
Contributor
There was a problem hiding this comment.
warning: variable 'unused' is not initialized [cppcoreguidelines-init-variables]
Suggested change
| uint8_t unused; | |
| = 0 |
justsmth
approved these changes
Mar 19, 2026
WillChilds-Klein
approved these changes
Mar 19, 2026
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #3107 +/- ##
==========================================
+ Coverage 78.18% 78.20% +0.02%
==========================================
Files 689 689
Lines 121825 121914 +89
Branches 16994 17009 +15
==========================================
+ Hits 95247 95344 +97
+ Misses 25694 25681 -13
- Partials 884 889 +5 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
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 of changes:
This change fixes two issues in name constraints enforcement:
cn2dnsidnow recognizes wildcard CNs (leading*.) as DNS identifiers by skipping the prefix during DNS syntax validation. The full wildcard string is returned sonc_dnscan perform suffix matching against permitted/excluded subtrees.nc_dnsnow handles wildcard DNS names against excluded subtrees. An exclusion offoo.example.comcorrectly matches*.example.comby comparing parent domains when the DNS name starts with*. This is based on upstream commit: google/boringssl@5774ecaCall-outs:
This change makes name constraints enforcement stricter. Certificates that were previously accepted (due to wildcard CNs being skipped) will now be checked against their CA's name constraints. Only certificates that were already in violation of their CA's constraints will be newly rejected.
Testing:
NameConstraintsinx509_test.ccto test both permitted and excluded subtrees. Also taken from upstream commit referenced above.CommonNameToDNSinx509_compat_test.cc.NameConstraintsWildcardCNinx509_test.ccto test the end-to-end CN fallback path with wildcard CNs against both permitted and excluded subtrees.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license and the ISC license.