From d742635cb5fce692059f41a6353881bf7aeafcc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Trojnara?= Date: Wed, 18 Nov 2026 09:32:37 +0100 Subject: [PATCH] Warn when no CRL distribution point uses http:// Only http:// CRL distribution points are downloaded. A signer or timestamp certificate whose distribution points all use other schemes, such as https:// or ldap://, was accepted without a revocation check and without any indication, while an unreachable http:// distribution point makes verification fail. Print a warning that lists the unsupported distribution points and suggests -CRLfile or -TSA-CRLfile. Verification results are unchanged: failing instead would break certificates with LDAP-only distribution points, such as those issued by some Active Directory Certificate Services deployments. Certificates without CRL distribution points are not affected. --- NEWS.md | 4 ++++ osslsigncode.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ osslsigncode.md | 7 +++++++ 3 files changed, 55 insertions(+) diff --git a/NEWS.md b/NEWS.md index 9711a5c4..6d75b7a2 100644 --- a/NEWS.md +++ b/NEWS.md @@ -9,6 +9,10 @@ cannot be loaded - fixed allocation-failure crashes when decoding Base64 script signatures and timestamp responses, or creating signature content +- added a warning when a signer or timestamp certificate lists CRL + Distribution Points, but none with an http:// URL, so its revocation + status is not checked online (thanks to SecBuddyF of Tencent Keen + Security Lab for reporting the issue) ### 2.16 (2026.11.13) diff --git a/osslsigncode.c b/osslsigncode.c index d2da58fc..a4a2f280 100644 --- a/osslsigncode.c +++ b/osslsigncode.c @@ -2143,6 +2143,46 @@ static char *clrdp_url_get_x509(X509 *cert) return url; } +/* + * Warn that the certificate has CRL distribution points, but none of them + * provides a supported (http://) URL, so its revocation status was not + * checked. Only call this function if no CRL was available, which implies + * that clrdp_url_get_x509() returned NULL. + * [in] cert: X509 certificate + * [in] crlfile_option: option used to supply CRLs manually + * [returns] none + */ +static void clrdp_unsupported_warning(X509 *cert, const char *crlfile_option) +{ + STACK_OF(DIST_POINT) *crldp; + DIST_POINT *dp; + GENERAL_NAMES *gens; + BIO *bio; + int i, j; + + crldp = X509_get_ext_d2i(cert, NID_crl_distribution_points, NULL, NULL); + if (!crldp) + return; + + printf("Warning: No http:// CRL distribution point, revocation status not checked\n"); + bio = BIO_new_fp(stdout, BIO_NOCLOSE); + for (i = 0; bio && i < sk_DIST_POINT_num(crldp); i++) { + dp = sk_DIST_POINT_value(crldp, i); + if (!dp->distpoint || dp->distpoint->type != 0) + continue; + gens = dp->distpoint->name.fullname; + for (j = 0; j < sk_GENERAL_NAME_num(gens); j++) { + BIO_puts(bio, "Unsupported CRL distribution point: "); + GENERAL_NAME_print(bio, sk_GENERAL_NAME_value(gens, j)); + BIO_puts(bio, "\n"); + } + } + BIO_free(bio); + printf("Use the \"%s\" option to add one or more CRLs in PEM format.\n", + crlfile_option); + sk_DIST_POINT_pop_free(crldp, DIST_POINT_free); +} + /* * Get Certificate Revocation List from a CRL distribution point * and write it into the X509_CRL structure. @@ -2395,6 +2435,8 @@ static int verify_timestamp(FILE_FORMAT_CTX *ctx, PKCS7 *p7, CMS_ContentInfo *ti if (!crlok) goto out; } else { + if (!ctx->options->ignore_crl) + clrdp_unsupported_warning(signer, "-TSA-CRLfile"); printf("\n"); } /* check extended key usage flag XKU_TIMESTAMP */ @@ -2573,6 +2615,8 @@ static int verify_authenticode(FILE_FORMAT_CTX *ctx, PKCS7 *p7, time_t time, X50 printf("Signature CRL verification: %s\n", crlok ? "ok" : "failed"); if (!crlok) goto out; + } else if (!ctx->options->ignore_crl) { + clrdp_unsupported_warning(signer, "-CRLfile"); } /* keyUsage, if present, must permit digitalSignature (RFC 5280 section 4.2.1.3) */ if (!(X509_get_key_usage(signer) & X509v3_KU_DIGITAL_SIGNATURE)) { diff --git a/osslsigncode.md b/osslsigncode.md index 4d923ece..9692f9bc 100644 --- a/osslsigncode.md +++ b/osslsigncode.md @@ -155,6 +155,13 @@ Verification may include digest consistency, certificate chain validation, certificate revocation checking, timestamp validation, and optional checking of the signer's leaf certificate hash. +CRLs are downloaded only from `http://` CRL Distribution Points. A signer +or timestamp certificate without one is checked for revocation only against +CRLs embedded in the signature or supplied with `-CRLfile` or +`-TSA-CRLfile`. If no such CRLs are available and the certificate lists +only other CRL Distribution Points, such as `https://` or `ldap://` URLs, +a warning is printed. + When verifying that a file is covered by a catalog, use `verify -catalog catalog.cat -in file`. Verifying the CAT file by itself validates the catalog signature; verifying with `-catalog` checks whether the specified