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.c56
1 files changed, 24 insertions, 32 deletions
diff --git a/mod_log_sql_ssl.c b/mod_log_sql_ssl.c
index 92e0684..c874a2b 100644
--- a/mod_log_sql_ssl.c
+++ b/mod_log_sql_ssl.c
@@ -1,4 +1,4 @@
1/* $Header: /home/cvs/mod_log_sql/mod_log_sql_ssl.c,v 1.3 2004/01/21 04:34:21 urkle Exp $ */ 1/* $Header: /home/cvs/mod_log_sql/mod_log_sql_ssl.c,v 1.4 2004/01/22 05:26:56 urkle Exp $ */
2/* mod_log_sql_ssl */ 2/* mod_log_sql_ssl */
3 3
4#if defined(WITH_APACHE20) 4#if defined(WITH_APACHE20)
@@ -22,18 +22,19 @@
22#include "config.h" 22#include "config.h"
23#endif 23#endif
24 24
25#include "mod_log_sql.h"
25#include "mod_ssl.h" 26#include "mod_ssl.h"
26 27
28#if defined(WITH_APACHE20)
29# define TEST_SSL(r) myConnConfig(r->connection)
30#elif defined(WITH_APACHE13)
31# define TEST_SSL(r) ap_ctx_get(r->connection->client->ctx, "ssl")
32#endif
33
27static const char *extract_ssl_keysize(request_rec *r, char *a) 34static const char *extract_ssl_keysize(request_rec *r, char *a)
28{ 35{
29 char *result = NULL; 36 char *result = NULL;
30#if defined(APACHE20) 37 if (TEST_SSL(r) != NULL)
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 {
38 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE"); 39 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_USEKEYSIZE");
39 #ifdef DEBUG 40 #ifdef DEBUG
@@ -50,13 +51,7 @@ static const char *extract_ssl_keysize(request_rec *r, char *a)
50static const char *extract_ssl_maxkeysize(request_rec *r, char *a) 51static const char *extract_ssl_maxkeysize(request_rec *r, char *a)
51{ 52{
52 char *result = NULL; 53 char *result = NULL;
53#if defined(APACHE20) 54 if (TEST_SSL(r) != NULL)
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 { 55 {
61 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE"); 56 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER_ALGKEYSIZE");
62 #ifdef DEBUG 57 #ifdef DEBUG
@@ -73,13 +68,7 @@ static const char *extract_ssl_maxkeysize(request_rec *r, char *a)
73static const char *extract_ssl_cipher(request_rec *r, char *a) 68static const char *extract_ssl_cipher(request_rec *r, char *a)
74{ 69{
75 char *result = NULL; 70 char *result = NULL;
76#if defined(APACHE20) 71 if (TEST_SSL(r) != NULL)
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 { 72 {
84 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER"); 73 result = ssl_var_lookup(r->pool, r->server, r->connection, r, "SSL_CIPHER");
85 #ifdef DEBUG 74 #ifdef DEBUG
@@ -94,23 +83,26 @@ static const char *extract_ssl_cipher(request_rec *r, char *a)
94} 83}
95 84
96#if defined(WITH_APACHE20) 85#if defined(WITH_APACHE20)
97static int pre_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp) 86static int post_config(apr_pool_t *p, apr_pool_t *plog, apr_pool_t *ptemp, server_rec *s)
98#elif defined(WITH_APACHE13) 87#elif defined(WITH_APACHE13)
99static void module_init(server_rec *s, apr_pool_t *p) 88static void module_init(server_rec *s, apr_pool_t *p)
100#endif 89#endif
101{ 90{
102 log_sql_register_item(p,'q', extract_ssl_keysize, "ssl_keysize", 0, 1); 91 log_sql_register_item(s,p,'q', extract_ssl_keysize, "ssl_keysize", 0, 1);
103 log_sql_register_item(p,'Q', extract_ssl_maxkeysize, "ssl_maxkeysize", 0, 1); 92 log_sql_register_item(s,p,'Q', extract_ssl_maxkeysize, "ssl_maxkeysize", 0, 1);
104 log_sql_register_item(p,'z', extract_ssl_cipher, "ssl_cipher", 0, 1); 93 log_sql_register_item(s,p,'z', extract_ssl_cipher, "ssl_cipher", 0, 1);
94#if defined(WITH_APACHE20)
95 return OK;
96#endif
105} 97}
106 98
107/* The configuration array that sets up the hooks into the module. */ 99/* The configuration array that sets up the hooks into the module. */
108#if defined(WITH_APACHE20) 100#if defined(WITH_APACHE20)
109static void register_hooks(apr_pool_t *p) { 101static void register_hooks(apr_pool_t *p) {
110 ap_hook_pre_config(pre_config, NULL, NULL, APR_HOOK_REALLY_FIRST); 102 ap_hook_post_config(post_config, NULL, NULL, APR_HOOK_REALLY_FIRST);
111} 103}
112 104
113module AP_MODULE_DECLARE_DATA log_sql_module = { 105module AP_MODULE_DECLARE_DATA log_sql_ssl_module = {
114 STANDARD20_MODULE_STUFF, 106 STANDARD20_MODULE_STUFF,
115 NULL, /* create per-directory config structures */ 107 NULL, /* create per-directory config structures */
116 NULL, /* merge per-directory config structures */ 108 NULL, /* merge per-directory config structures */
@@ -127,7 +119,7 @@ module log_sql_ssl_module = {
127 NULL, /* merge per-dir config */ 119 NULL, /* merge per-dir config */
128 NULL, /* create server config */ 120 NULL, /* create server config */
129 NULL, /* merge server config */ 121 NULL, /* merge server config */
130 log_sql_cmds, /* config directive table */ 122 NULL, /* config directive table */
131 NULL, /* [9] content handlers */ 123 NULL, /* [9] content handlers */
132 NULL, /* [2] URI-to-filename translation */ 124 NULL, /* [2] URI-to-filename translation */
133 NULL, /* [5] check/validate user_id */ 125 NULL, /* [5] check/validate user_id */
@@ -135,11 +127,11 @@ module log_sql_ssl_module = {
135 NULL, /* [4] check access by host */ 127 NULL, /* [4] check access by host */
136 NULL, /* [7] MIME type checker/setter */ 128 NULL, /* [7] MIME type checker/setter */
137 NULL, /* [8] fixups */ 129 NULL, /* [8] fixups */
138 log_sql_transaction, /* [10] logger */ 130 NULL, /* [10] logger */
139 NULL /* [3] header parser */ 131 NULL /* [3] header parser */
140#if MODULE_MAGIC_NUMBER >= 19970728 /* 1.3-dev or later support these additionals... */ 132#if MODULE_MAGIC_NUMBER >= 19970728 /* 1.3-dev or later support these additionals... */
141 ,log_sql_child_init, /* child process initializer */ 133 ,NULL, /* child process initializer */
142 log_sql_child_exit, /* process exit/cleanup */ 134 NULL, /* process exit/cleanup */
143 NULL /* [1] post read-request */ 135 NULL /* [1] post read-request */
144#endif 136#endif
145 137