httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From do...@apache.org
Subject cvs commit: httpd-2.0/modules/ssl ssl_engine_kernel.c
Date Thu, 29 Nov 2001 06:27:41 GMT
dougm       01/11/28 22:27:41

  Modified:    modules/ssl ssl_engine_kernel.c
  Log:
  ssl_callback_SSLVerify() was calling (the expensive) X509_NAME_oneline()
  function and free() of the return value twice each, for logging
  regardless of SSLLogLevel.  changed to happen only if SSLLogLevel >= trace
  
  Revision  Changes    Path
  1.33      +12 -12    httpd-2.0/modules/ssl/ssl_engine_kernel.c
  
  Index: ssl_engine_kernel.c
  ===================================================================
  RCS file: /home/cvs/httpd-2.0/modules/ssl/ssl_engine_kernel.c,v
  retrieving revision 1.32
  retrieving revision 1.33
  diff -u -r1.32 -r1.33
  --- ssl_engine_kernel.c	2001/11/29 05:45:48	1.32
  +++ ssl_engine_kernel.c	2001/11/29 06:27:41	1.33
  @@ -1235,8 +1235,6 @@
       X509 *xs;
       int errnum;
       int errdepth;
  -    char *cp;
  -    char *cp2;
       int depth;
       int verify;
   
  @@ -1261,16 +1259,18 @@
       /*
        * Log verification information
        */
  -    cp  = X509_NAME_oneline(X509_get_subject_name(xs), NULL, 0);
  -    cp2 = X509_NAME_oneline(X509_get_issuer_name(xs),  NULL, 0);
  -    ssl_log(s, SSL_LOG_TRACE,
  -            "Certificate Verification: depth: %d, subject: %s, issuer: %s",
  -            errdepth, cp != NULL ? cp : "-unknown-",
  -            cp2 != NULL ? cp2 : "-unknown");
  -    if (cp)
  -        free(cp);
  -    if (cp2)
  -        free(cp2);
  +    if (sc->nLogLevel >= SSL_LOG_TRACE) {
  +        char *cp  = X509_NAME_oneline(X509_get_subject_name(xs), NULL, 0);
  +        char *cp2 = X509_NAME_oneline(X509_get_issuer_name(xs),  NULL, 0);
  +        ssl_log(s, SSL_LOG_TRACE,
  +                "Certificate Verification: depth: %d, subject: %s, issuer: %s",
  +                errdepth, cp != NULL ? cp : "-unknown-",
  +                cp2 != NULL ? cp2 : "-unknown");
  +        if (cp)
  +            free(cp);
  +        if (cp2)
  +            free(cp2);
  +    }
   
       /*
        * Check for optionally acceptable non-verifiable issuer situation
  
  
  

Mime
View raw message