httpd-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jor...@apache.org
Subject svn commit: r598690 - /httpd/httpd/trunk/modules/ssl/ssl_engine_log.c
Date Tue, 27 Nov 2007 16:57:12 GMT
Author: jorton
Date: Tue Nov 27 08:57:12 2007
New Revision: 598690

URL: http://svn.apache.org/viewvc?rev=598690&view=rev
Log:
* modules/ssl/ssl_engine_log.c (ssl_log_cxerror): Log the certificate
  serial number along with the subject and issuer names.

Modified:
    httpd/httpd/trunk/modules/ssl/ssl_engine_log.c

Modified: httpd/httpd/trunk/modules/ssl/ssl_engine_log.c
URL: http://svn.apache.org/viewvc/httpd/httpd/trunk/modules/ssl/ssl_engine_log.c?rev=598690&r1=598689&r2=598690&view=diff
==============================================================================
--- httpd/httpd/trunk/modules/ssl/ssl_engine_log.c (original)
+++ httpd/httpd/trunk/modules/ssl/ssl_engine_log.c Tue Nov 27 08:57:12 2007
@@ -114,7 +114,8 @@
 {
     va_list ap;
     char buf[HUGE_STRING_LEN];
-    char *sname, *iname;
+    char *sname, *iname, *serial;
+    BIGNUM *bn;
     
     if (c->base_server->loglevel < level) {
         /* Bail early since the rest of this function is expensive. */
@@ -123,16 +124,19 @@
 
     sname = X509_NAME_oneline(X509_get_subject_name(cert), NULL, 0);
     iname = X509_NAME_oneline(X509_get_issuer_name(cert),  NULL, 0);
+    bn = ASN1_INTEGER_to_BN(X509_get_serialNumber(cert), NULL);
+    serial = bn && !BN_is_zero(bn) ? BN_bn2hex(bn) : NULL;
     
     va_start(ap, format);
     apr_vsnprintf(buf, sizeof buf, format, ap);
     va_end(ap);
 
     ap_log_cerror(file, line, level, rv, c, 
-                  "%s [peer subject: %s, issuer: %s]",
+                  "%s [peer subject: %s, issuer: %s, serial: %s]",
                   buf,
                   sname ? sname : "-unknown-",
-                  iname ? iname : "-unknown-");
+                  iname ? iname : "-unknown-",
+                  serial ? serial : "-unknown-");
 
     if (sname) {
         modssl_free(sname);
@@ -140,5 +144,13 @@
     
     if (iname) {
         modssl_free(iname);
+    }
+    
+    if (serial) {
+        modssl_free(serial);
+    }
+
+    if (bn) {
+        BN_free(bn);
     }
 }



Mime
View raw message