serf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r1830700 - in /serf/branches/ocsp-verification: SConstruct buckets/ssl_buckets.c
Date Tue, 01 May 2018 17:41:01 GMT
Author: brane
Date: Tue May  1 17:41:00 2018
New Revision: 1830700

URL: http://svn.apache.org/viewvc?rev=1830700&view=rev
Log:
Avoid using a deprecated function with OpenSSL 1.1.

* SConstruct (SERF_NO_SSL_ASN1_STRING_GET0_DATA):
   Define if the ASN1_STRING_get0_data() is not available.

* buckets/ssl_buckets.c (ASN1_STRING_get0_data):
   Add optional replacement macro for the new function.
  (convert_asn1_generalized_time): Update implementation.

Modified:
    serf/branches/ocsp-verification/SConstruct
    serf/branches/ocsp-verification/buckets/ssl_buckets.c

Modified: serf/branches/ocsp-verification/SConstruct
URL: http://svn.apache.org/viewvc/serf/branches/ocsp-verification/SConstruct?rev=1830700&r1=1830699&r2=1830700&view=diff
==============================================================================
--- serf/branches/ocsp-verification/SConstruct (original)
+++ serf/branches/ocsp-verification/SConstruct Tue May  1 17:41:00 2018
@@ -469,6 +469,8 @@ if not conf.CheckFunc('X509_get0_notAfte
   env.Append(CPPDEFINES=['SERF_NO_SSL_X509_GET0_NOTAFTER'])
 if not conf.CheckFunc('X509_STORE_CTX_get0_chain'):
   env.Append(CPPDEFINES=['SERF_NO_SSL_X509_GET0_CHAIN'])
+if not conf.CheckFunc('ASN1_STRING_get0_data'):
+  env.Append(CPPDEFINES=['SERF_NO_SSL_ASN1_STRING_GET0_DATA'])
 if conf.CheckFunc('CRYPTO_set_locking_callback'):
   env.Append(CPPDEFINES=['SERF_HAVE_SSL_LOCKING_CALLBACKS'])
 if conf.CheckFunc('OPENSSL_malloc_init', '#include <openssl/crypto.h>'):

Modified: serf/branches/ocsp-verification/buckets/ssl_buckets.c
URL: http://svn.apache.org/viewvc/serf/branches/ocsp-verification/buckets/ssl_buckets.c?rev=1830700&r1=1830699&r2=1830700&view=diff
==============================================================================
--- serf/branches/ocsp-verification/buckets/ssl_buckets.c (original)
+++ serf/branches/ocsp-verification/buckets/ssl_buckets.c Tue May  1 17:41:00 2018
@@ -65,6 +65,9 @@
 #define X509_STORE_CTX_get0_chain(store) (X509_STORE_CTX_get_chain(store))
 #endif
 
+#ifdef SERF_NO_SSL_ASN1_STRING_GET0_DATA
+#define ASN1_STRING_get0_data(asn1string) (ASN1_STRING_data(asn1string))
+#endif
 
 /*
  * Here's an overview of the SSL bucket's relationship to OpenSSL and serf.
@@ -2950,7 +2953,7 @@ convert_asn1_generalized_time(ASN1_GENER
                               apr_status_t parse_error)
 {
     apr_time_exp_t xt = { 0 };
-    void *data;
+    const void *data;
     char *date;
     int len;
     char tz;
@@ -2959,7 +2962,7 @@ convert_asn1_generalized_time(ASN1_GENER
         return 0;
 
     len = ASN1_STRING_length(asn1_time);
-    data = ASN1_STRING_data(asn1_time);
+    data = ASN1_STRING_get0_data(asn1_time);
     date = apr_pstrndup(scratch_pool, data, len);
 
     if (6 > sscanf(date, "%4d%2d%2d%2d%2d%2d%c",



Mime
View raw message