source: mod_gnutls/src/mod_gnutls.c @ dcf1118

debian/masterdebian/stretch-backportsjessie-backportsmsvaupstream
Last change on this file since dcf1118 was b072204, checked in by Nokis Mavrogiannopoulos <nmav@…>, 12 years ago

corrected SRP enable flag, and corrected the DBM hook support. It now free data needed by some DBM providers.

  • Property mode set to 100644
File size: 6.0 KB
Line 
1/**
2 *  Copyright 2004-2005 Paul Querna
3 *
4 *  Licensed under the Apache License, Version 2.0 (the "License");
5 *  you may not use this file except in compliance with the License.
6 *  You may obtain a copy of the License at
7 *
8 *      http://www.apache.org/licenses/LICENSE-2.0
9 *
10 *  Unless required by applicable law or agreed to in writing, software
11 *  distributed under the License is distributed on an "AS IS" BASIS,
12 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 *  See the License for the specific language governing permissions and
14 *  limitations under the License.
15 *
16 */
17
18#include "mod_gnutls.h"
19
20static void gnutls_hooks(apr_pool_t * p)
21{
22    ap_hook_pre_connection(mgs_hook_pre_connection, NULL, NULL,
23                           APR_HOOK_MIDDLE);
24    ap_hook_post_config(mgs_hook_post_config, NULL, NULL,
25                        APR_HOOK_MIDDLE);
26    ap_hook_child_init(mgs_hook_child_init, NULL, NULL,
27                       APR_HOOK_MIDDLE);
28#if USING_2_1_RECENT
29    ap_hook_http_scheme(mgs_hook_http_scheme, NULL, NULL,
30                        APR_HOOK_MIDDLE);
31#else
32    ap_hook_http_method(mgs_hook_http_scheme, NULL, NULL,
33                        APR_HOOK_MIDDLE);
34#endif
35    ap_hook_default_port(mgs_hook_default_port, NULL, NULL,
36                         APR_HOOK_MIDDLE);
37    ap_hook_pre_config(mgs_hook_pre_config, NULL, NULL,
38                       APR_HOOK_MIDDLE);
39   
40    ap_hook_access_checker(mgs_hook_authz, NULL, NULL, APR_HOOK_REALLY_FIRST);
41   
42    ap_hook_fixups(mgs_hook_fixups, NULL, NULL, APR_HOOK_REALLY_FIRST);
43   
44    /* TODO: HTTP Upgrade Filter */
45    /* ap_register_output_filter ("UPGRADE_FILTER",
46     *          ssl_io_filter_Upgrade, NULL, AP_FTYPE_PROTOCOL + 5);
47     */
48
49    ap_register_input_filter(GNUTLS_INPUT_FILTER_NAME,
50                             mgs_filter_input, NULL,
51                             AP_FTYPE_CONNECTION + 5);
52    ap_register_output_filter(GNUTLS_OUTPUT_FILTER_NAME,
53                              mgs_filter_output, NULL,
54                              AP_FTYPE_CONNECTION + 5);
55}
56
57static const command_rec mgs_config_cmds[] = {
58    AP_INIT_TAKE1("GnuTLSClientVerify", mgs_set_client_verify,
59                  NULL,
60                  RSRC_CONF|OR_AUTHCFG,
61                  "Set Verification Requirements of the Client Certificate"),
62    AP_INIT_TAKE1("GnuTLSClientCAFile", mgs_set_client_ca_file,
63                  NULL,
64                  RSRC_CONF,
65                  "Set the CA File to verify Client Certificates"),
66    AP_INIT_TAKE1("GnuTLSX509CAFile", mgs_set_client_ca_file,
67                  NULL,
68                  RSRC_CONF,
69                  "Set the CA File to verify Client Certificates"),
70    AP_INIT_TAKE1("GnuTLSPGPKeyringFile", mgs_set_keyring_file,
71                  NULL,
72                  RSRC_CONF,
73                  "Set the Keyring File to verify Client Certificates"),
74    AP_INIT_TAKE1("GnuTLSDHFile", mgs_set_dh_file,
75                  NULL,
76                  RSRC_CONF,
77                  "Set the file to read Diffie Hellman parameters from"),
78    AP_INIT_TAKE1("GnuTLSRSAFile", mgs_set_rsa_export_file,
79                  NULL,
80                  RSRC_CONF,
81                  "Set the file to read RSA-EXPORT parameters from"),
82    AP_INIT_TAKE1("GnuTLSCertificateFile", mgs_set_cert_file,
83                  NULL,
84                  RSRC_CONF,
85                  "SSL Server X509 Certificate file"),
86    AP_INIT_TAKE1("GnuTLSKeyFile", mgs_set_key_file,
87                  NULL,
88                  RSRC_CONF,
89                  "SSL Server X509 Private Key file"),
90    AP_INIT_TAKE1("GnuTLSX509CertificateFile", mgs_set_cert_file,
91                  NULL,
92                  RSRC_CONF,
93                  "SSL Server X509 Certificate file"),
94    AP_INIT_TAKE1("GnuTLSX509KeyFile", mgs_set_key_file,
95                  NULL,
96                  RSRC_CONF,
97                  "SSL Server X509 Private Key file"),
98    AP_INIT_TAKE1("GnuTLSPGPCertificateFile", mgs_set_pgpcert_file,
99                  NULL,
100                  RSRC_CONF,
101                  "SSL Server PGP Certificate file"),
102    AP_INIT_TAKE1("GnuTLSPGPKeyFile", mgs_set_pgpkey_file,
103                  NULL,
104                  RSRC_CONF,
105                  "SSL Server PGP Private key file"),
106#ifdef ENABLE_SRP
107    AP_INIT_TAKE1("GnuTLSSRPPasswdFile", mgs_set_srp_tpasswd_file,
108                  NULL,
109                  RSRC_CONF,
110                  "SSL Server SRP Password Conf file"),
111    AP_INIT_TAKE1("GnuTLSSRPPasswdConfFile", mgs_set_srp_tpasswd_conf_file,
112                  NULL,
113                  RSRC_CONF,
114                  "SSL Server SRP Parameters file"),
115#endif
116    AP_INIT_TAKE1("GnuTLSCacheTimeout", mgs_set_cache_timeout,
117                  NULL,
118                  RSRC_CONF,
119                  "Cache Timeout"),
120    AP_INIT_TAKE2("GnuTLSCache", mgs_set_cache,
121                  NULL,
122                  RSRC_CONF,
123                  "Cache Configuration"),
124    AP_INIT_RAW_ARGS("GnuTLSPriorities", mgs_set_priorities,
125                  NULL,
126                  RSRC_CONF,
127                  "The priorities to enable (ciphers, Key exchange, macs, compression)."),
128    AP_INIT_TAKE1("GnuTLSEnable", mgs_set_enabled,
129                  NULL,
130                  RSRC_CONF,
131                  "Whether this server has GnuTLS Enabled. Default: Off"),
132    AP_INIT_TAKE1("GnuTLSExportCertificates", mgs_set_export_certificates_enabled,
133                  NULL,
134                  RSRC_CONF,
135                  "Whether to export PEM encoded certificates to CGIs. Default: Off"),
136#if 0
137    AP_INIT_RAW_ARGS("<GnuTLSRequire", mgs_set_require_section,
138                  NULL,
139                  EXEC_ON_READ|OR_ALL,
140                  "Whether this server has GnuTLS Enabled. Default: Off"),
141    AP_INIT_RAW_ARGS("GnuTLSRequireByteCode", mgs_set_require_bytecode,
142                     NULL,
143                     OR_ALL,
144                     "Internal Command for reading Lua Bytecode."),
145#endif
146    {NULL}
147};
148
149module AP_MODULE_DECLARE_DATA gnutls_module = {
150    STANDARD20_MODULE_STUFF,
151    mgs_config_dir_create,
152    mgs_config_dir_merge,
153    mgs_config_server_create,
154    NULL,
155    mgs_config_cmds,
156    gnutls_hooks
157};
Note: See TracBrowser for help on using the repository browser.