Skip to content

Commit

Permalink
Issue proftpd#859, proftpd#861: Fix handling of CRL lookups by proper…
Browse files Browse the repository at this point in the history
…ly using issuer for

lookups, and guarding against null pointers.
  • Loading branch information
Castaglia committed Nov 24, 2019
1 parent 0ad8694 commit 81cc5dc
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions contrib/mod_tls.c
Expand Up @@ -9777,10 +9777,10 @@ static int tls_verify_crl(int ok, X509_STORE_CTX *ctx) {

#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
!defined(HAVE_LIBRESSL)
crls = X509_STORE_CTX_get1_crls(store_ctx, subject);
crls = X509_STORE_CTX_get1_crls(store_ctx, issuer);
#elif OPENSSL_VERSION_NUMBER >= 0x10000000L && \
!defined(HAVE_LIBRESSL)
crls = X509_STORE_get1_crls(store_ctx, subject);
crls = X509_STORE_get1_crls(store_ctx, issuer);
#else
/* Your OpenSSL is before 1.0.0. You really need to upgrade. */
crls = NULL;
Expand All @@ -9799,6 +9799,9 @@ static int tls_verify_crl(int ok, X509_STORE_CTX *ctx) {
ASN1_INTEGER *sn;

revoked = sk_X509_REVOKED_value(X509_CRL_get_REVOKED(crl), j);
if (revoked == NULL) {
continue;
}
#if OPENSSL_VERSION_NUMBER >= 0x10100000L && \
!defined(HAVE_LIBRESSL)
sn = X509_REVOKED_get0_serialNumber(revoked);
Expand Down

0 comments on commit 81cc5dc

Please sign in to comment.