Remove dead Windows 7 conditions and inline CheckKeyConsistency in PfxFormatTests#125142
Remove dead Windows 7 conditions and inline CheckKeyConsistency in PfxFormatTests#125142stephentoub merged 2 commits intomainfrom
Conversation
…tTests Co-authored-by: vcsjones <361677+vcsjones@users.noreply.github.com>
|
Tagging subscribers to this area: @bartonjs, @vcsjones, @dotnet/area-system-security |
|
This was just incomplete cleanup done in #122907. |
There was a problem hiding this comment.
Pull request overview
Cleans up dead/unreachable Windows 7-specific code paths in PfxFormatTests by removing an always-false condition and simplifying the callback wiring used by ReadMultiPfx.
Changes:
- Removed the dead
OperatingSystem.IsWindows() && !PlatformDetection.IsWindowsbranches (and associated Windows 7 comments). - Eliminated the intermediate
followupdelegate variable. - Passed
CheckKeyConsistencydirectly intoReadMultiPfxcalls.
|
@copilot please invoke the code-review skill and post the analysis/comments as a comment on this PR |
src/libraries/System.Security.Cryptography/tests/X509Certificates/PfxFormatTests.cs
Show resolved
Hide resolved
🤖 Copilot Code ReviewHolistic AssessmentMotivation: This PR cleans up dead code left behind by PR #122907 (removal of Approach: The fix correctly removes the dead Summary: ✅ LGTM. The change is minimal, correct, and behavior-preserving. No functional impact — the removed code paths were unreachable. Detailed Findings✅ Dead code removal is correctThe condition ✅ Remaining
|
Description
Two places in
PfxFormatTests.cshad an always-false conditionOperatingSystem.IsWindows() && !PlatformDetection.IsWindowsguardingfollowup = null. Since these can never be true, thefollowupvariable was alwaysCheckKeyConsistencyand never modified.ifblocks and their associated Windows 7 comment blocksAction<X509Certificate2> followupvariableCheckKeyConsistencydirectly toReadMultiPfxcallsBefore:
After: