Skip to content

Commit 8b41976

Browse files
committed
Added comment explaining verification flags.
1 parent 2b95e6d commit 8b41976

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

AuthenticodeLint/Rules/SigningCertificateDigestAlgorithmRule.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ public RuleResult Validate(Graph<Signature> graph, SignatureLoggerBase verboseWr
2323
{
2424
chain.ChainPolicy.ExtraStore.AddRange(certificates);
2525
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
26+
//The purpose of this check is not to validate the chain, completely.
27+
//The chain is needed so we know which certificate is the root and intermediates so we know which to validate and which not to validate.
28+
//It is possible to have a valid authenticode signature if the certificate is expired but was
29+
//timestamped while it was valid. In this case we still want to successfully build a chain to perform validation.
2630
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.IgnoreNotTimeValid;
2731
bool success = chain.Build(signature.SignerInfo.Certificate);
2832
if (!success)

0 commit comments

Comments
 (0)