Closed adb014 closed 5 months ago
Duplicate of #373. The "-ignore-cdp" option already does what you need.
Sorry to contradict you but -ignore-cdp will ignore the crl specified in the certificate and then the verification will fail asking for “-CRLfile” to be specified. I wouldn’t have implemented this otherwise. Try disconnecting from the network and trying to verify a Microsoft kb with
osslsigncode verify -CAfile cert.crt -TSA-CAfile cert.crt -time $time <kb>
where cert.crt is the Microsoft root certificate and time is the signature time. Before you tell me this doesn’t fully verify the chain of trust, I know it’s only a simple example to show to problem. In real life I check all intermediate and leaf certificates as well
I discussed it with @olszomal, who wrote the "-ignore-cdp" code, and you're right: it only disables fetching CRLs, and not verifying them. Please submit a PR.
Don't forget to also update the usage() and help_for() functions. Apparently, the current help for "-ignore-cdp" is somewhat confusing, so please use the opportunity to also clarify it.
I'm using osslsigncode in an airgapped environment where all files entering the zone are scanned before permitiing them to enter. Recent changes (since version 2.6) in osslsigncode have added the feature to always check the CRL and fail the verification if the CRL is not available. In an airgapped environment I certainly don't have access to the CRL.
The patch below adds the "-ignore-crl" option to the verify commands, allowing the verification to suceed even if the CRL is not available.
Sorry there are quite a few whitespace changes in the above as the CRL verification is in an if block. But hopefully these whitespace changes should be relatively obvious. Could this feature be addded in a future version of osslsigncode ?