httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1677830 - in /httpd/httpd/trunk/modules/ssl: ssl_engine_init.c ssl_util_ssl.c ssl_util_ssl.h
Date Tue, 05 May 2015 14:09:35 GMT
Author: stsp
Date: Tue May  5 14:09:35 2015
New Revision: 1677830

URL: http://svn.apache.org/r1677830
Log:
mod_ssl namespacing: Merge SSL_X509_INFO_load_path() into its only caller
ssl_init_proxy_certs() in ssl_engine_init.c. No functional change.
Review by: kbrand

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_init.c
    httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
    httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_init.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_init.c?rev=1677830&r1=1677829&r2=1677830&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_init.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_init.c Tue May  5 14:09:35 2015
@@ -1247,7 +1247,26 @@ static apr_status_t ssl_init_proxy_certs
     }
 
     if (pkp->cert_path) {
-        SSL_X509_INFO_load_path(ptemp, sk, pkp->cert_path);
+        apr_dir_t *dir;
+        apr_finfo_t dirent;
+        apr_int32_t finfo_flags = APR_FINFO_TYPE|APR_FINFO_NAME;
+    
+        if (apr_dir_open(&dir, pkp->cert_path, ptemp) == APR_SUCCESS) {
+            while ((apr_dir_read(&dirent, finfo_flags, dir)) == APR_SUCCESS) {
+                const char *fullname;
+
+                if (dirent.filetype == APR_DIR) {
+                    continue; /* don't try to load directories */
+                }
+        
+                fullname = apr_pstrcat(ptemp,
+                                       pkp->cert_path, "/", dirent.name,
+                                       NULL);
+                modssl_X509_INFO_load_file(ptemp, sk, fullname);
+            }
+
+            apr_dir_close(dir);
+        }
     }
 
     if ((ncerts = sk_X509_INFO_num(sk)) <= 0) {

Modified: httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c?rev=1677830&r1=1677829&r2=1677830&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_util_ssl.c Tue May  5 14:09:35 2015
@@ -441,43 +441,6 @@ BOOL modssl_X509_INFO_load_file(apr_pool
     return TRUE;
 }
 
-BOOL SSL_X509_INFO_load_path(apr_pool_t *ptemp,
-                             STACK_OF(X509_INFO) *sk,
-                             const char *pathname)
-{
-    /* XXX: this dir read code is exactly the same as that in
-     * ssl_engine_init.c, only the call to handle the fullname is different,
-     * should fold the duplication.
-     */
-    apr_dir_t *dir;
-    apr_finfo_t dirent;
-    apr_int32_t finfo_flags = APR_FINFO_TYPE|APR_FINFO_NAME;
-    const char *fullname;
-    BOOL ok = FALSE;
-
-    if (apr_dir_open(&dir, pathname, ptemp) != APR_SUCCESS) {
-        return FALSE;
-    }
-
-    while ((apr_dir_read(&dirent, finfo_flags, dir)) == APR_SUCCESS) {
-        if (dirent.filetype == APR_DIR) {
-            continue; /* don't try to load directories */
-        }
-
-        fullname = apr_pstrcat(ptemp,
-                               pathname, "/", dirent.name,
-                               NULL);
-
-        if (modssl_X509_INFO_load_file(ptemp, sk, fullname)) {
-            ok = TRUE;
-        }
-    }
-
-    apr_dir_close(dir);
-
-    return ok;
-}
-
 /*  _________________________________________________________________
 **
 **  Custom (EC)DH parameter support

Modified: httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h?rev=1677830&r1=1677829&r2=1677830&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_util_ssl.h Tue May  5 14:09:35 2015
@@ -68,7 +68,6 @@ char       *modssl_X509_NAME_to_string(a
 BOOL        modssl_X509_getSAN(apr_pool_t *, X509 *, int, int, apr_array_header_t **);
 BOOL        modssl_X509_match_name(apr_pool_t *, X509 *, const char *, BOOL, server_rec *);
 BOOL        modssl_X509_INFO_load_file(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
-BOOL        SSL_X509_INFO_load_path(apr_pool_t *, STACK_OF(X509_INFO) *, const char *);
 int         SSL_CTX_use_certificate_chain(SSL_CTX *, char *, int, pem_password_cb *);
 char       *SSL_SESSION_id2sz(unsigned char *, int, char *, int);
 



Mime
View raw message