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