Make AiaCompletionHasLimits handle Windows variance#131242
Open
bartonjs wants to merge 1 commit into
Open
Conversation
|
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 |
Contributor
There was a problem hiding this comment.
Pull request overview
This PR updates the AiaCompletionHasLimits revocation test to tolerate observed Windows differences in how many AIA certificates can be materialized per X509Chain.Build call (2 vs 3), reducing test flakiness across Windows builds.
Changes:
- Increase the generated intermediate CA chain length used by
AiaCompletionHasLimits(from 6 → 8). - Add branching logic to accept either 4 or 5 chain elements after the first build, and adjust subsequent expected counts and extra-store cloning accordingly.
- Update final chain expectations to reflect the longer chain (ending at 10 elements).
Comment on lines
+314
to
317
| // AIA fetches intermediate7 and root, chain finishes. | ||
| AssertExtensions.TrueExpression(chain.Build(endEntity)); | ||
| Assert.Equal(8, chain.ChainElements.Count); | ||
| Assert.Equal(10, chain.ChainElements.Count); | ||
| Assert.Equal(X509ChainStatusFlags.UntrustedRoot, chain.AllStatusFlags()); |
Member
There was a problem hiding this comment.
I do think this is true - I am not sure the retry helper gets us what we want since the chain creation is outside the retry.
Comment on lines
+264
to
+265
| // Current Windows only allows 2, by black box testing, but 3 does seem to happen | ||
| // on some builds. So, variant test for it being over-sized |
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.
Fixes #130947 (theoretically)
I've run this on Windows 11 25H2 26200.8893 both with a registry override to force 3 (by setting the limit to 4) and in the default behavior (which wincrypt.h says is 3, but black box says is 2).
This should definitely eliminate failures from getting 5 on the first answer. But, along the fix development path it appears that Windows is squirrelling away the previous AIA fetches, and so RetryHelper might take a problem and amplify it. (Since I don't see the certs ending up in persisted stores, I'm going to guess they don't count AIA fetches if they're in memory in the Windows version of the AIA fetch cache)