diff options
author | bentley <> | 2014-10-12 09:33:04 +0000 |
---|---|---|
committer | bentley <> | 2014-10-12 09:33:04 +0000 |
commit | 82b7f378b6907ab315a6e50322d2a0a8794a0aa9 (patch) | |
tree | a5087bf8d016a6041c2b6822fbecfd8f6c5e70b1 /src/lib/libssl/doc/SSL_CTX_set_options.3 | |
parent | 0a63f0cf49369e1926567ab62e04e3355cedf0cd (diff) | |
download | openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.gz openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.tar.bz2 openbsd-82b7f378b6907ab315a6e50322d2a0a8794a0aa9.zip |
Convert libssl manpages from pod to mdoc(7).
libcrypto has not been started yet.
ok schwarze@ miod@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_options.3')
-rw-r--r-- | src/lib/libssl/doc/SSL_CTX_set_options.3 | 384 |
1 files changed, 384 insertions, 0 deletions
diff --git a/src/lib/libssl/doc/SSL_CTX_set_options.3 b/src/lib/libssl/doc/SSL_CTX_set_options.3 new file mode 100644 index 0000000000..8b2f75cc59 --- /dev/null +++ b/src/lib/libssl/doc/SSL_CTX_set_options.3 | |||
@@ -0,0 +1,384 @@ | |||
1 | .Dd $Mdocdate: October 12 2014 $ | ||
2 | .Dt SSL_CTX_SET_OPTIONS 3 | ||
3 | .Os | ||
4 | .Sh NAME | ||
5 | .Nm SSL_CTX_set_options , | ||
6 | .Nm SSL_set_options , | ||
7 | .Nm SSL_CTX_clear_options , | ||
8 | .Nm SSL_clear_options , | ||
9 | .Nm SSL_CTX_get_options , | ||
10 | .Nm SSL_get_options , | ||
11 | .Nm SSL_get_secure_renegotiation_support | ||
12 | .Nd manipulate SSL options | ||
13 | .Sh SYNOPSIS | ||
14 | .In openssl/ssl.h | ||
15 | .Ft long | ||
16 | .Fn SSL_CTX_set_options "SSL_CTX *ctx" "long options" | ||
17 | .Ft long | ||
18 | .Fn SSL_set_options "SSL *ssl" "long options" | ||
19 | .Ft long | ||
20 | .Fn SSL_CTX_clear_options "SSL_CTX *ctx" "long options" | ||
21 | .Ft long | ||
22 | .Fn SSL_clear_options "SSL *ssl" "long options" | ||
23 | .Ft long | ||
24 | .Fn SSL_CTX_get_options "SSL_CTX *ctx" | ||
25 | .Ft long | ||
26 | .Fn SSL_get_options "SSL *ssl" | ||
27 | .Ft long | ||
28 | .Fn SSL_get_secure_renegotiation_support "SSL *ssl" | ||
29 | .Sh DESCRIPTION | ||
30 | Note: all these functions are implemented using macros. | ||
31 | .Pp | ||
32 | .Fn SSL_CTX_set_options | ||
33 | adds the options set via bitmask in | ||
34 | .Fa options | ||
35 | to | ||
36 | .Fa ctx . | ||
37 | Options already set before are not cleared! | ||
38 | .Pp | ||
39 | .Fn SSL_set_options | ||
40 | adds the options set via bitmask in | ||
41 | .Fa options | ||
42 | to | ||
43 | .Fa ssl . | ||
44 | Options already set before are not cleared! | ||
45 | .Pp | ||
46 | .Fn SSL_CTX_clear_options | ||
47 | clears the options set via bitmask in | ||
48 | .Fa options | ||
49 | to | ||
50 | .Fa ctx . | ||
51 | .Pp | ||
52 | .Fn SSL_clear_options | ||
53 | clears the options set via bitmask in | ||
54 | .Fa options | ||
55 | to | ||
56 | .Fa ssl . | ||
57 | .Pp | ||
58 | .Fn SSL_CTX_get_options | ||
59 | returns the options set for | ||
60 | .Fa ctx . | ||
61 | .Pp | ||
62 | .Fn SSL_get_options | ||
63 | returns the options set for | ||
64 | .Fa ssl . | ||
65 | .Pp | ||
66 | .Fn SSL_get_secure_renegotiation_support | ||
67 | indicates whether the peer supports secure renegotiation. | ||
68 | .Sh NOTES | ||
69 | The behaviour of the SSL library can be changed by setting several options. | ||
70 | The options are coded as bitmasks and can be combined by a bitwise OR | ||
71 | operation (|). | ||
72 | .Pp | ||
73 | .Fn SSL_CTX_set_options | ||
74 | and | ||
75 | .Fn SSL_set_options | ||
76 | affect the (external) protocol behaviour of the SSL library. | ||
77 | The (internal) behaviour of the API can be changed by using the similar | ||
78 | .Xr SSL_CTX_set_mode 3 | ||
79 | and | ||
80 | .Xr SSL_set_mode 3 | ||
81 | functions. | ||
82 | .Pp | ||
83 | During a handshake, the option settings of the SSL object are used. | ||
84 | When a new SSL object is created from a context using | ||
85 | .Xr SSL_new 3 , | ||
86 | the current option setting is copied. | ||
87 | Changes to | ||
88 | .Fa ctx | ||
89 | do not affect already created | ||
90 | .Vt SSL | ||
91 | objects. | ||
92 | .Fn SSL_clear | ||
93 | does not affect the settings. | ||
94 | .Pp | ||
95 | The following | ||
96 | .Em bug workaround | ||
97 | options are available: | ||
98 | .Bl -tag -width Ds | ||
99 | .It Dv SSL_OP_MICROSOFT_SESS_ID_BUG | ||
100 | .Lk www.microsoft.com | ||
101 | \(en when talking SSLv2, if session-id reuse is performed, | ||
102 | the session-id passed back in the server-finished message is different from the | ||
103 | one decided upon. | ||
104 | .It Dv SSL_OP_NETSCAPE_CHALLENGE_BUG | ||
105 | Netscape-Commerce/1.12, when talking SSLv2, accepts a 32 byte challenge but | ||
106 | then appears to only use 16 bytes when generating the encryption keys. | ||
107 | Using 16 bytes is ok but it should be ok to use 32. | ||
108 | According to the SSLv3 spec, one should use 32 bytes for the challenge when | ||
109 | operating in SSLv2/v3 compatibility mode, but as mentioned above, this breaks | ||
110 | this server so 16 bytes is the way to go. | ||
111 | .It Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG | ||
112 | As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect. | ||
113 | .It Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG | ||
114 | \&... | ||
115 | .It Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER | ||
116 | \&... | ||
117 | .It Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG | ||
118 | Don't prefer ECDHE-ECDSA ciphers when the client appears to be Safari on OS X. | ||
119 | OS X 10.8..10.8.3 has broken support for ECDHE-ECDSA ciphers. | ||
120 | .It Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG | ||
121 | \&... | ||
122 | .It Dv SSL_OP_TLS_D5_BUG | ||
123 | \&... | ||
124 | .It Dv SSL_OP_TLS_BLOCK_PADDING_BUG | ||
125 | \&... | ||
126 | .It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
127 | Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability | ||
128 | affecting CBC ciphers, which cannot be handled by some broken SSL | ||
129 | implementations. | ||
130 | This option has no effect for connections using other ciphers. | ||
131 | .It Dv SSL_OP_TLSEXT_PADDING | ||
132 | Adds a padding extension to ensure the ClientHello size is never between 256 | ||
133 | and 511 bytes in length. | ||
134 | This is needed as a workaround for some implementations. | ||
135 | .It Dv SSL_OP_ALL | ||
136 | All of the above bug workarounds. | ||
137 | .El | ||
138 | .Pp | ||
139 | It is usually safe to use | ||
140 | .Dv SSL_OP_ALL | ||
141 | to enable the bug workaround options if compatibility with somewhat broken | ||
142 | implementations is desired. | ||
143 | .Pp | ||
144 | The following | ||
145 | .Em modifying | ||
146 | options are available: | ||
147 | .Bl -tag -width Ds | ||
148 | .It Dv SSL_OP_TLS_ROLLBACK_BUG | ||
149 | Disable version rollback attack detection. | ||
150 | .Pp | ||
151 | During the client key exchange, the client must send the same information | ||
152 | about acceptable SSL/TLS protocol levels as during the first hello. | ||
153 | Some clients violate this rule by adapting to the server's answer. | ||
154 | (Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1, | ||
155 | the server only understands up to SSLv3. | ||
156 | In this case the client must still use the same SSLv3.1=TLSv1 announcement. | ||
157 | Some clients step down to SSLv3 with respect to the server's answer and violate | ||
158 | the version rollback protection.) | ||
159 | .It Dv SSL_OP_SINGLE_DH_USE | ||
160 | Always create a new key when using temporary/ephemeral DH parameters | ||
161 | (see | ||
162 | .Xr SSL_CTX_set_tmp_dh_callback 3 ) . | ||
163 | This option must be used to prevent small subgroup attacks, when the DH | ||
164 | parameters were not generated using | ||
165 | .Dq strong | ||
166 | primes (e.g., when using DSA-parameters, see | ||
167 | .Xr dhparam 1 ) . | ||
168 | If | ||
169 | .Dq strong | ||
170 | primes were used, it is not strictly necessary to generate a new DH key during | ||
171 | each handshake but it is also recommended. | ||
172 | .Dv SSL_OP_SINGLE_DH_USE | ||
173 | should therefore be enabled whenever temporary/ephemeral DH parameters are used. | ||
174 | .It SSL_OP_EPHEMERAL_RSA | ||
175 | Always use ephemeral (temporary) RSA key when doing RSA operations (see | ||
176 | .Xr SSL_CTX_set_tmp_rsa_callback 3 ) . | ||
177 | According to the specifications, this is only done when a RSA key can only be | ||
178 | used for signature operations (namely under export ciphers with restricted RSA | ||
179 | keylength). | ||
180 | By setting this option, ephemeral RSA keys are always used. | ||
181 | This option breaks compatibility with the SSL/TLS specifications and may lead | ||
182 | to interoperability problems with clients and should therefore never be used. | ||
183 | Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead. | ||
184 | .It Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
185 | When choosing a cipher, use the server's preferences instead of the client | ||
186 | preferences. | ||
187 | When not set, the SSL server will always follow the client's preferences. | ||
188 | When set, the SSLv3/TLSv1 server will choose following its own preferences. | ||
189 | Because of the different protocol, for SSLv2 the server will send its list of | ||
190 | preferences to the client and the client chooses. | ||
191 | .It Dv SSL_OP_NETSCAPE_CA_DN_BUG | ||
192 | If we accept a netscape connection, demand a client cert, have a | ||
193 | non-self-signed CA which does not have its CA in netscape, and the browser has | ||
194 | a cert, it will crash/hang. | ||
195 | Works for 3.x and 4.xbeta | ||
196 | .It Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG | ||
197 | \&... | ||
198 | .It Dv SSL_OP_NO_SSLv2 | ||
199 | As of | ||
200 | .Ox 5.6 , | ||
201 | this option has no effect as SSLv2 support has been removed. | ||
202 | In previous versions it disabled use of the SSLv2 protocol. | ||
203 | .It Dv SSL_OP_NO_SSLv3 | ||
204 | Do not use the SSLv3 protocol. | ||
205 | .It Dv SSL_OP_NO_TLSv1 | ||
206 | Do not use the TLSv1.0 protocol. | ||
207 | .It Dv SSL_OP_NO_TLSv1_1 | ||
208 | Do not use the TLSv1.1 protocol. | ||
209 | .It Dv SSL_OP_NO_TLSv1_2 | ||
210 | Do not use the TLSv1.2 protocol. | ||
211 | .It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
212 | When performing renegotiation as a server, always start a new session (i.e., | ||
213 | session resumption requests are only accepted in the initial handshake). | ||
214 | This option is not needed for clients. | ||
215 | .It Dv SSL_OP_NO_TICKET | ||
216 | Normally clients and servers will, where possible, transparently make use of | ||
217 | RFC4507bis tickets for stateless session resumption. | ||
218 | .Pp | ||
219 | If this option is set this functionality is disabled and tickets will not be | ||
220 | used by clients or servers. | ||
221 | .It Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
222 | As of | ||
223 | .Ox 5.6 , | ||
224 | this option has no effect. | ||
225 | In previous versions it allowed legacy insecure renegotiation between OpenSSL | ||
226 | and unpatched clients or servers. | ||
227 | See the | ||
228 | .Sx SECURE RENEGOTIATION | ||
229 | section for more details. | ||
230 | .It Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
231 | Allow legacy insecure renegotiation between OpenSSL and unpatched servers | ||
232 | .Em only : | ||
233 | this option is currently set by default. | ||
234 | See the | ||
235 | .Sx SECURE RENEGOTIATION | ||
236 | section for more details. | ||
237 | .El | ||
238 | .Sh SECURE RENEGOTIATION | ||
239 | OpenSSL 0.9.8m and later always attempts to use secure renegotiation as | ||
240 | described in RFC5746. | ||
241 | This counters the prefix attack described in CVE-2009-3555 and elsewhere. | ||
242 | .Pp | ||
243 | The deprecated and highly broken SSLv2 protocol does not support renegotiation | ||
244 | at all; its use is | ||
245 | .Em strongly | ||
246 | discouraged. | ||
247 | .Pp | ||
248 | This attack has far-reaching consequences which application writers should be | ||
249 | aware of. | ||
250 | In the description below an implementation supporting secure renegotiation is | ||
251 | referred to as | ||
252 | .Dq patched . | ||
253 | A server not supporting secure | ||
254 | renegotiation is referred to as | ||
255 | .Dq unpatched . | ||
256 | .Pp | ||
257 | The following sections describe the operations permitted by OpenSSL's secure | ||
258 | renegotiation implementation. | ||
259 | .Ss Patched client and server | ||
260 | Connections and renegotiation are always permitted by OpenSSL implementations. | ||
261 | .Ss Unpatched client and patched OpenSSL server | ||
262 | The initial connection succeeds but client renegotiation is denied by the | ||
263 | server with a | ||
264 | .Em no_renegotiation | ||
265 | warning alert if TLS v1.0 is used or a fatal | ||
266 | .Em handshake_failure | ||
267 | alert in SSL v3.0. | ||
268 | .Pp | ||
269 | If the patched OpenSSL server attempts to renegotiate a fatal | ||
270 | .Em handshake_failure | ||
271 | alert is sent. | ||
272 | This is because the server code may be unaware of the unpatched nature of the | ||
273 | client. | ||
274 | .Pp | ||
275 | .Em N.B.: | ||
276 | a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will | ||
277 | result in the connection hanging if it receives a | ||
278 | .Em no_renegotiation | ||
279 | alert. | ||
280 | OpenSSL versions 0.9.8m and later will regard a | ||
281 | .Em no_renegotiation | ||
282 | alert as fatal and respond with a fatal | ||
283 | .Em handshake_failure | ||
284 | alert. | ||
285 | This is because the OpenSSL API currently has no provision to indicate to an | ||
286 | application that a renegotiation attempt was refused. | ||
287 | .Ss Patched OpenSSL client and unpatched server | ||
288 | If the option | ||
289 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
290 | is set then initial connections and renegotiation between patched OpenSSL | ||
291 | clients and unpatched servers succeeds. | ||
292 | If neither option is set then initial connections to unpatched servers will | ||
293 | fail. | ||
294 | .Pp | ||
295 | The option | ||
296 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
297 | is currently set by default even though it has security implications: | ||
298 | otherwise it would be impossible to connect to unpatched servers (i.e., all of | ||
299 | them initially) and this is clearly not acceptable. | ||
300 | Renegotiation is permitted because this does not add any additional security | ||
301 | issues: during an attack clients do not see any renegotiations anyway. | ||
302 | .Pp | ||
303 | As more servers become patched the option | ||
304 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
305 | will | ||
306 | .Em not | ||
307 | be set by default in a future version of OpenSSL. | ||
308 | .Pp | ||
309 | OpenSSL client applications wishing to ensure they can connect to unpatched | ||
310 | servers should always | ||
311 | .Em set | ||
312 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
313 | .Pp | ||
314 | OpenSSL client applications that want to ensure they can | ||
315 | .Em not | ||
316 | connect to unpatched servers (and thus avoid any security issues) should always | ||
317 | .Em clear | ||
318 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
319 | using | ||
320 | .Fn SSL_CTX_clear_options | ||
321 | or | ||
322 | .Fn SSL_clear_options . | ||
323 | .Sh RETURN VALUES | ||
324 | .Fn SSL_CTX_set_options | ||
325 | and | ||
326 | .Fn SSL_set_options | ||
327 | return the new options bitmask after adding | ||
328 | .Fa options . | ||
329 | .Pp | ||
330 | .Fn SSL_CTX_clear_options | ||
331 | and | ||
332 | .Fn SSL_clear_options | ||
333 | return the new options bitmask after clearing | ||
334 | .Fa options . | ||
335 | .Pp | ||
336 | .Fn SSL_CTX_get_options | ||
337 | and | ||
338 | .Fn SSL_get_options | ||
339 | return the current bitmask. | ||
340 | .Pp | ||
341 | .Fn SSL_get_secure_renegotiation_support | ||
342 | returns 1 is the peer supports secure renegotiation and 0 if it does not. | ||
343 | .Sh SEE ALSO | ||
344 | .Xr dhparam 1 , | ||
345 | .Xr ssl 3 , | ||
346 | .Xr SSL_clear 3 , | ||
347 | .Xr SSL_CTX_set_tmp_dh_callback 3 , | ||
348 | .Xr SSL_CTX_set_tmp_rsa_callback 3 , | ||
349 | .Xr SSL_new 3 | ||
350 | .Sh HISTORY | ||
351 | .Dv SSL_OP_CIPHER_SERVER_PREFERENCE | ||
352 | and | ||
353 | .Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION | ||
354 | have been added in | ||
355 | OpenSSL 0.9.7. | ||
356 | .Pp | ||
357 | .Dv SSL_OP_TLS_ROLLBACK_BUG | ||
358 | has been added in OpenSSL 0.9.6 and was automatically enabled with | ||
359 | .Dv SSL_OP_ALL . | ||
360 | As of 0.9.7, it is no longer included in | ||
361 | .Dv SSL_OP_ALL | ||
362 | and must be explicitly set. | ||
363 | .Pp | ||
364 | .Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS | ||
365 | has been added in OpenSSL 0.9.6e. | ||
366 | Versions up to OpenSSL 0.9.6c do not include the countermeasure that can be | ||
367 | disabled with this option (in OpenSSL 0.9.6d, it was always enabled). | ||
368 | .Pp | ||
369 | .Fn SSL_CTX_clear_options | ||
370 | and | ||
371 | .Fn SSL_clear_options | ||
372 | were first added in OpenSSL 0.9.8m. | ||
373 | .Pp | ||
374 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION , | ||
375 | .Dv SSL_OP_LEGACY_SERVER_CONNECT | ||
376 | and the function | ||
377 | .Fn SSL_get_secure_renegotiation_support | ||
378 | were first added in OpenSSL 0.9.8m. | ||
379 | .Pp | ||
380 | .Dv SSL_OP_NO_SSLv2 | ||
381 | and | ||
382 | .Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION | ||
383 | were changed to have no effect in | ||
384 | .Ox 5.6 . | ||