Skip to content

Commit 551792a

Browse files
Kuldeep-MSsinghashish-wpf
authored andcommitted
Merged PR 35490: Fixing VerifyCertificate NET 6.0
Adding a check to return NotValidForUsage status when there is an internal failure occurred in chain.Build
1 parent 41b7234 commit 551792a

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/Microsoft.DotNet.Wpf/src/WindowsBase/System/IO/Packaging/PackageDigitalSignatureManager.cs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -836,6 +836,14 @@ public static X509ChainStatusFlags VerifyCertificate(X509Certificate certificate
836836
if (!valid)
837837
{
838838
X509ChainStatus[] chainStatus = chain.ChainStatus;
839+
840+
//check if build has experienced any internal failure
841+
if (chainStatus.Length == 0)
842+
{
843+
//Internal failure has occurred while building
844+
return X509ChainStatusFlags.NotValidForUsage;
845+
}
846+
839847
for (int i = 0; i < chainStatus.Length; i++)
840848
{
841849
status |= chainStatus[i].Status;

0 commit comments

Comments
 (0)