]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/blob - secure/lib/libcrypto/man/SSL_CTX_set_security_level.3
Regen manual pages.
[FreeBSD/FreeBSD.git] / secure / lib / libcrypto / man / SSL_CTX_set_security_level.3
1 .\" Automatically generated by Pod::Man 4.09 (Pod::Simple 3.35)
2 .\"
3 .\" Standard preamble:
4 .\" ========================================================================
5 .de Sp \" Vertical space (when we can't use .PP)
6 .if t .sp .5v
7 .if n .sp
8 ..
9 .de Vb \" Begin verbatim text
10 .ft CW
11 .nf
12 .ne \\$1
13 ..
14 .de Ve \" End verbatim text
15 .ft R
16 .fi
17 ..
18 .\" Set up some character translations and predefined strings.  \*(-- will
19 .\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left
20 .\" double quote, and \*(R" will give a right double quote.  \*(C+ will
21 .\" give a nicer C++.  Capital omega is used to do unbreakable dashes and
22 .\" therefore won't be available.  \*(C` and \*(C' expand to `' in nroff,
23 .\" nothing in troff, for use with C<>.
24 .tr \(*W-
25 .ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p'
26 .ie n \{\
27 .    ds -- \(*W-
28 .    ds PI pi
29 .    if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch
30 .    if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\"  diablo 12 pitch
31 .    ds L" ""
32 .    ds R" ""
33 .    ds C` ""
34 .    ds C' ""
35 'br\}
36 .el\{\
37 .    ds -- \|\(em\|
38 .    ds PI \(*p
39 .    ds L" ``
40 .    ds R" ''
41 .    ds C`
42 .    ds C'
43 'br\}
44 .\"
45 .\" Escape single quotes in literal strings from groff's Unicode transform.
46 .ie \n(.g .ds Aq \(aq
47 .el       .ds Aq '
48 .\"
49 .\" If the F register is >0, we'll generate index entries on stderr for
50 .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index
51 .\" entries marked with X<> in POD.  Of course, you'll have to process the
52 .\" output yourself in some meaningful fashion.
53 .\"
54 .\" Avoid warning from groff about undefined register 'F'.
55 .de IX
56 ..
57 .if !\nF .nr F 0
58 .if \nF>0 \{\
59 .    de IX
60 .    tm Index:\\$1\t\\n%\t"\\$2"
61 ..
62 .    if !\nF==2 \{\
63 .        nr % 0
64 .        nr F 2
65 .    \}
66 .\}
67 .\"
68 .\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2).
69 .\" Fear.  Run.  Save yourself.  No user-serviceable parts.
70 .    \" fudge factors for nroff and troff
71 .if n \{\
72 .    ds #H 0
73 .    ds #V .8m
74 .    ds #F .3m
75 .    ds #[ \f1
76 .    ds #] \fP
77 .\}
78 .if t \{\
79 .    ds #H ((1u-(\\\\n(.fu%2u))*.13m)
80 .    ds #V .6m
81 .    ds #F 0
82 .    ds #[ \&
83 .    ds #] \&
84 .\}
85 .    \" simple accents for nroff and troff
86 .if n \{\
87 .    ds ' \&
88 .    ds ` \&
89 .    ds ^ \&
90 .    ds , \&
91 .    ds ~ ~
92 .    ds /
93 .\}
94 .if t \{\
95 .    ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u"
96 .    ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u'
97 .    ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u'
98 .    ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u'
99 .    ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u'
100 .    ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u'
101 .\}
102 .    \" troff and (daisy-wheel) nroff accents
103 .ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V'
104 .ds 8 \h'\*(#H'\(*b\h'-\*(#H'
105 .ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#]
106 .ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H'
107 .ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u'
108 .ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#]
109 .ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#]
110 .ds ae a\h'-(\w'a'u*4/10)'e
111 .ds Ae A\h'-(\w'A'u*4/10)'E
112 .    \" corrections for vroff
113 .if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u'
114 .if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u'
115 .    \" for low resolution devices (crt and lpr)
116 .if \n(.H>23 .if \n(.V>19 \
117 \{\
118 .    ds : e
119 .    ds 8 ss
120 .    ds o a
121 .    ds d- d\h'-1'\(ga
122 .    ds D- D\h'-1'\(hy
123 .    ds th \o'bp'
124 .    ds Th \o'LP'
125 .    ds ae ae
126 .    ds Ae AE
127 .\}
128 .rm #[ #] #H #V #F C
129 .\" ========================================================================
130 .\"
131 .IX Title "SSL_CTX_SET_SECURITY_LEVEL 3"
132 .TH SSL_CTX_SET_SECURITY_LEVEL 3 "2018-09-11" "1.1.1" "OpenSSL"
133 .\" For nroff, turn off justification.  Always turn off hyphenation; it makes
134 .\" way too many mistakes in technical documents.
135 .if n .ad l
136 .nh
137 .SH "NAME"
138 SSL_CTX_set_security_level, SSL_set_security_level, SSL_CTX_get_security_level, SSL_get_security_level, SSL_CTX_set_security_callback, SSL_set_security_callback, SSL_CTX_get_security_callback, SSL_get_security_callback, SSL_CTX_set0_security_ex_data, SSL_set0_security_ex_data, SSL_CTX_get0_security_ex_data, SSL_get0_security_ex_data \- SSL/TLS security framework
139 .SH "SYNOPSIS"
140 .IX Header "SYNOPSIS"
141 .Vb 1
142 \& #include <openssl/ssl.h>
143 \&
144 \& void SSL_CTX_set_security_level(SSL_CTX *ctx, int level);
145 \& void SSL_set_security_level(SSL *s, int level);
146 \&
147 \& int SSL_CTX_get_security_level(const SSL_CTX *ctx);
148 \& int SSL_get_security_level(const SSL *s);
149 \&
150 \& void SSL_CTX_set_security_callback(SSL_CTX *ctx,
151 \&                                    int (*cb)(SSL *s, SSL_CTX *ctx, int op,
152 \&                                              int bits, int nid,
153 \&                                              void *other, void *ex));
154 \&
155 \& void SSL_set_security_callback(SSL *s, int (*cb)(SSL *s, SSL_CTX *ctx, int op,
156 \&                                                  int bits, int nid,
157 \&                                                  void *other, void *ex));
158 \&
159 \& int (*SSL_CTX_get_security_callback(const SSL_CTX *ctx))(SSL *s, SSL_CTX *ctx, int op,
160 \&                                                          int bits, int nid, void *other,
161 \&                                                          void *ex);
162 \& int (*SSL_get_security_callback(const SSL *s))(SSL *s, SSL_CTX *ctx, int op,
163 \&                                                int bits, int nid, void *other,
164 \&                                                void *ex);
165 \&
166 \& void SSL_CTX_set0_security_ex_data(SSL_CTX *ctx, void *ex);
167 \& void SSL_set0_security_ex_data(SSL *s, void *ex);
168 \&
169 \& void *SSL_CTX_get0_security_ex_data(const SSL_CTX *ctx);
170 \& void *SSL_get0_security_ex_data(const SSL *s);
171 .Ve
172 .SH "DESCRIPTION"
173 .IX Header "DESCRIPTION"
174 The functions \fISSL_CTX_set_security_level()\fR and \fISSL_set_security_level()\fR set
175 the security level to \fBlevel\fR. If not set the library default security level
176 is used.
177 .PP
178 The functions \fISSL_CTX_get_security_level()\fR and \fISSL_get_security_level()\fR
179 retrieve the current security level.
180 .PP
181 \&\fISSL_CTX_set_security_callback()\fR, \fISSL_set_security_callback()\fR,
182 \&\fISSL_CTX_get_security_callback()\fR and \fISSL_get_security_callback()\fR get or set
183 the security callback associated with \fBctx\fR or \fBs\fR. If not set a default
184 security callback is used. The meaning of the parameters and the behaviour
185 of the default callbacks is described below.
186 .PP
187 \&\fISSL_CTX_set0_security_ex_data()\fR, \fISSL_set0_security_ex_data()\fR,
188 \&\fISSL_CTX_get0_security_ex_data()\fR and \fISSL_get0_security_ex_data()\fR set the
189 extra data pointer passed to the \fBex\fR parameter of the callback. This
190 value is passed to the callback verbatim and can be set to any convenient
191 application specific value.
192 .SH "DEFAULT CALLBACK BEHAVIOUR"
193 .IX Header "DEFAULT CALLBACK BEHAVIOUR"
194 If an application doesn't set its own security callback the default
195 callback is used. It is intended to provide sane defaults. The meaning
196 of each level is described below.
197 .IP "\fBLevel 0\fR" 4
198 .IX Item "Level 0"
199 Everything is permitted. This retains compatibility with previous versions of
200 OpenSSL.
201 .IP "\fBLevel 1\fR" 4
202 .IX Item "Level 1"
203 The security level corresponds to a minimum of 80 bits of security. Any
204 parameters offering below 80 bits of security are excluded. As a result \s-1RSA,
205 DSA\s0 and \s-1DH\s0 keys shorter than 1024 bits and \s-1ECC\s0 keys shorter than 160 bits
206 are prohibited. All export cipher suites are prohibited since they all offer
207 less than 80 bits of security. \s-1SSL\s0 version 2 is prohibited. Any cipher suite
208 using \s-1MD5\s0 for the \s-1MAC\s0 is also prohibited.
209 .IP "\fBLevel 2\fR" 4
210 .IX Item "Level 2"
211 Security level set to 112 bits of security. As a result \s-1RSA, DSA\s0 and \s-1DH\s0 keys
212 shorter than 2048 bits and \s-1ECC\s0 keys shorter than 224 bits are prohibited.
213 In addition to the level 1 exclusions any cipher suite using \s-1RC4\s0 is also
214 prohibited. \s-1SSL\s0 version 3 is also not allowed. Compression is disabled.
215 .IP "\fBLevel 3\fR" 4
216 .IX Item "Level 3"
217 Security level set to 128 bits of security. As a result \s-1RSA, DSA\s0 and \s-1DH\s0 keys
218 shorter than 3072 bits and \s-1ECC\s0 keys shorter than 256 bits are prohibited.
219 In addition to the level 2 exclusions cipher suites not offering forward
220 secrecy are prohibited. \s-1TLS\s0 versions below 1.1 are not permitted. Session
221 tickets are disabled.
222 .IP "\fBLevel 4\fR" 4
223 .IX Item "Level 4"
224 Security level set to 192 bits of security. As a result \s-1RSA, DSA\s0 and
225 \&\s-1DH\s0 keys shorter than 7680 bits and \s-1ECC\s0 keys shorter than 384 bits are
226 prohibited.  Cipher suites using \s-1SHA1\s0 for the \s-1MAC\s0 are prohibited. \s-1TLS\s0
227 versions below 1.2 are not permitted.
228 .IP "\fBLevel 5\fR" 4
229 .IX Item "Level 5"
230 Security level set to 256 bits of security. As a result \s-1RSA, DSA\s0 and \s-1DH\s0 keys
231 shorter than 15360 bits and \s-1ECC\s0 keys shorter than 512 bits are prohibited.
232 .SH "APPLICATION DEFINED SECURITY CALLBACKS"
233 .IX Header "APPLICATION DEFINED SECURITY CALLBACKS"
234 \&\fIDocumentation to be provided.\fR
235 .SH "NOTES"
236 .IX Header "NOTES"
237 \&\fB\s-1WARNING\s0\fR at this time setting the security level higher than 1 for
238 general internet use is likely to cause \fBconsiderable\fR interoperability
239 issues and is not recommended. This is because the \fB\s-1SHA1\s0\fR algorithm
240 is very widely used in certificates and will be rejected at levels
241 higher than 1 because it only offers 80 bits of security.
242 .PP
243 The default security level can be configured when OpenSSL is compiled by
244 setting \fB\-DOPENSSL_TLS_SECURITY_LEVEL=level\fR. If not set then 1 is used.
245 .PP
246 The security framework disables or reject parameters inconsistent with the
247 set security level. In the past this was difficult as applications had to set
248 a number of distinct parameters (supported ciphers, supported curves supported
249 signature algorithms) to achieve this end and some cases (\s-1DH\s0 parameter size
250 for example) could not be checked at all.
251 .PP
252 By setting an appropriate security level much of this complexity can be
253 avoided.
254 .PP
255 The bits of security limits affect all relevant parameters including
256 cipher suite encryption algorithms, supported \s-1ECC\s0 curves, supported
257 signature algorithms, \s-1DH\s0 parameter sizes, certificate key sizes and
258 signature algorithms. This limit applies no matter what other custom
259 settings an application has set: so if the cipher suite is set to \fB\s-1ALL\s0\fR
260 then only cipher suites consistent with the security level are permissible.
261 .PP
262 See \s-1SP800\-57\s0 for how the security limits are related to individual
263 algorithms.
264 .PP
265 Some security levels require large key sizes for non-ECC public key
266 algorithms which can severely degrade performance. For example 256 bits
267 of security requires the use of \s-1RSA\s0 keys of at least 15360 bits in size.
268 .PP
269 Some restrictions can be gracefully handled: for example cipher suites
270 offering insufficient security are not sent by the client and will not
271 be selected by the server. Other restrictions such as the peer certificate
272 key size or the \s-1DH\s0 parameter size will abort the handshake with a fatal
273 alert.
274 .PP
275 Attempts to set certificates or parameters with insufficient security are
276 also blocked. For example trying to set a certificate using a 512 bit \s-1RSA\s0
277 key using \fISSL_CTX_use_certificate()\fR at level 1. Applications which do not
278 check the return values for errors will misbehave: for example it might
279 appear that a certificate is not set at all because it had been rejected.
280 .SH "RETURN VALUES"
281 .IX Header "RETURN VALUES"
282 \&\fISSL_CTX_set_security_level()\fR and \fISSL_set_security_level()\fR do not return values.
283 .PP
284 \&\fISSL_CTX_get_security_level()\fR and \fISSL_get_security_level()\fR return a integer that
285 represents the security level with \fB\s-1SSL_CTX\s0\fR or \fB\s-1SSL\s0\fR, respectively.
286 .PP
287 \&\fISSL_CTX_set_security_callback()\fR and \fISSL_set_security_callback()\fR do not return
288 values.
289 .PP
290 \&\fISSL_CTX_get_security_callback()\fR and \fISSL_get_security_callback()\fR return the pointer
291 to the security callback or \s-1NULL\s0 if the callback is not set.
292 .PP
293 \&\fISSL_CTX_get0_security_ex_data()\fR and \fISSL_get0_security_ex_data()\fR return the extra
294 data pointer or \s-1NULL\s0 if the ex data is not set.
295 .SH "HISTORY"
296 .IX Header "HISTORY"
297 These functions were first added to OpenSSL 1.1.0
298 .SH "COPYRIGHT"
299 .IX Header "COPYRIGHT"
300 Copyright 2014\-2018 The OpenSSL Project Authors. All Rights Reserved.
301 .PP
302 Licensed under the OpenSSL license (the \*(L"License\*(R").  You may not use
303 this file except in compliance with the License.  You can obtain a copy
304 in the file \s-1LICENSE\s0 in the source distribution or at
305 <https://www.openssl.org/source/license.html>.