update libressl to v2.7.4
[unleashed.git] / lib / libssl / man / SSL_CTX_set_max_cert_list.3
blob7714e1d10e9f5296b27ac04d34d238604ac2896c
1 .\"     $OpenBSD: SSL_CTX_set_max_cert_list.3,v 1.4 2018/03/22 21:09:18 schwarze Exp $
2 .\"     OpenSSL b97fdb57 Nov 11 09:33:09 2016 +0100
3 .\"
4 .\" This file was written by Lutz Jaenicke <jaenicke@openssl.org>.
5 .\" Copyright (c) 2001 The OpenSSL Project.  All rights reserved.
6 .\"
7 .\" Redistribution and use in source and binary forms, with or without
8 .\" modification, are permitted provided that the following conditions
9 .\" are met:
10 .\"
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\"    notice, this list of conditions and the following disclaimer.
13 .\"
14 .\" 2. Redistributions in binary form must reproduce the above copyright
15 .\"    notice, this list of conditions and the following disclaimer in
16 .\"    the documentation and/or other materials provided with the
17 .\"    distribution.
18 .\"
19 .\" 3. All advertising materials mentioning features or use of this
20 .\"    software must display the following acknowledgment:
21 .\"    "This product includes software developed by the OpenSSL Project
22 .\"    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
23 .\"
24 .\" 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
25 .\"    endorse or promote products derived from this software without
26 .\"    prior written permission. For written permission, please contact
27 .\"    openssl-core@openssl.org.
28 .\"
29 .\" 5. Products derived from this software may not be called "OpenSSL"
30 .\"    nor may "OpenSSL" appear in their names without prior written
31 .\"    permission of the OpenSSL Project.
32 .\"
33 .\" 6. Redistributions of any form whatsoever must retain the following
34 .\"    acknowledgment:
35 .\"    "This product includes software developed by the OpenSSL Project
36 .\"    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
37 .\"
38 .\" THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
39 .\" EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
40 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
41 .\" PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
42 .\" ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
43 .\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
44 .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
45 .\" LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
46 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
47 .\" STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 .\" ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
49 .\" OF THE POSSIBILITY OF SUCH DAMAGE.
50 .\"
51 .Dd $Mdocdate: March 22 2018 $
52 .Dt SSL_CTX_SET_MAX_CERT_LIST 3
53 .Os
54 .Sh NAME
55 .Nm SSL_CTX_set_max_cert_list ,
56 .Nm SSL_CTX_get_max_cert_list ,
57 .Nm SSL_set_max_cert_list ,
58 .Nm SSL_get_max_cert_list
59 .Nd manipulate allowed size for the peer's certificate chain
60 .Sh SYNOPSIS
61 .In openssl/ssl.h
62 .Ft long
63 .Fn SSL_CTX_set_max_cert_list "SSL_CTX *ctx" "long size"
64 .Ft long
65 .Fn SSL_CTX_get_max_cert_list "SSL_CTX *ctx"
66 .Ft long
67 .Fn SSL_set_max_cert_list "SSL *ssl" "long size"
68 .Ft long
69 .Fn SSL_get_max_cert_list "SSL *ctx"
70 .Sh DESCRIPTION
71 .Fn SSL_CTX_set_max_cert_list
72 sets the maximum size allowed for the peer's certificate chain for all
73 .Vt SSL
74 objects created from
75 .Fa ctx
76 to be
77 .Fa size
78 bytes.
79 The
80 .Vt SSL
81 objects inherit the setting valid for
82 .Fa ctx
83 at the time
84 .Xr SSL_new 3
85 is being called.
86 .Pp
87 .Fn SSL_CTX_get_max_cert_list
88 returns the currently set maximum size for
89 .Fa ctx .
90 .Pp
91 .Fn SSL_set_max_cert_list
92 sets the maximum size allowed for the peer's certificate chain for
93 .Fa ssl
94 to be
95 .Fa size
96 bytes.
97 This setting stays valid until a new value is set.
98 .Pp
99 .Fn SSL_get_max_cert_list
100 returns the currently set maximum size for
101 .Fa ssl .
102 .Sh NOTES
103 During the handshake process, the peer may send a certificate chain.
104 The TLS/SSL standard does not give any maximum size of the certificate chain.
105 The OpenSSL library handles incoming data by a dynamically allocated buffer.
106 In order to prevent this buffer from growing without bound due to data
107 received from a faulty or malicious peer, a maximum size for the certificate
108 chain is set.
110 The default value for the maximum certificate chain size is 100kB (30kB
111 on the 16bit DOS platform).
112 This should be sufficient for usual certificate chains
113 (OpenSSL's default maximum chain length is 10, see
114 .Xr SSL_CTX_set_verify 3 ,
115 and certificates without special extensions have a typical size of 1-2kB).
117 For special applications it can be necessary to extend the maximum certificate
118 chain size allowed to be sent by the peer.
119 See for example the work on
120 .%T "Internet X.509 Public Key Infrastructure Proxy Certificate Profile"
122 .%T "TLS Delegation Protocol"
124 .Lk https://www.ietf.org/
126 .Lk http://www.globus.org/ .
128 Under normal conditions it should never be necessary to set a value smaller
129 than the default, as the buffer is handled dynamically and only uses the
130 memory actually required by the data sent by the peer.
132 If the maximum certificate chain size allowed is exceeded, the handshake will
133 fail with a
134 .Dv SSL_R_EXCESSIVE_MESSAGE_SIZE
135 error.
136 .Sh RETURN VALUES
137 .Fn SSL_CTX_set_max_cert_list
139 .Fn SSL_set_max_cert_list
140 return the previously set value.
142 .Fn SSL_CTX_get_max_cert_list
144 .Fn SSL_get_max_cert_list
145 return the currently set value.
146 .Sh SEE ALSO
147 .Xr SSL_CTX_ctrl 3 ,
148 .Xr SSL_CTX_set_verify 3 ,
149 .Xr SSL_new 3
150 .Sh HISTORY
151 These functions first appeared in OpenSSL 0.9.7
152 and have been available since
153 .Ox 3.2 .