canl_mod_ssl-private.h
Go to the documentation of this file.
1
/*
2
Copyright (c) 2003-8, Andrew McNab, University of Manchester
3
All rights reserved.
4
5
Redistribution and use in source and binary forms, with or
6
without modification, are permitted provided that the following
7
conditions are met:
8
9
o Redistributions of source code must retain the above
10
copyright notice, this list of conditions and the following
11
disclaimer.
12
o Redistributions in binary form must reproduce the above
13
copyright notice, this list of conditions and the following
14
disclaimer in the documentation and/or other materials
15
provided with the distribution.
16
17
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND
18
CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
19
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
20
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS
22
BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
23
EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
24
TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
25
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
26
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
28
OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29
POSSIBILITY OF SUCH DAMAGE.
30
*/
31
32
/*
33
34
Portions of this code are derived from Apache mod_ssl, and are covered
35
by the Apache Software License:
36
37
* Copyright 2001-2004 The Apache Software Foundation
38
*
39
* Licensed under the Apache License, Version 2.0 (the "License");
40
* you may not use this file except in compliance with the License.
41
* You may obtain a copy of the License at
42
*
43
* http://www.apache.org/licenses/LICENSE-2.0
44
*
45
* Unless required by applicable law or agreed to in writing, software
46
* distributed under the License is distributed on an "AS IS" BASIS,
47
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
48
* See the License for the specific language governing permissions and
49
* limitations under the License.
50
*/
51
52
/*
53
This work has been partially funded by the EU Commission (contract
54
INFSO-RI-222667) under the EGEE-III collaboration.
55
*/
56
57
/*------------------------------------------------------------------*
58
* This program is part of GridSite: http://www.gridsite.org/ *
59
*------------------------------------------------------------------*/
60
61
62
/*
63
* After 2.0.49, Apache mod_ssl has most of the mod_ssl structures defined
64
* in ssl_private.h, which is not installed along with httpd-devel (eg in
65
* the FC2 RPM.) This include file provides SIMPLIFIED structures for use
66
* by mod_gridsite: for example, pointers to unused structures are replaced
67
* by void * and some of the structures are truncated when only the early
68
* members are used.
69
*
70
* CLEARLY, THIS WILL BREAK IF THERE ARE MAJOR CHANGES TO ssl_private.h!!!
71
*/
72
73
#include <openssl/ssl.h>
74
75
#ifndef BOOL
76
#define BOOL unsigned int
77
#endif
78
79
typedef
enum
{
80
SSL_SHUTDOWN_TYPE_UNSET
,
81
SSL_SHUTDOWN_TYPE_STANDARD
,
82
SSL_SHUTDOWN_TYPE_UNCLEAN
,
83
SSL_SHUTDOWN_TYPE_ACCURATE
84
}
ssl_shutdown_type_e
;
85
86
typedef
enum
{
87
SSL_ENABLED_UNSET
= -1,
88
SSL_ENABLED_FALSE
= 0,
89
SSL_ENABLED_TRUE
= 1,
90
SSL_ENABLED_OPTIONAL
= 3
91
}
ssl_enabled_t
;
92
93
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
94
typedef
enum
{
95
SSL_CVERIFY_UNSET
= -1,
96
SSL_CVERIFY_NONE
= 0,
97
SSL_CVERIFY_OPTIONAL
= 1,
98
SSL_CVERIFY_REQUIRE
= 2,
99
SSL_CVERIFY_OPTIONAL_NO_CA
= 3
100
}
ssl_verify_t
;
101
102
#endif
103
104
typedef
struct
{
105
SSL *
ssl
;
106
const
char
*
client_dn
;
107
X509 *
client_cert
;
108
ssl_shutdown_type_e
shutdown_type
;
109
const
char
*
verify_info
;
110
const
char
*
verify_error
;
111
int
verify_depth
;
112
int
is_proxy
;
113
int
disabled
;
114
int
non_ssl_request
;
115
}
SSLConnRec
;
116
117
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
118
typedef
struct
{
119
const
char
*
ca_cert_path
;
120
const
char
*
ca_cert_file
;
121
122
const
char
*
cipher_suite
;
123
124
int
verify_depth
;
125
ssl_verify_t
verify_mode
;
126
}
modssl_auth_ctx_t
;
127
#endif
128
129
typedef
struct
{
130
void
*
sc
;
/* pointer back to server config */
131
SSL_CTX *
ssl_ctx
;
132
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
133
void
*
pks
;
134
void
*
pkp
;
135
136
int
protocol
;
137
138
int
pphrase_dialog_type
;
139
const
char
*
pphrase_dialog_path
;
140
141
const
char
*
cert_chain
;
142
143
const
char
*
crl_path
;
144
const
char
*
crl_file
;
145
X509_STORE *
crl
;
146
147
modssl_auth_ctx_t
auth
;
148
#endif
149
}
modssl_ctx_t
;
150
151
/* original SSLSrvConfigRec */
152
typedef
struct
{
153
void
*
mc
;
154
BOOL
enabled
;
155
BOOL
proxy_enabled
;
156
const
char
*
vhost_id
;
157
int
vhost_id_len
;
158
int
session_cache_timeout
;
159
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
160
BOOL
cipher_server_pref
;
161
#endif
162
modssl_ctx_t
*
server
;
163
modssl_ctx_t
*
proxy
;
164
}
SSLSrvConfigRec
;
165
166
/* SSLSrvConfigRec after mod_ssl patch for CVE-2009-3555 */
167
typedef
struct
{
168
void
*
mc
;
169
unsigned
int
enabled
;
170
unsigned
int
proxy_enabled
;
171
const
char
*
vhost_id
;
172
int
vhost_id_len
;
173
int
session_cache_timeout
;
174
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
175
BOOL
cipher_server_pref
;
176
#endif
177
/* this is the member that was added */
178
int
insecure_reneg
;
179
modssl_ctx_t
*
server
;
180
modssl_ctx_t
*
proxy
;
181
}
SSLSrvConfigRec2
;
182
183
/* The server and proxy members of SSLSrvConfigRec must only be accessed
184
using these macros: */
185
#define SSLSrvConfigRec_server(sc) (mod_ssl_with_insecure_reneg ? (((SSLSrvConfigRec2 *) sc)->server) : (((SSLSrvConfigRec *) sc)->server))
186
#define SSLSrvConfigRec_proxy(sc) (mod_ssl_with_insecure_reneg ? (((SSLSrvConfigRec2 *) sc)->proxy) : (((SSLSrvConfigRec *) sc)->proxy))
187
188
#if AP_MODULE_MAGIC_AT_LEAST(20051115,0)
189
typedef
struct
{
190
BOOL
bSSLRequired
;
191
apr_array_header_t *
aRequirement
;
192
int
nOptions
;
193
int
nOptionsAdd
;
194
int
nOptionsDel
;
195
const
char
*
szCipherSuite
;
196
ssl_verify_t
nVerifyClient
;
197
int
nVerifyDepth
;
198
const
char
*
szCACertificatePath
;
199
const
char
*
szCACertificateFile
;
200
const
char
*
szUserName
;
201
}
SSLDirConfigRec
;
202
#endif
203
204
extern
module AP_MODULE_DECLARE_DATA
ssl_module
;
Generated on Fri Nov 1 2013 07:43:08 by
1.8.4