[rs-commit] r60 - in /mod_ca/trunk: config.h.in configure configure.ac mod_ca_crl.c

rs-commit at redwax.eu rs-commit at redwax.eu
Thu Aug 29 00:36:32 CEST 2019


Author: minfrin at redwax.eu
Date: Thu Aug 29 00:36:26 2019
New Revision: 60

Log:
X509_CRL_get0_lastUpdate() does not appear to exist in all versions of openssl
as the docs suggest.

Modified:
    mod_ca/trunk/config.h.in
    mod_ca/trunk/configure
    mod_ca/trunk/configure.ac
    mod_ca/trunk/mod_ca_crl.c

Modified: mod_ca/trunk/config.h.in
==============================================================================
--- mod_ca/trunk/config.h.in	(original)
+++ mod_ca/trunk/config.h.in	Thu Aug 29 00:36:26 2019
@@ -29,6 +29,12 @@
 
 /* Define to 1 if you have the <unistd.h> header file. */
 #undef HAVE_UNISTD_H
+
+/* Define to 1 if you have the `X509_CRL_get0_lastUpdate' function. */
+#undef HAVE_X509_CRL_GET0_LASTUPDATE
+
+/* Define to 1 if you have the `X509_CRL_get0_nextUpdate' function. */
+#undef HAVE_X509_CRL_GET0_NEXTUPDATE
 
 /* Define to 1 if you have the `X509_REVOKED_get0_revocationDate' function. */
 #undef HAVE_X509_REVOKED_GET0_REVOCATIONDATE

Modified: mod_ca/trunk/configure
==============================================================================
--- mod_ca/trunk/configure	(original)
+++ mod_ca/trunk/configure	Thu Aug 29 00:36:26 2019
@@ -4735,7 +4735,7 @@
 
 
 # Checks for library functions.
-for ac_func in X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data
+for ac_func in X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data X509_CRL_get0_lastUpdate X509_CRL_get0_nextUpdate
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"

Modified: mod_ca/trunk/configure.ac
==============================================================================
--- mod_ca/trunk/configure.ac	(original)
+++ mod_ca/trunk/configure.ac	Thu Aug 29 00:36:26 2019
@@ -62,7 +62,7 @@
 AC_TYPE_SIZE_T
 
 # Checks for library functions.
-AC_CHECK_FUNCS([X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data])
+AC_CHECK_FUNCS([X509_REVOKED_get0_revocationDate X509_REVOKED_get0_serialNumber ASN1_STRING_get0_data X509_CRL_get0_lastUpdate X509_CRL_get0_nextUpdate])
 
 AC_SUBST(PACKAGE_VERSION)
 AC_OUTPUT

Modified: mod_ca/trunk/mod_ca_crl.c
==============================================================================
--- mod_ca/trunk/mod_ca_crl.c	(original)
+++ mod_ca/trunk/mod_ca_crl.c	Thu Aug 29 00:36:26 2019
@@ -291,7 +291,11 @@
         }
 
         /* return the last update */
+#if HAVE_X509_CRL_GET0_LASTUPDATE
         thisupdate = X509_CRL_get0_lastUpdate(conf->crl);
+#else
+        thisupdate = X509_CRL_get_lastUpdate(conf->crl);
+#endif
         if (thisupdate) {
             apr_hash_set(certstatus, CA_THIS_UPDATE, APR_HASH_KEY_STRING,
                     make_ASN1_TIME(r->pool, thisupdate));
@@ -401,7 +405,11 @@
         }
     }
 
+#if HAVE_X509_CRL_GET0_NEXTUPDATE
     nextupdate = X509_CRL_get0_nextUpdate(conf->crl);
+#else
+    nextupdate = X509_CRL_get_nextUpdate(conf->crl);
+#endif
     if (nextupdate) {
         conf->crl_expires = ASN1_TIME_to_gmtime(nextupdate);
     }



More information about the rs-commit mailing list