aboutsummaryrefslogtreecommitdiffstats
path: root/include/mod_gnutls.h.in
diff options
context:
space:
mode:
Diffstat (limited to 'include/mod_gnutls.h.in')
-rw-r--r--include/mod_gnutls.h.in75
1 files changed, 49 insertions, 26 deletions
diff --git a/include/mod_gnutls.h.in b/include/mod_gnutls.h.in
index 61b0198..b5a84c0 100644
--- a/include/mod_gnutls.h.in
+++ b/include/mod_gnutls.h.in
@@ -62,17 +62,17 @@ module AP_MODULE_DECLARE_DATA gnutls_module;
62 62
63typedef enum 63typedef enum
64{ 64{
65 mod_gnutls_cache_none, 65 mgs_cache_none,
66 mod_gnutls_cache_dbm, 66 mgs_cache_dbm,
67#if HAVE_APR_MEMCACHE 67#if HAVE_APR_MEMCACHE
68 mod_gnutls_cache_memcache 68 mgs_cache_memcache
69#endif 69#endif
70} mod_gnutls_cache_e; 70} mgs_cache_e;
71 71
72typedef struct 72typedef struct
73{ 73{
74 int client_verify_mode; 74 int client_verify_mode;
75} mod_gnutls_dirconf_rec; 75} mgs_dirconf_rec;
76 76
77typedef struct 77typedef struct
78{ 78{
@@ -88,21 +88,21 @@ typedef struct
88 int compression[16]; 88 int compression[16];
89 int cert_types[16]; 89 int cert_types[16];
90 apr_time_t cache_timeout; 90 apr_time_t cache_timeout;
91 mod_gnutls_cache_e cache_type; 91 mgs_cache_e cache_type;
92 const char* cache_config; 92 const char* cache_config;
93 const char* rsa_params_file; 93 const char* rsa_params_file;
94 const char* dh_params_file; 94 const char* dh_params_file;
95 int client_verify_mode; 95 int client_verify_mode;
96} mod_gnutls_srvconf_rec; 96} mgs_srvconf_rec;
97 97
98typedef struct { 98typedef struct {
99 int length; 99 int length;
100 char *value; 100 char *value;
101} mod_gnutls_char_buffer_t; 101} mgs_char_buffer_t;
102 102
103typedef struct 103typedef struct
104{ 104{
105 mod_gnutls_srvconf_rec *sc; 105 mgs_srvconf_rec *sc;
106 conn_rec* c; 106 conn_rec* c;
107 gnutls_session_t session; 107 gnutls_session_t session;
108 108
@@ -111,7 +111,7 @@ typedef struct
111 apr_bucket_brigade *input_bb; 111 apr_bucket_brigade *input_bb;
112 apr_read_type_e input_block; 112 apr_read_type_e input_block;
113 ap_input_mode_t input_mode; 113 ap_input_mode_t input_mode;
114 mod_gnutls_char_buffer_t input_cbuf; 114 mgs_char_buffer_t input_cbuf;
115 char input_buffer[AP_IOBUFSIZE]; 115 char input_buffer[AP_IOBUFSIZE];
116 116
117 apr_status_t output_rc; 117 apr_status_t output_rc;
@@ -123,12 +123,12 @@ typedef struct
123 123
124 int status; 124 int status;
125 int non_https; 125 int non_https;
126} mod_gnutls_handle_t; 126} mgs_handle_t;
127 127
128/** Functions in gnutls_io.c **/ 128/** Functions in gnutls_io.c **/
129 129
130/** 130/**
131 * mod_gnutls_filter_input will filter the input data 131 * mgs_filter_input will filter the input data
132 * by decrypting it using GnuTLS and passes it cleartext. 132 * by decrypting it using GnuTLS and passes it cleartext.
133 * 133 *
134 * @param f the filter info record 134 * @param f the filter info record
@@ -137,26 +137,26 @@ typedef struct
137 * @param block a block index we shall read from? 137 * @param block a block index we shall read from?
138 * @return result status 138 * @return result status
139 */ 139 */
140apr_status_t mod_gnutls_filter_input(ap_filter_t * f, 140apr_status_t mgs_filter_input(ap_filter_t * f,
141 apr_bucket_brigade * bb, 141 apr_bucket_brigade * bb,
142 ap_input_mode_t mode, 142 ap_input_mode_t mode,
143 apr_read_type_e block, 143 apr_read_type_e block,
144 apr_off_t readbytes); 144 apr_off_t readbytes);
145 145
146/** 146/**
147 * mod_gnutls_filter_output will filter the encrypt 147 * mgs_filter_output will filter the encrypt
148 * the incoming bucket using GnuTLS and passes it onto the next filter. 148 * the incoming bucket using GnuTLS and passes it onto the next filter.
149 * 149 *
150 * @param f the filter info record 150 * @param f the filter info record
151 * @param bb the bucket brigade, where to store the result to 151 * @param bb the bucket brigade, where to store the result to
152 * @return result status 152 * @return result status
153 */ 153 */
154apr_status_t mod_gnutls_filter_output(ap_filter_t * f, 154apr_status_t mgs_filter_output(ap_filter_t * f,
155 apr_bucket_brigade * bb); 155 apr_bucket_brigade * bb);
156 156
157 157
158/** 158/**
159 * mod_gnutls_transport_read is called from GnuTLS to provide encrypted 159 * mgs_transport_read is called from GnuTLS to provide encrypted
160 * data from the client. 160 * data from the client.
161 * 161 *
162 * @param ptr pointer to the filter context 162 * @param ptr pointer to the filter context
@@ -164,11 +164,11 @@ apr_status_t mod_gnutls_filter_output(ap_filter_t * f,
164 * @param len maximum size 164 * @param len maximum size
165 * @return size length of the data stored in buffer 165 * @return size length of the data stored in buffer
166 */ 166 */
167ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr, 167ssize_t mgs_transport_read(gnutls_transport_ptr_t ptr,
168 void *buffer, size_t len); 168 void *buffer, size_t len);
169 169
170/** 170/**
171 * mod_gnutls_transport_write is called from GnuTLS to 171 * mgs_transport_write is called from GnuTLS to
172 * write data to the client. 172 * write data to the client.
173 * 173 *
174 * @param ptr pointer to the filter context 174 * @param ptr pointer to the filter context
@@ -176,28 +176,28 @@ ssize_t mod_gnutls_transport_read(gnutls_transport_ptr_t ptr,
176 * @param len size of the buffer 176 * @param len size of the buffer
177 * @return size length of the data written 177 * @return size length of the data written
178 */ 178 */
179ssize_t mod_gnutls_transport_write(gnutls_transport_ptr_t ptr, 179ssize_t mgs_transport_write(gnutls_transport_ptr_t ptr,
180 const void *buffer, size_t len); 180 const void *buffer, size_t len);
181 181
182 182
183int mod_gnutls_rehandshake(mod_gnutls_handle_t * ctxt); 183int mgs_rehandshake(mgs_handle_t * ctxt);
184 184
185 185
186 186
187/** 187/**
188 * Init the Cache after Configuration is done 188 * Init the Cache after Configuration is done
189 */ 189 */
190int mod_gnutls_cache_post_config(apr_pool_t *p, server_rec *s, 190int mgs_cache_post_config(apr_pool_t *p, server_rec *s,
191 mod_gnutls_srvconf_rec *sc); 191 mgs_srvconf_rec *sc);
192/** 192/**
193 * Init the Cache inside each Process 193 * Init the Cache inside each Process
194 */ 194 */
195int mod_gnutls_cache_child_init(apr_pool_t *p, server_rec *s, 195int mgs_cache_child_init(apr_pool_t *p, server_rec *s,
196 mod_gnutls_srvconf_rec *sc); 196 mgs_srvconf_rec *sc);
197/** 197/**
198 * Setup the Session Caching 198 * Setup the Session Caching
199 */ 199 */
200int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt); 200int mgs_cache_session_init(mgs_handle_t *ctxt);
201 201
202#define GNUTLS_SESSION_ID_STRING_LEN \ 202#define GNUTLS_SESSION_ID_STRING_LEN \
203 ((GNUTLS_MAX_SESSION_ID + 1) * 2) 203 ((GNUTLS_MAX_SESSION_ID + 1) * 2)
@@ -209,9 +209,10 @@ int mod_gnutls_cache_session_init(mod_gnutls_handle_t *ctxt);
209 * @param str Location to store the Hex Encoded String 209 * @param str Location to store the Hex Encoded String
210 * @param strsize The Maximum Length that can be stored in str 210 * @param strsize The Maximum Length that can be stored in str
211 */ 211 */
212char *mod_gnutls_session_id2sz(unsigned char *id, int idlen, 212char *mgs_session_id2sz(unsigned char *id, int idlen,
213 char *str, int strsize); 213 char *str, int strsize);
214 214
215
215/* Configuration Functions */ 216/* Configuration Functions */
216 217
217const char *mgs_set_cert_file(cmd_parms * parms, void *dummy, 218const char *mgs_set_cert_file(cmd_parms * parms, void *dummy,
@@ -239,4 +240,26 @@ void *mgs_config_server_create(apr_pool_t * p, server_rec * s);
239 240
240void *mgs_config_dir_create(apr_pool_t *p, char *dir); 241void *mgs_config_dir_create(apr_pool_t *p, char *dir);
241 242
243
244/* mod_gnutls Hooks. */
245
246int mgs_hook_pre_config(apr_pool_t * pconf,
247 apr_pool_t * plog, apr_pool_t * ptemp);
248
249int mgs_hook_post_config(apr_pool_t * p, apr_pool_t * plog,
250 apr_pool_t * ptemp,
251 server_rec * base_server);
252
253void mgs_hook_child_init(apr_pool_t *p, server_rec *s);
254
255const char *mgs_hook_http_scheme(const request_rec * r);
256
257apr_port_t mgs_hook_default_port(const request_rec * r);
258
259int mgs_hook_pre_connection(conn_rec * c, void *csd);
260
261int mgs_hook_fixups(request_rec *r);
262
263int mgs_hook_authz(request_rec *r);
264
242#endif /* __mod_gnutls_h_inc */ 265#endif /* __mod_gnutls_h_inc */