Uh oh!
There was an error while loading. Please reload this page.
[release/11.0] Normalize X509Chain App/Cert policies across OSes - #132904
Merged
Conversation
The original policy handling code was written before contextual trust, which made it hard to write good tests. Now that we have more tests, unify the behaviors as best we can, even across invalidly encoded extensions.
|
Azure Pipelines: Successfully started running 3 pipeline(s). 13 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
artl93
reviewed
Aug 28, 2026
Uh oh!
There was an error while loading. Please reload this page.
bartonjs
commented
Aug 28, 2026
Member
Not from an API impact sense. There are definitely some observable runtime differences, which is the point, so I'd be fine with writing a runtime/behavior breaking change for it... but the impact is largely around esoteric corner cases that don't appear in public certificate hierarchies (but could in private/enterprise). |
bartonjs
commented
Aug 28, 2026
Member
/ba-g #132831 |
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 freeto 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.
Backport of #132348 to release/11.0
/cc @bartonjs
Customer Impact
Users of the X509Chain API could encounter platform-specific differences regarding handling of the ChainPolicy.ApplicationPolicies and ChainPolicy.CertificatePolicies validators and their interaction with the ms-appPolicy, EKU, CertPolicy, and CertPolicyMapping extensions, leading to the chain to report a certificate suitable for usage on some systems while unsuitable for usage on others (both false-positives and false-negatives).
Some certificates gave a solid true/false on Windows, but caused exceptions on other platforms.
Regression
The managed certificate policy validator (which is trying to emulate Windows for .NET Framework compatibility) hasn't substantially changed since 2015.
Testing
A whole lot of new tests are added in this change.
The component was written before the CertificateRequest API was created, and at the time creating test certificates was a laborious process and involved checking in test cases.
Many tests were added involving corrupt extensions, certificate policy mappings, any-policy and inhibit-any-policy, et cetera. These new tests are believed to be comprehensive for the area.
Risk
Low, due to the added test coverage.