summaryrefslogtreecommitdiffstats
path: root/mod_log_sql_ssl.c
diff options
context:
space:
mode:
Diffstat (limited to 'mod_log_sql_ssl.c')
-rw-r--r--mod_log_sql_ssl.c100
1 files changed, 100 insertions, 0 deletions
diff --git a/mod_log_sql_ssl.c b/mod_log_sql_ssl.c
new file mode 100644
index 0000000..3346d2f
--- /dev/null
+++ b/mod_log_sql_ssl.c
@@ -0,0 +1,100 @@
1/* $Header: /home/cvs/mod_log_sql/mod_log_sql_ssl.c,v 1.1 2004/01/20 19:38:08 urkle Exp $ */
2/* mod_log_sql_ssl */
3
4#if defined(WITH_APACHE20)
5# include "apache20.h"
6#elif defined(WITH_APACHE13)
7# include "apache13.h"
8#else
9# error Unsupported Apache version
10#endif
11
12#ifdef HAVE_CONFIG_H
13/* Undefine these to prevent conflicts between Apache ap_config_auto.h and
14 * my config.h. Only really needed for Apache < 2.0.48, but it can't hurt.
15 */
16#undef PACKAGE_BUGREPORT
17#undef PACKAGE_NAME
18#undef PACKAGE_STRING
19#undef PACKAGE_TARNAME
20#undef PACKAGE_VERSION
21
22#include "config.h"
23#endif
24
25#include "mod_ssl.h"
26
27static const char *extract_ssl_keysize(request_rec *r, char *a)
28{
29 char *result = NULL;
30#if defined(APACHE20)
31 SSLConnRec *scc = myConnConfig(r->connection);
32 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
33 if (myCtxConfig(scc,ssc) != NULL
34#elif defined(APACHE13)
35 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL)
36#endif
37 {
38 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE");
39 #ifdef DEBUG
40 log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_KEYSIZE: %s", result);
41 #endif
42 if (result != NULL && result[0] == '\0')
43 result = NULL;
44 return result;
45 } else {
46 return "0";
47 }
48}
49
50static const char *extract_ssl_maxkeysize(request_rec *r, char *a)
51{
52 char *result = NULL;
53#if defined(APACHE20)
54 SSLConnRec *scc = myConnConfig(r->connection);
55 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
56 if (myCtxConfig(scc,ssc) != NULL
57#elif defined(APACHE13)
58 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL)
59#endif
60 {
61 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE");
62 #ifdef DEBUG
63 log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_ALGKEYSIZE: %s", result);
64 #endif
65 if (result != NULL && result[0] == '\0')
66 result = NULL;
67 return result;
68 } else {
69 return "0";
70 }
71}
72
73static const char *extract_ssl_cipher(request_rec *r, char *a)
74{
75 char *result = NULL;
76#if defined(APACHE20)
77 SSLConnRec *scc = myConnConfig(r->connection);
78 SSLSrvConfigRec *ssc = mySrvConfig(r->server);
79 if (myCtxConfig(scc,ssc) != NULL
80#elif defined(APACHE13)
81 if (ap_ctx_get(r->connection->client->ctx, "ssl") != NULL)
82#endif
83 {
84 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER");
85 #ifdef DEBUG
86 log_error(APLOG_MARK,APLOG_DEBUG,0,r->server,"SSL_CIPHER: %s", result);
87 #endif
88 if (result != NULL && result[0] == '\0')
89 result = NULL;
90 return result;
91 } else {
92 return "-";
93 }
94}
95
96#ifdef WANT_SSL_LOGGING
97 { 'q', extract_ssl_keysize, "ssl_keysize", 0, 1 },
98 { 'Q', extract_ssl_maxkeysize, "ssl_maxkeysize", 0, 1 },
99 { 'z', extract_ssl_cipher, "ssl_cipher", 0, 1 },
100#endif