This relates to a thread on gnupg-devel: https://lists.gnupg.org/pipermail/gnupg-devel/2019-March/034256.html
With gpgsm 2.2.13, I was unable to decrypt e-mails due to an expired CA certificate:
$ gpgsm -d mail.p7m gpgsm: Note: non-critical certificate policy not allowed gpgsm: certificate #1C7CAD9DED77429D3CA98D1D/1.2.840.113549.1.9.1=#636140756E692D6D75656E737465722E6465,CN=Zertifizierungsstelle Universitaet Muenster - G02,O=Universitaet Muenster,C=DE gpgsm: checking the CRL failed: Certificate expired gpgsm: can't sign using '5E:A8:6C:19:99:8E:43:CC:CF:BB:1C:0E:35:07:FF:F6:F2:BA:3C:26': Certificate expired gpgsm: Note: non-critical certificate policy not allowed gpgsm: certificate #1C7CAD9DED77429D3CA98D1D/1.2.840.113549.1.9.1=#636140756E692D6D75656E737465722E6465,CN=Zertifizierungsstelle Universitaet Muenster - G02,O=Universitaet Muenster,C=DE gpgsm: checking the CRL failed: Certificate expired gpgsm: Note: won't be able to encrypt to '5E:A8:6C:19:99:8E:43:CC:CF:BB:1C:0E:35:07:FF:F6:F2:BA:3C:26': Certificate expired
The core reason is that different certificates may reuse the same key (with same keygrip, same Subject Key Identifier). In my case, an expired certificate was found by dirmngr, leading to a failure, while a valid certificate with the same key exists as well.
I'm aware of two workarounds:
- Add disable-crl-checks to gpgsm.conf
- Remove expired certificate from keyring