Skip to content

Commit 2b95e6d

Browse files
committed
Ignore the expiration of certificate in SHA2 check
The purpose of this check is not to validate the chain, completely. 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. It is possible to have a valid authenticode signature if the certificate is expired but was timestamped while it was valid. In this case we still want to successfully build a chain to perform validation. The expirely rules will be covered in the VerifyTrust check.
1 parent ada54b4 commit 2b95e6d

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

AuthenticodeLint/Rules/SigningCertificateDigestAlgorithmRule.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ public RuleResult Validate(Graph<Signature> graph, SignatureLoggerBase verboseWr
2323
{
2424
chain.ChainPolicy.ExtraStore.AddRange(certificates);
2525
chain.ChainPolicy.RevocationMode = X509RevocationMode.NoCheck;
26+
chain.ChainPolicy.VerificationFlags = X509VerificationFlags.IgnoreNotTimeValid;
2627
bool success = chain.Build(signature.SignerInfo.Certificate);
2728
if (!success)
2829
{

0 commit comments

Comments
 (0)