httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject cvs commit: httpd-2.0/modules/ssl README ssl_util_ssl.c ssl_util_ssl.h mod_ssl.h
Date Sat, 05 May 2001 20:11:05 GMT
rse         01/05/05 13:11:05

  Modified:    modules/ssl README ssl_util_ssl.c ssl_util_ssl.h mod_ssl.h
  Log:
  Port ssl_util_ssl.[ch] stuff to APR.
  
  Revision  Changes    Path
  1.15      +2 -2      httpd-2.0/modules/ssl/README
  
  Index: README
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/README,v
  retrieving revision 1.14
  retrieving revision 1.15
  diff -u -r1.14 -r1.15
  --- README	2001/05/05 19:52:59	1.14
  +++ README	2001/05/05 20:11:04	1.15
  @@ -52,8 +52,8 @@
    - ssl_scache_shmcb.c ...... session cache via shared memory cyclic buffer
    - ssl_scache_shmht.c ...... session cache via shared memory hash table
    - ssl_util.c .............. utility functions
  - - ssl_util_ssl.c .......... the OpenSSL companion source
  - - ssl_util_ssl.h .......... the OpenSSL companion header
  + # ssl_util_ssl.c .......... the OpenSSL companion source
  + # ssl_util_ssl.h .......... the OpenSSL companion header
    - ssl_util_table.c ........ the hash table library source
    - ssl_util_table.h ........ the hash table library header
   
  
  
  
  1.4       +19 -26    httpd-2.0/modules/ssl/ssl_util_ssl.c
  
  Index: ssl_util_ssl.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_util_ssl.c,v
  retrieving revision 1.3
  retrieving revision 1.4
  diff -u -r1.3 -r1.4
  --- ssl_util_ssl.c	2001/05/05 10:12:08	1.3
  +++ ssl_util_ssl.c	2001/05/05 20:11:04	1.4
  @@ -59,8 +59,6 @@
   
   #include "mod_ssl.h"
   
  -#if 0 /* XXX */
  -
   /*  _________________________________________________________________
   **
   **  Additional High-Level Functions for OpenSSL
  @@ -269,7 +267,7 @@
   **  _________________________________________________________________
   */
   
  -char *SSL_make_ciphersuite(pool *p, SSL *ssl)
  +char *SSL_make_ciphersuite(apr_pool_t *p, SSL *ssl)
   {
       STACK_OF(SSL_CIPHER) *sk;
       SSL_CIPHER *c;
  @@ -289,7 +287,7 @@
       }
       if (l == 0)
           return "";
  -    cpCipherSuite = (char *)ap_palloc(p, l+1);
  +    cpCipherSuite = (char *)apr_palloc(p, l+1);
       cp = cpCipherSuite;
       for (i = 0; i < sk_SSL_CIPHER_num(sk); i++) {
           c = sk_SSL_CIPHER_value(sk, i);
  @@ -369,7 +367,7 @@
   }
   
   /* retrieve subject CommonName of certificate */
  -BOOL SSL_X509_getCN(pool *p, X509 *xs, char **cppCN)
  +BOOL SSL_X509_getCN(apr_pool_t *p, X509 *xs, char **cppCN)
   {
       X509_NAME *xsn;
       X509_NAME_ENTRY *xsne;
  @@ -380,8 +378,8 @@
           xsne = sk_X509_NAME_ENTRY_value(xsn->entries, i);
           nid = OBJ_obj2nid(xsne->object);
           if (nid == NID_commonName) {
  -            *cppCN = ap_palloc(p, xsne->value->length+1);
  -            ap_cpystrn(*cppCN, (char *)xsne->value->data, xsne->value->length+1);
  +            *cppCN = apr_palloc(p, xsne->value->length+1);
  +            apr_cpystrn(*cppCN, (char *)xsne->value->data, xsne->value->length+1);
               (*cppCN)[xsne->value->length] = NUL;
   #ifdef CHARSET_EBCDIC
               ascii2ebcdic(*cppCN, *cppCN, strlen(*cppCN));
  @@ -400,7 +398,7 @@
   
   #ifdef SSL_EXPERIMENTAL_PROXY
   
  -BOOL SSL_load_CrtAndKeyInfo_file(pool *p, STACK_OF(X509_INFO) *sk, char *filename)
  +BOOL SSL_load_CrtAndKeyInfo_file(apr_pool_t *p, STACK_OF(X509_INFO) *sk, char *filename)
   {
       BIO *in;
   
  @@ -420,32 +418,29 @@
       return TRUE;
   }
   
  -BOOL SSL_load_CrtAndKeyInfo_path(pool *p, STACK_OF(X509_INFO) *sk, char *pathname)
  +BOOL SSL_load_CrtAndKeyInfo_path(apr_pool_t *p, STACK_OF(X509_INFO) *sk, char *pathname)
   {
  -    struct stat st;
  -    DIR *dir;
  -    pool *sp;
  -    struct dirent *nextent;
  +    apr_pool_t *sp;
  +    apr_dir_t *dir;
  +    apr_finfo_t dirent;
       char *fullname;
       BOOL ok;
   
  -    sp = ap_make_sub_pool(p);
  -    if ((dir = ap_popendir(sp, pathname)) == NULL) {
  -        ap_destroy_pool(sp);
  +    sp = apr_pool_sub_make(p, NULL);
  +    if (apr_dir_open(&dir, pathname, sp)) != APR_SUCCESS) {
  +        apr_pool_destroy(sp);
           return FALSE;
       }
       ok = FALSE;
  -    while ((nextent = readdir(dir)) != NULL) {
  -        fullname = ap_pstrcat(sp, pathname, "/", nextent->d_name, NULL);
  -        if (stat(fullname, &st) != 0)
  -            continue;
  -        if (!S_ISREG(st.st_mode))
  +    while ((apr_dir_read(&dirent, APR_FINFO_DIRENT, dir)) == APR_SUCCESS) {
  +        fullname = apr_pstrcat(sp, pathname, "/", dirent.name, NULL);
  +        if (dirent.filetype != APR_REG)
               continue;
           if (SSL_load_CrtAndKeyInfo_file(sp, sk, fullname))
               ok = TRUE;
       }
  -    ap_pclosedir(p, dir);
  -    ap_destroy_pool(sp);
  +    apr_dir_close(dir);
  +    apr_pool_destroy(sp);
       return ok;
   }              
   
  @@ -534,12 +529,10 @@
   
       cp = str;
       for (n = 0; n < idlen && n < SSL_MAX_SSL_SESSION_ID_LENGTH; n++) {
  -        ap_snprintf(cp, sizeof(str)-(cp-str), "%02X", id[n]);
  +        apr_snprintf(cp, sizeof(str)-(cp-str), "%02X", id[n]);
           cp += 2;
       }
       *cp = NUL;
       return str;
   }
  -
  -#endif /* XXX */
   
  
  
  
  1.6       +4 -8      httpd-2.0/modules/ssl/ssl_util_ssl.h
  
  Index: ssl_util_ssl.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_util_ssl.h,v
  retrieving revision 1.5
  retrieving revision 1.6
  diff -u -r1.5 -r1.6
  --- ssl_util_ssl.h	2001/05/05 19:56:17	1.5
  +++ ssl_util_ssl.h	2001/05/05 20:11:04	1.6
  @@ -73,8 +73,6 @@
   #define SSL_LIBRARY_TEXT    "OtherSSL 0.0.0 00 XXX 0000"
   #endif
   
  -#if 0 /* XXX */
  -
   /*
    * Support for retrieving/overriding states
    */
  @@ -101,17 +99,15 @@
   int         SSL_smart_shutdown(SSL *ssl);
   X509_STORE *SSL_X509_STORE_create(char *, char *);
   int         SSL_X509_STORE_lookup(X509_STORE *, int, X509_NAME *, X509_OBJECT *);
  -char       *SSL_make_ciphersuite(pool *, SSL *);
  +char       *SSL_make_ciphersuite(apr_pool_t *, SSL *);
   BOOL        SSL_X509_isSGC(X509 *);
   BOOL        SSL_X509_getBC(X509 *, int *, int *);
  -BOOL        SSL_X509_getCN(pool *, X509 *, char **);
  +BOOL        SSL_X509_getCN(apr_pool_t *, X509 *, char **);
   #ifdef SSL_EXPERIMENTAL_PROXY
  -BOOL        SSL_load_CrtAndKeyInfo_file(pool *, STACK_OF(X509_INFO) *, char *);
  -BOOL        SSL_load_CrtAndKeyInfo_path(pool *, STACK_OF(X509_INFO) *, char *);
  +BOOL        SSL_load_CrtAndKeyInfo_file(apr_pool_t *, STACK_OF(X509_INFO) *, char *);
  +BOOL        SSL_load_CrtAndKeyInfo_path(apr_pool_t *, STACK_OF(X509_INFO) *, char *);
   #endif /* SSL_EXPERIMENTAL_PROXY */
   int         SSL_CTX_use_certificate_chain(SSL_CTX *, char *, int, int (*)());
   char       *SSL_SESSION_id2sz(unsigned char *, int);
  -
  -#endif /* XXX */
   
   #endif /* __SSL_UTIL_SSL_H__ */
  
  
  
  1.14      +1 -0      httpd-2.0/modules/ssl/mod_ssl.h
  
  Index: mod_ssl.h
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/mod_ssl.h,v
  retrieving revision 1.13
  retrieving revision 1.14
  diff -u -r1.13 -r1.14
  --- mod_ssl.h	2001/05/05 19:56:17	1.13
  +++ mod_ssl.h	2001/05/05 20:11:04	1.14
  @@ -129,6 +129,7 @@
   #include "apr_strings.h"
   #include "apr_pools.h"
   #include "apr_tables.h"
  +#include "apr_file_info.h"
   #undef CORE_PRIVATE
   
   /* mod_ssl headers */
  
  
  

Mime
View raw message