summaryrefslogtreecommitdiff
path: root/src/lib/libssl/doc/SSL_CTX_set_options.3
diff options
context:
space:
mode:
authorschwarze <>2016-11-05 15:32:20 +0000
committerschwarze <>2016-11-05 15:32:20 +0000
commit5af30545c000c195ca6e44f207da004e5780ddb5 (patch)
tree1672f1234352c29443fcacb44e22f1b20f174d99 /src/lib/libssl/doc/SSL_CTX_set_options.3
parentba7c6bac5d2c870a4d1c1ce9f08db5e57c660625 (diff)
downloadopenbsd-5af30545c000c195ca6e44f207da004e5780ddb5.tar.gz
openbsd-5af30545c000c195ca6e44f207da004e5780ddb5.tar.bz2
openbsd-5af30545c000c195ca6e44f207da004e5780ddb5.zip
move manual pages from doc/ to man/ for consistency with other
libraries, in particular considering that there are unrelated files in doc/; requested by jsing@ and beck@
Diffstat (limited to 'src/lib/libssl/doc/SSL_CTX_set_options.3')
-rw-r--r--src/lib/libssl/doc/SSL_CTX_set_options.3395
1 files changed, 0 insertions, 395 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 852553e97f..0000000000
--- a/src/lib/libssl/doc/SSL_CTX_set_options.3
+++ /dev/null
@@ -1,395 +0,0 @@
1.\"
2.\" $OpenBSD: SSL_CTX_set_options.3,v 1.10 2015/07/18 19:41:54 doug Exp $
3.\"
4.Dd $Mdocdate: July 18 2015 $
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
103As of
104.Ox 5.8 ,
105this option has no effect.
106.It Dv SSL_OP_NETSCAPE_CHALLENGE_BUG
107As of
108.Ox 5.8 ,
109this option has no effect.
110.It Dv SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG
111As of OpenSSL 0.9.8q and 1.0.0c, this option has no effect.
112.It Dv SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG
113As of
114.Ox 5.8 ,
115this option has no effect.
116.It Dv SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER
117As of
118.Ox 5.8 ,
119this option has no effect.
120.It Dv SSL_OP_SAFARI_ECDHE_ECDSA_BUG
121As of
122.Ox 5.8 ,
123this option has no effect.
124.It Dv SSL_OP_SSLEAY_080_CLIENT_DH_BUG
125As of
126.Ox 5.8 ,
127this option has no effect.
128.It Dv SSL_OP_TLS_D5_BUG
129As of
130.Ox 5.8 ,
131this option has no effect.
132.It Dv SSL_OP_TLS_BLOCK_PADDING_BUG
133As of
134.Ox 5.8 ,
135this option has no effect.
136.It Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
137Disables a countermeasure against a SSL 3.0/TLS 1.0 protocol vulnerability
138affecting CBC ciphers, which cannot be handled by some broken SSL
139implementations.
140This option has no effect for connections using other ciphers.
141.It Dv SSL_OP_TLSEXT_PADDING
142Adds a padding extension to ensure the ClientHello size is never between 256
143and 511 bytes in length.
144This is needed as a workaround for some implementations.
145.It Dv SSL_OP_ALL
146All of the above bug workarounds.
147.El
148.Pp
149It is usually safe to use
150.Dv SSL_OP_ALL
151to enable the bug workaround options if compatibility with somewhat broken
152implementations is desired.
153.Pp
154The following
155.Em modifying
156options are available:
157.Bl -tag -width Ds
158.It Dv SSL_OP_TLS_ROLLBACK_BUG
159Disable version rollback attack detection.
160.Pp
161During the client key exchange, the client must send the same information
162about acceptable SSL/TLS protocol levels as during the first hello.
163Some clients violate this rule by adapting to the server's answer.
164(Example: the client sends a SSLv2 hello and accepts up to SSLv3.1=TLSv1,
165the server only understands up to SSLv3.
166In this case the client must still use the same SSLv3.1=TLSv1 announcement.
167Some clients step down to SSLv3 with respect to the server's answer and violate
168the version rollback protection.)
169.It Dv SSL_OP_SINGLE_DH_USE
170Always create a new key when using temporary/ephemeral DH parameters
171(see
172.Xr SSL_CTX_set_tmp_dh_callback 3 ) .
173This option must be used to prevent small subgroup attacks, when the DH
174parameters were not generated using
175.Dq strong
176primes (e.g., when using DSA-parameters, see
177.Xr openssl 1 ) .
178If
179.Dq strong
180primes were used, it is not strictly necessary to generate a new DH key during
181each handshake but it is also recommended.
182.Dv SSL_OP_SINGLE_DH_USE
183should therefore be enabled whenever temporary/ephemeral DH parameters are used.
184.It SSL_OP_EPHEMERAL_RSA
185Always use ephemeral (temporary) RSA key when doing RSA operations (see
186.Xr SSL_CTX_set_tmp_rsa_callback 3 ) .
187According to the specifications, this is only done when a RSA key can only be
188used for signature operations (namely under export ciphers with restricted RSA
189keylength).
190By setting this option, ephemeral RSA keys are always used.
191This option breaks compatibility with the SSL/TLS specifications and may lead
192to interoperability problems with clients and should therefore never be used.
193Ciphers with EDH (ephemeral Diffie-Hellman) key exchange should be used instead.
194.It Dv SSL_OP_CIPHER_SERVER_PREFERENCE
195When choosing a cipher, use the server's preferences instead of the client
196preferences.
197When not set, the SSL server will always follow the client's preferences.
198When set, the SSLv3/TLSv1 server will choose following its own preferences.
199Because of the different protocol, for SSLv2 the server will send its list of
200preferences to the client and the client chooses.
201.It Dv SSL_OP_NETSCAPE_CA_DN_BUG
202As of
203.Ox 5.8 ,
204this option has no effect.
205.It Dv SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG
206As of
207.Ox 5.8 ,
208this option has no effect.
209.It Dv SSL_OP_NO_SSLv2
210As of
211.Ox 5.6 ,
212this option has no effect as SSLv2 support has been removed.
213In previous versions it disabled use of the SSLv2 protocol.
214.It Dv SSL_OP_NO_SSLv3
215Do not use the SSLv3 protocol.
216.It Dv SSL_OP_NO_TLSv1
217Do not use the TLSv1.0 protocol.
218.It Dv SSL_OP_NO_TLSv1_1
219Do not use the TLSv1.1 protocol.
220.It Dv SSL_OP_NO_TLSv1_2
221Do not use the TLSv1.2 protocol.
222.It Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
223When performing renegotiation as a server, always start a new session (i.e.,
224session resumption requests are only accepted in the initial handshake).
225This option is not needed for clients.
226.It Dv SSL_OP_NO_TICKET
227Normally clients and servers will, where possible, transparently make use of
228RFC4507bis tickets for stateless session resumption.
229.Pp
230If this option is set this functionality is disabled and tickets will not be
231used by clients or servers.
232.It Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
233As of
234.Ox 5.6 ,
235this option has no effect.
236In previous versions it allowed legacy insecure renegotiation between OpenSSL
237and unpatched clients or servers.
238See the
239.Sx SECURE RENEGOTIATION
240section for more details.
241.It Dv SSL_OP_LEGACY_SERVER_CONNECT
242Allow legacy insecure renegotiation between OpenSSL and unpatched servers
243.Em only :
244this option is currently set by default.
245See the
246.Sx SECURE RENEGOTIATION
247section for more details.
248.El
249.Sh SECURE RENEGOTIATION
250OpenSSL 0.9.8m and later always attempts to use secure renegotiation as
251described in RFC5746.
252This counters the prefix attack described in CVE-2009-3555 and elsewhere.
253.Pp
254The deprecated and highly broken SSLv2 protocol does not support renegotiation
255at all; its use is
256.Em strongly
257discouraged.
258.Pp
259This attack has far-reaching consequences which application writers should be
260aware of.
261In the description below an implementation supporting secure renegotiation is
262referred to as
263.Dq patched .
264A server not supporting secure
265renegotiation is referred to as
266.Dq unpatched .
267.Pp
268The following sections describe the operations permitted by OpenSSL's secure
269renegotiation implementation.
270.Ss Patched client and server
271Connections and renegotiation are always permitted by OpenSSL implementations.
272.Ss Unpatched client and patched OpenSSL server
273The initial connection succeeds but client renegotiation is denied by the
274server with a
275.Em no_renegotiation
276warning alert if TLS v1.0 is used or a fatal
277.Em handshake_failure
278alert in SSL v3.0.
279.Pp
280If the patched OpenSSL server attempts to renegotiate a fatal
281.Em handshake_failure
282alert is sent.
283This is because the server code may be unaware of the unpatched nature of the
284client.
285.Pp
286.Em N.B.:
287a bug in OpenSSL clients earlier than 0.9.8m (all of which are unpatched) will
288result in the connection hanging if it receives a
289.Em no_renegotiation
290alert.
291OpenSSL versions 0.9.8m and later will regard a
292.Em no_renegotiation
293alert as fatal and respond with a fatal
294.Em handshake_failure
295alert.
296This is because the OpenSSL API currently has no provision to indicate to an
297application that a renegotiation attempt was refused.
298.Ss Patched OpenSSL client and unpatched server
299If the option
300.Dv SSL_OP_LEGACY_SERVER_CONNECT
301is set then initial connections and renegotiation between patched OpenSSL
302clients and unpatched servers succeeds.
303If neither option is set then initial connections to unpatched servers will
304fail.
305.Pp
306The option
307.Dv SSL_OP_LEGACY_SERVER_CONNECT
308is currently set by default even though it has security implications:
309otherwise it would be impossible to connect to unpatched servers (i.e., all of
310them initially) and this is clearly not acceptable.
311Renegotiation is permitted because this does not add any additional security
312issues: during an attack clients do not see any renegotiations anyway.
313.Pp
314As more servers become patched the option
315.Dv SSL_OP_LEGACY_SERVER_CONNECT
316will
317.Em not
318be set by default in a future version of OpenSSL.
319.Pp
320OpenSSL client applications wishing to ensure they can connect to unpatched
321servers should always
322.Em set
323.Dv SSL_OP_LEGACY_SERVER_CONNECT
324.Pp
325OpenSSL client applications that want to ensure they can
326.Em not
327connect to unpatched servers (and thus avoid any security issues) should always
328.Em clear
329.Dv SSL_OP_LEGACY_SERVER_CONNECT
330using
331.Fn SSL_CTX_clear_options
332or
333.Fn SSL_clear_options .
334.Sh RETURN VALUES
335.Fn SSL_CTX_set_options
336and
337.Fn SSL_set_options
338return the new options bitmask after adding
339.Fa options .
340.Pp
341.Fn SSL_CTX_clear_options
342and
343.Fn SSL_clear_options
344return the new options bitmask after clearing
345.Fa options .
346.Pp
347.Fn SSL_CTX_get_options
348and
349.Fn SSL_get_options
350return the current bitmask.
351.Pp
352.Fn SSL_get_secure_renegotiation_support
353returns 1 is the peer supports secure renegotiation and 0 if it does not.
354.Sh SEE ALSO
355.Xr openssl 1 ,
356.Xr ssl 3 ,
357.Xr SSL_clear 3 ,
358.Xr SSL_CTX_set_tmp_dh_callback 3 ,
359.Xr SSL_CTX_set_tmp_rsa_callback 3 ,
360.Xr SSL_new 3
361.Sh HISTORY
362.Dv SSL_OP_CIPHER_SERVER_PREFERENCE
363and
364.Dv SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION
365have been added in
366OpenSSL 0.9.7.
367.Pp
368.Dv SSL_OP_TLS_ROLLBACK_BUG
369has been added in OpenSSL 0.9.6 and was automatically enabled with
370.Dv SSL_OP_ALL .
371As of 0.9.7, it is no longer included in
372.Dv SSL_OP_ALL
373and must be explicitly set.
374.Pp
375.Dv SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS
376has been added in OpenSSL 0.9.6e.
377Versions up to OpenSSL 0.9.6c do not include the countermeasure that can be
378disabled with this option (in OpenSSL 0.9.6d, it was always enabled).
379.Pp
380.Fn SSL_CTX_clear_options
381and
382.Fn SSL_clear_options
383were first added in OpenSSL 0.9.8m.
384.Pp
385.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION ,
386.Dv SSL_OP_LEGACY_SERVER_CONNECT
387and the function
388.Fn SSL_get_secure_renegotiation_support
389were first added in OpenSSL 0.9.8m.
390.Pp
391.Dv SSL_OP_NO_SSLv2
392and
393.Dv SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION
394were changed to have no effect in
395.Ox 5.6 .