This simple test program sets a CMS gpgme context into offline mode then tries to learn the validity of the identity of alice.crt, based on trusting ca.crt (certs are from the LAMPS sample certificates.
Despite explicitly asking for offline mode and certificate validation, the certificate validity check fails unless the user has manually set disable-crl-checks in gpgsm.conf.
Here is a transcript of me testing without disable-crl-checks and then with disable-crl-checks. Note that the validity goes from UNKNOWN to FULL:
0 $ make
gcc -O2 -g -Wall -Werror -pedantic -o test test.c -lgpgme -lassuan -lgpg-error
echo "4D:E0:FF:63:C0:E9:EC:01:29:11:C8:7A:EE:DA:3A:9A:7F:6E:C1:0D S relax" > ghome/trustlist.txt
gpgsm --import ca.crt
gpgsm: total number processed: 1
gpgsm: unchanged: 1
gpgsm --import alice.crt
gpgsm: total number processed: 1
gpgsm: unchanged: 1
printf disable-crl-checks:16: | gpgconf --change-options gpgsm
gpgsm:S/MIME:/usr/bin/gpgsm:1:1:
./test
version: 1.13.1-unknown
validity: UNKNOWN
name:
email:
userid: CN=Alice Lovelace
validity: UNKNOWN
name:
email: <alice@smime.example>
userid: <alice@smime.example>
printf disable-crl-checks::1 | gpgconf --change-options gpgsm
gpgsm:S/MIME:/usr/bin/gpgsm:1:1:
./test
version: 1.13.1-unknown
validity: FULL
name:
email:
userid: CN=Alice Lovelace
validity: FULL
name:
email: <alice@smime.example>
userid: <alice@smime.example>
0 $I'm testing this with gpgsm 2.2.19.
(this was the original bug i was trying to track down when i filed T4881, as it is getting in the way of a robust test suite for notmuch to handle S/MIME (via GMime's wrapper around gpgme))