xref: /minix3/crypto/external/bsd/openssl/dist/ssl/ssl.h (revision 0a6a1f1d05b60e214de2f05a7310ddd1f0e590e7)
1ebfedea0SLionel Sambuc /* ssl/ssl.h */
2ebfedea0SLionel Sambuc /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3ebfedea0SLionel Sambuc  * All rights reserved.
4ebfedea0SLionel Sambuc  *
5ebfedea0SLionel Sambuc  * This package is an SSL implementation written
6ebfedea0SLionel Sambuc  * by Eric Young (eay@cryptsoft.com).
7ebfedea0SLionel Sambuc  * The implementation was written so as to conform with Netscapes SSL.
8ebfedea0SLionel Sambuc  *
9ebfedea0SLionel Sambuc  * This library is free for commercial and non-commercial use as long as
10ebfedea0SLionel Sambuc  * the following conditions are aheared to.  The following conditions
11ebfedea0SLionel Sambuc  * apply to all code found in this distribution, be it the RC4, RSA,
12ebfedea0SLionel Sambuc  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
13ebfedea0SLionel Sambuc  * included with this distribution is covered by the same copyright terms
14ebfedea0SLionel Sambuc  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
15ebfedea0SLionel Sambuc  *
16ebfedea0SLionel Sambuc  * Copyright remains Eric Young's, and as such any Copyright notices in
17ebfedea0SLionel Sambuc  * the code are not to be removed.
18ebfedea0SLionel Sambuc  * If this package is used in a product, Eric Young should be given attribution
19ebfedea0SLionel Sambuc  * as the author of the parts of the library used.
20ebfedea0SLionel Sambuc  * This can be in the form of a textual message at program startup or
21ebfedea0SLionel Sambuc  * in documentation (online or textual) provided with the package.
22ebfedea0SLionel Sambuc  *
23ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
24ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
25ebfedea0SLionel Sambuc  * are met:
26ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the copyright
27ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
28ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
29ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in the
30ebfedea0SLionel Sambuc  *    documentation and/or other materials provided with the distribution.
31ebfedea0SLionel Sambuc  * 3. All advertising materials mentioning features or use of this software
32ebfedea0SLionel Sambuc  *    must display the following acknowledgement:
33ebfedea0SLionel Sambuc  *    "This product includes cryptographic software written by
34ebfedea0SLionel Sambuc  *     Eric Young (eay@cryptsoft.com)"
35ebfedea0SLionel Sambuc  *    The word 'cryptographic' can be left out if the rouines from the library
36ebfedea0SLionel Sambuc  *    being used are not cryptographic related :-).
37ebfedea0SLionel Sambuc  * 4. If you include any Windows specific code (or a derivative thereof) from
38ebfedea0SLionel Sambuc  *    the apps directory (application code) you must include an acknowledgement:
39ebfedea0SLionel Sambuc  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
40ebfedea0SLionel Sambuc  *
41ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
42ebfedea0SLionel Sambuc  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
43ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
44ebfedea0SLionel Sambuc  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
45ebfedea0SLionel Sambuc  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
46ebfedea0SLionel Sambuc  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
47ebfedea0SLionel Sambuc  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
48ebfedea0SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
49ebfedea0SLionel Sambuc  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
50ebfedea0SLionel Sambuc  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
51ebfedea0SLionel Sambuc  * SUCH DAMAGE.
52ebfedea0SLionel Sambuc  *
53ebfedea0SLionel Sambuc  * The licence and distribution terms for any publically available version or
54ebfedea0SLionel Sambuc  * derivative of this code cannot be changed.  i.e. this code cannot simply be
55ebfedea0SLionel Sambuc  * copied and put under another distribution licence
56ebfedea0SLionel Sambuc  * [including the GNU Public Licence.]
57ebfedea0SLionel Sambuc  */
58ebfedea0SLionel Sambuc /* ====================================================================
59ebfedea0SLionel Sambuc  * Copyright (c) 1998-2007 The OpenSSL Project.  All rights reserved.
60ebfedea0SLionel Sambuc  *
61ebfedea0SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
62ebfedea0SLionel Sambuc  * modification, are permitted provided that the following conditions
63ebfedea0SLionel Sambuc  * are met:
64ebfedea0SLionel Sambuc  *
65ebfedea0SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright
66ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer.
67ebfedea0SLionel Sambuc  *
68ebfedea0SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright
69ebfedea0SLionel Sambuc  *    notice, this list of conditions and the following disclaimer in
70ebfedea0SLionel Sambuc  *    the documentation and/or other materials provided with the
71ebfedea0SLionel Sambuc  *    distribution.
72ebfedea0SLionel Sambuc  *
73ebfedea0SLionel Sambuc  * 3. All advertising materials mentioning features or use of this
74ebfedea0SLionel Sambuc  *    software must display the following acknowledgment:
75ebfedea0SLionel Sambuc  *    "This product includes software developed by the OpenSSL Project
76ebfedea0SLionel Sambuc  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
77ebfedea0SLionel Sambuc  *
78ebfedea0SLionel Sambuc  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
79ebfedea0SLionel Sambuc  *    endorse or promote products derived from this software without
80ebfedea0SLionel Sambuc  *    prior written permission. For written permission, please contact
81ebfedea0SLionel Sambuc  *    openssl-core@openssl.org.
82ebfedea0SLionel Sambuc  *
83ebfedea0SLionel Sambuc  * 5. Products derived from this software may not be called "OpenSSL"
84ebfedea0SLionel Sambuc  *    nor may "OpenSSL" appear in their names without prior written
85ebfedea0SLionel Sambuc  *    permission of the OpenSSL Project.
86ebfedea0SLionel Sambuc  *
87ebfedea0SLionel Sambuc  * 6. Redistributions of any form whatsoever must retain the following
88ebfedea0SLionel Sambuc  *    acknowledgment:
89ebfedea0SLionel Sambuc  *    "This product includes software developed by the OpenSSL Project
90ebfedea0SLionel Sambuc  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
91ebfedea0SLionel Sambuc  *
92ebfedea0SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
93ebfedea0SLionel Sambuc  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
94ebfedea0SLionel Sambuc  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
95ebfedea0SLionel Sambuc  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
96ebfedea0SLionel Sambuc  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
97ebfedea0SLionel Sambuc  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
98ebfedea0SLionel Sambuc  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
99ebfedea0SLionel Sambuc  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
100ebfedea0SLionel Sambuc  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
101ebfedea0SLionel Sambuc  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
102ebfedea0SLionel Sambuc  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
103ebfedea0SLionel Sambuc  * OF THE POSSIBILITY OF SUCH DAMAGE.
104ebfedea0SLionel Sambuc  * ====================================================================
105ebfedea0SLionel Sambuc  *
106ebfedea0SLionel Sambuc  * This product includes cryptographic software written by Eric Young
107ebfedea0SLionel Sambuc  * (eay@cryptsoft.com).  This product includes software written by Tim
108ebfedea0SLionel Sambuc  * Hudson (tjh@cryptsoft.com).
109ebfedea0SLionel Sambuc  *
110ebfedea0SLionel Sambuc  */
111ebfedea0SLionel Sambuc /* ====================================================================
112ebfedea0SLionel Sambuc  * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
113ebfedea0SLionel Sambuc  * ECC cipher suite support in OpenSSL originally developed by
114ebfedea0SLionel Sambuc  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
115ebfedea0SLionel Sambuc  */
116ebfedea0SLionel Sambuc /* ====================================================================
117ebfedea0SLionel Sambuc  * Copyright 2005 Nokia. All rights reserved.
118ebfedea0SLionel Sambuc  *
119ebfedea0SLionel Sambuc  * The portions of the attached software ("Contribution") is developed by
120ebfedea0SLionel Sambuc  * Nokia Corporation and is licensed pursuant to the OpenSSL open source
121ebfedea0SLionel Sambuc  * license.
122ebfedea0SLionel Sambuc  *
123ebfedea0SLionel Sambuc  * The Contribution, originally written by Mika Kousa and Pasi Eronen of
124ebfedea0SLionel Sambuc  * Nokia Corporation, consists of the "PSK" (Pre-Shared Key) ciphersuites
125ebfedea0SLionel Sambuc  * support (see RFC 4279) to OpenSSL.
126ebfedea0SLionel Sambuc  *
127ebfedea0SLionel Sambuc  * No patent licenses or other rights except those expressly stated in
128ebfedea0SLionel Sambuc  * the OpenSSL open source license shall be deemed granted or received
129ebfedea0SLionel Sambuc  * expressly, by implication, estoppel, or otherwise.
130ebfedea0SLionel Sambuc  *
131ebfedea0SLionel Sambuc  * No assurances are provided by Nokia that the Contribution does not
132ebfedea0SLionel Sambuc  * infringe the patent or other intellectual property rights of any third
133ebfedea0SLionel Sambuc  * party or that the license provides you with all the necessary rights
134ebfedea0SLionel Sambuc  * to make use of the Contribution.
135ebfedea0SLionel Sambuc  *
136ebfedea0SLionel Sambuc  * THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. IN
137ebfedea0SLionel Sambuc  * ADDITION TO THE DISCLAIMERS INCLUDED IN THE LICENSE, NOKIA
138ebfedea0SLionel Sambuc  * SPECIFICALLY DISCLAIMS ANY LIABILITY FOR CLAIMS BROUGHT BY YOU OR ANY
139ebfedea0SLionel Sambuc  * OTHER ENTITY BASED ON INFRINGEMENT OF INTELLECTUAL PROPERTY RIGHTS OR
140ebfedea0SLionel Sambuc  * OTHERWISE.
141ebfedea0SLionel Sambuc  */
142ebfedea0SLionel Sambuc 
143ebfedea0SLionel Sambuc #ifndef HEADER_SSL_H
144ebfedea0SLionel Sambuc # define HEADER_SSL_H
145ebfedea0SLionel Sambuc 
146ebfedea0SLionel Sambuc # include <openssl/e_os2.h>
147ebfedea0SLionel Sambuc 
148ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_COMP
149ebfedea0SLionel Sambuc #  include <openssl/comp.h>
150ebfedea0SLionel Sambuc # endif
151ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO
152ebfedea0SLionel Sambuc #  include <openssl/bio.h>
153ebfedea0SLionel Sambuc # endif
154ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_DEPRECATED
155ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_X509
156ebfedea0SLionel Sambuc #   include <openssl/x509.h>
157ebfedea0SLionel Sambuc #  endif
158ebfedea0SLionel Sambuc #  include <openssl/crypto.h>
159ebfedea0SLionel Sambuc #  include <openssl/lhash.h>
160ebfedea0SLionel Sambuc #  include <openssl/buffer.h>
161ebfedea0SLionel Sambuc # endif
162ebfedea0SLionel Sambuc # include <openssl/pem.h>
163ebfedea0SLionel Sambuc # include <openssl/hmac.h>
164ebfedea0SLionel Sambuc 
165ebfedea0SLionel Sambuc # include <openssl/kssl.h>
166ebfedea0SLionel Sambuc # include <openssl/safestack.h>
167ebfedea0SLionel Sambuc # include <openssl/symhacks.h>
168ebfedea0SLionel Sambuc 
169ebfedea0SLionel Sambuc #ifdef  __cplusplus
170ebfedea0SLionel Sambuc extern "C" {
171ebfedea0SLionel Sambuc #endif
172ebfedea0SLionel Sambuc 
173ebfedea0SLionel Sambuc /* SSLeay version number for ASN.1 encoding of the session information */
174*0a6a1f1dSLionel Sambuc /*-
175*0a6a1f1dSLionel Sambuc  * Version 0 - initial version
176ebfedea0SLionel Sambuc  * Version 1 - added the optional peer certificate
177ebfedea0SLionel Sambuc  */
178ebfedea0SLionel Sambuc # define SSL_SESSION_ASN1_VERSION 0x0001
179ebfedea0SLionel Sambuc 
180ebfedea0SLionel Sambuc /* text strings for the ciphers */
181ebfedea0SLionel Sambuc # define SSL_TXT_NULL_WITH_MD5           SSL2_TXT_NULL_WITH_MD5
182ebfedea0SLionel Sambuc # define SSL_TXT_RC4_128_WITH_MD5        SSL2_TXT_RC4_128_WITH_MD5
183ebfedea0SLionel Sambuc # define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
184ebfedea0SLionel Sambuc # define SSL_TXT_RC2_128_CBC_WITH_MD5    SSL2_TXT_RC2_128_CBC_WITH_MD5
185ebfedea0SLionel Sambuc # define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
186ebfedea0SLionel Sambuc # define SSL_TXT_IDEA_128_CBC_WITH_MD5   SSL2_TXT_IDEA_128_CBC_WITH_MD5
187ebfedea0SLionel Sambuc # define SSL_TXT_DES_64_CBC_WITH_MD5     SSL2_TXT_DES_64_CBC_WITH_MD5
188ebfedea0SLionel Sambuc # define SSL_TXT_DES_64_CBC_WITH_SHA     SSL2_TXT_DES_64_CBC_WITH_SHA
189ebfedea0SLionel Sambuc # define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
190ebfedea0SLionel Sambuc # define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
191ebfedea0SLionel Sambuc 
192*0a6a1f1dSLionel Sambuc /*
193*0a6a1f1dSLionel Sambuc  * VRS Additional Kerberos5 entries
194ebfedea0SLionel Sambuc  */
195ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA
196ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
197ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC4_128_SHA      SSL3_TXT_KRB5_RC4_128_SHA
198ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA
199ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5
200ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
201ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC4_128_MD5      SSL3_TXT_KRB5_RC4_128_MD5
202ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
203ebfedea0SLionel Sambuc 
204ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA
205ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC2_40_CBC_SHA   SSL3_TXT_KRB5_RC2_40_CBC_SHA
206ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC4_40_SHA       SSL3_TXT_KRB5_RC4_40_SHA
207ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5
208ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC2_40_CBC_MD5   SSL3_TXT_KRB5_RC2_40_CBC_MD5
209ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_RC4_40_MD5       SSL3_TXT_KRB5_RC4_40_MD5
210ebfedea0SLionel Sambuc 
211ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA
212ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5
213ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA
214ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5
215ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
216ebfedea0SLionel Sambuc # define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
217ebfedea0SLionel Sambuc # define SSL_MAX_KRB5_PRINCIPAL_LENGTH  256
218ebfedea0SLionel Sambuc 
219ebfedea0SLionel Sambuc # define SSL_MAX_SSL_SESSION_ID_LENGTH           32
220ebfedea0SLionel Sambuc # define SSL_MAX_SID_CTX_LENGTH                  32
221ebfedea0SLionel Sambuc 
222ebfedea0SLionel Sambuc # define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES     (512/8)
223ebfedea0SLionel Sambuc # define SSL_MAX_KEY_ARG_LENGTH                  8
224ebfedea0SLionel Sambuc # define SSL_MAX_MASTER_KEY_LENGTH               48
225ebfedea0SLionel Sambuc 
226ebfedea0SLionel Sambuc /* These are used to specify which ciphers to use and not to use */
227ebfedea0SLionel Sambuc 
228ebfedea0SLionel Sambuc # define SSL_TXT_EXP40           "EXPORT40"
229ebfedea0SLionel Sambuc # define SSL_TXT_EXP56           "EXPORT56"
230ebfedea0SLionel Sambuc # define SSL_TXT_LOW             "LOW"
231ebfedea0SLionel Sambuc # define SSL_TXT_MEDIUM          "MEDIUM"
232ebfedea0SLionel Sambuc # define SSL_TXT_HIGH            "HIGH"
233ebfedea0SLionel Sambuc # define SSL_TXT_FIPS            "FIPS"
234ebfedea0SLionel Sambuc 
235ebfedea0SLionel Sambuc # define SSL_TXT_kFZA            "kFZA"/* unused! */
236ebfedea0SLionel Sambuc # define SSL_TXT_aFZA            "aFZA"/* unused! */
237ebfedea0SLionel Sambuc # define SSL_TXT_eFZA            "eFZA"/* unused! */
238ebfedea0SLionel Sambuc # define SSL_TXT_FZA             "FZA"/* unused! */
239ebfedea0SLionel Sambuc 
240ebfedea0SLionel Sambuc # define SSL_TXT_aNULL           "aNULL"
241ebfedea0SLionel Sambuc # define SSL_TXT_eNULL           "eNULL"
242ebfedea0SLionel Sambuc # define SSL_TXT_NULL            "NULL"
243ebfedea0SLionel Sambuc 
244ebfedea0SLionel Sambuc # define SSL_TXT_kRSA            "kRSA"
245ebfedea0SLionel Sambuc # define SSL_TXT_kDHr            "kDHr"/* no such ciphersuites supported! */
246ebfedea0SLionel Sambuc # define SSL_TXT_kDHd            "kDHd"/* no such ciphersuites supported! */
247ebfedea0SLionel Sambuc # define SSL_TXT_kDH             "kDH"/* no such ciphersuites supported! */
248ebfedea0SLionel Sambuc # define SSL_TXT_kEDH            "kEDH"
249ebfedea0SLionel Sambuc # define SSL_TXT_kKRB5           "kKRB5"
250ebfedea0SLionel Sambuc # define SSL_TXT_kECDHr          "kECDHr"
251ebfedea0SLionel Sambuc # define SSL_TXT_kECDHe          "kECDHe"
252ebfedea0SLionel Sambuc # define SSL_TXT_kECDH           "kECDH"
253ebfedea0SLionel Sambuc # define SSL_TXT_kEECDH          "kEECDH"
254ebfedea0SLionel Sambuc # define SSL_TXT_kPSK            "kPSK"
255ebfedea0SLionel Sambuc # define SSL_TXT_kGOST           "kGOST"
256ebfedea0SLionel Sambuc # define SSL_TXT_kSRP            "kSRP"
257ebfedea0SLionel Sambuc 
258ebfedea0SLionel Sambuc # define SSL_TXT_aRSA            "aRSA"
259ebfedea0SLionel Sambuc # define SSL_TXT_aDSS            "aDSS"
260ebfedea0SLionel Sambuc # define SSL_TXT_aDH             "aDH"/* no such ciphersuites supported! */
261ebfedea0SLionel Sambuc # define SSL_TXT_aECDH           "aECDH"
262ebfedea0SLionel Sambuc # define SSL_TXT_aKRB5           "aKRB5"
263ebfedea0SLionel Sambuc # define SSL_TXT_aECDSA          "aECDSA"
264ebfedea0SLionel Sambuc # define SSL_TXT_aPSK            "aPSK"
265ebfedea0SLionel Sambuc # define SSL_TXT_aGOST94 "aGOST94"
266ebfedea0SLionel Sambuc # define SSL_TXT_aGOST01 "aGOST01"
267ebfedea0SLionel Sambuc # define SSL_TXT_aGOST  "aGOST"
268*0a6a1f1dSLionel Sambuc # define SSL_TXT_aSRP            "aSRP"
269ebfedea0SLionel Sambuc 
270ebfedea0SLionel Sambuc # define SSL_TXT_DSS             "DSS"
271ebfedea0SLionel Sambuc # define SSL_TXT_DH              "DH"
272ebfedea0SLionel Sambuc # define SSL_TXT_EDH             "EDH"/* same as "kEDH:-ADH" */
273ebfedea0SLionel Sambuc # define SSL_TXT_ADH             "ADH"
274ebfedea0SLionel Sambuc # define SSL_TXT_RSA             "RSA"
275ebfedea0SLionel Sambuc # define SSL_TXT_ECDH            "ECDH"
276ebfedea0SLionel Sambuc # define SSL_TXT_EECDH           "EECDH"/* same as "kEECDH:-AECDH" */
277ebfedea0SLionel Sambuc # define SSL_TXT_AECDH           "AECDH"
278ebfedea0SLionel Sambuc # define SSL_TXT_ECDSA           "ECDSA"
279ebfedea0SLionel Sambuc # define SSL_TXT_KRB5            "KRB5"
280ebfedea0SLionel Sambuc # define SSL_TXT_PSK             "PSK"
281ebfedea0SLionel Sambuc # define SSL_TXT_SRP             "SRP"
282ebfedea0SLionel Sambuc 
283ebfedea0SLionel Sambuc # define SSL_TXT_DES             "DES"
284ebfedea0SLionel Sambuc # define SSL_TXT_3DES            "3DES"
285ebfedea0SLionel Sambuc # define SSL_TXT_RC4             "RC4"
286ebfedea0SLionel Sambuc # define SSL_TXT_RC2             "RC2"
287ebfedea0SLionel Sambuc # define SSL_TXT_IDEA            "IDEA"
288ebfedea0SLionel Sambuc # define SSL_TXT_SEED            "SEED"
289ebfedea0SLionel Sambuc # define SSL_TXT_AES128          "AES128"
290ebfedea0SLionel Sambuc # define SSL_TXT_AES256          "AES256"
291ebfedea0SLionel Sambuc # define SSL_TXT_AES             "AES"
292ebfedea0SLionel Sambuc # define SSL_TXT_AES_GCM         "AESGCM"
293ebfedea0SLionel Sambuc # define SSL_TXT_CAMELLIA128     "CAMELLIA128"
294ebfedea0SLionel Sambuc # define SSL_TXT_CAMELLIA256     "CAMELLIA256"
295ebfedea0SLionel Sambuc # define SSL_TXT_CAMELLIA        "CAMELLIA"
296ebfedea0SLionel Sambuc 
297ebfedea0SLionel Sambuc # define SSL_TXT_MD5             "MD5"
298ebfedea0SLionel Sambuc # define SSL_TXT_SHA1            "SHA1"
299ebfedea0SLionel Sambuc # define SSL_TXT_SHA             "SHA"/* same as "SHA1" */
300ebfedea0SLionel Sambuc # define SSL_TXT_GOST94          "GOST94"
301ebfedea0SLionel Sambuc # define SSL_TXT_GOST89MAC               "GOST89MAC"
302ebfedea0SLionel Sambuc # define SSL_TXT_SHA256          "SHA256"
303ebfedea0SLionel Sambuc # define SSL_TXT_SHA384          "SHA384"
304ebfedea0SLionel Sambuc 
305ebfedea0SLionel Sambuc # define SSL_TXT_SSLV2           "SSLv2"
306ebfedea0SLionel Sambuc # define SSL_TXT_SSLV3           "SSLv3"
307ebfedea0SLionel Sambuc # define SSL_TXT_TLSV1           "TLSv1"
308ebfedea0SLionel Sambuc # define SSL_TXT_TLSV1_1         "TLSv1.1"
309ebfedea0SLionel Sambuc # define SSL_TXT_TLSV1_2         "TLSv1.2"
310ebfedea0SLionel Sambuc 
311ebfedea0SLionel Sambuc # define SSL_TXT_EXP             "EXP"
312ebfedea0SLionel Sambuc # define SSL_TXT_EXPORT          "EXPORT"
313ebfedea0SLionel Sambuc 
314ebfedea0SLionel Sambuc # define SSL_TXT_ALL             "ALL"
315ebfedea0SLionel Sambuc 
316*0a6a1f1dSLionel Sambuc /*-
317ebfedea0SLionel Sambuc  * COMPLEMENTOF* definitions. These identifiers are used to (de-select)
318ebfedea0SLionel Sambuc  * ciphers normally not being used.
319ebfedea0SLionel Sambuc  * Example: "RC4" will activate all ciphers using RC4 including ciphers
320ebfedea0SLionel Sambuc  * without authentication, which would normally disabled by DEFAULT (due
321ebfedea0SLionel Sambuc  * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT"
322ebfedea0SLionel Sambuc  * will make sure that it is also disabled in the specific selection.
323ebfedea0SLionel Sambuc  * COMPLEMENTOF* identifiers are portable between version, as adjustments
324ebfedea0SLionel Sambuc  * to the default cipher setup will also be included here.
325ebfedea0SLionel Sambuc  *
326ebfedea0SLionel Sambuc  * COMPLEMENTOFDEFAULT does not experience the same special treatment that
327ebfedea0SLionel Sambuc  * DEFAULT gets, as only selection is being done and no sorting as needed
328ebfedea0SLionel Sambuc  * for DEFAULT.
329ebfedea0SLionel Sambuc  */
330ebfedea0SLionel Sambuc # define SSL_TXT_CMPALL          "COMPLEMENTOFALL"
331ebfedea0SLionel Sambuc # define SSL_TXT_CMPDEF          "COMPLEMENTOFDEFAULT"
332ebfedea0SLionel Sambuc 
333*0a6a1f1dSLionel Sambuc /*
334*0a6a1f1dSLionel Sambuc  * The following cipher list is used by default. It also is substituted when
335*0a6a1f1dSLionel Sambuc  * an application-defined cipher list string starts with 'DEFAULT'.
336*0a6a1f1dSLionel Sambuc  */
337*0a6a1f1dSLionel Sambuc # define SSL_DEFAULT_CIPHER_LIST "ALL:!EXPORT:!aNULL:!eNULL:!SSLv2"
338*0a6a1f1dSLionel Sambuc /*
339*0a6a1f1dSLionel Sambuc  * As of OpenSSL 1.0.0, ssl_create_cipher_list() in ssl/ssl_ciph.c always
340ebfedea0SLionel Sambuc  * starts with a reasonable order, and all we have to do for DEFAULT is
341*0a6a1f1dSLionel Sambuc  * throwing out anonymous and unencrypted ciphersuites! (The latter are not
342*0a6a1f1dSLionel Sambuc  * actually enabled by ALL, but "ALL:RSA" would enable some of them.)
343ebfedea0SLionel Sambuc  */
344ebfedea0SLionel Sambuc 
345ebfedea0SLionel Sambuc /* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
346ebfedea0SLionel Sambuc # define SSL_SENT_SHUTDOWN       1
347ebfedea0SLionel Sambuc # define SSL_RECEIVED_SHUTDOWN   2
348ebfedea0SLionel Sambuc 
349ebfedea0SLionel Sambuc #ifdef __cplusplus
350ebfedea0SLionel Sambuc }
351ebfedea0SLionel Sambuc #endif
352ebfedea0SLionel Sambuc 
353ebfedea0SLionel Sambuc #ifdef  __cplusplus
354ebfedea0SLionel Sambuc extern "C" {
355ebfedea0SLionel Sambuc #endif
356ebfedea0SLionel Sambuc 
357ebfedea0SLionel Sambuc # if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2)
358ebfedea0SLionel Sambuc #  define OPENSSL_NO_SSL2
359ebfedea0SLionel Sambuc # endif
360ebfedea0SLionel Sambuc 
361ebfedea0SLionel Sambuc # define SSL_FILETYPE_ASN1       X509_FILETYPE_ASN1
362ebfedea0SLionel Sambuc # define SSL_FILETYPE_PEM        X509_FILETYPE_PEM
363ebfedea0SLionel Sambuc 
364*0a6a1f1dSLionel Sambuc /*
365*0a6a1f1dSLionel Sambuc  * This is needed to stop compilers complaining about the 'struct ssl_st *'
366*0a6a1f1dSLionel Sambuc  * function parameters used to prototype callbacks in SSL_CTX.
367*0a6a1f1dSLionel Sambuc  */
368ebfedea0SLionel Sambuc typedef struct ssl_st *ssl_crock_st;
369ebfedea0SLionel Sambuc typedef struct tls_session_ticket_ext_st TLS_SESSION_TICKET_EXT;
370ebfedea0SLionel Sambuc typedef struct ssl_method_st SSL_METHOD;
371ebfedea0SLionel Sambuc typedef struct ssl_cipher_st SSL_CIPHER;
372ebfedea0SLionel Sambuc typedef struct ssl_session_st SSL_SESSION;
373ebfedea0SLionel Sambuc 
374ebfedea0SLionel Sambuc DECLARE_STACK_OF(SSL_CIPHER)
375ebfedea0SLionel Sambuc 
376ebfedea0SLionel Sambuc /* SRTP protection profiles for use with the use_srtp extension (RFC 5764)*/
377*0a6a1f1dSLionel Sambuc typedef struct srtp_protection_profile_st {
378ebfedea0SLionel Sambuc     const char *name;
379ebfedea0SLionel Sambuc     unsigned long id;
380ebfedea0SLionel Sambuc } SRTP_PROTECTION_PROFILE;
381ebfedea0SLionel Sambuc 
382ebfedea0SLionel Sambuc DECLARE_STACK_OF(SRTP_PROTECTION_PROFILE)
383ebfedea0SLionel Sambuc 
384*0a6a1f1dSLionel Sambuc typedef int (*tls_session_ticket_ext_cb_fn) (SSL *s,
385*0a6a1f1dSLionel Sambuc                                              const unsigned char *data,
386*0a6a1f1dSLionel Sambuc                                              int len, void *arg);
387*0a6a1f1dSLionel Sambuc typedef int (*tls_session_secret_cb_fn) (SSL *s, void *secret,
388*0a6a1f1dSLionel Sambuc                                          int *secret_len,
389*0a6a1f1dSLionel Sambuc                                          STACK_OF(SSL_CIPHER) *peer_ciphers,
390*0a6a1f1dSLionel Sambuc                                          SSL_CIPHER **cipher, void *arg);
391ebfedea0SLionel Sambuc 
392ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SSL_INTERN
393ebfedea0SLionel Sambuc 
394ebfedea0SLionel Sambuc /* used to hold info on the particular ciphers used */
395*0a6a1f1dSLionel Sambuc struct ssl_cipher_st {
396ebfedea0SLionel Sambuc     int valid;
397ebfedea0SLionel Sambuc     const char *name;           /* text name */
398ebfedea0SLionel Sambuc     unsigned long id;           /* id, 4 bytes, first is version */
399*0a6a1f1dSLionel Sambuc     /*
400*0a6a1f1dSLionel Sambuc      * changed in 0.9.9: these four used to be portions of a single value
401*0a6a1f1dSLionel Sambuc      * 'algorithms'
402*0a6a1f1dSLionel Sambuc      */
403ebfedea0SLionel Sambuc     unsigned long algorithm_mkey; /* key exchange algorithm */
404ebfedea0SLionel Sambuc     unsigned long algorithm_auth; /* server authentication */
405ebfedea0SLionel Sambuc     unsigned long algorithm_enc; /* symmetric encryption */
406ebfedea0SLionel Sambuc     unsigned long algorithm_mac; /* symmetric authentication */
407ebfedea0SLionel Sambuc     unsigned long algorithm_ssl; /* (major) protocol version */
408ebfedea0SLionel Sambuc     unsigned long algo_strength; /* strength and export flags */
409ebfedea0SLionel Sambuc     unsigned long algorithm2;   /* Extra flags */
410ebfedea0SLionel Sambuc     int strength_bits;          /* Number of bits really used */
411ebfedea0SLionel Sambuc     int alg_bits;               /* Number of bits for algorithm */
412ebfedea0SLionel Sambuc };
413ebfedea0SLionel Sambuc 
414ebfedea0SLionel Sambuc /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
415*0a6a1f1dSLionel Sambuc struct ssl_method_st {
416ebfedea0SLionel Sambuc     int version;
417ebfedea0SLionel Sambuc     int (*ssl_new) (SSL *s);
418ebfedea0SLionel Sambuc     void (*ssl_clear) (SSL *s);
419ebfedea0SLionel Sambuc     void (*ssl_free) (SSL *s);
420ebfedea0SLionel Sambuc     int (*ssl_accept) (SSL *s);
421ebfedea0SLionel Sambuc     int (*ssl_connect) (SSL *s);
422ebfedea0SLionel Sambuc     int (*ssl_read) (SSL *s, void *buf, int len);
423ebfedea0SLionel Sambuc     int (*ssl_peek) (SSL *s, void *buf, int len);
424ebfedea0SLionel Sambuc     int (*ssl_write) (SSL *s, const void *buf, int len);
425ebfedea0SLionel Sambuc     int (*ssl_shutdown) (SSL *s);
426ebfedea0SLionel Sambuc     int (*ssl_renegotiate) (SSL *s);
427ebfedea0SLionel Sambuc     int (*ssl_renegotiate_check) (SSL *s);
428ebfedea0SLionel Sambuc     long (*ssl_get_message) (SSL *s, int st1, int stn, int mt, long
429ebfedea0SLionel Sambuc                              max, int *ok);
430ebfedea0SLionel Sambuc     int (*ssl_read_bytes) (SSL *s, int type, unsigned char *buf, int len,
431ebfedea0SLionel Sambuc                            int peek);
432ebfedea0SLionel Sambuc     int (*ssl_write_bytes) (SSL *s, int type, const void *buf_, int len);
433ebfedea0SLionel Sambuc     int (*ssl_dispatch_alert) (SSL *s);
434ebfedea0SLionel Sambuc     long (*ssl_ctrl) (SSL *s, int cmd, long larg, void *parg);
435ebfedea0SLionel Sambuc     long (*ssl_ctx_ctrl) (SSL_CTX *ctx, int cmd, long larg, void *parg);
436ebfedea0SLionel Sambuc     const SSL_CIPHER *(*get_cipher_by_char) (const unsigned char *ptr);
437ebfedea0SLionel Sambuc     int (*put_cipher_by_char) (const SSL_CIPHER *cipher, unsigned char *ptr);
438ebfedea0SLionel Sambuc     int (*ssl_pending) (const SSL *s);
439ebfedea0SLionel Sambuc     int (*num_ciphers) (void);
440ebfedea0SLionel Sambuc     const SSL_CIPHER *(*get_cipher) (unsigned ncipher);
441ebfedea0SLionel Sambuc     const struct ssl_method_st *(*get_ssl_method) (int version);
442ebfedea0SLionel Sambuc     long (*get_timeout) (void);
443ebfedea0SLionel Sambuc     struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
444ebfedea0SLionel Sambuc     int (*ssl_version) (void);
445ebfedea0SLionel Sambuc     long (*ssl_callback_ctrl) (SSL *s, int cb_id, void (*fp) (void));
446ebfedea0SLionel Sambuc     long (*ssl_ctx_callback_ctrl) (SSL_CTX *s, int cb_id, void (*fp) (void));
447ebfedea0SLionel Sambuc };
448ebfedea0SLionel Sambuc 
449*0a6a1f1dSLionel Sambuc /*-
450*0a6a1f1dSLionel Sambuc  * Lets make this into an ASN.1 type structure as follows
451ebfedea0SLionel Sambuc  * SSL_SESSION_ID ::= SEQUENCE {
452ebfedea0SLionel Sambuc  *      version                 INTEGER,        -- structure version number
453ebfedea0SLionel Sambuc  *      SSLversion              INTEGER,        -- SSL version number
454ebfedea0SLionel Sambuc  *      Cipher                  OCTET STRING,   -- the 3 byte cipher ID
455ebfedea0SLionel Sambuc  *      Session_ID              OCTET STRING,   -- the Session ID
456ebfedea0SLionel Sambuc  *      Master_key              OCTET STRING,   -- the master key
457ebfedea0SLionel Sambuc  *      KRB5_principal          OCTET STRING    -- optional Kerberos principal
458ebfedea0SLionel Sambuc  *      Key_Arg [ 0 ] IMPLICIT  OCTET STRING,   -- the optional Key argument
459ebfedea0SLionel Sambuc  *      Time [ 1 ] EXPLICIT     INTEGER,        -- optional Start Time
460ebfedea0SLionel Sambuc  *      Timeout [ 2 ] EXPLICIT  INTEGER,        -- optional Timeout ins seconds
461ebfedea0SLionel Sambuc  *      Peer [ 3 ] EXPLICIT     X509,           -- optional Peer Certificate
462ebfedea0SLionel Sambuc  *      Session_ID_context [ 4 ] EXPLICIT OCTET STRING,   -- the Session ID context
463ebfedea0SLionel Sambuc  *      Verify_result [ 5 ] EXPLICIT INTEGER,   -- X509_V_... code for `Peer'
464ebfedea0SLionel Sambuc  *      HostName [ 6 ] EXPLICIT OCTET STRING,   -- optional HostName from servername TLS extension
465ebfedea0SLionel Sambuc  *      PSK_identity_hint [ 7 ] EXPLICIT OCTET STRING, -- optional PSK identity hint
466ebfedea0SLionel Sambuc  *      PSK_identity [ 8 ] EXPLICIT OCTET STRING,  -- optional PSK identity
467ebfedea0SLionel Sambuc  *      Ticket_lifetime_hint [9] EXPLICIT INTEGER, -- server's lifetime hint for session ticket
468ebfedea0SLionel Sambuc  *      Ticket [10]             EXPLICIT OCTET STRING, -- session ticket (clients only)
469ebfedea0SLionel Sambuc  *      Compression_meth [11]   EXPLICIT OCTET STRING, -- optional compression method
470ebfedea0SLionel Sambuc  *      SRP_username [ 12 ] EXPLICIT OCTET STRING -- optional SRP username
471ebfedea0SLionel Sambuc  *      }
472ebfedea0SLionel Sambuc  * Look in ssl/ssl_asn1.c for more details
473ebfedea0SLionel Sambuc  * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
474ebfedea0SLionel Sambuc  */
475*0a6a1f1dSLionel Sambuc struct ssl_session_st {
476*0a6a1f1dSLionel Sambuc     int ssl_version;            /* what ssl version session info is being
477*0a6a1f1dSLionel Sambuc                                  * kept in here? */
478ebfedea0SLionel Sambuc     /* only really used in SSLv2 */
479ebfedea0SLionel Sambuc     unsigned int key_arg_length;
480ebfedea0SLionel Sambuc     unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
481ebfedea0SLionel Sambuc     int master_key_length;
482ebfedea0SLionel Sambuc     unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
483ebfedea0SLionel Sambuc     /* session_id - valid? */
484ebfedea0SLionel Sambuc     unsigned int session_id_length;
485ebfedea0SLionel Sambuc     unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
486*0a6a1f1dSLionel Sambuc     /*
487*0a6a1f1dSLionel Sambuc      * this is used to determine whether the session is being reused in the
488*0a6a1f1dSLionel Sambuc      * appropriate context. It is up to the application to set this, via
489*0a6a1f1dSLionel Sambuc      * SSL_new
490*0a6a1f1dSLionel Sambuc      */
491ebfedea0SLionel Sambuc     unsigned int sid_ctx_length;
492ebfedea0SLionel Sambuc     unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
493ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_KRB5
494ebfedea0SLionel Sambuc     unsigned int krb5_client_princ_len;
495ebfedea0SLionel Sambuc     unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
496ebfedea0SLionel Sambuc #  endif                        /* OPENSSL_NO_KRB5 */
497ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_PSK
498ebfedea0SLionel Sambuc     char *psk_identity_hint;
499ebfedea0SLionel Sambuc     char *psk_identity;
500ebfedea0SLionel Sambuc #  endif
501*0a6a1f1dSLionel Sambuc     /*
502*0a6a1f1dSLionel Sambuc      * Used to indicate that session resumption is not allowed. Applications
503*0a6a1f1dSLionel Sambuc      * can also set this bit for a new session via not_resumable_session_cb
504*0a6a1f1dSLionel Sambuc      * to disable session caching and tickets.
505*0a6a1f1dSLionel Sambuc      */
506ebfedea0SLionel Sambuc     int not_resumable;
507ebfedea0SLionel Sambuc     /* The cert is the certificate used to establish this connection */
508ebfedea0SLionel Sambuc     struct sess_cert_st /* SESS_CERT */ *sess_cert;
509*0a6a1f1dSLionel Sambuc     /*
510*0a6a1f1dSLionel Sambuc      * This is the cert for the other end. On clients, it will be the same as
511*0a6a1f1dSLionel Sambuc      * sess_cert->peer_key->x509 (the latter is not enough as sess_cert is
512*0a6a1f1dSLionel Sambuc      * not retained in the external representation of sessions, see
513*0a6a1f1dSLionel Sambuc      * ssl_asn1.c).
514*0a6a1f1dSLionel Sambuc      */
515ebfedea0SLionel Sambuc     X509 *peer;
516*0a6a1f1dSLionel Sambuc     /*
517*0a6a1f1dSLionel Sambuc      * when app_verify_callback accepts a session where the peer's
518*0a6a1f1dSLionel Sambuc      * certificate is not ok, we must remember the error for session reuse:
519*0a6a1f1dSLionel Sambuc      */
520ebfedea0SLionel Sambuc     long verify_result;         /* only for servers */
521ebfedea0SLionel Sambuc     int references;
522ebfedea0SLionel Sambuc     long timeout;
523ebfedea0SLionel Sambuc     long time;
524ebfedea0SLionel Sambuc     unsigned int compress_meth; /* Need to lookup the method */
525ebfedea0SLionel Sambuc     const SSL_CIPHER *cipher;
526*0a6a1f1dSLionel Sambuc     unsigned long cipher_id;    /* when ASN.1 loaded, this needs to be used
527*0a6a1f1dSLionel Sambuc                                  * to load the 'cipher' structure */
528ebfedea0SLionel Sambuc     STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
529ebfedea0SLionel Sambuc     CRYPTO_EX_DATA ex_data;     /* application specific data */
530*0a6a1f1dSLionel Sambuc     /*
531*0a6a1f1dSLionel Sambuc      * These are used to make removal of session-ids more efficient and to
532*0a6a1f1dSLionel Sambuc      * implement a maximum cache size.
533*0a6a1f1dSLionel Sambuc      */
534ebfedea0SLionel Sambuc     struct ssl_session_st *prev, *next;
535ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_TLSEXT
536ebfedea0SLionel Sambuc     char *tlsext_hostname;
537ebfedea0SLionel Sambuc #   ifndef OPENSSL_NO_EC
538ebfedea0SLionel Sambuc     size_t tlsext_ecpointformatlist_length;
539ebfedea0SLionel Sambuc     unsigned char *tlsext_ecpointformatlist; /* peer's list */
540ebfedea0SLionel Sambuc     size_t tlsext_ellipticcurvelist_length;
541ebfedea0SLionel Sambuc     unsigned char *tlsext_ellipticcurvelist; /* peer's list */
542ebfedea0SLionel Sambuc #   endif                       /* OPENSSL_NO_EC */
543ebfedea0SLionel Sambuc     /* RFC4507 info */
544ebfedea0SLionel Sambuc     unsigned char *tlsext_tick; /* Session ticket */
545ebfedea0SLionel Sambuc     size_t tlsext_ticklen;      /* Session ticket length */
546ebfedea0SLionel Sambuc     long tlsext_tick_lifetime_hint; /* Session lifetime hint in seconds */
547ebfedea0SLionel Sambuc #  endif
548ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_SRP
549ebfedea0SLionel Sambuc     char *srp_username;
550ebfedea0SLionel Sambuc #  endif
551ebfedea0SLionel Sambuc };
552ebfedea0SLionel Sambuc 
553ebfedea0SLionel Sambuc # endif
554ebfedea0SLionel Sambuc 
555ebfedea0SLionel Sambuc # define SSL_OP_MICROSOFT_SESS_ID_BUG                    0x00000001L
556ebfedea0SLionel Sambuc # define SSL_OP_NETSCAPE_CHALLENGE_BUG                   0x00000002L
557ebfedea0SLionel Sambuc /* Allow initial connection to servers that don't support RI */
558ebfedea0SLionel Sambuc # define SSL_OP_LEGACY_SERVER_CONNECT                    0x00000004L
559ebfedea0SLionel Sambuc # define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG         0x00000008L
560*0a6a1f1dSLionel Sambuc # define SSL_OP_TLSEXT_PADDING                           0x00000010L
561ebfedea0SLionel Sambuc # define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER               0x00000020L
562*0a6a1f1dSLionel Sambuc # define SSL_OP_SAFARI_ECDHE_ECDSA_BUG                   0x00000040L
563ebfedea0SLionel Sambuc # define SSL_OP_SSLEAY_080_CLIENT_DH_BUG                 0x00000080L
564ebfedea0SLionel Sambuc # define SSL_OP_TLS_D5_BUG                               0x00000100L
565ebfedea0SLionel Sambuc # define SSL_OP_TLS_BLOCK_PADDING_BUG                    0x00000200L
566ebfedea0SLionel Sambuc 
567*0a6a1f1dSLionel Sambuc /* Hasn't done anything since OpenSSL 0.9.7h, retained for compatibility */
568*0a6a1f1dSLionel Sambuc # define SSL_OP_MSIE_SSLV2_RSA_PADDING                   0x0
569*0a6a1f1dSLionel Sambuc /* Refers to ancient SSLREF and SSLv2, retained for compatibility */
570*0a6a1f1dSLionel Sambuc # define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG              0x0
571ebfedea0SLionel Sambuc 
572*0a6a1f1dSLionel Sambuc /*
573*0a6a1f1dSLionel Sambuc  * Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added in
574*0a6a1f1dSLionel Sambuc  * OpenSSL 0.9.6d.  Usually (depending on the application protocol) the
575*0a6a1f1dSLionel Sambuc  * workaround is not needed.  Unfortunately some broken SSL/TLS
576*0a6a1f1dSLionel Sambuc  * implementations cannot handle it at all, which is why we include it in
577*0a6a1f1dSLionel Sambuc  * SSL_OP_ALL.
578*0a6a1f1dSLionel Sambuc  */
579*0a6a1f1dSLionel Sambuc /* added in 0.9.6e */
580*0a6a1f1dSLionel Sambuc # define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS              0x00000800L
581*0a6a1f1dSLionel Sambuc 
582*0a6a1f1dSLionel Sambuc /*
583*0a6a1f1dSLionel Sambuc  * SSL_OP_ALL: various bug workarounds that should be rather harmless.  This
584*0a6a1f1dSLionel Sambuc  * used to be 0x000FFFFFL before 0.9.7.
585*0a6a1f1dSLionel Sambuc  */
586ebfedea0SLionel Sambuc # define SSL_OP_ALL                                      0x80000BFFL
587ebfedea0SLionel Sambuc 
588ebfedea0SLionel Sambuc /* DTLS options */
589ebfedea0SLionel Sambuc # define SSL_OP_NO_QUERY_MTU                 0x00001000L
590ebfedea0SLionel Sambuc /* Turn on Cookie Exchange (on relevant for servers) */
591ebfedea0SLionel Sambuc # define SSL_OP_COOKIE_EXCHANGE              0x00002000L
592ebfedea0SLionel Sambuc /* Don't use RFC4507 ticket extension */
593ebfedea0SLionel Sambuc # define SSL_OP_NO_TICKET                    0x00004000L
594ebfedea0SLionel Sambuc /* Use Cisco's "speshul" version of DTLS_BAD_VER (as client)  */
595ebfedea0SLionel Sambuc # define SSL_OP_CISCO_ANYCONNECT             0x00008000L
596ebfedea0SLionel Sambuc 
597ebfedea0SLionel Sambuc /* As server, disallow session resumption on renegotiation */
598ebfedea0SLionel Sambuc # define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION   0x00010000L
599ebfedea0SLionel Sambuc /* Don't use compression even if supported */
600ebfedea0SLionel Sambuc # define SSL_OP_NO_COMPRESSION                           0x00020000L
601ebfedea0SLionel Sambuc /* Permit unsafe legacy renegotiation */
602ebfedea0SLionel Sambuc # define SSL_OP_ALLOW_UNSAFE_LEGACY_RENEGOTIATION        0x00040000L
603ebfedea0SLionel Sambuc /* If set, always create a new key when using tmp_ecdh parameters */
604ebfedea0SLionel Sambuc # define SSL_OP_SINGLE_ECDH_USE                          0x00080000L
605ebfedea0SLionel Sambuc /* If set, always create a new key when using tmp_dh parameters */
606ebfedea0SLionel Sambuc # define SSL_OP_SINGLE_DH_USE                            0x00100000L
607*0a6a1f1dSLionel Sambuc /* Does nothing: retained for compatibiity */
608*0a6a1f1dSLionel Sambuc # define SSL_OP_EPHEMERAL_RSA                            0x0
609*0a6a1f1dSLionel Sambuc /*
610*0a6a1f1dSLionel Sambuc  * Set on servers to choose the cipher according to the server's preferences
611*0a6a1f1dSLionel Sambuc  */
612ebfedea0SLionel Sambuc # define SSL_OP_CIPHER_SERVER_PREFERENCE                 0x00400000L
613*0a6a1f1dSLionel Sambuc /*
614*0a6a1f1dSLionel Sambuc  * If set, a server will allow a client to issue a SSLv3.0 version number as
615*0a6a1f1dSLionel Sambuc  * latest version supported in the premaster secret, even when TLSv1.0
616ebfedea0SLionel Sambuc  * (version 3.1) was announced in the client hello. Normally this is
617*0a6a1f1dSLionel Sambuc  * forbidden to prevent version rollback attacks.
618*0a6a1f1dSLionel Sambuc  */
619ebfedea0SLionel Sambuc # define SSL_OP_TLS_ROLLBACK_BUG                         0x00800000L
620ebfedea0SLionel Sambuc 
621ebfedea0SLionel Sambuc # define SSL_OP_NO_SSLv2                                 0x01000000L
622ebfedea0SLionel Sambuc # define SSL_OP_NO_SSLv3                                 0x02000000L
623ebfedea0SLionel Sambuc # define SSL_OP_NO_TLSv1                                 0x04000000L
624ebfedea0SLionel Sambuc # define SSL_OP_NO_TLSv1_2                               0x08000000L
625ebfedea0SLionel Sambuc # define SSL_OP_NO_TLSv1_1                               0x10000000L
626ebfedea0SLionel Sambuc 
627*0a6a1f1dSLionel Sambuc /*
628*0a6a1f1dSLionel Sambuc  * These next two were never actually used for anything since SSLeay zap so
629*0a6a1f1dSLionel Sambuc  * we have some more flags.
630ebfedea0SLionel Sambuc  */
631*0a6a1f1dSLionel Sambuc /*
632*0a6a1f1dSLionel Sambuc  * The next flag deliberately changes the ciphertest, this is a check for the
633*0a6a1f1dSLionel Sambuc  * PKCS#1 attack
634*0a6a1f1dSLionel Sambuc  */
635ebfedea0SLionel Sambuc # define SSL_OP_PKCS1_CHECK_1                            0x0
636ebfedea0SLionel Sambuc # define SSL_OP_PKCS1_CHECK_2                            0x0
637ebfedea0SLionel Sambuc 
638ebfedea0SLionel Sambuc # define SSL_OP_NETSCAPE_CA_DN_BUG                       0x20000000L
639ebfedea0SLionel Sambuc # define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG          0x40000000L
640*0a6a1f1dSLionel Sambuc /*
641*0a6a1f1dSLionel Sambuc  * Make server add server-hello extension from early version of cryptopro
642*0a6a1f1dSLionel Sambuc  * draft, when GOST ciphersuite is negotiated. Required for interoperability
643*0a6a1f1dSLionel Sambuc  * with CryptoPro CSP 3.x
644ebfedea0SLionel Sambuc  */
645ebfedea0SLionel Sambuc # define SSL_OP_CRYPTOPRO_TLSEXT_BUG                     0x80000000L
646ebfedea0SLionel Sambuc 
647*0a6a1f1dSLionel Sambuc /*
648*0a6a1f1dSLionel Sambuc  * Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
649*0a6a1f1dSLionel Sambuc  * when just a single record has been written):
650*0a6a1f1dSLionel Sambuc  */
651ebfedea0SLionel Sambuc # define SSL_MODE_ENABLE_PARTIAL_WRITE       0x00000001L
652*0a6a1f1dSLionel Sambuc /*
653*0a6a1f1dSLionel Sambuc  * Make it possible to retry SSL_write() with changed buffer location (buffer
654*0a6a1f1dSLionel Sambuc  * contents must stay the same!); this is not the default to avoid the
655*0a6a1f1dSLionel Sambuc  * misconception that non-blocking SSL_write() behaves like non-blocking
656*0a6a1f1dSLionel Sambuc  * write():
657*0a6a1f1dSLionel Sambuc  */
658ebfedea0SLionel Sambuc # define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
659*0a6a1f1dSLionel Sambuc /*
660*0a6a1f1dSLionel Sambuc  * Never bother the application with retries if the transport is blocking:
661*0a6a1f1dSLionel Sambuc  */
662ebfedea0SLionel Sambuc # define SSL_MODE_AUTO_RETRY 0x00000004L
663ebfedea0SLionel Sambuc /* Don't attempt to automatically build certificate chain */
664ebfedea0SLionel Sambuc # define SSL_MODE_NO_AUTO_CHAIN 0x00000008L
665*0a6a1f1dSLionel Sambuc /*
666*0a6a1f1dSLionel Sambuc  * Save RAM by releasing read and write buffers when they're empty. (SSL3 and
667*0a6a1f1dSLionel Sambuc  * TLS only.) "Released" buffers are put onto a free-list in the context or
668*0a6a1f1dSLionel Sambuc  * just freed (depending on the context's setting for freelist_max_len).
669*0a6a1f1dSLionel Sambuc  */
670ebfedea0SLionel Sambuc # define SSL_MODE_RELEASE_BUFFERS 0x00000010L
671*0a6a1f1dSLionel Sambuc /*
672*0a6a1f1dSLionel Sambuc  * Send the current time in the Random fields of the ClientHello and
673*0a6a1f1dSLionel Sambuc  * ServerHello records for compatibility with hypothetical implementations
674*0a6a1f1dSLionel Sambuc  * that require it.
675*0a6a1f1dSLionel Sambuc  */
676*0a6a1f1dSLionel Sambuc # define SSL_MODE_SEND_CLIENTHELLO_TIME 0x00000020L
677*0a6a1f1dSLionel Sambuc # define SSL_MODE_SEND_SERVERHELLO_TIME 0x00000040L
678*0a6a1f1dSLionel Sambuc /*
679*0a6a1f1dSLionel Sambuc  * Send TLS_FALLBACK_SCSV in the ClientHello. To be set only by applications
680*0a6a1f1dSLionel Sambuc  * that reconnect with a downgraded protocol version; see
681*0a6a1f1dSLionel Sambuc  * draft-ietf-tls-downgrade-scsv-00 for details. DO NOT ENABLE THIS if your
682*0a6a1f1dSLionel Sambuc  * application attempts a normal handshake. Only use this in explicit
683*0a6a1f1dSLionel Sambuc  * fallback retries, following the guidance in
684*0a6a1f1dSLionel Sambuc  * draft-ietf-tls-downgrade-scsv-00.
685*0a6a1f1dSLionel Sambuc  */
686*0a6a1f1dSLionel Sambuc # define SSL_MODE_SEND_FALLBACK_SCSV 0x00000080L
687ebfedea0SLionel Sambuc 
688*0a6a1f1dSLionel Sambuc /*
689*0a6a1f1dSLionel Sambuc  * Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, they
690*0a6a1f1dSLionel Sambuc  * cannot be used to clear bits.
691*0a6a1f1dSLionel Sambuc  */
692ebfedea0SLionel Sambuc 
693ebfedea0SLionel Sambuc # define SSL_CTX_set_options(ctx,op) \
694ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
695ebfedea0SLionel Sambuc # define SSL_CTX_clear_options(ctx,op) \
696ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
697ebfedea0SLionel Sambuc # define SSL_CTX_get_options(ctx) \
698ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
699ebfedea0SLionel Sambuc # define SSL_set_options(ssl,op) \
700ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
701ebfedea0SLionel Sambuc # define SSL_clear_options(ssl,op) \
702ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_CLEAR_OPTIONS,(op),NULL)
703ebfedea0SLionel Sambuc # define SSL_get_options(ssl) \
704ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)
705ebfedea0SLionel Sambuc 
706ebfedea0SLionel Sambuc # define SSL_CTX_set_mode(ctx,op) \
707ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
708ebfedea0SLionel Sambuc # define SSL_CTX_clear_mode(ctx,op) \
709ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_CLEAR_MODE,(op),NULL)
710ebfedea0SLionel Sambuc # define SSL_CTX_get_mode(ctx) \
711ebfedea0SLionel Sambuc         SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
712ebfedea0SLionel Sambuc # define SSL_clear_mode(ssl,op) \
713ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_CLEAR_MODE,(op),NULL)
714ebfedea0SLionel Sambuc # define SSL_set_mode(ssl,op) \
715ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
716ebfedea0SLionel Sambuc # define SSL_get_mode(ssl) \
717ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
718ebfedea0SLionel Sambuc # define SSL_set_mtu(ssl, mtu) \
719ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
720*0a6a1f1dSLionel Sambuc # define DTLS_set_link_mtu(ssl, mtu) \
721*0a6a1f1dSLionel Sambuc         SSL_ctrl((ssl),DTLS_CTRL_SET_LINK_MTU,(mtu),NULL)
722*0a6a1f1dSLionel Sambuc # define DTLS_get_link_min_mtu(ssl) \
723*0a6a1f1dSLionel Sambuc         SSL_ctrl((ssl),DTLS_CTRL_GET_LINK_MIN_MTU,0,NULL)
724ebfedea0SLionel Sambuc 
725ebfedea0SLionel Sambuc # define SSL_get_secure_renegotiation_support(ssl) \
726ebfedea0SLionel Sambuc         SSL_ctrl((ssl), SSL_CTRL_GET_RI_SUPPORT, 0, NULL)
727ebfedea0SLionel Sambuc 
728ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_HEARTBEATS
729ebfedea0SLionel Sambuc #  define SSL_heartbeat(ssl) \
730ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_TLS_EXT_SEND_HEARTBEAT,0,NULL)
731ebfedea0SLionel Sambuc # endif
732ebfedea0SLionel Sambuc 
733*0a6a1f1dSLionel Sambuc void SSL_CTX_set_msg_callback(SSL_CTX *ctx,
734*0a6a1f1dSLionel Sambuc                               void (*cb) (int write_p, int version,
735*0a6a1f1dSLionel Sambuc                                           int content_type, const void *buf,
736*0a6a1f1dSLionel Sambuc                                           size_t len, SSL *ssl, void *arg));
737*0a6a1f1dSLionel Sambuc void SSL_set_msg_callback(SSL *ssl,
738*0a6a1f1dSLionel Sambuc                           void (*cb) (int write_p, int version,
739*0a6a1f1dSLionel Sambuc                                       int content_type, const void *buf,
740*0a6a1f1dSLionel Sambuc                                       size_t len, SSL *ssl, void *arg));
741ebfedea0SLionel Sambuc # define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
742ebfedea0SLionel Sambuc # define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
743ebfedea0SLionel Sambuc 
744ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SRP
745ebfedea0SLionel Sambuc 
746ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_SSL_INTERN
747ebfedea0SLionel Sambuc 
748*0a6a1f1dSLionel Sambuc typedef struct srp_ctx_st {
749ebfedea0SLionel Sambuc     /* param for all the callbacks */
750ebfedea0SLionel Sambuc     void *SRP_cb_arg;
751ebfedea0SLionel Sambuc     /* set client Hello login callback */
752ebfedea0SLionel Sambuc     int (*TLS_ext_srp_username_callback) (SSL *, int *, void *);
753ebfedea0SLionel Sambuc     /* set SRP N/g param callback for verification */
754ebfedea0SLionel Sambuc     int (*SRP_verify_param_callback) (SSL *, void *);
755ebfedea0SLionel Sambuc     /* set SRP client passwd callback */
756ebfedea0SLionel Sambuc     char *(*SRP_give_srp_client_pwd_callback) (SSL *, void *);
757ebfedea0SLionel Sambuc     char *login;
758ebfedea0SLionel Sambuc     BIGNUM *N, *g, *s, *B, *A;
759ebfedea0SLionel Sambuc     BIGNUM *a, *b, *v;
760ebfedea0SLionel Sambuc     char *info;
761ebfedea0SLionel Sambuc     int strength;
762ebfedea0SLionel Sambuc     unsigned long srp_Mask;
763ebfedea0SLionel Sambuc } SRP_CTX;
764ebfedea0SLionel Sambuc 
765ebfedea0SLionel Sambuc #  endif
766ebfedea0SLionel Sambuc 
767ebfedea0SLionel Sambuc /* see tls_srp.c */
768ebfedea0SLionel Sambuc int SSL_SRP_CTX_init(SSL *s);
769ebfedea0SLionel Sambuc int SSL_CTX_SRP_CTX_init(SSL_CTX *ctx);
770ebfedea0SLionel Sambuc int SSL_SRP_CTX_free(SSL *ctx);
771ebfedea0SLionel Sambuc int SSL_CTX_SRP_CTX_free(SSL_CTX *ctx);
772ebfedea0SLionel Sambuc int SSL_srp_server_param_with_username(SSL *s, int *ad);
773ebfedea0SLionel Sambuc int SRP_generate_server_master_secret(SSL *s, unsigned char *master_key);
774ebfedea0SLionel Sambuc int SRP_Calc_A_param(SSL *s);
775ebfedea0SLionel Sambuc int SRP_generate_client_master_secret(SSL *s, unsigned char *master_key);
776ebfedea0SLionel Sambuc 
777ebfedea0SLionel Sambuc # endif
778ebfedea0SLionel Sambuc 
779ebfedea0SLionel Sambuc # if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
780*0a6a1f1dSLionel Sambuc #  define SSL_MAX_CERT_LIST_DEFAULT 1024*30
781*0a6a1f1dSLionel Sambuc                                           /* 30k max cert list :-) */
782ebfedea0SLionel Sambuc # else
783*0a6a1f1dSLionel Sambuc #  define SSL_MAX_CERT_LIST_DEFAULT 1024*100
784*0a6a1f1dSLionel Sambuc                                            /* 100k max cert list :-) */
785ebfedea0SLionel Sambuc # endif
786ebfedea0SLionel Sambuc 
787ebfedea0SLionel Sambuc # define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT      (1024*20)
788ebfedea0SLionel Sambuc 
789*0a6a1f1dSLionel Sambuc /*
790*0a6a1f1dSLionel Sambuc  * This callback type is used inside SSL_CTX, SSL, and in the functions that
791*0a6a1f1dSLionel Sambuc  * set them. It is used to override the generation of SSL/TLS session IDs in
792*0a6a1f1dSLionel Sambuc  * a server. Return value should be zero on an error, non-zero to proceed.
793*0a6a1f1dSLionel Sambuc  * Also, callbacks should themselves check if the id they generate is unique
794*0a6a1f1dSLionel Sambuc  * otherwise the SSL handshake will fail with an error - callbacks can do
795*0a6a1f1dSLionel Sambuc  * this using the 'ssl' value they're passed by;
796*0a6a1f1dSLionel Sambuc  * SSL_has_matching_session_id(ssl, id, *id_len) The length value passed in
797*0a6a1f1dSLionel Sambuc  * is set at the maximum size the session ID can be. In SSLv2 this is 16
798*0a6a1f1dSLionel Sambuc  * bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback can alter this
799*0a6a1f1dSLionel Sambuc  * length to be less if desired, but under SSLv2 session IDs are supposed to
800*0a6a1f1dSLionel Sambuc  * be fixed at 16 bytes so the id will be padded after the callback returns
801*0a6a1f1dSLionel Sambuc  * in this case. It is also an error for the callback to set the size to
802*0a6a1f1dSLionel Sambuc  * zero.
803*0a6a1f1dSLionel Sambuc  */
804ebfedea0SLionel Sambuc typedef int (*GEN_SESSION_CB) (const SSL *ssl, unsigned char *id,
805ebfedea0SLionel Sambuc                                unsigned int *id_len);
806ebfedea0SLionel Sambuc 
807ebfedea0SLionel Sambuc typedef struct ssl_comp_st SSL_COMP;
808ebfedea0SLionel Sambuc 
809ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SSL_INTERN
810ebfedea0SLionel Sambuc 
811*0a6a1f1dSLionel Sambuc struct ssl_comp_st {
812ebfedea0SLionel Sambuc     int id;
813ebfedea0SLionel Sambuc     const char *name;
814ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_COMP
815ebfedea0SLionel Sambuc     COMP_METHOD *method;
816ebfedea0SLionel Sambuc #  else
817ebfedea0SLionel Sambuc     char *method;
818ebfedea0SLionel Sambuc #  endif
819ebfedea0SLionel Sambuc };
820ebfedea0SLionel Sambuc 
821ebfedea0SLionel Sambuc DECLARE_STACK_OF(SSL_COMP)
822ebfedea0SLionel Sambuc DECLARE_LHASH_OF(SSL_SESSION);
823ebfedea0SLionel Sambuc 
824*0a6a1f1dSLionel Sambuc struct ssl_ctx_st {
825ebfedea0SLionel Sambuc     const SSL_METHOD *method;
826ebfedea0SLionel Sambuc     STACK_OF(SSL_CIPHER) *cipher_list;
827ebfedea0SLionel Sambuc     /* same as above but sorted for lookup */
828ebfedea0SLionel Sambuc     STACK_OF(SSL_CIPHER) *cipher_list_by_id;
829ebfedea0SLionel Sambuc     struct x509_store_st /* X509_STORE */ *cert_store;
830ebfedea0SLionel Sambuc     LHASH_OF(SSL_SESSION) *sessions;
831*0a6a1f1dSLionel Sambuc     /*
832*0a6a1f1dSLionel Sambuc      * Most session-ids that will be cached, default is
833*0a6a1f1dSLionel Sambuc      * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited.
834*0a6a1f1dSLionel Sambuc      */
835ebfedea0SLionel Sambuc     unsigned long session_cache_size;
836ebfedea0SLionel Sambuc     struct ssl_session_st *session_cache_head;
837ebfedea0SLionel Sambuc     struct ssl_session_st *session_cache_tail;
838*0a6a1f1dSLionel Sambuc     /*
839*0a6a1f1dSLionel Sambuc      * This can have one of 2 values, ored together, SSL_SESS_CACHE_CLIENT,
840*0a6a1f1dSLionel Sambuc      * SSL_SESS_CACHE_SERVER, Default is SSL_SESSION_CACHE_SERVER, which
841*0a6a1f1dSLionel Sambuc      * means only SSL_accept which cache SSL_SESSIONS.
842*0a6a1f1dSLionel Sambuc      */
843ebfedea0SLionel Sambuc     int session_cache_mode;
844*0a6a1f1dSLionel Sambuc     /*
845*0a6a1f1dSLionel Sambuc      * If timeout is not 0, it is the default timeout value set when
846*0a6a1f1dSLionel Sambuc      * SSL_new() is called.  This has been put in to make life easier to set
847*0a6a1f1dSLionel Sambuc      * things up
848*0a6a1f1dSLionel Sambuc      */
849ebfedea0SLionel Sambuc     long session_timeout;
850*0a6a1f1dSLionel Sambuc     /*
851*0a6a1f1dSLionel Sambuc      * If this callback is not null, it will be called each time a session id
852*0a6a1f1dSLionel Sambuc      * is added to the cache.  If this function returns 1, it means that the
853*0a6a1f1dSLionel Sambuc      * callback will do a SSL_SESSION_free() when it has finished using it.
854*0a6a1f1dSLionel Sambuc      * Otherwise, on 0, it means the callback has finished with it. If
855*0a6a1f1dSLionel Sambuc      * remove_session_cb is not null, it will be called when a session-id is
856*0a6a1f1dSLionel Sambuc      * removed from the cache.  After the call, OpenSSL will
857*0a6a1f1dSLionel Sambuc      * SSL_SESSION_free() it.
858*0a6a1f1dSLionel Sambuc      */
859ebfedea0SLionel Sambuc     int (*new_session_cb) (struct ssl_st *ssl, SSL_SESSION *sess);
860ebfedea0SLionel Sambuc     void (*remove_session_cb) (struct ssl_ctx_st *ctx, SSL_SESSION *sess);
861ebfedea0SLionel Sambuc     SSL_SESSION *(*get_session_cb) (struct ssl_st *ssl,
862ebfedea0SLionel Sambuc                                     unsigned char *data, int len, int *copy);
863*0a6a1f1dSLionel Sambuc     struct {
864ebfedea0SLionel Sambuc         int sess_connect;       /* SSL new conn - started */
865ebfedea0SLionel Sambuc         int sess_connect_renegotiate; /* SSL reneg - requested */
866ebfedea0SLionel Sambuc         int sess_connect_good;  /* SSL new conne/reneg - finished */
867ebfedea0SLionel Sambuc         int sess_accept;        /* SSL new accept - started */
868ebfedea0SLionel Sambuc         int sess_accept_renegotiate; /* SSL reneg - requested */
869ebfedea0SLionel Sambuc         int sess_accept_good;   /* SSL accept/reneg - finished */
870ebfedea0SLionel Sambuc         int sess_miss;          /* session lookup misses */
871ebfedea0SLionel Sambuc         int sess_timeout;       /* reuse attempt on timeouted session */
872ebfedea0SLionel Sambuc         int sess_cache_full;    /* session removed due to full cache */
873ebfedea0SLionel Sambuc         int sess_hit;           /* session reuse actually done */
874*0a6a1f1dSLionel Sambuc         int sess_cb_hit;        /* session-id that was not in the cache was
875ebfedea0SLionel Sambuc                                  * passed back via the callback.  This
876ebfedea0SLionel Sambuc                                  * indicates that the application is
877ebfedea0SLionel Sambuc                                  * supplying session-id's from other
878ebfedea0SLionel Sambuc                                  * processes - spooky :-) */
879ebfedea0SLionel Sambuc     } stats;
880ebfedea0SLionel Sambuc 
881ebfedea0SLionel Sambuc     int references;
882ebfedea0SLionel Sambuc 
883ebfedea0SLionel Sambuc     /* if defined, these override the X509_verify_cert() calls */
884ebfedea0SLionel Sambuc     int (*app_verify_callback) (X509_STORE_CTX *, void *);
885ebfedea0SLionel Sambuc     void *app_verify_arg;
886*0a6a1f1dSLionel Sambuc     /*
887*0a6a1f1dSLionel Sambuc      * before OpenSSL 0.9.7, 'app_verify_arg' was ignored
888*0a6a1f1dSLionel Sambuc      * ('app_verify_callback' was called with just one argument)
889*0a6a1f1dSLionel Sambuc      */
890ebfedea0SLionel Sambuc 
891ebfedea0SLionel Sambuc     /* Default password callback. */
892ebfedea0SLionel Sambuc     pem_password_cb *default_passwd_callback;
893ebfedea0SLionel Sambuc 
894ebfedea0SLionel Sambuc     /* Default password callback user data. */
895ebfedea0SLionel Sambuc     void *default_passwd_callback_userdata;
896ebfedea0SLionel Sambuc 
897ebfedea0SLionel Sambuc     /* get client cert callback */
898ebfedea0SLionel Sambuc     int (*client_cert_cb) (SSL *ssl, X509 **x509, EVP_PKEY **pkey);
899ebfedea0SLionel Sambuc 
900ebfedea0SLionel Sambuc     /* cookie generate callback */
901ebfedea0SLionel Sambuc     int (*app_gen_cookie_cb) (SSL *ssl, unsigned char *cookie,
902ebfedea0SLionel Sambuc                               unsigned int *cookie_len);
903ebfedea0SLionel Sambuc 
904ebfedea0SLionel Sambuc     /* verify cookie callback */
905ebfedea0SLionel Sambuc     int (*app_verify_cookie_cb) (SSL *ssl, unsigned char *cookie,
906ebfedea0SLionel Sambuc                                  unsigned int cookie_len);
907ebfedea0SLionel Sambuc 
908ebfedea0SLionel Sambuc     CRYPTO_EX_DATA ex_data;
909ebfedea0SLionel Sambuc 
910ebfedea0SLionel Sambuc     const EVP_MD *rsa_md5;      /* For SSLv2 - name is 'ssl2-md5' */
911ebfedea0SLionel Sambuc     const EVP_MD *md5;          /* For SSLv3/TLSv1 'ssl3-md5' */
912ebfedea0SLionel Sambuc     const EVP_MD *sha1;         /* For SSLv3/TLSv1 'ssl3->sha1' */
913ebfedea0SLionel Sambuc 
914ebfedea0SLionel Sambuc     STACK_OF(X509) *extra_certs;
915ebfedea0SLionel Sambuc     STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
916ebfedea0SLionel Sambuc 
917ebfedea0SLionel Sambuc     /* Default values used when no per-SSL value is defined follow */
918ebfedea0SLionel Sambuc 
919*0a6a1f1dSLionel Sambuc     /* used if SSL's info_callback is NULL */
920*0a6a1f1dSLionel Sambuc     void (*info_callback) (const SSL *ssl, int type, int val);
921ebfedea0SLionel Sambuc 
922ebfedea0SLionel Sambuc     /* what we put in client cert requests */
923ebfedea0SLionel Sambuc     STACK_OF(X509_NAME) *client_CA;
924ebfedea0SLionel Sambuc 
925*0a6a1f1dSLionel Sambuc     /*
926*0a6a1f1dSLionel Sambuc      * Default values to use in SSL structures follow (these are copied by
927*0a6a1f1dSLionel Sambuc      * SSL_new)
928*0a6a1f1dSLionel Sambuc      */
929ebfedea0SLionel Sambuc 
930ebfedea0SLionel Sambuc     unsigned long options;
931ebfedea0SLionel Sambuc     unsigned long mode;
932ebfedea0SLionel Sambuc     long max_cert_list;
933ebfedea0SLionel Sambuc 
934ebfedea0SLionel Sambuc     struct cert_st /* CERT */ *cert;
935ebfedea0SLionel Sambuc     int read_ahead;
936ebfedea0SLionel Sambuc 
937ebfedea0SLionel Sambuc     /* callback that allows applications to peek at protocol messages */
938*0a6a1f1dSLionel Sambuc     void (*msg_callback) (int write_p, int version, int content_type,
939*0a6a1f1dSLionel Sambuc                           const void *buf, size_t len, SSL *ssl, void *arg);
940ebfedea0SLionel Sambuc     void *msg_callback_arg;
941ebfedea0SLionel Sambuc 
942ebfedea0SLionel Sambuc     int verify_mode;
943ebfedea0SLionel Sambuc     unsigned int sid_ctx_length;
944ebfedea0SLionel Sambuc     unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
945*0a6a1f1dSLionel Sambuc     /* called 'verify_callback' in the SSL */
946*0a6a1f1dSLionel Sambuc     int (*default_verify_callback) (int ok, X509_STORE_CTX *ctx);
947ebfedea0SLionel Sambuc 
948ebfedea0SLionel Sambuc     /* Default generate session ID callback. */
949ebfedea0SLionel Sambuc     GEN_SESSION_CB generate_session_id;
950ebfedea0SLionel Sambuc 
951ebfedea0SLionel Sambuc     X509_VERIFY_PARAM *param;
952ebfedea0SLionel Sambuc 
953ebfedea0SLionel Sambuc #  if 0
954ebfedea0SLionel Sambuc     int purpose;                /* Purpose setting */
955ebfedea0SLionel Sambuc     int trust;                  /* Trust setting */
956ebfedea0SLionel Sambuc #  endif
957ebfedea0SLionel Sambuc 
958ebfedea0SLionel Sambuc     int quiet_shutdown;
959ebfedea0SLionel Sambuc 
960*0a6a1f1dSLionel Sambuc     /*
961*0a6a1f1dSLionel Sambuc      * Maximum amount of data to send in one fragment. actual record size can
962*0a6a1f1dSLionel Sambuc      * be more than this due to padding and MAC overheads.
963ebfedea0SLionel Sambuc      */
964ebfedea0SLionel Sambuc     unsigned int max_send_fragment;
965ebfedea0SLionel Sambuc 
966*0a6a1f1dSLionel Sambuc #  ifndef OPENSSL_NO_ENGINE
967*0a6a1f1dSLionel Sambuc     /*
968*0a6a1f1dSLionel Sambuc      * Engine to pass requests for client certs to
969ebfedea0SLionel Sambuc      */
970ebfedea0SLionel Sambuc     ENGINE *client_cert_engine;
971ebfedea0SLionel Sambuc #  endif
972ebfedea0SLionel Sambuc 
973ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_TLSEXT
974ebfedea0SLionel Sambuc     /* TLS extensions servername callback */
975ebfedea0SLionel Sambuc     int (*tlsext_servername_callback) (SSL *, int *, void *);
976ebfedea0SLionel Sambuc     void *tlsext_servername_arg;
977ebfedea0SLionel Sambuc     /* RFC 4507 session ticket keys */
978ebfedea0SLionel Sambuc     unsigned char tlsext_tick_key_name[16];
979ebfedea0SLionel Sambuc     unsigned char tlsext_tick_hmac_key[16];
980ebfedea0SLionel Sambuc     unsigned char tlsext_tick_aes_key[16];
981ebfedea0SLionel Sambuc     /* Callback to support customisation of ticket key setting */
982ebfedea0SLionel Sambuc     int (*tlsext_ticket_key_cb) (SSL *ssl,
983ebfedea0SLionel Sambuc                                  unsigned char *name, unsigned char *iv,
984ebfedea0SLionel Sambuc                                  EVP_CIPHER_CTX *ectx,
985ebfedea0SLionel Sambuc                                  HMAC_CTX *hctx, int enc);
986ebfedea0SLionel Sambuc 
987ebfedea0SLionel Sambuc     /* certificate status request info */
988ebfedea0SLionel Sambuc     /* Callback for status request */
989ebfedea0SLionel Sambuc     int (*tlsext_status_cb) (SSL *ssl, void *arg);
990ebfedea0SLionel Sambuc     void *tlsext_status_arg;
991ebfedea0SLionel Sambuc 
992ebfedea0SLionel Sambuc     /* draft-rescorla-tls-opaque-prf-input-00.txt information */
993*0a6a1f1dSLionel Sambuc     int (*tlsext_opaque_prf_input_callback) (SSL *, void *peerinput,
994*0a6a1f1dSLionel Sambuc                                              size_t len, void *arg);
995ebfedea0SLionel Sambuc     void *tlsext_opaque_prf_input_callback_arg;
996ebfedea0SLionel Sambuc #  endif
997ebfedea0SLionel Sambuc 
998ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_PSK
999ebfedea0SLionel Sambuc     char *psk_identity_hint;
1000*0a6a1f1dSLionel Sambuc     unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
1001*0a6a1f1dSLionel Sambuc                                          char *identity,
1002*0a6a1f1dSLionel Sambuc                                          unsigned int max_identity_len,
1003*0a6a1f1dSLionel Sambuc                                          unsigned char *psk,
1004ebfedea0SLionel Sambuc                                          unsigned int max_psk_len);
1005ebfedea0SLionel Sambuc     unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
1006*0a6a1f1dSLionel Sambuc                                          unsigned char *psk,
1007*0a6a1f1dSLionel Sambuc                                          unsigned int max_psk_len);
1008ebfedea0SLionel Sambuc #  endif
1009ebfedea0SLionel Sambuc 
1010ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_BUF_FREELISTS
1011ebfedea0SLionel Sambuc #   define SSL_MAX_BUF_FREELIST_LEN_DEFAULT 32
1012ebfedea0SLionel Sambuc     unsigned int freelist_max_len;
1013ebfedea0SLionel Sambuc     struct ssl3_buf_freelist_st *wbuf_freelist;
1014ebfedea0SLionel Sambuc     struct ssl3_buf_freelist_st *rbuf_freelist;
1015ebfedea0SLionel Sambuc #  endif
1016ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_SRP
1017ebfedea0SLionel Sambuc     SRP_CTX srp_ctx;            /* ctx for SRP authentication */
1018ebfedea0SLionel Sambuc #  endif
1019ebfedea0SLionel Sambuc 
1020ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_TLSEXT
1021ebfedea0SLionel Sambuc 
1022ebfedea0SLionel Sambuc #   ifndef OPENSSL_NO_NEXTPROTONEG
1023ebfedea0SLionel Sambuc     /* Next protocol negotiation information */
1024ebfedea0SLionel Sambuc     /* (for experimental NPN extension). */
1025ebfedea0SLionel Sambuc 
1026*0a6a1f1dSLionel Sambuc     /*
1027*0a6a1f1dSLionel Sambuc      * For a server, this contains a callback function by which the set of
1028*0a6a1f1dSLionel Sambuc      * advertised protocols can be provided.
1029*0a6a1f1dSLionel Sambuc      */
1030ebfedea0SLionel Sambuc     int (*next_protos_advertised_cb) (SSL *s, const unsigned char **buf,
1031ebfedea0SLionel Sambuc                                       unsigned int *len, void *arg);
1032ebfedea0SLionel Sambuc     void *next_protos_advertised_cb_arg;
1033*0a6a1f1dSLionel Sambuc     /*
1034*0a6a1f1dSLionel Sambuc      * For a client, this contains a callback function that selects the next
1035*0a6a1f1dSLionel Sambuc      * protocol from the list provided by the server.
1036*0a6a1f1dSLionel Sambuc      */
1037ebfedea0SLionel Sambuc     int (*next_proto_select_cb) (SSL *s, unsigned char **out,
1038ebfedea0SLionel Sambuc                                  unsigned char *outlen,
1039ebfedea0SLionel Sambuc                                  const unsigned char *in,
1040*0a6a1f1dSLionel Sambuc                                  unsigned int inlen, void *arg);
1041ebfedea0SLionel Sambuc     void *next_proto_select_cb_arg;
1042ebfedea0SLionel Sambuc #   endif
1043ebfedea0SLionel Sambuc     /* SRTP profiles we are willing to do from RFC 5764 */
1044ebfedea0SLionel Sambuc     STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
1045ebfedea0SLionel Sambuc #  endif
1046ebfedea0SLionel Sambuc };
1047ebfedea0SLionel Sambuc 
1048ebfedea0SLionel Sambuc # endif
1049ebfedea0SLionel Sambuc 
1050ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_OFF                      0x0000
1051ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_CLIENT                   0x0001
1052ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_SERVER                   0x0002
1053ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_BOTH     (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
1054ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_NO_AUTO_CLEAR            0x0080
1055ebfedea0SLionel Sambuc /* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */
1056ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP       0x0100
1057ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_NO_INTERNAL_STORE        0x0200
1058ebfedea0SLionel Sambuc # define SSL_SESS_CACHE_NO_INTERNAL \
1059ebfedea0SLionel Sambuc         (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
1060ebfedea0SLionel Sambuc 
1061ebfedea0SLionel Sambuc LHASH_OF(SSL_SESSION) *SSL_CTX_sessions(SSL_CTX *ctx);
1062ebfedea0SLionel Sambuc # define SSL_CTX_sess_number(ctx) \
1063ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
1064ebfedea0SLionel Sambuc # define SSL_CTX_sess_connect(ctx) \
1065ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
1066ebfedea0SLionel Sambuc # define SSL_CTX_sess_connect_good(ctx) \
1067ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
1068ebfedea0SLionel Sambuc # define SSL_CTX_sess_connect_renegotiate(ctx) \
1069ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
1070ebfedea0SLionel Sambuc # define SSL_CTX_sess_accept(ctx) \
1071ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
1072ebfedea0SLionel Sambuc # define SSL_CTX_sess_accept_renegotiate(ctx) \
1073ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
1074ebfedea0SLionel Sambuc # define SSL_CTX_sess_accept_good(ctx) \
1075ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
1076ebfedea0SLionel Sambuc # define SSL_CTX_sess_hits(ctx) \
1077ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
1078ebfedea0SLionel Sambuc # define SSL_CTX_sess_cb_hits(ctx) \
1079ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
1080ebfedea0SLionel Sambuc # define SSL_CTX_sess_misses(ctx) \
1081ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
1082ebfedea0SLionel Sambuc # define SSL_CTX_sess_timeouts(ctx) \
1083ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
1084ebfedea0SLionel Sambuc # define SSL_CTX_sess_cache_full(ctx) \
1085ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
1086ebfedea0SLionel Sambuc 
1087*0a6a1f1dSLionel Sambuc void SSL_CTX_sess_set_new_cb(SSL_CTX *ctx,
1088*0a6a1f1dSLionel Sambuc                              int (*new_session_cb) (struct ssl_st *ssl,
1089*0a6a1f1dSLionel Sambuc                                                     SSL_SESSION *sess));
1090*0a6a1f1dSLionel Sambuc int (*SSL_CTX_sess_get_new_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
1091*0a6a1f1dSLionel Sambuc                                               SSL_SESSION *sess);
1092*0a6a1f1dSLionel Sambuc void SSL_CTX_sess_set_remove_cb(SSL_CTX *ctx,
1093*0a6a1f1dSLionel Sambuc                                 void (*remove_session_cb) (struct ssl_ctx_st
1094*0a6a1f1dSLionel Sambuc                                                            *ctx,
1095*0a6a1f1dSLionel Sambuc                                                            SSL_SESSION
1096*0a6a1f1dSLionel Sambuc                                                            *sess));
1097*0a6a1f1dSLionel Sambuc void (*SSL_CTX_sess_get_remove_cb(SSL_CTX *ctx)) (struct ssl_ctx_st *ctx,
1098*0a6a1f1dSLionel Sambuc                                                   SSL_SESSION *sess);
1099*0a6a1f1dSLionel Sambuc void SSL_CTX_sess_set_get_cb(SSL_CTX *ctx,
1100*0a6a1f1dSLionel Sambuc                              SSL_SESSION *(*get_session_cb) (struct ssl_st
1101*0a6a1f1dSLionel Sambuc                                                              *ssl,
1102*0a6a1f1dSLionel Sambuc                                                              unsigned char
1103*0a6a1f1dSLionel Sambuc                                                              *data, int len,
1104*0a6a1f1dSLionel Sambuc                                                              int *copy));
1105*0a6a1f1dSLionel Sambuc SSL_SESSION *(*SSL_CTX_sess_get_get_cb(SSL_CTX *ctx)) (struct ssl_st *ssl,
1106*0a6a1f1dSLionel Sambuc                                                        unsigned char *Data,
1107*0a6a1f1dSLionel Sambuc                                                        int len, int *copy);
1108*0a6a1f1dSLionel Sambuc void SSL_CTX_set_info_callback(SSL_CTX *ctx,
1109*0a6a1f1dSLionel Sambuc                                void (*cb) (const SSL *ssl, int type,
1110*0a6a1f1dSLionel Sambuc                                            int val));
1111*0a6a1f1dSLionel Sambuc void (*SSL_CTX_get_info_callback(SSL_CTX *ctx)) (const SSL *ssl, int type,
1112*0a6a1f1dSLionel Sambuc                                                  int val);
1113*0a6a1f1dSLionel Sambuc void SSL_CTX_set_client_cert_cb(SSL_CTX *ctx,
1114*0a6a1f1dSLionel Sambuc                                 int (*client_cert_cb) (SSL *ssl, X509 **x509,
1115*0a6a1f1dSLionel Sambuc                                                        EVP_PKEY **pkey));
1116*0a6a1f1dSLionel Sambuc int (*SSL_CTX_get_client_cert_cb(SSL_CTX *ctx)) (SSL *ssl, X509 **x509,
1117*0a6a1f1dSLionel Sambuc                                                  EVP_PKEY **pkey);
1118ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_ENGINE
1119ebfedea0SLionel Sambuc int SSL_CTX_set_client_cert_engine(SSL_CTX *ctx, ENGINE *e);
1120ebfedea0SLionel Sambuc # endif
1121*0a6a1f1dSLionel Sambuc void SSL_CTX_set_cookie_generate_cb(SSL_CTX *ctx,
1122*0a6a1f1dSLionel Sambuc                                     int (*app_gen_cookie_cb) (SSL *ssl,
1123*0a6a1f1dSLionel Sambuc                                                               unsigned char
1124*0a6a1f1dSLionel Sambuc                                                               *cookie,
1125*0a6a1f1dSLionel Sambuc                                                               unsigned int
1126*0a6a1f1dSLionel Sambuc                                                               *cookie_len));
1127*0a6a1f1dSLionel Sambuc void SSL_CTX_set_cookie_verify_cb(SSL_CTX *ctx,
1128*0a6a1f1dSLionel Sambuc                                   int (*app_verify_cookie_cb) (SSL *ssl,
1129*0a6a1f1dSLionel Sambuc                                                                unsigned char
1130*0a6a1f1dSLionel Sambuc                                                                *cookie,
1131*0a6a1f1dSLionel Sambuc                                                                unsigned int
1132*0a6a1f1dSLionel Sambuc                                                                cookie_len));
1133ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_NEXTPROTONEG
1134ebfedea0SLionel Sambuc void SSL_CTX_set_next_protos_advertised_cb(SSL_CTX *s,
1135ebfedea0SLionel Sambuc                                            int (*cb) (SSL *ssl,
1136*0a6a1f1dSLionel Sambuc                                                       const unsigned char
1137*0a6a1f1dSLionel Sambuc                                                       **out,
1138ebfedea0SLionel Sambuc                                                       unsigned int *outlen,
1139*0a6a1f1dSLionel Sambuc                                                       void *arg), void *arg);
1140ebfedea0SLionel Sambuc void SSL_CTX_set_next_proto_select_cb(SSL_CTX *s,
1141ebfedea0SLionel Sambuc                                       int (*cb) (SSL *ssl,
1142ebfedea0SLionel Sambuc                                                  unsigned char **out,
1143ebfedea0SLionel Sambuc                                                  unsigned char *outlen,
1144ebfedea0SLionel Sambuc                                                  const unsigned char *in,
1145ebfedea0SLionel Sambuc                                                  unsigned int inlen,
1146*0a6a1f1dSLionel Sambuc                                                  void *arg), void *arg);
1147ebfedea0SLionel Sambuc 
1148ebfedea0SLionel Sambuc int SSL_select_next_proto(unsigned char **out, unsigned char *outlen,
1149ebfedea0SLionel Sambuc                           const unsigned char *in, unsigned int inlen,
1150*0a6a1f1dSLionel Sambuc                           const unsigned char *client,
1151*0a6a1f1dSLionel Sambuc                           unsigned int client_len);
1152*0a6a1f1dSLionel Sambuc void SSL_get0_next_proto_negotiated(const SSL *s, const unsigned char **data,
1153*0a6a1f1dSLionel Sambuc                                     unsigned *len);
1154ebfedea0SLionel Sambuc 
1155ebfedea0SLionel Sambuc #  define OPENSSL_NPN_UNSUPPORTED 0
1156ebfedea0SLionel Sambuc #  define OPENSSL_NPN_NEGOTIATED  1
1157ebfedea0SLionel Sambuc #  define OPENSSL_NPN_NO_OVERLAP  2
1158ebfedea0SLionel Sambuc # endif
1159ebfedea0SLionel Sambuc 
1160ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_PSK
1161*0a6a1f1dSLionel Sambuc /*
1162*0a6a1f1dSLionel Sambuc  * the maximum length of the buffer given to callbacks containing the
1163*0a6a1f1dSLionel Sambuc  * resulting identity/psk
1164*0a6a1f1dSLionel Sambuc  */
1165ebfedea0SLionel Sambuc #  define PSK_MAX_IDENTITY_LEN 128
1166ebfedea0SLionel Sambuc #  define PSK_MAX_PSK_LEN 256
1167ebfedea0SLionel Sambuc void SSL_CTX_set_psk_client_callback(SSL_CTX *ctx,
1168*0a6a1f1dSLionel Sambuc                                      unsigned int (*psk_client_callback) (SSL
1169*0a6a1f1dSLionel Sambuc                                                                           *ssl,
1170*0a6a1f1dSLionel Sambuc                                                                           const
1171*0a6a1f1dSLionel Sambuc                                                                           char
1172*0a6a1f1dSLionel Sambuc                                                                           *hint,
1173*0a6a1f1dSLionel Sambuc                                                                           char
1174*0a6a1f1dSLionel Sambuc                                                                           *identity,
1175*0a6a1f1dSLionel Sambuc                                                                           unsigned
1176*0a6a1f1dSLionel Sambuc                                                                           int
1177*0a6a1f1dSLionel Sambuc                                                                           max_identity_len,
1178*0a6a1f1dSLionel Sambuc                                                                           unsigned
1179*0a6a1f1dSLionel Sambuc                                                                           char
1180*0a6a1f1dSLionel Sambuc                                                                           *psk,
1181*0a6a1f1dSLionel Sambuc                                                                           unsigned
1182*0a6a1f1dSLionel Sambuc                                                                           int
1183*0a6a1f1dSLionel Sambuc                                                                           max_psk_len));
1184ebfedea0SLionel Sambuc void SSL_set_psk_client_callback(SSL *ssl,
1185*0a6a1f1dSLionel Sambuc                                  unsigned int (*psk_client_callback) (SSL
1186*0a6a1f1dSLionel Sambuc                                                                       *ssl,
1187*0a6a1f1dSLionel Sambuc                                                                       const
1188*0a6a1f1dSLionel Sambuc                                                                       char
1189*0a6a1f1dSLionel Sambuc                                                                       *hint,
1190*0a6a1f1dSLionel Sambuc                                                                       char
1191*0a6a1f1dSLionel Sambuc                                                                       *identity,
1192*0a6a1f1dSLionel Sambuc                                                                       unsigned
1193*0a6a1f1dSLionel Sambuc                                                                       int
1194*0a6a1f1dSLionel Sambuc                                                                       max_identity_len,
1195*0a6a1f1dSLionel Sambuc                                                                       unsigned
1196*0a6a1f1dSLionel Sambuc                                                                       char
1197*0a6a1f1dSLionel Sambuc                                                                       *psk,
1198*0a6a1f1dSLionel Sambuc                                                                       unsigned
1199*0a6a1f1dSLionel Sambuc                                                                       int
1200*0a6a1f1dSLionel Sambuc                                                                       max_psk_len));
1201ebfedea0SLionel Sambuc void SSL_CTX_set_psk_server_callback(SSL_CTX *ctx,
1202*0a6a1f1dSLionel Sambuc                                      unsigned int (*psk_server_callback) (SSL
1203*0a6a1f1dSLionel Sambuc                                                                           *ssl,
1204*0a6a1f1dSLionel Sambuc                                                                           const
1205*0a6a1f1dSLionel Sambuc                                                                           char
1206*0a6a1f1dSLionel Sambuc                                                                           *identity,
1207*0a6a1f1dSLionel Sambuc                                                                           unsigned
1208*0a6a1f1dSLionel Sambuc                                                                           char
1209*0a6a1f1dSLionel Sambuc                                                                           *psk,
1210*0a6a1f1dSLionel Sambuc                                                                           unsigned
1211*0a6a1f1dSLionel Sambuc                                                                           int
1212*0a6a1f1dSLionel Sambuc                                                                           max_psk_len));
1213ebfedea0SLionel Sambuc void SSL_set_psk_server_callback(SSL *ssl,
1214*0a6a1f1dSLionel Sambuc                                  unsigned int (*psk_server_callback) (SSL
1215*0a6a1f1dSLionel Sambuc                                                                       *ssl,
1216*0a6a1f1dSLionel Sambuc                                                                       const
1217*0a6a1f1dSLionel Sambuc                                                                       char
1218*0a6a1f1dSLionel Sambuc                                                                       *identity,
1219*0a6a1f1dSLionel Sambuc                                                                       unsigned
1220*0a6a1f1dSLionel Sambuc                                                                       char
1221*0a6a1f1dSLionel Sambuc                                                                       *psk,
1222*0a6a1f1dSLionel Sambuc                                                                       unsigned
1223*0a6a1f1dSLionel Sambuc                                                                       int
1224*0a6a1f1dSLionel Sambuc                                                                       max_psk_len));
1225ebfedea0SLionel Sambuc int SSL_CTX_use_psk_identity_hint(SSL_CTX *ctx, const char *identity_hint);
1226ebfedea0SLionel Sambuc int SSL_use_psk_identity_hint(SSL *s, const char *identity_hint);
1227ebfedea0SLionel Sambuc const char *SSL_get_psk_identity_hint(const SSL *s);
1228ebfedea0SLionel Sambuc const char *SSL_get_psk_identity(const SSL *s);
1229ebfedea0SLionel Sambuc # endif
1230ebfedea0SLionel Sambuc 
1231ebfedea0SLionel Sambuc # define SSL_NOTHING     1
1232ebfedea0SLionel Sambuc # define SSL_WRITING     2
1233ebfedea0SLionel Sambuc # define SSL_READING     3
1234ebfedea0SLionel Sambuc # define SSL_X509_LOOKUP 4
1235ebfedea0SLionel Sambuc 
1236ebfedea0SLionel Sambuc /* These will only be used when doing non-blocking IO */
1237ebfedea0SLionel Sambuc # define SSL_want_nothing(s)     (SSL_want(s) == SSL_NOTHING)
1238ebfedea0SLionel Sambuc # define SSL_want_read(s)        (SSL_want(s) == SSL_READING)
1239ebfedea0SLionel Sambuc # define SSL_want_write(s)       (SSL_want(s) == SSL_WRITING)
1240ebfedea0SLionel Sambuc # define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP)
1241ebfedea0SLionel Sambuc 
1242ebfedea0SLionel Sambuc # define SSL_MAC_FLAG_READ_MAC_STREAM 1
1243ebfedea0SLionel Sambuc # define SSL_MAC_FLAG_WRITE_MAC_STREAM 2
1244ebfedea0SLionel Sambuc 
1245ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SSL_INTERN
1246ebfedea0SLionel Sambuc 
1247*0a6a1f1dSLionel Sambuc struct ssl_st {
1248*0a6a1f1dSLionel Sambuc     /*
1249*0a6a1f1dSLionel Sambuc      * protocol version (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION,
1250*0a6a1f1dSLionel Sambuc      * DTLS1_VERSION)
1251ebfedea0SLionel Sambuc      */
1252ebfedea0SLionel Sambuc     int version;
1253*0a6a1f1dSLionel Sambuc     /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
1254*0a6a1f1dSLionel Sambuc     int type;
1255*0a6a1f1dSLionel Sambuc     /* SSLv3 */
1256*0a6a1f1dSLionel Sambuc     const SSL_METHOD *method;
1257*0a6a1f1dSLionel Sambuc     /*
1258*0a6a1f1dSLionel Sambuc      * There are 2 BIO's even though they are normally both the same.  This
1259*0a6a1f1dSLionel Sambuc      * is so data can be read and written to different handlers
1260*0a6a1f1dSLionel Sambuc      */
1261ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_BIO
1262*0a6a1f1dSLionel Sambuc     /* used by SSL_read */
1263*0a6a1f1dSLionel Sambuc     BIO *rbio;
1264*0a6a1f1dSLionel Sambuc     /* used by SSL_write */
1265*0a6a1f1dSLionel Sambuc     BIO *wbio;
1266*0a6a1f1dSLionel Sambuc     /* used during session-id reuse to concatenate messages */
1267*0a6a1f1dSLionel Sambuc     BIO *bbio;
1268ebfedea0SLionel Sambuc #  else
1269*0a6a1f1dSLionel Sambuc     /* used by SSL_read */
1270*0a6a1f1dSLionel Sambuc     char *rbio;
1271*0a6a1f1dSLionel Sambuc     /* used by SSL_write */
1272*0a6a1f1dSLionel Sambuc     char *wbio;
1273ebfedea0SLionel Sambuc     char *bbio;
1274ebfedea0SLionel Sambuc #  endif
1275*0a6a1f1dSLionel Sambuc     /*
1276*0a6a1f1dSLionel Sambuc      * This holds a variable that indicates what we were doing when a 0 or -1
1277*0a6a1f1dSLionel Sambuc      * is returned.  This is needed for non-blocking IO so we know what
1278*0a6a1f1dSLionel Sambuc      * request needs re-doing when in SSL_accept or SSL_connect
1279*0a6a1f1dSLionel Sambuc      */
1280ebfedea0SLionel Sambuc     int rwstate;
1281ebfedea0SLionel Sambuc     /* true when we are actually in SSL_accept() or SSL_connect() */
1282ebfedea0SLionel Sambuc     int in_handshake;
1283ebfedea0SLionel Sambuc     int (*handshake_func) (SSL *);
1284*0a6a1f1dSLionel Sambuc     /*
1285*0a6a1f1dSLionel Sambuc      * Imagine that here's a boolean member "init" that is switched as soon
1286*0a6a1f1dSLionel Sambuc      * as SSL_set_{accept/connect}_state is called for the first time, so
1287*0a6a1f1dSLionel Sambuc      * that "state" and "handshake_func" are properly initialized.  But as
1288*0a6a1f1dSLionel Sambuc      * handshake_func is == 0 until then, we use this test instead of an
1289*0a6a1f1dSLionel Sambuc      * "init" member.
1290ebfedea0SLionel Sambuc      */
1291*0a6a1f1dSLionel Sambuc     /* are we the server side? - mostly used by SSL_clear */
1292*0a6a1f1dSLionel Sambuc     int server;
1293*0a6a1f1dSLionel Sambuc     /*
1294*0a6a1f1dSLionel Sambuc      * Generate a new session or reuse an old one.
1295ebfedea0SLionel Sambuc      * NB: For servers, the 'new' session may actually be a previously
1296ebfedea0SLionel Sambuc      * cached session or even the previous session unless
1297*0a6a1f1dSLionel Sambuc      * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set
1298*0a6a1f1dSLionel Sambuc      */
1299*0a6a1f1dSLionel Sambuc     int new_session;
1300*0a6a1f1dSLionel Sambuc     /* don't send shutdown packets */
1301*0a6a1f1dSLionel Sambuc     int quiet_shutdown;
1302*0a6a1f1dSLionel Sambuc     /* we have shut things down, 0x01 sent, 0x02 for received */
1303*0a6a1f1dSLionel Sambuc     int shutdown;
1304*0a6a1f1dSLionel Sambuc     /* where we are */
1305*0a6a1f1dSLionel Sambuc     int state;
1306*0a6a1f1dSLionel Sambuc     /* where we are when reading */
1307*0a6a1f1dSLionel Sambuc     int rstate;
1308ebfedea0SLionel Sambuc     BUF_MEM *init_buf;          /* buffer used during init */
1309*0a6a1f1dSLionel Sambuc     void *init_msg;             /* pointer to handshake message body, set by
1310*0a6a1f1dSLionel Sambuc                                  * ssl3_get_message() */
1311ebfedea0SLionel Sambuc     int init_num;               /* amount read/written */
1312ebfedea0SLionel Sambuc     int init_off;               /* amount read/written */
1313ebfedea0SLionel Sambuc     /* used internally to point at a raw packet */
1314ebfedea0SLionel Sambuc     unsigned char *packet;
1315ebfedea0SLionel Sambuc     unsigned int packet_length;
1316ebfedea0SLionel Sambuc     struct ssl2_state_st *s2;   /* SSLv2 variables */
1317ebfedea0SLionel Sambuc     struct ssl3_state_st *s3;   /* SSLv3 variables */
1318ebfedea0SLionel Sambuc     struct dtls1_state_st *d1;  /* DTLSv1 variables */
1319*0a6a1f1dSLionel Sambuc     int read_ahead;             /* Read as many input bytes as possible (for
1320*0a6a1f1dSLionel Sambuc                                  * non-blocking reads) */
1321ebfedea0SLionel Sambuc     /* callback that allows applications to peek at protocol messages */
1322*0a6a1f1dSLionel Sambuc     void (*msg_callback) (int write_p, int version, int content_type,
1323*0a6a1f1dSLionel Sambuc                           const void *buf, size_t len, SSL *ssl, void *arg);
1324ebfedea0SLionel Sambuc     void *msg_callback_arg;
1325ebfedea0SLionel Sambuc     int hit;                    /* reusing a previous session */
1326ebfedea0SLionel Sambuc     X509_VERIFY_PARAM *param;
1327ebfedea0SLionel Sambuc #  if 0
1328ebfedea0SLionel Sambuc     int purpose;                /* Purpose setting */
1329ebfedea0SLionel Sambuc     int trust;                  /* Trust setting */
1330ebfedea0SLionel Sambuc #  endif
1331ebfedea0SLionel Sambuc     /* crypto */
1332ebfedea0SLionel Sambuc     STACK_OF(SSL_CIPHER) *cipher_list;
1333ebfedea0SLionel Sambuc     STACK_OF(SSL_CIPHER) *cipher_list_by_id;
1334*0a6a1f1dSLionel Sambuc     /*
1335*0a6a1f1dSLionel Sambuc      * These are the ones being used, the ones in SSL_SESSION are the ones to
1336*0a6a1f1dSLionel Sambuc      * be 'copied' into these ones
1337*0a6a1f1dSLionel Sambuc      */
1338ebfedea0SLionel Sambuc     int mac_flags;
1339ebfedea0SLionel Sambuc     EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */
1340ebfedea0SLionel Sambuc     EVP_MD_CTX *read_hash;      /* used for mac generation */
1341ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_COMP
1342ebfedea0SLionel Sambuc     COMP_CTX *expand;           /* uncompress */
1343ebfedea0SLionel Sambuc #  else
1344ebfedea0SLionel Sambuc     char *expand;
1345ebfedea0SLionel Sambuc #  endif
1346ebfedea0SLionel Sambuc     EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */
1347ebfedea0SLionel Sambuc     EVP_MD_CTX *write_hash;     /* used for mac generation */
1348ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_COMP
1349ebfedea0SLionel Sambuc     COMP_CTX *compress;         /* compression */
1350ebfedea0SLionel Sambuc #  else
1351ebfedea0SLionel Sambuc     char *compress;
1352ebfedea0SLionel Sambuc #  endif
1353ebfedea0SLionel Sambuc     /* session info */
1354ebfedea0SLionel Sambuc     /* client cert? */
1355ebfedea0SLionel Sambuc     /* This is used to hold the server certificate used */
1356ebfedea0SLionel Sambuc     struct cert_st /* CERT */ *cert;
1357*0a6a1f1dSLionel Sambuc     /*
1358*0a6a1f1dSLionel Sambuc      * the session_id_context is used to ensure sessions are only reused in
1359*0a6a1f1dSLionel Sambuc      * the appropriate context
1360*0a6a1f1dSLionel Sambuc      */
1361ebfedea0SLionel Sambuc     unsigned int sid_ctx_length;
1362ebfedea0SLionel Sambuc     unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
1363ebfedea0SLionel Sambuc     /* This can also be in the session once a session is established */
1364ebfedea0SLionel Sambuc     SSL_SESSION *session;
1365ebfedea0SLionel Sambuc     /* Default generate session ID callback. */
1366ebfedea0SLionel Sambuc     GEN_SESSION_CB generate_session_id;
1367ebfedea0SLionel Sambuc     /* Used in SSL2 and SSL3 */
1368*0a6a1f1dSLionel Sambuc     /*
1369*0a6a1f1dSLionel Sambuc      * 0 don't care about verify failure.
1370*0a6a1f1dSLionel Sambuc      * 1 fail if verify fails
1371*0a6a1f1dSLionel Sambuc      */
1372*0a6a1f1dSLionel Sambuc     int verify_mode;
1373*0a6a1f1dSLionel Sambuc     /* fail if callback returns 0 */
1374*0a6a1f1dSLionel Sambuc     int (*verify_callback) (int ok, X509_STORE_CTX *ctx);
1375*0a6a1f1dSLionel Sambuc     /* optional informational callback */
1376*0a6a1f1dSLionel Sambuc     void (*info_callback) (const SSL *ssl, int type, int val);
1377*0a6a1f1dSLionel Sambuc     /* error bytes to be written */
1378*0a6a1f1dSLionel Sambuc     int error;
1379*0a6a1f1dSLionel Sambuc     /* actual code */
1380*0a6a1f1dSLionel Sambuc     int error_code;
1381ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_KRB5
1382*0a6a1f1dSLionel Sambuc     /* Kerberos 5 context */
1383*0a6a1f1dSLionel Sambuc     KSSL_CTX *kssl_ctx;
1384ebfedea0SLionel Sambuc #  endif                        /* OPENSSL_NO_KRB5 */
1385ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_PSK
1386*0a6a1f1dSLionel Sambuc     unsigned int (*psk_client_callback) (SSL *ssl, const char *hint,
1387*0a6a1f1dSLionel Sambuc                                          char *identity,
1388*0a6a1f1dSLionel Sambuc                                          unsigned int max_identity_len,
1389*0a6a1f1dSLionel Sambuc                                          unsigned char *psk,
1390ebfedea0SLionel Sambuc                                          unsigned int max_psk_len);
1391ebfedea0SLionel Sambuc     unsigned int (*psk_server_callback) (SSL *ssl, const char *identity,
1392*0a6a1f1dSLionel Sambuc                                          unsigned char *psk,
1393*0a6a1f1dSLionel Sambuc                                          unsigned int max_psk_len);
1394ebfedea0SLionel Sambuc #  endif
1395ebfedea0SLionel Sambuc     SSL_CTX *ctx;
1396*0a6a1f1dSLionel Sambuc     /*
1397*0a6a1f1dSLionel Sambuc      * set this flag to 1 and a sleep(1) is put into all SSL_read() and
1398*0a6a1f1dSLionel Sambuc      * SSL_write() calls, good for nbio debuging :-)
1399*0a6a1f1dSLionel Sambuc      */
1400ebfedea0SLionel Sambuc     int debug;
1401ebfedea0SLionel Sambuc     /* extra application data */
1402ebfedea0SLionel Sambuc     long verify_result;
1403ebfedea0SLionel Sambuc     CRYPTO_EX_DATA ex_data;
1404ebfedea0SLionel Sambuc     /* for server side, keep the list of CA_dn we can use */
1405ebfedea0SLionel Sambuc     STACK_OF(X509_NAME) *client_CA;
1406ebfedea0SLionel Sambuc     int references;
1407*0a6a1f1dSLionel Sambuc     /* protocol behaviour */
1408*0a6a1f1dSLionel Sambuc     unsigned long options;
1409*0a6a1f1dSLionel Sambuc     /* API behaviour */
1410*0a6a1f1dSLionel Sambuc     unsigned long mode;
1411ebfedea0SLionel Sambuc     long max_cert_list;
1412ebfedea0SLionel Sambuc     int first_packet;
1413*0a6a1f1dSLionel Sambuc     /* what was passed, used for SSLv3/TLS rollback check */
1414*0a6a1f1dSLionel Sambuc     int client_version;
1415ebfedea0SLionel Sambuc     unsigned int max_send_fragment;
1416ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_TLSEXT
1417ebfedea0SLionel Sambuc     /* TLS extension debug callback */
1418ebfedea0SLionel Sambuc     void (*tlsext_debug_cb) (SSL *s, int client_server, int type,
1419*0a6a1f1dSLionel Sambuc                              unsigned char *data, int len, void *arg);
1420ebfedea0SLionel Sambuc     void *tlsext_debug_arg;
1421ebfedea0SLionel Sambuc     char *tlsext_hostname;
1422*0a6a1f1dSLionel Sambuc     /*-
1423*0a6a1f1dSLionel Sambuc      * no further mod of servername
1424*0a6a1f1dSLionel Sambuc      * 0 : call the servername extension callback.
1425*0a6a1f1dSLionel Sambuc      * 1 : prepare 2, allow last ack just after in server callback.
1426*0a6a1f1dSLionel Sambuc      * 2 : don't call servername callback, no ack in server hello
1427ebfedea0SLionel Sambuc      */
1428*0a6a1f1dSLionel Sambuc     int servername_done;
1429ebfedea0SLionel Sambuc     /* certificate status request info */
1430ebfedea0SLionel Sambuc     /* Status type or -1 if no status type */
1431ebfedea0SLionel Sambuc     int tlsext_status_type;
1432ebfedea0SLionel Sambuc     /* Expect OCSP CertificateStatus message */
1433ebfedea0SLionel Sambuc     int tlsext_status_expected;
1434ebfedea0SLionel Sambuc     /* OCSP status request only */
1435ebfedea0SLionel Sambuc     STACK_OF(OCSP_RESPID) *tlsext_ocsp_ids;
1436ebfedea0SLionel Sambuc     X509_EXTENSIONS *tlsext_ocsp_exts;
1437ebfedea0SLionel Sambuc     /* OCSP response received or to be sent */
1438ebfedea0SLionel Sambuc     unsigned char *tlsext_ocsp_resp;
1439ebfedea0SLionel Sambuc     int tlsext_ocsp_resplen;
1440ebfedea0SLionel Sambuc     /* RFC4507 session ticket expected to be received or sent */
1441ebfedea0SLionel Sambuc     int tlsext_ticket_expected;
1442ebfedea0SLionel Sambuc #   ifndef OPENSSL_NO_EC
1443ebfedea0SLionel Sambuc     size_t tlsext_ecpointformatlist_length;
1444*0a6a1f1dSLionel Sambuc     /* our list */
1445*0a6a1f1dSLionel Sambuc     unsigned char *tlsext_ecpointformatlist;
1446ebfedea0SLionel Sambuc     size_t tlsext_ellipticcurvelist_length;
1447*0a6a1f1dSLionel Sambuc     /* our list */
1448*0a6a1f1dSLionel Sambuc     unsigned char *tlsext_ellipticcurvelist;
1449ebfedea0SLionel Sambuc #   endif                       /* OPENSSL_NO_EC */
1450*0a6a1f1dSLionel Sambuc     /*
1451*0a6a1f1dSLionel Sambuc      * draft-rescorla-tls-opaque-prf-input-00.txt information to be used for
1452*0a6a1f1dSLionel Sambuc      * handshakes
1453*0a6a1f1dSLionel Sambuc      */
1454ebfedea0SLionel Sambuc     void *tlsext_opaque_prf_input;
1455ebfedea0SLionel Sambuc     size_t tlsext_opaque_prf_input_len;
1456ebfedea0SLionel Sambuc     /* TLS Session Ticket extension override */
1457ebfedea0SLionel Sambuc     TLS_SESSION_TICKET_EXT *tlsext_session_ticket;
1458ebfedea0SLionel Sambuc     /* TLS Session Ticket extension callback */
1459ebfedea0SLionel Sambuc     tls_session_ticket_ext_cb_fn tls_session_ticket_ext_cb;
1460ebfedea0SLionel Sambuc     void *tls_session_ticket_ext_cb_arg;
1461ebfedea0SLionel Sambuc     /* TLS pre-shared secret session resumption */
1462ebfedea0SLionel Sambuc     tls_session_secret_cb_fn tls_session_secret_cb;
1463ebfedea0SLionel Sambuc     void *tls_session_secret_cb_arg;
1464ebfedea0SLionel Sambuc     SSL_CTX *initial_ctx;       /* initial ctx, used to store sessions */
1465ebfedea0SLionel Sambuc #   ifndef OPENSSL_NO_NEXTPROTONEG
1466*0a6a1f1dSLionel Sambuc     /*
1467*0a6a1f1dSLionel Sambuc      * Next protocol negotiation. For the client, this is the protocol that
1468ebfedea0SLionel Sambuc      * we sent in NextProtocol and is set when handling ServerHello
1469*0a6a1f1dSLionel Sambuc      * extensions. For a server, this is the client's selected_protocol from
1470*0a6a1f1dSLionel Sambuc      * NextProtocol and is set when handling the NextProtocol message, before
1471*0a6a1f1dSLionel Sambuc      * the Finished message.
1472*0a6a1f1dSLionel Sambuc      */
1473ebfedea0SLionel Sambuc     unsigned char *next_proto_negotiated;
1474ebfedea0SLionel Sambuc     unsigned char next_proto_negotiated_len;
1475ebfedea0SLionel Sambuc #   endif
1476ebfedea0SLionel Sambuc #   define session_ctx initial_ctx
1477*0a6a1f1dSLionel Sambuc     /* What we'll do */
1478*0a6a1f1dSLionel Sambuc     STACK_OF(SRTP_PROTECTION_PROFILE) *srtp_profiles;
1479*0a6a1f1dSLionel Sambuc     /* What's been chosen */
1480*0a6a1f1dSLionel Sambuc     SRTP_PROTECTION_PROFILE *srtp_profile;
1481*0a6a1f1dSLionel Sambuc         /*-
1482*0a6a1f1dSLionel Sambuc          * Is use of the Heartbeat extension negotiated?
1483*0a6a1f1dSLionel Sambuc          * 0: disabled
1484*0a6a1f1dSLionel Sambuc          * 1: enabled
1485*0a6a1f1dSLionel Sambuc          * 2: enabled, but not allowed to send Requests
1486ebfedea0SLionel Sambuc          */
1487*0a6a1f1dSLionel Sambuc     unsigned int tlsext_heartbeat;
1488*0a6a1f1dSLionel Sambuc     /* Indicates if a HeartbeatRequest is in flight */
1489*0a6a1f1dSLionel Sambuc     unsigned int tlsext_hb_pending;
1490*0a6a1f1dSLionel Sambuc     /* HeartbeatRequest sequence number */
1491*0a6a1f1dSLionel Sambuc     unsigned int tlsext_hb_seq;
1492ebfedea0SLionel Sambuc #  else
1493ebfedea0SLionel Sambuc #   define session_ctx ctx
1494ebfedea0SLionel Sambuc #  endif                        /* OPENSSL_NO_TLSEXT */
1495*0a6a1f1dSLionel Sambuc     /*-
1496*0a6a1f1dSLionel Sambuc      * 1 if we are renegotiating.
1497ebfedea0SLionel Sambuc      * 2 if we are a server and are inside a handshake
1498*0a6a1f1dSLionel Sambuc      * (i.e. not just sending a HelloRequest)
1499*0a6a1f1dSLionel Sambuc      */
1500*0a6a1f1dSLionel Sambuc     int renegotiate;
1501ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_SRP
1502*0a6a1f1dSLionel Sambuc     /* ctx for SRP authentication */
1503*0a6a1f1dSLionel Sambuc     SRP_CTX srp_ctx;
1504ebfedea0SLionel Sambuc #  endif
1505ebfedea0SLionel Sambuc };
1506ebfedea0SLionel Sambuc 
1507ebfedea0SLionel Sambuc # endif
1508ebfedea0SLionel Sambuc 
1509ebfedea0SLionel Sambuc #ifdef __cplusplus
1510ebfedea0SLionel Sambuc }
1511ebfedea0SLionel Sambuc #endif
1512ebfedea0SLionel Sambuc 
1513ebfedea0SLionel Sambuc # include <openssl/ssl2.h>
1514ebfedea0SLionel Sambuc # include <openssl/ssl3.h>
1515ebfedea0SLionel Sambuc # include <openssl/tls1.h>      /* This is mostly sslv3 with a few tweaks */
1516ebfedea0SLionel Sambuc # include <openssl/dtls1.h>     /* Datagram TLS */
1517ebfedea0SLionel Sambuc # include <openssl/ssl23.h>
1518ebfedea0SLionel Sambuc # include <openssl/srtp.h>      /* Support for the use_srtp extension */
1519ebfedea0SLionel Sambuc 
1520ebfedea0SLionel Sambuc #ifdef  __cplusplus
1521ebfedea0SLionel Sambuc extern "C" {
1522ebfedea0SLionel Sambuc #endif
1523ebfedea0SLionel Sambuc 
1524ebfedea0SLionel Sambuc /* compatibility */
1525ebfedea0SLionel Sambuc # define SSL_set_app_data(s,arg)         (SSL_set_ex_data(s,0,(char *)arg))
1526ebfedea0SLionel Sambuc # define SSL_get_app_data(s)             (SSL_get_ex_data(s,0))
1527ebfedea0SLionel Sambuc # define SSL_SESSION_set_app_data(s,a)   (SSL_SESSION_set_ex_data(s,0,(char *)a))
1528ebfedea0SLionel Sambuc # define SSL_SESSION_get_app_data(s)     (SSL_SESSION_get_ex_data(s,0))
1529ebfedea0SLionel Sambuc # define SSL_CTX_get_app_data(ctx)       (SSL_CTX_get_ex_data(ctx,0))
1530ebfedea0SLionel Sambuc # define SSL_CTX_set_app_data(ctx,arg)   (SSL_CTX_set_ex_data(ctx,0,(char *)arg))
1531ebfedea0SLionel Sambuc 
1532*0a6a1f1dSLionel Sambuc /*
1533*0a6a1f1dSLionel Sambuc  * The following are the possible values for ssl->state are are used to
1534*0a6a1f1dSLionel Sambuc  * indicate where we are up to in the SSL connection establishment. The
1535*0a6a1f1dSLionel Sambuc  * macros that follow are about the only things you should need to use and
1536*0a6a1f1dSLionel Sambuc  * even then, only when using non-blocking IO. It can also be useful to work
1537*0a6a1f1dSLionel Sambuc  * out where you were when the connection failed
1538*0a6a1f1dSLionel Sambuc  */
1539ebfedea0SLionel Sambuc 
1540ebfedea0SLionel Sambuc # define SSL_ST_CONNECT                  0x1000
1541ebfedea0SLionel Sambuc # define SSL_ST_ACCEPT                   0x2000
1542ebfedea0SLionel Sambuc # define SSL_ST_MASK                     0x0FFF
1543ebfedea0SLionel Sambuc # define SSL_ST_INIT                     (SSL_ST_CONNECT|SSL_ST_ACCEPT)
1544ebfedea0SLionel Sambuc # define SSL_ST_BEFORE                   0x4000
1545ebfedea0SLionel Sambuc # define SSL_ST_OK                       0x03
1546ebfedea0SLionel Sambuc # define SSL_ST_RENEGOTIATE              (0x04|SSL_ST_INIT)
1547*0a6a1f1dSLionel Sambuc # define SSL_ST_ERR                      0x05
1548ebfedea0SLionel Sambuc 
1549ebfedea0SLionel Sambuc # define SSL_CB_LOOP                     0x01
1550ebfedea0SLionel Sambuc # define SSL_CB_EXIT                     0x02
1551ebfedea0SLionel Sambuc # define SSL_CB_READ                     0x04
1552ebfedea0SLionel Sambuc # define SSL_CB_WRITE                    0x08
1553ebfedea0SLionel Sambuc # define SSL_CB_ALERT                    0x4000/* used in callback */
1554ebfedea0SLionel Sambuc # define SSL_CB_READ_ALERT               (SSL_CB_ALERT|SSL_CB_READ)
1555ebfedea0SLionel Sambuc # define SSL_CB_WRITE_ALERT              (SSL_CB_ALERT|SSL_CB_WRITE)
1556ebfedea0SLionel Sambuc # define SSL_CB_ACCEPT_LOOP              (SSL_ST_ACCEPT|SSL_CB_LOOP)
1557ebfedea0SLionel Sambuc # define SSL_CB_ACCEPT_EXIT              (SSL_ST_ACCEPT|SSL_CB_EXIT)
1558ebfedea0SLionel Sambuc # define SSL_CB_CONNECT_LOOP             (SSL_ST_CONNECT|SSL_CB_LOOP)
1559ebfedea0SLionel Sambuc # define SSL_CB_CONNECT_EXIT             (SSL_ST_CONNECT|SSL_CB_EXIT)
1560ebfedea0SLionel Sambuc # define SSL_CB_HANDSHAKE_START          0x10
1561ebfedea0SLionel Sambuc # define SSL_CB_HANDSHAKE_DONE           0x20
1562ebfedea0SLionel Sambuc 
1563ebfedea0SLionel Sambuc /* Is the SSL_connection established? */
1564ebfedea0SLionel Sambuc # define SSL_get_state(a)                SSL_state(a)
1565ebfedea0SLionel Sambuc # define SSL_is_init_finished(a)         (SSL_state(a) == SSL_ST_OK)
1566ebfedea0SLionel Sambuc # define SSL_in_init(a)                  (SSL_state(a)&SSL_ST_INIT)
1567ebfedea0SLionel Sambuc # define SSL_in_before(a)                (SSL_state(a)&SSL_ST_BEFORE)
1568ebfedea0SLionel Sambuc # define SSL_in_connect_init(a)          (SSL_state(a)&SSL_ST_CONNECT)
1569ebfedea0SLionel Sambuc # define SSL_in_accept_init(a)           (SSL_state(a)&SSL_ST_ACCEPT)
1570ebfedea0SLionel Sambuc 
1571*0a6a1f1dSLionel Sambuc /*
1572*0a6a1f1dSLionel Sambuc  * The following 2 states are kept in ssl->rstate when reads fail, you should
1573*0a6a1f1dSLionel Sambuc  * not need these
1574*0a6a1f1dSLionel Sambuc  */
1575ebfedea0SLionel Sambuc # define SSL_ST_READ_HEADER                      0xF0
1576ebfedea0SLionel Sambuc # define SSL_ST_READ_BODY                        0xF1
1577ebfedea0SLionel Sambuc # define SSL_ST_READ_DONE                        0xF2
1578ebfedea0SLionel Sambuc 
1579*0a6a1f1dSLionel Sambuc /*-
1580*0a6a1f1dSLionel Sambuc  * Obtain latest Finished message
1581ebfedea0SLionel Sambuc  *   -- that we sent (SSL_get_finished)
1582ebfedea0SLionel Sambuc  *   -- that we expected from peer (SSL_get_peer_finished).
1583*0a6a1f1dSLionel Sambuc  * Returns length (0 == no Finished so far), copies up to 'count' bytes.
1584*0a6a1f1dSLionel Sambuc  */
1585ebfedea0SLionel Sambuc size_t SSL_get_finished(const SSL *s, void *buf, size_t count);
1586ebfedea0SLionel Sambuc size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
1587ebfedea0SLionel Sambuc 
1588*0a6a1f1dSLionel Sambuc /*
1589*0a6a1f1dSLionel Sambuc  * use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options are
1590*0a6a1f1dSLionel Sambuc  * 'ored' with SSL_VERIFY_PEER if they are desired
1591*0a6a1f1dSLionel Sambuc  */
1592ebfedea0SLionel Sambuc # define SSL_VERIFY_NONE                 0x00
1593ebfedea0SLionel Sambuc # define SSL_VERIFY_PEER                 0x01
1594ebfedea0SLionel Sambuc # define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02
1595ebfedea0SLionel Sambuc # define SSL_VERIFY_CLIENT_ONCE          0x04
1596ebfedea0SLionel Sambuc 
1597ebfedea0SLionel Sambuc # define OpenSSL_add_ssl_algorithms()    SSL_library_init()
1598ebfedea0SLionel Sambuc # define SSLeay_add_ssl_algorithms()     SSL_library_init()
1599ebfedea0SLionel Sambuc 
1600ebfedea0SLionel Sambuc /* this is for backward compatibility */
1601ebfedea0SLionel Sambuc # if 0                          /* NEW_SSLEAY */
1602ebfedea0SLionel Sambuc #  define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
1603ebfedea0SLionel Sambuc #  define SSL_set_pref_cipher(c,n)        SSL_set_cipher_list(c,n)
1604ebfedea0SLionel Sambuc #  define SSL_add_session(a,b)            SSL_CTX_add_session((a),(b))
1605ebfedea0SLionel Sambuc #  define SSL_remove_session(a,b)         SSL_CTX_remove_session((a),(b))
1606ebfedea0SLionel Sambuc #  define SSL_flush_sessions(a,b)         SSL_CTX_flush_sessions((a),(b))
1607ebfedea0SLionel Sambuc # endif
1608ebfedea0SLionel Sambuc /* More backward compatibility */
1609ebfedea0SLionel Sambuc # define SSL_get_cipher(s) \
1610ebfedea0SLionel Sambuc                 SSL_CIPHER_get_name(SSL_get_current_cipher(s))
1611ebfedea0SLionel Sambuc # define SSL_get_cipher_bits(s,np) \
1612ebfedea0SLionel Sambuc                 SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
1613ebfedea0SLionel Sambuc # define SSL_get_cipher_version(s) \
1614ebfedea0SLionel Sambuc                 SSL_CIPHER_get_version(SSL_get_current_cipher(s))
1615ebfedea0SLionel Sambuc # define SSL_get_cipher_name(s) \
1616ebfedea0SLionel Sambuc                 SSL_CIPHER_get_name(SSL_get_current_cipher(s))
1617ebfedea0SLionel Sambuc # define SSL_get_time(a)         SSL_SESSION_get_time(a)
1618ebfedea0SLionel Sambuc # define SSL_set_time(a,b)       SSL_SESSION_set_time((a),(b))
1619ebfedea0SLionel Sambuc # define SSL_get_timeout(a)      SSL_SESSION_get_timeout(a)
1620ebfedea0SLionel Sambuc # define SSL_set_timeout(a,b)    SSL_SESSION_set_timeout((a),(b))
1621ebfedea0SLionel Sambuc 
1622ebfedea0SLionel Sambuc # define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)
1623ebfedea0SLionel Sambuc # define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)
1624ebfedea0SLionel Sambuc 
1625ebfedea0SLionel Sambuc DECLARE_PEM_rw(SSL_SESSION, SSL_SESSION)
1626*0a6a1f1dSLionel Sambuc # define SSL_AD_REASON_OFFSET            1000/* offset to get SSL_R_... value
1627*0a6a1f1dSLionel Sambuc                                               * from SSL_AD_... */
1628ebfedea0SLionel Sambuc /* These alert types are for SSLv3 and TLSv1 */
1629ebfedea0SLionel Sambuc # define SSL_AD_CLOSE_NOTIFY             SSL3_AD_CLOSE_NOTIFY
1630*0a6a1f1dSLionel Sambuc /* fatal */
1631*0a6a1f1dSLionel Sambuc # define SSL_AD_UNEXPECTED_MESSAGE       SSL3_AD_UNEXPECTED_MESSAGE
1632*0a6a1f1dSLionel Sambuc /* fatal */
1633*0a6a1f1dSLionel Sambuc # define SSL_AD_BAD_RECORD_MAC           SSL3_AD_BAD_RECORD_MAC
1634ebfedea0SLionel Sambuc # define SSL_AD_DECRYPTION_FAILED        TLS1_AD_DECRYPTION_FAILED
1635ebfedea0SLionel Sambuc # define SSL_AD_RECORD_OVERFLOW          TLS1_AD_RECORD_OVERFLOW
1636*0a6a1f1dSLionel Sambuc /* fatal */
1637*0a6a1f1dSLionel Sambuc # define SSL_AD_DECOMPRESSION_FAILURE    SSL3_AD_DECOMPRESSION_FAILURE
1638*0a6a1f1dSLionel Sambuc /* fatal */
1639*0a6a1f1dSLionel Sambuc # define SSL_AD_HANDSHAKE_FAILURE        SSL3_AD_HANDSHAKE_FAILURE
1640*0a6a1f1dSLionel Sambuc /* Not for TLS */
1641*0a6a1f1dSLionel Sambuc # define SSL_AD_NO_CERTIFICATE           SSL3_AD_NO_CERTIFICATE
1642ebfedea0SLionel Sambuc # define SSL_AD_BAD_CERTIFICATE          SSL3_AD_BAD_CERTIFICATE
1643ebfedea0SLionel Sambuc # define SSL_AD_UNSUPPORTED_CERTIFICATE  SSL3_AD_UNSUPPORTED_CERTIFICATE
1644ebfedea0SLionel Sambuc # define SSL_AD_CERTIFICATE_REVOKED      SSL3_AD_CERTIFICATE_REVOKED
1645ebfedea0SLionel Sambuc # define SSL_AD_CERTIFICATE_EXPIRED      SSL3_AD_CERTIFICATE_EXPIRED
1646ebfedea0SLionel Sambuc # define SSL_AD_CERTIFICATE_UNKNOWN      SSL3_AD_CERTIFICATE_UNKNOWN
1647*0a6a1f1dSLionel Sambuc /* fatal */
1648*0a6a1f1dSLionel Sambuc # define SSL_AD_ILLEGAL_PARAMETER        SSL3_AD_ILLEGAL_PARAMETER
1649*0a6a1f1dSLionel Sambuc /* fatal */
1650*0a6a1f1dSLionel Sambuc # define SSL_AD_UNKNOWN_CA               TLS1_AD_UNKNOWN_CA
1651*0a6a1f1dSLionel Sambuc /* fatal */
1652*0a6a1f1dSLionel Sambuc # define SSL_AD_ACCESS_DENIED            TLS1_AD_ACCESS_DENIED
1653*0a6a1f1dSLionel Sambuc /* fatal */
1654*0a6a1f1dSLionel Sambuc # define SSL_AD_DECODE_ERROR             TLS1_AD_DECODE_ERROR
1655ebfedea0SLionel Sambuc # define SSL_AD_DECRYPT_ERROR            TLS1_AD_DECRYPT_ERROR
1656*0a6a1f1dSLionel Sambuc /* fatal */
1657*0a6a1f1dSLionel Sambuc # define SSL_AD_EXPORT_RESTRICTION       TLS1_AD_EXPORT_RESTRICTION
1658*0a6a1f1dSLionel Sambuc /* fatal */
1659*0a6a1f1dSLionel Sambuc # define SSL_AD_PROTOCOL_VERSION         TLS1_AD_PROTOCOL_VERSION
1660*0a6a1f1dSLionel Sambuc /* fatal */
1661*0a6a1f1dSLionel Sambuc # define SSL_AD_INSUFFICIENT_SECURITY    TLS1_AD_INSUFFICIENT_SECURITY
1662*0a6a1f1dSLionel Sambuc /* fatal */
1663*0a6a1f1dSLionel Sambuc # define SSL_AD_INTERNAL_ERROR           TLS1_AD_INTERNAL_ERROR
1664ebfedea0SLionel Sambuc # define SSL_AD_USER_CANCELLED           TLS1_AD_USER_CANCELLED
1665ebfedea0SLionel Sambuc # define SSL_AD_NO_RENEGOTIATION         TLS1_AD_NO_RENEGOTIATION
1666ebfedea0SLionel Sambuc # define SSL_AD_UNSUPPORTED_EXTENSION    TLS1_AD_UNSUPPORTED_EXTENSION
1667ebfedea0SLionel Sambuc # define SSL_AD_CERTIFICATE_UNOBTAINABLE TLS1_AD_CERTIFICATE_UNOBTAINABLE
1668ebfedea0SLionel Sambuc # define SSL_AD_UNRECOGNIZED_NAME        TLS1_AD_UNRECOGNIZED_NAME
1669ebfedea0SLionel Sambuc # define SSL_AD_BAD_CERTIFICATE_STATUS_RESPONSE TLS1_AD_BAD_CERTIFICATE_STATUS_RESPONSE
1670ebfedea0SLionel Sambuc # define SSL_AD_BAD_CERTIFICATE_HASH_VALUE TLS1_AD_BAD_CERTIFICATE_HASH_VALUE
1671*0a6a1f1dSLionel Sambuc /* fatal */
1672*0a6a1f1dSLionel Sambuc # define SSL_AD_UNKNOWN_PSK_IDENTITY     TLS1_AD_UNKNOWN_PSK_IDENTITY
1673*0a6a1f1dSLionel Sambuc /* fatal */
1674*0a6a1f1dSLionel Sambuc # define SSL_AD_INAPPROPRIATE_FALLBACK   TLS1_AD_INAPPROPRIATE_FALLBACK
1675ebfedea0SLionel Sambuc # define SSL_ERROR_NONE                  0
1676ebfedea0SLionel Sambuc # define SSL_ERROR_SSL                   1
1677ebfedea0SLionel Sambuc # define SSL_ERROR_WANT_READ             2
1678ebfedea0SLionel Sambuc # define SSL_ERROR_WANT_WRITE            3
1679ebfedea0SLionel Sambuc # define SSL_ERROR_WANT_X509_LOOKUP      4
1680*0a6a1f1dSLionel Sambuc # define SSL_ERROR_SYSCALL               5/* look at error stack/return
1681*0a6a1f1dSLionel Sambuc                                            * value/errno */
1682ebfedea0SLionel Sambuc # define SSL_ERROR_ZERO_RETURN           6
1683ebfedea0SLionel Sambuc # define SSL_ERROR_WANT_CONNECT          7
1684ebfedea0SLionel Sambuc # define SSL_ERROR_WANT_ACCEPT           8
1685ebfedea0SLionel Sambuc # define SSL_CTRL_NEED_TMP_RSA                   1
1686ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_RSA                    2
1687ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_DH                     3
1688ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_ECDH                   4
1689ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_RSA_CB                 5
1690ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_DH_CB                  6
1691ebfedea0SLionel Sambuc # define SSL_CTRL_SET_TMP_ECDH_CB                7
1692ebfedea0SLionel Sambuc # define SSL_CTRL_GET_SESSION_REUSED             8
1693ebfedea0SLionel Sambuc # define SSL_CTRL_GET_CLIENT_CERT_REQUEST        9
1694ebfedea0SLionel Sambuc # define SSL_CTRL_GET_NUM_RENEGOTIATIONS         10
1695ebfedea0SLionel Sambuc # define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS       11
1696ebfedea0SLionel Sambuc # define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS       12
1697ebfedea0SLionel Sambuc # define SSL_CTRL_GET_FLAGS                      13
1698ebfedea0SLionel Sambuc # define SSL_CTRL_EXTRA_CHAIN_CERT               14
1699ebfedea0SLionel Sambuc # define SSL_CTRL_SET_MSG_CALLBACK               15
1700ebfedea0SLionel Sambuc # define SSL_CTRL_SET_MSG_CALLBACK_ARG           16
1701ebfedea0SLionel Sambuc /* only applies to datagram connections */
1702ebfedea0SLionel Sambuc # define SSL_CTRL_SET_MTU                17
1703ebfedea0SLionel Sambuc /* Stats */
1704ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_NUMBER                    20
1705ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_CONNECT                   21
1706ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_CONNECT_GOOD              22
1707ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_CONNECT_RENEGOTIATE       23
1708ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_ACCEPT                    24
1709ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_ACCEPT_GOOD               25
1710ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE        26
1711ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_HIT                       27
1712ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_CB_HIT                    28
1713ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_MISSES                    29
1714ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_TIMEOUTS                  30
1715ebfedea0SLionel Sambuc # define SSL_CTRL_SESS_CACHE_FULL                31
1716ebfedea0SLionel Sambuc # define SSL_CTRL_OPTIONS                        32
1717ebfedea0SLionel Sambuc # define SSL_CTRL_MODE                           33
1718ebfedea0SLionel Sambuc # define SSL_CTRL_GET_READ_AHEAD                 40
1719ebfedea0SLionel Sambuc # define SSL_CTRL_SET_READ_AHEAD                 41
1720ebfedea0SLionel Sambuc # define SSL_CTRL_SET_SESS_CACHE_SIZE            42
1721ebfedea0SLionel Sambuc # define SSL_CTRL_GET_SESS_CACHE_SIZE            43
1722ebfedea0SLionel Sambuc # define SSL_CTRL_SET_SESS_CACHE_MODE            44
1723ebfedea0SLionel Sambuc # define SSL_CTRL_GET_SESS_CACHE_MODE            45
1724ebfedea0SLionel Sambuc # define SSL_CTRL_GET_MAX_CERT_LIST              50
1725ebfedea0SLionel Sambuc # define SSL_CTRL_SET_MAX_CERT_LIST              51
1726ebfedea0SLionel Sambuc # define SSL_CTRL_SET_MAX_SEND_FRAGMENT          52
1727ebfedea0SLionel Sambuc /* see tls1.h for macros based on these */
1728ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_TLSEXT
1729ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_SERVERNAME_CB       53
1730ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_SERVERNAME_ARG      54
1731ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_HOSTNAME            55
1732ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_DEBUG_CB            56
1733ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_DEBUG_ARG           57
1734ebfedea0SLionel Sambuc #  define SSL_CTRL_GET_TLSEXT_TICKET_KEYS         58
1735ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_TICKET_KEYS         59
1736ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT    60
1737ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB 61
1738ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_OPAQUE_PRF_INPUT_CB_ARG 62
1739ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB       63
1740ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_CB_ARG   64
1741ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_TYPE     65
1742ebfedea0SLionel Sambuc #  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_EXTS     66
1743ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_EXTS     67
1744ebfedea0SLionel Sambuc #  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_IDS      68
1745ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_IDS      69
1746ebfedea0SLionel Sambuc #  define SSL_CTRL_GET_TLSEXT_STATUS_REQ_OCSP_RESP        70
1747ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_STATUS_REQ_OCSP_RESP        71
1748ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLSEXT_TICKET_KEY_CB       72
1749ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME_CB    75
1750ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_SRP_VERIFY_PARAM_CB                76
1751ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_SRP_GIVE_CLIENT_PWD_CB             77
1752ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_SRP_ARG            78
1753ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLS_EXT_SRP_USERNAME               79
1754ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLS_EXT_SRP_STRENGTH               80
1755ebfedea0SLionel Sambuc #  define SSL_CTRL_SET_TLS_EXT_SRP_PASSWORD               81
1756ebfedea0SLionel Sambuc #  ifndef OPENSSL_NO_HEARTBEATS
1757ebfedea0SLionel Sambuc #   define SSL_CTRL_TLS_EXT_SEND_HEARTBEAT                         85
1758ebfedea0SLionel Sambuc #   define SSL_CTRL_GET_TLS_EXT_HEARTBEAT_PENDING          86
1759ebfedea0SLionel Sambuc #   define SSL_CTRL_SET_TLS_EXT_HEARTBEAT_NO_REQUESTS      87
1760ebfedea0SLionel Sambuc #  endif
1761ebfedea0SLionel Sambuc # endif
1762ebfedea0SLionel Sambuc # define DTLS_CTRL_GET_TIMEOUT           73
1763ebfedea0SLionel Sambuc # define DTLS_CTRL_HANDLE_TIMEOUT        74
1764ebfedea0SLionel Sambuc # define DTLS_CTRL_LISTEN                        75
1765ebfedea0SLionel Sambuc # define SSL_CTRL_GET_RI_SUPPORT                 76
1766ebfedea0SLionel Sambuc # define SSL_CTRL_CLEAR_OPTIONS                  77
1767ebfedea0SLionel Sambuc # define SSL_CTRL_CLEAR_MODE                     78
1768ebfedea0SLionel Sambuc # define SSL_CTRL_GET_EXTRA_CHAIN_CERTS          82
1769ebfedea0SLionel Sambuc # define SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS        83
1770*0a6a1f1dSLionel Sambuc # define SSL_CTRL_CHECK_PROTO_VERSION            119
1771*0a6a1f1dSLionel Sambuc # define DTLS_CTRL_SET_LINK_MTU                  120
1772*0a6a1f1dSLionel Sambuc # define DTLS_CTRL_GET_LINK_MIN_MTU              121
1773ebfedea0SLionel Sambuc # define DTLSv1_get_timeout(ssl, arg) \
1774ebfedea0SLionel Sambuc         SSL_ctrl(ssl,DTLS_CTRL_GET_TIMEOUT,0, (void *)arg)
1775ebfedea0SLionel Sambuc # define DTLSv1_handle_timeout(ssl) \
1776ebfedea0SLionel Sambuc         SSL_ctrl(ssl,DTLS_CTRL_HANDLE_TIMEOUT,0, NULL)
1777ebfedea0SLionel Sambuc # define DTLSv1_listen(ssl, peer) \
1778ebfedea0SLionel Sambuc         SSL_ctrl(ssl,DTLS_CTRL_LISTEN,0, (void *)peer)
1779ebfedea0SLionel Sambuc # define SSL_session_reused(ssl) \
1780ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
1781ebfedea0SLionel Sambuc # define SSL_num_renegotiations(ssl) \
1782ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
1783ebfedea0SLionel Sambuc # define SSL_clear_num_renegotiations(ssl) \
1784ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
1785ebfedea0SLionel Sambuc # define SSL_total_renegotiations(ssl) \
1786ebfedea0SLionel Sambuc         SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
1787ebfedea0SLionel Sambuc # define SSL_CTX_need_tmp_RSA(ctx) \
1788ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
1789ebfedea0SLionel Sambuc # define SSL_CTX_set_tmp_rsa(ctx,rsa) \
1790ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
1791ebfedea0SLionel Sambuc # define SSL_CTX_set_tmp_dh(ctx,dh) \
1792ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
1793ebfedea0SLionel Sambuc # define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \
1794ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
1795ebfedea0SLionel Sambuc # define SSL_need_tmp_RSA(ssl) \
1796ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
1797ebfedea0SLionel Sambuc # define SSL_set_tmp_rsa(ssl,rsa) \
1798ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
1799ebfedea0SLionel Sambuc # define SSL_set_tmp_dh(ssl,dh) \
1800ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
1801ebfedea0SLionel Sambuc # define SSL_set_tmp_ecdh(ssl,ecdh) \
1802ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
1803ebfedea0SLionel Sambuc # define SSL_CTX_add_extra_chain_cert(ctx,x509) \
1804ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
1805ebfedea0SLionel Sambuc # define SSL_CTX_get_extra_chain_certs(ctx,px509) \
1806ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_GET_EXTRA_CHAIN_CERTS,0,px509)
1807ebfedea0SLionel Sambuc # define SSL_CTX_clear_extra_chain_certs(ctx) \
1808ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_CLEAR_EXTRA_CHAIN_CERTS,0,NULL)
1809ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO
1810ebfedea0SLionel Sambuc BIO_METHOD *BIO_f_ssl(void);
1811ebfedea0SLionel Sambuc BIO *BIO_new_ssl(SSL_CTX *ctx, int client);
1812ebfedea0SLionel Sambuc BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
1813ebfedea0SLionel Sambuc BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
1814ebfedea0SLionel Sambuc int BIO_ssl_copy_session_id(BIO *to, BIO *from);
1815ebfedea0SLionel Sambuc void BIO_ssl_shutdown(BIO *ssl_bio);
1816ebfedea0SLionel Sambuc 
1817ebfedea0SLionel Sambuc # endif
1818ebfedea0SLionel Sambuc 
1819ebfedea0SLionel Sambuc int SSL_CTX_set_cipher_list(SSL_CTX *, const char *str);
1820ebfedea0SLionel Sambuc SSL_CTX *SSL_CTX_new(const SSL_METHOD *meth);
1821ebfedea0SLionel Sambuc void SSL_CTX_free(SSL_CTX *);
1822ebfedea0SLionel Sambuc long SSL_CTX_set_timeout(SSL_CTX *ctx, long t);
1823ebfedea0SLionel Sambuc long SSL_CTX_get_timeout(const SSL_CTX *ctx);
1824ebfedea0SLionel Sambuc X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
1825ebfedea0SLionel Sambuc void SSL_CTX_set_cert_store(SSL_CTX *, X509_STORE *);
1826ebfedea0SLionel Sambuc int SSL_want(const SSL *s);
1827ebfedea0SLionel Sambuc int SSL_clear(SSL *s);
1828ebfedea0SLionel Sambuc 
1829ebfedea0SLionel Sambuc void SSL_CTX_flush_sessions(SSL_CTX *ctx, long tm);
1830ebfedea0SLionel Sambuc 
1831ebfedea0SLionel Sambuc const SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
1832ebfedea0SLionel Sambuc int SSL_CIPHER_get_bits(const SSL_CIPHER *c, int *alg_bits);
1833ebfedea0SLionel Sambuc char *SSL_CIPHER_get_version(const SSL_CIPHER *c);
1834ebfedea0SLionel Sambuc const char *SSL_CIPHER_get_name(const SSL_CIPHER *c);
1835ebfedea0SLionel Sambuc unsigned long SSL_CIPHER_get_id(const SSL_CIPHER *c);
1836ebfedea0SLionel Sambuc 
1837ebfedea0SLionel Sambuc int SSL_get_fd(const SSL *s);
1838ebfedea0SLionel Sambuc int SSL_get_rfd(const SSL *s);
1839ebfedea0SLionel Sambuc int SSL_get_wfd(const SSL *s);
1840ebfedea0SLionel Sambuc const char *SSL_get_cipher_list(const SSL *s, int n);
1841ebfedea0SLionel Sambuc char *SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
1842ebfedea0SLionel Sambuc int SSL_get_read_ahead(const SSL *s);
1843ebfedea0SLionel Sambuc int SSL_pending(const SSL *s);
1844ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SOCK
1845ebfedea0SLionel Sambuc int SSL_set_fd(SSL *s, int fd);
1846ebfedea0SLionel Sambuc int SSL_set_rfd(SSL *s, int fd);
1847ebfedea0SLionel Sambuc int SSL_set_wfd(SSL *s, int fd);
1848ebfedea0SLionel Sambuc # endif
1849ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO
1850ebfedea0SLionel Sambuc void SSL_set_bio(SSL *s, BIO *rbio, BIO *wbio);
1851ebfedea0SLionel Sambuc BIO *SSL_get_rbio(const SSL *s);
1852ebfedea0SLionel Sambuc BIO *SSL_get_wbio(const SSL *s);
1853ebfedea0SLionel Sambuc # endif
1854ebfedea0SLionel Sambuc int SSL_set_cipher_list(SSL *s, const char *str);
1855ebfedea0SLionel Sambuc void SSL_set_read_ahead(SSL *s, int yes);
1856ebfedea0SLionel Sambuc int SSL_get_verify_mode(const SSL *s);
1857ebfedea0SLionel Sambuc int SSL_get_verify_depth(const SSL *s);
1858ebfedea0SLionel Sambuc int (*SSL_get_verify_callback(const SSL *s)) (int, X509_STORE_CTX *);
1859ebfedea0SLionel Sambuc void SSL_set_verify(SSL *s, int mode,
1860ebfedea0SLionel Sambuc                     int (*callback) (int ok, X509_STORE_CTX *ctx));
1861ebfedea0SLionel Sambuc void SSL_set_verify_depth(SSL *s, int depth);
1862ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_RSA
1863ebfedea0SLionel Sambuc int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
1864ebfedea0SLionel Sambuc # endif
1865ebfedea0SLionel Sambuc int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
1866ebfedea0SLionel Sambuc int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
1867*0a6a1f1dSLionel Sambuc int SSL_use_PrivateKey_ASN1(int pk, SSL *ssl, const unsigned char *d,
1868*0a6a1f1dSLionel Sambuc                             long len);
1869ebfedea0SLionel Sambuc int SSL_use_certificate(SSL *ssl, X509 *x);
1870ebfedea0SLionel Sambuc int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
1871ebfedea0SLionel Sambuc 
1872ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_STDIO
1873ebfedea0SLionel Sambuc int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
1874ebfedea0SLionel Sambuc int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
1875ebfedea0SLionel Sambuc int SSL_use_certificate_file(SSL *ssl, const char *file, int type);
1876ebfedea0SLionel Sambuc int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
1877ebfedea0SLionel Sambuc int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
1878ebfedea0SLionel Sambuc int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
1879*0a6a1f1dSLionel Sambuc /* PEM type */
1880*0a6a1f1dSLionel Sambuc int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file);
1881ebfedea0SLionel Sambuc STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
1882ebfedea0SLionel Sambuc int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
1883ebfedea0SLionel Sambuc                                         const char *file);
1884ebfedea0SLionel Sambuc #  ifndef OPENSSL_SYS_VMS
1885*0a6a1f1dSLionel Sambuc /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */
1886*0a6a1f1dSLionel Sambuc #   ifndef OPENSSL_SYS_MACINTOSH_CLASSIC
1887ebfedea0SLionel Sambuc int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
1888ebfedea0SLionel Sambuc                                        const char *dir);
1889ebfedea0SLionel Sambuc #   endif
1890ebfedea0SLionel Sambuc #  endif
1891ebfedea0SLionel Sambuc 
1892ebfedea0SLionel Sambuc # endif
1893ebfedea0SLionel Sambuc 
1894ebfedea0SLionel Sambuc void SSL_load_error_strings(void);
1895ebfedea0SLionel Sambuc const char *SSL_state_string(const SSL *s);
1896ebfedea0SLionel Sambuc const char *SSL_rstate_string(const SSL *s);
1897ebfedea0SLionel Sambuc const char *SSL_state_string_long(const SSL *s);
1898ebfedea0SLionel Sambuc const char *SSL_rstate_string_long(const SSL *s);
1899ebfedea0SLionel Sambuc long SSL_SESSION_get_time(const SSL_SESSION *s);
1900ebfedea0SLionel Sambuc long SSL_SESSION_set_time(SSL_SESSION *s, long t);
1901ebfedea0SLionel Sambuc long SSL_SESSION_get_timeout(const SSL_SESSION *s);
1902ebfedea0SLionel Sambuc long SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
1903ebfedea0SLionel Sambuc void SSL_copy_session_id(SSL *to, const SSL *from);
1904ebfedea0SLionel Sambuc X509 *SSL_SESSION_get0_peer(SSL_SESSION *s);
1905ebfedea0SLionel Sambuc int SSL_SESSION_set1_id_context(SSL_SESSION *s, const unsigned char *sid_ctx,
1906ebfedea0SLionel Sambuc                                 unsigned int sid_ctx_len);
1907ebfedea0SLionel Sambuc 
1908ebfedea0SLionel Sambuc SSL_SESSION *SSL_SESSION_new(void);
1909ebfedea0SLionel Sambuc const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s,
1910ebfedea0SLionel Sambuc                                         unsigned int *len);
1911ebfedea0SLionel Sambuc unsigned int SSL_SESSION_get_compress_id(const SSL_SESSION *s);
1912ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_FP_API
1913ebfedea0SLionel Sambuc int SSL_SESSION_print_fp(FILE *fp, const SSL_SESSION *ses);
1914ebfedea0SLionel Sambuc # endif
1915ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_BIO
1916ebfedea0SLionel Sambuc int SSL_SESSION_print(BIO *fp, const SSL_SESSION *ses);
1917ebfedea0SLionel Sambuc # endif
1918ebfedea0SLionel Sambuc void SSL_SESSION_free(SSL_SESSION *ses);
1919ebfedea0SLionel Sambuc int i2d_SSL_SESSION(SSL_SESSION *in, unsigned char **pp);
1920ebfedea0SLionel Sambuc int SSL_set_session(SSL *to, SSL_SESSION *session);
1921ebfedea0SLionel Sambuc int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
1922ebfedea0SLionel Sambuc int SSL_CTX_remove_session(SSL_CTX *, SSL_SESSION *c);
1923ebfedea0SLionel Sambuc int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
1924ebfedea0SLionel Sambuc int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
1925ebfedea0SLionel Sambuc int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
1926ebfedea0SLionel Sambuc                                 unsigned int id_len);
1927ebfedea0SLionel Sambuc SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a, const unsigned char **pp,
1928ebfedea0SLionel Sambuc                              long length);
1929ebfedea0SLionel Sambuc 
1930ebfedea0SLionel Sambuc # ifdef HEADER_X509_H
1931ebfedea0SLionel Sambuc X509 *SSL_get_peer_certificate(const SSL *s);
1932ebfedea0SLionel Sambuc # endif
1933ebfedea0SLionel Sambuc 
1934ebfedea0SLionel Sambuc STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
1935ebfedea0SLionel Sambuc 
1936ebfedea0SLionel Sambuc int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
1937ebfedea0SLionel Sambuc int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
1938*0a6a1f1dSLionel Sambuc int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx)) (int,
1939*0a6a1f1dSLionel Sambuc                                                         X509_STORE_CTX *);
1940ebfedea0SLionel Sambuc void SSL_CTX_set_verify(SSL_CTX *ctx, int mode,
1941ebfedea0SLionel Sambuc                         int (*callback) (int, X509_STORE_CTX *));
1942ebfedea0SLionel Sambuc void SSL_CTX_set_verify_depth(SSL_CTX *ctx, int depth);
1943*0a6a1f1dSLionel Sambuc void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx,
1944*0a6a1f1dSLionel Sambuc                                       int (*cb) (X509_STORE_CTX *, void *),
1945*0a6a1f1dSLionel Sambuc                                       void *arg);
1946ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_RSA
1947ebfedea0SLionel Sambuc int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
1948ebfedea0SLionel Sambuc # endif
1949*0a6a1f1dSLionel Sambuc int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d,
1950*0a6a1f1dSLionel Sambuc                                    long len);
1951ebfedea0SLionel Sambuc int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
1952ebfedea0SLionel Sambuc int SSL_CTX_use_PrivateKey_ASN1(int pk, SSL_CTX *ctx,
1953ebfedea0SLionel Sambuc                                 const unsigned char *d, long len);
1954ebfedea0SLionel Sambuc int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
1955*0a6a1f1dSLionel Sambuc int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len,
1956*0a6a1f1dSLionel Sambuc                                  const unsigned char *d);
1957ebfedea0SLionel Sambuc 
1958ebfedea0SLionel Sambuc void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
1959ebfedea0SLionel Sambuc void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
1960ebfedea0SLionel Sambuc 
1961ebfedea0SLionel Sambuc int SSL_CTX_check_private_key(const SSL_CTX *ctx);
1962ebfedea0SLionel Sambuc int SSL_check_private_key(const SSL *ctx);
1963ebfedea0SLionel Sambuc 
1964ebfedea0SLionel Sambuc int SSL_CTX_set_session_id_context(SSL_CTX *ctx, const unsigned char *sid_ctx,
1965ebfedea0SLionel Sambuc                                    unsigned int sid_ctx_len);
1966ebfedea0SLionel Sambuc 
1967ebfedea0SLionel Sambuc SSL *SSL_new(SSL_CTX *ctx);
1968ebfedea0SLionel Sambuc int SSL_set_session_id_context(SSL *ssl, const unsigned char *sid_ctx,
1969ebfedea0SLionel Sambuc                                unsigned int sid_ctx_len);
1970ebfedea0SLionel Sambuc 
1971ebfedea0SLionel Sambuc int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
1972ebfedea0SLionel Sambuc int SSL_set_purpose(SSL *s, int purpose);
1973ebfedea0SLionel Sambuc int SSL_CTX_set_trust(SSL_CTX *s, int trust);
1974ebfedea0SLionel Sambuc int SSL_set_trust(SSL *s, int trust);
1975ebfedea0SLionel Sambuc 
1976ebfedea0SLionel Sambuc int SSL_CTX_set1_param(SSL_CTX *ctx, X509_VERIFY_PARAM *vpm);
1977ebfedea0SLionel Sambuc int SSL_set1_param(SSL *ssl, X509_VERIFY_PARAM *vpm);
1978ebfedea0SLionel Sambuc 
1979ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SRP
1980ebfedea0SLionel Sambuc int SSL_CTX_set_srp_username(SSL_CTX *ctx, char *name);
1981ebfedea0SLionel Sambuc int SSL_CTX_set_srp_password(SSL_CTX *ctx, char *password);
1982ebfedea0SLionel Sambuc int SSL_CTX_set_srp_strength(SSL_CTX *ctx, int strength);
1983ebfedea0SLionel Sambuc int SSL_CTX_set_srp_client_pwd_callback(SSL_CTX *ctx,
1984ebfedea0SLionel Sambuc                                         char *(*cb) (SSL *, void *));
1985ebfedea0SLionel Sambuc int SSL_CTX_set_srp_verify_param_callback(SSL_CTX *ctx,
1986ebfedea0SLionel Sambuc                                           int (*cb) (SSL *, void *));
1987ebfedea0SLionel Sambuc int SSL_CTX_set_srp_username_callback(SSL_CTX *ctx,
1988ebfedea0SLionel Sambuc                                       int (*cb) (SSL *, int *, void *));
1989ebfedea0SLionel Sambuc int SSL_CTX_set_srp_cb_arg(SSL_CTX *ctx, void *arg);
1990ebfedea0SLionel Sambuc 
1991ebfedea0SLionel Sambuc int SSL_set_srp_server_param(SSL *s, const BIGNUM *N, const BIGNUM *g,
1992ebfedea0SLionel Sambuc                              BIGNUM *sa, BIGNUM *v, char *info);
1993ebfedea0SLionel Sambuc int SSL_set_srp_server_param_pw(SSL *s, const char *user, const char *pass,
1994ebfedea0SLionel Sambuc                                 const char *grp);
1995ebfedea0SLionel Sambuc 
1996ebfedea0SLionel Sambuc BIGNUM *SSL_get_srp_g(SSL *s);
1997ebfedea0SLionel Sambuc BIGNUM *SSL_get_srp_N(SSL *s);
1998ebfedea0SLionel Sambuc 
1999ebfedea0SLionel Sambuc char *SSL_get_srp_username(SSL *s);
2000ebfedea0SLionel Sambuc char *SSL_get_srp_userinfo(SSL *s);
2001ebfedea0SLionel Sambuc # endif
2002ebfedea0SLionel Sambuc 
2003ebfedea0SLionel Sambuc void SSL_free(SSL *ssl);
2004ebfedea0SLionel Sambuc int SSL_accept(SSL *ssl);
2005ebfedea0SLionel Sambuc int SSL_connect(SSL *ssl);
2006ebfedea0SLionel Sambuc int SSL_read(SSL *ssl, void *buf, int num);
2007ebfedea0SLionel Sambuc int SSL_peek(SSL *ssl, void *buf, int num);
2008ebfedea0SLionel Sambuc int SSL_write(SSL *ssl, const void *buf, int num);
2009ebfedea0SLionel Sambuc long SSL_ctrl(SSL *ssl, int cmd, long larg, void *parg);
2010ebfedea0SLionel Sambuc long SSL_callback_ctrl(SSL *, int, void (*)(void));
2011ebfedea0SLionel Sambuc long SSL_CTX_ctrl(SSL_CTX *ctx, int cmd, long larg, void *parg);
2012ebfedea0SLionel Sambuc long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
2013ebfedea0SLionel Sambuc 
2014ebfedea0SLionel Sambuc int SSL_get_error(const SSL *s, int ret_code);
2015ebfedea0SLionel Sambuc const char *SSL_get_version(const SSL *s);
2016ebfedea0SLionel Sambuc 
2017ebfedea0SLionel Sambuc /* This sets the 'default' SSL version that SSL_new() will create */
2018ebfedea0SLionel Sambuc int SSL_CTX_set_ssl_version(SSL_CTX *ctx, const SSL_METHOD *meth);
2019ebfedea0SLionel Sambuc 
2020ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_SSL2
2021ebfedea0SLionel Sambuc const SSL_METHOD *SSLv2_method(void); /* SSLv2 */
2022ebfedea0SLionel Sambuc const SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */
2023ebfedea0SLionel Sambuc const SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */
2024ebfedea0SLionel Sambuc # endif
2025ebfedea0SLionel Sambuc 
2026*0a6a1f1dSLionel Sambuc # ifndef OPENSSL_NO_SSL3_METHOD
2027ebfedea0SLionel Sambuc const SSL_METHOD *SSLv3_method(void); /* SSLv3 */
2028ebfedea0SLionel Sambuc const SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */
2029ebfedea0SLionel Sambuc const SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */
2030*0a6a1f1dSLionel Sambuc # endif
2031ebfedea0SLionel Sambuc 
2032*0a6a1f1dSLionel Sambuc const SSL_METHOD *SSLv23_method(void); /* Negotiate highest available SSL/TLS
2033*0a6a1f1dSLionel Sambuc                                         * version */
2034*0a6a1f1dSLionel Sambuc const SSL_METHOD *SSLv23_server_method(void); /* Negotiate highest available
2035*0a6a1f1dSLionel Sambuc                                                * SSL/TLS version */
2036*0a6a1f1dSLionel Sambuc const SSL_METHOD *SSLv23_client_method(void); /* Negotiate highest available
2037*0a6a1f1dSLionel Sambuc                                                * SSL/TLS version */
2038ebfedea0SLionel Sambuc 
2039ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */
2040ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */
2041ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */
2042ebfedea0SLionel Sambuc 
2043ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_1_method(void); /* TLSv1.1 */
2044ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_1_server_method(void); /* TLSv1.1 */
2045ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_1_client_method(void); /* TLSv1.1 */
2046ebfedea0SLionel Sambuc 
2047ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_2_method(void); /* TLSv1.2 */
2048ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_2_server_method(void); /* TLSv1.2 */
2049ebfedea0SLionel Sambuc const SSL_METHOD *TLSv1_2_client_method(void); /* TLSv1.2 */
2050ebfedea0SLionel Sambuc 
2051ebfedea0SLionel Sambuc const SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */
2052ebfedea0SLionel Sambuc const SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */
2053ebfedea0SLionel Sambuc const SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */
2054ebfedea0SLionel Sambuc 
2055ebfedea0SLionel Sambuc STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
2056ebfedea0SLionel Sambuc 
2057ebfedea0SLionel Sambuc int SSL_do_handshake(SSL *s);
2058ebfedea0SLionel Sambuc int SSL_renegotiate(SSL *s);
2059ebfedea0SLionel Sambuc int SSL_renegotiate_abbreviated(SSL *s);
2060ebfedea0SLionel Sambuc int SSL_renegotiate_pending(SSL *s);
2061ebfedea0SLionel Sambuc int SSL_shutdown(SSL *s);
2062ebfedea0SLionel Sambuc 
2063ebfedea0SLionel Sambuc const SSL_METHOD *SSL_get_ssl_method(SSL *s);
2064ebfedea0SLionel Sambuc int SSL_set_ssl_method(SSL *s, const SSL_METHOD *method);
2065ebfedea0SLionel Sambuc const char *SSL_alert_type_string_long(int value);
2066ebfedea0SLionel Sambuc const char *SSL_alert_type_string(int value);
2067ebfedea0SLionel Sambuc const char *SSL_alert_desc_string_long(int value);
2068ebfedea0SLionel Sambuc const char *SSL_alert_desc_string(int value);
2069ebfedea0SLionel Sambuc 
2070ebfedea0SLionel Sambuc void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
2071ebfedea0SLionel Sambuc void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
2072ebfedea0SLionel Sambuc STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s);
2073ebfedea0SLionel Sambuc STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s);
2074ebfedea0SLionel Sambuc int SSL_add_client_CA(SSL *ssl, X509 *x);
2075ebfedea0SLionel Sambuc int SSL_CTX_add_client_CA(SSL_CTX *ctx, X509 *x);
2076ebfedea0SLionel Sambuc 
2077ebfedea0SLionel Sambuc void SSL_set_connect_state(SSL *s);
2078ebfedea0SLionel Sambuc void SSL_set_accept_state(SSL *s);
2079ebfedea0SLionel Sambuc 
2080ebfedea0SLionel Sambuc long SSL_get_default_timeout(const SSL *s);
2081ebfedea0SLionel Sambuc 
2082ebfedea0SLionel Sambuc int SSL_library_init(void);
2083ebfedea0SLionel Sambuc 
2084ebfedea0SLionel Sambuc char *SSL_CIPHER_description(const SSL_CIPHER *, char *buf, int size);
2085ebfedea0SLionel Sambuc STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
2086ebfedea0SLionel Sambuc 
2087ebfedea0SLionel Sambuc SSL *SSL_dup(SSL *ssl);
2088ebfedea0SLionel Sambuc 
2089ebfedea0SLionel Sambuc X509 *SSL_get_certificate(const SSL *ssl);
2090*0a6a1f1dSLionel Sambuc /*
2091*0a6a1f1dSLionel Sambuc  * EVP_PKEY
2092*0a6a1f1dSLionel Sambuc  */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl);
2093ebfedea0SLionel Sambuc 
2094ebfedea0SLionel Sambuc void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx, int mode);
2095ebfedea0SLionel Sambuc int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
2096ebfedea0SLionel Sambuc void SSL_set_quiet_shutdown(SSL *ssl, int mode);
2097ebfedea0SLionel Sambuc int SSL_get_quiet_shutdown(const SSL *ssl);
2098ebfedea0SLionel Sambuc void SSL_set_shutdown(SSL *ssl, int mode);
2099ebfedea0SLionel Sambuc int SSL_get_shutdown(const SSL *ssl);
2100ebfedea0SLionel Sambuc int SSL_version(const SSL *ssl);
2101ebfedea0SLionel Sambuc int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
2102ebfedea0SLionel Sambuc int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
2103ebfedea0SLionel Sambuc                                   const char *CApath);
2104ebfedea0SLionel Sambuc # define SSL_get0_session SSL_get_session/* just peek at pointer */
2105ebfedea0SLionel Sambuc SSL_SESSION *SSL_get_session(const SSL *ssl);
2106ebfedea0SLionel Sambuc SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */
2107ebfedea0SLionel Sambuc SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);
2108ebfedea0SLionel Sambuc SSL_CTX *SSL_set_SSL_CTX(SSL *ssl, SSL_CTX *ctx);
2109ebfedea0SLionel Sambuc void SSL_set_info_callback(SSL *ssl,
2110ebfedea0SLionel Sambuc                            void (*cb) (const SSL *ssl, int type, int val));
2111*0a6a1f1dSLionel Sambuc void (*SSL_get_info_callback(const SSL *ssl)) (const SSL *ssl, int type,
2112*0a6a1f1dSLionel Sambuc                                                int val);
2113ebfedea0SLionel Sambuc int SSL_state(const SSL *ssl);
2114ebfedea0SLionel Sambuc void SSL_set_state(SSL *ssl, int state);
2115ebfedea0SLionel Sambuc 
2116ebfedea0SLionel Sambuc void SSL_set_verify_result(SSL *ssl, long v);
2117ebfedea0SLionel Sambuc long SSL_get_verify_result(const SSL *ssl);
2118ebfedea0SLionel Sambuc 
2119ebfedea0SLionel Sambuc int SSL_set_ex_data(SSL *ssl, int idx, void *data);
2120ebfedea0SLionel Sambuc void *SSL_get_ex_data(const SSL *ssl, int idx);
2121ebfedea0SLionel Sambuc int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
2122ebfedea0SLionel Sambuc                          CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
2123ebfedea0SLionel Sambuc 
2124ebfedea0SLionel Sambuc int SSL_SESSION_set_ex_data(SSL_SESSION *ss, int idx, void *data);
2125ebfedea0SLionel Sambuc void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss, int idx);
2126*0a6a1f1dSLionel Sambuc int SSL_SESSION_get_ex_new_index(long argl, void *argp,
2127*0a6a1f1dSLionel Sambuc                                  CRYPTO_EX_new *new_func,
2128*0a6a1f1dSLionel Sambuc                                  CRYPTO_EX_dup *dup_func,
2129*0a6a1f1dSLionel Sambuc                                  CRYPTO_EX_free *free_func);
2130ebfedea0SLionel Sambuc 
2131ebfedea0SLionel Sambuc int SSL_CTX_set_ex_data(SSL_CTX *ssl, int idx, void *data);
2132ebfedea0SLionel Sambuc void *SSL_CTX_get_ex_data(const SSL_CTX *ssl, int idx);
2133ebfedea0SLionel Sambuc int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
2134*0a6a1f1dSLionel Sambuc                              CRYPTO_EX_dup *dup_func,
2135*0a6a1f1dSLionel Sambuc                              CRYPTO_EX_free *free_func);
2136ebfedea0SLionel Sambuc 
2137ebfedea0SLionel Sambuc int SSL_get_ex_data_X509_STORE_CTX_idx(void);
2138ebfedea0SLionel Sambuc 
2139ebfedea0SLionel Sambuc # define SSL_CTX_sess_set_cache_size(ctx,t) \
2140ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
2141ebfedea0SLionel Sambuc # define SSL_CTX_sess_get_cache_size(ctx) \
2142ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
2143ebfedea0SLionel Sambuc # define SSL_CTX_set_session_cache_mode(ctx,m) \
2144ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
2145ebfedea0SLionel Sambuc # define SSL_CTX_get_session_cache_mode(ctx) \
2146ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
2147ebfedea0SLionel Sambuc 
2148ebfedea0SLionel Sambuc # define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
2149ebfedea0SLionel Sambuc # define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
2150ebfedea0SLionel Sambuc # define SSL_CTX_get_read_ahead(ctx) \
2151ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
2152ebfedea0SLionel Sambuc # define SSL_CTX_set_read_ahead(ctx,m) \
2153ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
2154ebfedea0SLionel Sambuc # define SSL_CTX_get_max_cert_list(ctx) \
2155ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
2156ebfedea0SLionel Sambuc # define SSL_CTX_set_max_cert_list(ctx,m) \
2157ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
2158ebfedea0SLionel Sambuc # define SSL_get_max_cert_list(ssl) \
2159ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
2160ebfedea0SLionel Sambuc # define SSL_set_max_cert_list(ssl,m) \
2161ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
2162ebfedea0SLionel Sambuc 
2163ebfedea0SLionel Sambuc # define SSL_CTX_set_max_send_fragment(ctx,m) \
2164ebfedea0SLionel Sambuc         SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
2165ebfedea0SLionel Sambuc # define SSL_set_max_send_fragment(ssl,m) \
2166ebfedea0SLionel Sambuc         SSL_ctrl(ssl,SSL_CTRL_SET_MAX_SEND_FRAGMENT,m,NULL)
2167ebfedea0SLionel Sambuc 
2168ebfedea0SLionel Sambuc      /* NB: the keylength is only applicable when is_export is true */
2169ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_RSA
2170ebfedea0SLionel Sambuc void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
2171ebfedea0SLionel Sambuc                                   RSA *(*cb) (SSL *ssl, int is_export,
2172ebfedea0SLionel Sambuc                                               int keylength));
2173ebfedea0SLionel Sambuc 
2174ebfedea0SLionel Sambuc void SSL_set_tmp_rsa_callback(SSL *ssl,
2175ebfedea0SLionel Sambuc                               RSA *(*cb) (SSL *ssl, int is_export,
2176ebfedea0SLionel Sambuc                                           int keylength));
2177ebfedea0SLionel Sambuc # endif
2178ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_DH
2179ebfedea0SLionel Sambuc void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
2180ebfedea0SLionel Sambuc                                  DH *(*dh) (SSL *ssl, int is_export,
2181ebfedea0SLionel Sambuc                                             int keylength));
2182ebfedea0SLionel Sambuc void SSL_set_tmp_dh_callback(SSL *ssl,
2183ebfedea0SLionel Sambuc                              DH *(*dh) (SSL *ssl, int is_export,
2184ebfedea0SLionel Sambuc                                         int keylength));
2185ebfedea0SLionel Sambuc # endif
2186ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_ECDH
2187ebfedea0SLionel Sambuc void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
2188ebfedea0SLionel Sambuc                                    EC_KEY *(*ecdh) (SSL *ssl, int is_export,
2189ebfedea0SLionel Sambuc                                                     int keylength));
2190ebfedea0SLionel Sambuc void SSL_set_tmp_ecdh_callback(SSL *ssl,
2191ebfedea0SLionel Sambuc                                EC_KEY *(*ecdh) (SSL *ssl, int is_export,
2192ebfedea0SLionel Sambuc                                                 int keylength));
2193ebfedea0SLionel Sambuc # endif
2194ebfedea0SLionel Sambuc 
2195ebfedea0SLionel Sambuc # ifndef OPENSSL_NO_COMP
2196ebfedea0SLionel Sambuc const COMP_METHOD *SSL_get_current_compression(SSL *s);
2197ebfedea0SLionel Sambuc const COMP_METHOD *SSL_get_current_expansion(SSL *s);
2198ebfedea0SLionel Sambuc const char *SSL_COMP_get_name(const COMP_METHOD *comp);
2199ebfedea0SLionel Sambuc STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
2200ebfedea0SLionel Sambuc int SSL_COMP_add_compression_method(int id, COMP_METHOD *cm);
2201ebfedea0SLionel Sambuc # else
2202ebfedea0SLionel Sambuc const void *SSL_get_current_compression(SSL *s);
2203ebfedea0SLionel Sambuc const void *SSL_get_current_expansion(SSL *s);
2204ebfedea0SLionel Sambuc const char *SSL_COMP_get_name(const void *comp);
2205ebfedea0SLionel Sambuc void *SSL_COMP_get_compression_methods(void);
2206ebfedea0SLionel Sambuc int SSL_COMP_add_compression_method(int id, void *cm);
2207ebfedea0SLionel Sambuc # endif
2208ebfedea0SLionel Sambuc 
2209ebfedea0SLionel Sambuc /* TLS extensions functions */
2210ebfedea0SLionel Sambuc int SSL_set_session_ticket_ext(SSL *s, void *ext_data, int ext_len);
2211ebfedea0SLionel Sambuc 
2212ebfedea0SLionel Sambuc int SSL_set_session_ticket_ext_cb(SSL *s, tls_session_ticket_ext_cb_fn cb,
2213ebfedea0SLionel Sambuc                                   void *arg);
2214ebfedea0SLionel Sambuc 
2215ebfedea0SLionel Sambuc /* Pre-shared secret session resumption functions */
2216*0a6a1f1dSLionel Sambuc int SSL_set_session_secret_cb(SSL *s,
2217*0a6a1f1dSLionel Sambuc                               tls_session_secret_cb_fn tls_session_secret_cb,
2218*0a6a1f1dSLionel Sambuc                               void *arg);
2219ebfedea0SLionel Sambuc 
2220ebfedea0SLionel Sambuc void SSL_set_debug(SSL *s, int debug);
2221ebfedea0SLionel Sambuc int SSL_cache_hit(SSL *s);
2222ebfedea0SLionel Sambuc 
2223*0a6a1f1dSLionel Sambuc # ifndef OPENSSL_NO_UNIT_TEST
2224*0a6a1f1dSLionel Sambuc const struct openssl_ssl_test_functions *SSL_test_functions(void);
2225*0a6a1f1dSLionel Sambuc # endif
2226*0a6a1f1dSLionel Sambuc 
2227ebfedea0SLionel Sambuc /* BEGIN ERROR CODES */
2228*0a6a1f1dSLionel Sambuc /*
2229*0a6a1f1dSLionel Sambuc  * The following lines are auto generated by the script mkerr.pl. Any changes
2230ebfedea0SLionel Sambuc  * made after this point may be overwritten when the script is next run.
2231ebfedea0SLionel Sambuc  */
2232ebfedea0SLionel Sambuc void ERR_load_SSL_strings(void);
2233ebfedea0SLionel Sambuc 
2234ebfedea0SLionel Sambuc /* Error codes for the SSL functions. */
2235ebfedea0SLionel Sambuc 
2236ebfedea0SLionel Sambuc /* Function codes. */
2237ebfedea0SLionel Sambuc # define SSL_F_CLIENT_CERTIFICATE                         100
2238ebfedea0SLionel Sambuc # define SSL_F_CLIENT_FINISHED                            167
2239ebfedea0SLionel Sambuc # define SSL_F_CLIENT_HELLO                               101
2240ebfedea0SLionel Sambuc # define SSL_F_CLIENT_MASTER_KEY                          102
2241ebfedea0SLionel Sambuc # define SSL_F_D2I_SSL_SESSION                            103
2242ebfedea0SLionel Sambuc # define SSL_F_DO_DTLS1_WRITE                             245
2243ebfedea0SLionel Sambuc # define SSL_F_DO_SSL3_WRITE                              104
2244ebfedea0SLionel Sambuc # define SSL_F_DTLS1_ACCEPT                               246
2245ebfedea0SLionel Sambuc # define SSL_F_DTLS1_ADD_CERT_TO_BUF                      295
2246ebfedea0SLionel Sambuc # define SSL_F_DTLS1_BUFFER_RECORD                        247
2247ebfedea0SLionel Sambuc # define SSL_F_DTLS1_CHECK_TIMEOUT_NUM                    316
2248ebfedea0SLionel Sambuc # define SSL_F_DTLS1_CLIENT_HELLO                         248
2249ebfedea0SLionel Sambuc # define SSL_F_DTLS1_CONNECT                              249
2250ebfedea0SLionel Sambuc # define SSL_F_DTLS1_ENC                                  250
2251ebfedea0SLionel Sambuc # define SSL_F_DTLS1_GET_HELLO_VERIFY                     251
2252ebfedea0SLionel Sambuc # define SSL_F_DTLS1_GET_MESSAGE                          252
2253ebfedea0SLionel Sambuc # define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT                 253
2254ebfedea0SLionel Sambuc # define SSL_F_DTLS1_GET_RECORD                           254
2255ebfedea0SLionel Sambuc # define SSL_F_DTLS1_HANDLE_TIMEOUT                       297
2256ebfedea0SLionel Sambuc # define SSL_F_DTLS1_HEARTBEAT                            305
2257ebfedea0SLionel Sambuc # define SSL_F_DTLS1_OUTPUT_CERT_CHAIN                    255
2258ebfedea0SLionel Sambuc # define SSL_F_DTLS1_PREPROCESS_FRAGMENT                  288
2259ebfedea0SLionel Sambuc # define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE           256
2260ebfedea0SLionel Sambuc # define SSL_F_DTLS1_PROCESS_RECORD                       257
2261ebfedea0SLionel Sambuc # define SSL_F_DTLS1_READ_BYTES                           258
2262ebfedea0SLionel Sambuc # define SSL_F_DTLS1_READ_FAILED                          259
2263ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST             260
2264ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE              261
2265ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE             262
2266ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_CLIENT_VERIFY                   263
2267ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST            264
2268ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE              265
2269ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_SERVER_HELLO                    266
2270ebfedea0SLionel Sambuc # define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE             267
2271ebfedea0SLionel Sambuc # define SSL_F_DTLS1_WRITE_APP_DATA_BYTES                 268
2272ebfedea0SLionel Sambuc # define SSL_F_GET_CLIENT_FINISHED                        105
2273ebfedea0SLionel Sambuc # define SSL_F_GET_CLIENT_HELLO                           106
2274ebfedea0SLionel Sambuc # define SSL_F_GET_CLIENT_MASTER_KEY                      107
2275ebfedea0SLionel Sambuc # define SSL_F_GET_SERVER_FINISHED                        108
2276ebfedea0SLionel Sambuc # define SSL_F_GET_SERVER_HELLO                           109
2277ebfedea0SLionel Sambuc # define SSL_F_GET_SERVER_VERIFY                          110
2278ebfedea0SLionel Sambuc # define SSL_F_I2D_SSL_SESSION                            111
2279ebfedea0SLionel Sambuc # define SSL_F_READ_N                                     112
2280ebfedea0SLionel Sambuc # define SSL_F_REQUEST_CERTIFICATE                        113
2281ebfedea0SLionel Sambuc # define SSL_F_SERVER_FINISH                              239
2282ebfedea0SLionel Sambuc # define SSL_F_SERVER_HELLO                               114
2283ebfedea0SLionel Sambuc # define SSL_F_SERVER_VERIFY                              240
2284ebfedea0SLionel Sambuc # define SSL_F_SSL23_ACCEPT                               115
2285ebfedea0SLionel Sambuc # define SSL_F_SSL23_CLIENT_HELLO                         116
2286ebfedea0SLionel Sambuc # define SSL_F_SSL23_CONNECT                              117
2287ebfedea0SLionel Sambuc # define SSL_F_SSL23_GET_CLIENT_HELLO                     118
2288ebfedea0SLionel Sambuc # define SSL_F_SSL23_GET_SERVER_HELLO                     119
2289ebfedea0SLionel Sambuc # define SSL_F_SSL23_PEEK                                 237
2290ebfedea0SLionel Sambuc # define SSL_F_SSL23_READ                                 120
2291ebfedea0SLionel Sambuc # define SSL_F_SSL23_WRITE                                121
2292ebfedea0SLionel Sambuc # define SSL_F_SSL2_ACCEPT                                122
2293ebfedea0SLionel Sambuc # define SSL_F_SSL2_CONNECT                               123
2294ebfedea0SLionel Sambuc # define SSL_F_SSL2_ENC_INIT                              124
2295ebfedea0SLionel Sambuc # define SSL_F_SSL2_GENERATE_KEY_MATERIAL                 241
2296ebfedea0SLionel Sambuc # define SSL_F_SSL2_PEEK                                  234
2297ebfedea0SLionel Sambuc # define SSL_F_SSL2_READ                                  125
2298ebfedea0SLionel Sambuc # define SSL_F_SSL2_READ_INTERNAL                         236
2299ebfedea0SLionel Sambuc # define SSL_F_SSL2_SET_CERTIFICATE                       126
2300ebfedea0SLionel Sambuc # define SSL_F_SSL2_WRITE                                 127
2301ebfedea0SLionel Sambuc # define SSL_F_SSL3_ACCEPT                                128
2302ebfedea0SLionel Sambuc # define SSL_F_SSL3_ADD_CERT_TO_BUF                       296
2303ebfedea0SLionel Sambuc # define SSL_F_SSL3_CALLBACK_CTRL                         233
2304ebfedea0SLionel Sambuc # define SSL_F_SSL3_CHANGE_CIPHER_STATE                   129
2305ebfedea0SLionel Sambuc # define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM              130
2306ebfedea0SLionel Sambuc # define SSL_F_SSL3_CHECK_CLIENT_HELLO                    304
2307*0a6a1f1dSLionel Sambuc # define SSL_F_SSL3_CHECK_FINISHED                        339
2308ebfedea0SLionel Sambuc # define SSL_F_SSL3_CLIENT_HELLO                          131
2309ebfedea0SLionel Sambuc # define SSL_F_SSL3_CONNECT                               132
2310ebfedea0SLionel Sambuc # define SSL_F_SSL3_CTRL                                  213
2311ebfedea0SLionel Sambuc # define SSL_F_SSL3_CTX_CTRL                              133
2312ebfedea0SLionel Sambuc # define SSL_F_SSL3_DIGEST_CACHED_RECORDS                 293
2313ebfedea0SLionel Sambuc # define SSL_F_SSL3_DO_CHANGE_CIPHER_SPEC                 292
2314ebfedea0SLionel Sambuc # define SSL_F_SSL3_ENC                                   134
2315ebfedea0SLionel Sambuc # define SSL_F_SSL3_GENERATE_KEY_BLOCK                    238
2316ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CERTIFICATE_REQUEST               135
2317ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CERT_STATUS                       289
2318ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CERT_VERIFY                       136
2319ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CLIENT_CERTIFICATE                137
2320ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CLIENT_HELLO                      138
2321ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE               139
2322ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_FINISHED                          140
2323ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_KEY_EXCHANGE                      141
2324ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_MESSAGE                           142
2325ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_NEW_SESSION_TICKET                283
2326ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_NEXT_PROTO                        306
2327ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_RECORD                            143
2328ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_SERVER_CERTIFICATE                144
2329ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_SERVER_DONE                       145
2330ebfedea0SLionel Sambuc # define SSL_F_SSL3_GET_SERVER_HELLO                      146
2331ebfedea0SLionel Sambuc # define SSL_F_SSL3_HANDSHAKE_MAC                         285
2332ebfedea0SLionel Sambuc # define SSL_F_SSL3_NEW_SESSION_TICKET                    287
2333ebfedea0SLionel Sambuc # define SSL_F_SSL3_OUTPUT_CERT_CHAIN                     147
2334ebfedea0SLionel Sambuc # define SSL_F_SSL3_PEEK                                  235
2335ebfedea0SLionel Sambuc # define SSL_F_SSL3_READ_BYTES                            148
2336ebfedea0SLionel Sambuc # define SSL_F_SSL3_READ_N                                149
2337ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST              150
2338ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE               151
2339ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE              152
2340ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_CLIENT_VERIFY                    153
2341ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_SERVER_CERTIFICATE               154
2342ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_SERVER_HELLO                     242
2343ebfedea0SLionel Sambuc # define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE              155
2344ebfedea0SLionel Sambuc # define SSL_F_SSL3_SETUP_KEY_BLOCK                       157
2345ebfedea0SLionel Sambuc # define SSL_F_SSL3_SETUP_READ_BUFFER                     156
2346ebfedea0SLionel Sambuc # define SSL_F_SSL3_SETUP_WRITE_BUFFER                    291
2347ebfedea0SLionel Sambuc # define SSL_F_SSL3_WRITE_BYTES                           158
2348ebfedea0SLionel Sambuc # define SSL_F_SSL3_WRITE_PENDING                         159
2349ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_CLIENTHELLO_RENEGOTIATE_EXT        298
2350ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_CLIENTHELLO_TLSEXT                 277
2351ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_CLIENTHELLO_USE_SRTP_EXT           307
2352ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK         215
2353ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK        216
2354ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_SERVERHELLO_RENEGOTIATE_EXT        299
2355ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_SERVERHELLO_TLSEXT                 278
2356ebfedea0SLionel Sambuc # define SSL_F_SSL_ADD_SERVERHELLO_USE_SRTP_EXT           308
2357ebfedea0SLionel Sambuc # define SSL_F_SSL_BAD_METHOD                             160
2358ebfedea0SLionel Sambuc # define SSL_F_SSL_BYTES_TO_CIPHER_LIST                   161
2359ebfedea0SLionel Sambuc # define SSL_F_SSL_CERT_DUP                               221
2360ebfedea0SLionel Sambuc # define SSL_F_SSL_CERT_INST                              222
2361ebfedea0SLionel Sambuc # define SSL_F_SSL_CERT_INSTANTIATE                       214
2362ebfedea0SLionel Sambuc # define SSL_F_SSL_CERT_NEW                               162
2363ebfedea0SLionel Sambuc # define SSL_F_SSL_CHECK_PRIVATE_KEY                      163
2364ebfedea0SLionel Sambuc # define SSL_F_SSL_CHECK_SERVERHELLO_TLSEXT               280
2365ebfedea0SLionel Sambuc # define SSL_F_SSL_CHECK_SRVR_ECC_CERT_AND_ALG            279
2366ebfedea0SLionel Sambuc # define SSL_F_SSL_CIPHER_PROCESS_RULESTR                 230
2367ebfedea0SLionel Sambuc # define SSL_F_SSL_CIPHER_STRENGTH_SORT                   231
2368ebfedea0SLionel Sambuc # define SSL_F_SSL_CLEAR                                  164
2369ebfedea0SLionel Sambuc # define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD            165
2370ebfedea0SLionel Sambuc # define SSL_F_SSL_CREATE_CIPHER_LIST                     166
2371ebfedea0SLionel Sambuc # define SSL_F_SSL_CTRL                                   232
2372ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY                  168
2373ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_MAKE_PROFILES                      309
2374ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_NEW                                169
2375ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_CIPHER_LIST                    269
2376ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_CLIENT_CERT_ENGINE             290
2377ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_PURPOSE                        226
2378ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT             219
2379ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_SSL_VERSION                    170
2380ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_SET_TRUST                          229
2381ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_CERTIFICATE                    171
2382ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1               172
2383ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE         220
2384ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE               173
2385ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_PRIVATEKEY                     174
2386ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1                175
2387ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE                176
2388ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_PSK_IDENTITY_HINT              272
2389ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY                  177
2390ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1             178
2391ebfedea0SLionel Sambuc # define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE             179
2392ebfedea0SLionel Sambuc # define SSL_F_SSL_DO_HANDSHAKE                           180
2393ebfedea0SLionel Sambuc # define SSL_F_SSL_GET_NEW_SESSION                        181
2394ebfedea0SLionel Sambuc # define SSL_F_SSL_GET_PREV_SESSION                       217
2395ebfedea0SLionel Sambuc # define SSL_F_SSL_GET_SERVER_SEND_CERT                   182
2396ebfedea0SLionel Sambuc # define SSL_F_SSL_GET_SERVER_SEND_PKEY                   317
2397ebfedea0SLionel Sambuc # define SSL_F_SSL_GET_SIGN_PKEY                          183
2398ebfedea0SLionel Sambuc # define SSL_F_SSL_INIT_WBIO_BUFFER                       184
2399ebfedea0SLionel Sambuc # define SSL_F_SSL_LOAD_CLIENT_CA_FILE                    185
2400ebfedea0SLionel Sambuc # define SSL_F_SSL_NEW                                    186
2401ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_CLIENTHELLO_RENEGOTIATE_EXT      300
2402ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_CLIENTHELLO_TLSEXT               302
2403ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_CLIENTHELLO_USE_SRTP_EXT         310
2404ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_SERVERHELLO_RENEGOTIATE_EXT      301
2405ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_SERVERHELLO_TLSEXT               303
2406ebfedea0SLionel Sambuc # define SSL_F_SSL_PARSE_SERVERHELLO_USE_SRTP_EXT         311
2407ebfedea0SLionel Sambuc # define SSL_F_SSL_PEEK                                   270
2408ebfedea0SLionel Sambuc # define SSL_F_SSL_PREPARE_CLIENTHELLO_TLSEXT             281
2409ebfedea0SLionel Sambuc # define SSL_F_SSL_PREPARE_SERVERHELLO_TLSEXT             282
2410ebfedea0SLionel Sambuc # define SSL_F_SSL_READ                                   223
2411ebfedea0SLionel Sambuc # define SSL_F_SSL_RSA_PRIVATE_DECRYPT                    187
2412ebfedea0SLionel Sambuc # define SSL_F_SSL_RSA_PUBLIC_ENCRYPT                     188
2413*0a6a1f1dSLionel Sambuc # define SSL_F_SSL_SESSION_DUP                            348
2414ebfedea0SLionel Sambuc # define SSL_F_SSL_SESSION_NEW                            189
2415ebfedea0SLionel Sambuc # define SSL_F_SSL_SESSION_PRINT_FP                       190
2416ebfedea0SLionel Sambuc # define SSL_F_SSL_SESSION_SET1_ID_CONTEXT                312
2417ebfedea0SLionel Sambuc # define SSL_F_SSL_SESS_CERT_NEW                          225
2418ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_CERT                               191
2419ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_CIPHER_LIST                        271
2420ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_FD                                 192
2421ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_PKEY                               193
2422ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_PURPOSE                            227
2423ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_RFD                                194
2424ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_SESSION                            195
2425ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_SESSION_ID_CONTEXT                 218
2426ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_SESSION_TICKET_EXT                 294
2427ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_TRUST                              228
2428ebfedea0SLionel Sambuc # define SSL_F_SSL_SET_WFD                                196
2429ebfedea0SLionel Sambuc # define SSL_F_SSL_SHUTDOWN                               224
2430ebfedea0SLionel Sambuc # define SSL_F_SSL_SRP_CTX_INIT                           313
2431ebfedea0SLionel Sambuc # define SSL_F_SSL_UNDEFINED_CONST_FUNCTION               243
2432ebfedea0SLionel Sambuc # define SSL_F_SSL_UNDEFINED_FUNCTION                     197
2433ebfedea0SLionel Sambuc # define SSL_F_SSL_UNDEFINED_VOID_FUNCTION                244
2434ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_CERTIFICATE                        198
2435ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_CERTIFICATE_ASN1                   199
2436ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_CERTIFICATE_FILE                   200
2437ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_PRIVATEKEY                         201
2438ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_PRIVATEKEY_ASN1                    202
2439ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_PRIVATEKEY_FILE                    203
2440ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_PSK_IDENTITY_HINT                  273
2441ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_RSAPRIVATEKEY                      204
2442ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1                 205
2443ebfedea0SLionel Sambuc # define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE                 206
2444ebfedea0SLionel Sambuc # define SSL_F_SSL_VERIFY_CERT_CHAIN                      207
2445ebfedea0SLionel Sambuc # define SSL_F_SSL_WRITE                                  208
2446ebfedea0SLionel Sambuc # define SSL_F_TLS1_CERT_VERIFY_MAC                       286
2447ebfedea0SLionel Sambuc # define SSL_F_TLS1_CHANGE_CIPHER_STATE                   209
2448ebfedea0SLionel Sambuc # define SSL_F_TLS1_CHECK_SERVERHELLO_TLSEXT              274
2449ebfedea0SLionel Sambuc # define SSL_F_TLS1_ENC                                   210
2450ebfedea0SLionel Sambuc # define SSL_F_TLS1_EXPORT_KEYING_MATERIAL                314
2451ebfedea0SLionel Sambuc # define SSL_F_TLS1_HEARTBEAT                             315
2452ebfedea0SLionel Sambuc # define SSL_F_TLS1_PREPARE_CLIENTHELLO_TLSEXT            275
2453ebfedea0SLionel Sambuc # define SSL_F_TLS1_PREPARE_SERVERHELLO_TLSEXT            276
2454ebfedea0SLionel Sambuc # define SSL_F_TLS1_PRF                                   284
2455ebfedea0SLionel Sambuc # define SSL_F_TLS1_SETUP_KEY_BLOCK                       211
2456ebfedea0SLionel Sambuc # define SSL_F_WRITE_PENDING                              212
2457ebfedea0SLionel Sambuc 
2458ebfedea0SLionel Sambuc /* Reason codes. */
2459ebfedea0SLionel Sambuc # define SSL_R_APP_DATA_IN_HANDSHAKE                      100
2460ebfedea0SLionel Sambuc # define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
2461ebfedea0SLionel Sambuc # define SSL_R_BAD_ALERT_RECORD                           101
2462ebfedea0SLionel Sambuc # define SSL_R_BAD_AUTHENTICATION_TYPE                    102
2463ebfedea0SLionel Sambuc # define SSL_R_BAD_CHANGE_CIPHER_SPEC                     103
2464ebfedea0SLionel Sambuc # define SSL_R_BAD_CHECKSUM                               104
2465ebfedea0SLionel Sambuc # define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK              106
2466ebfedea0SLionel Sambuc # define SSL_R_BAD_DECOMPRESSION                          107
2467ebfedea0SLionel Sambuc # define SSL_R_BAD_DH_G_LENGTH                            108
2468ebfedea0SLionel Sambuc # define SSL_R_BAD_DH_PUB_KEY_LENGTH                      109
2469ebfedea0SLionel Sambuc # define SSL_R_BAD_DH_P_LENGTH                            110
2470ebfedea0SLionel Sambuc # define SSL_R_BAD_DIGEST_LENGTH                          111
2471ebfedea0SLionel Sambuc # define SSL_R_BAD_DSA_SIGNATURE                          112
2472ebfedea0SLionel Sambuc # define SSL_R_BAD_ECC_CERT                               304
2473ebfedea0SLionel Sambuc # define SSL_R_BAD_ECDSA_SIGNATURE                        305
2474ebfedea0SLionel Sambuc # define SSL_R_BAD_ECPOINT                                306
2475ebfedea0SLionel Sambuc # define SSL_R_BAD_HANDSHAKE_LENGTH                       332
2476ebfedea0SLionel Sambuc # define SSL_R_BAD_HELLO_REQUEST                          105
2477ebfedea0SLionel Sambuc # define SSL_R_BAD_LENGTH                                 271
2478ebfedea0SLionel Sambuc # define SSL_R_BAD_MAC_DECODE                             113
2479ebfedea0SLionel Sambuc # define SSL_R_BAD_MAC_LENGTH                             333
2480ebfedea0SLionel Sambuc # define SSL_R_BAD_MESSAGE_TYPE                           114
2481ebfedea0SLionel Sambuc # define SSL_R_BAD_PACKET_LENGTH                          115
2482ebfedea0SLionel Sambuc # define SSL_R_BAD_PROTOCOL_VERSION_NUMBER                116
2483ebfedea0SLionel Sambuc # define SSL_R_BAD_PSK_IDENTITY_HINT_LENGTH               316
2484ebfedea0SLionel Sambuc # define SSL_R_BAD_RESPONSE_ARGUMENT                      117
2485ebfedea0SLionel Sambuc # define SSL_R_BAD_RSA_DECRYPT                            118
2486ebfedea0SLionel Sambuc # define SSL_R_BAD_RSA_ENCRYPT                            119
2487ebfedea0SLionel Sambuc # define SSL_R_BAD_RSA_E_LENGTH                           120
2488ebfedea0SLionel Sambuc # define SSL_R_BAD_RSA_MODULUS_LENGTH                     121
2489ebfedea0SLionel Sambuc # define SSL_R_BAD_RSA_SIGNATURE                          122
2490ebfedea0SLionel Sambuc # define SSL_R_BAD_SIGNATURE                              123
2491ebfedea0SLionel Sambuc # define SSL_R_BAD_SRP_A_LENGTH                           347
2492ebfedea0SLionel Sambuc # define SSL_R_BAD_SRP_B_LENGTH                           348
2493ebfedea0SLionel Sambuc # define SSL_R_BAD_SRP_G_LENGTH                           349
2494ebfedea0SLionel Sambuc # define SSL_R_BAD_SRP_N_LENGTH                           350
2495*0a6a1f1dSLionel Sambuc # define SSL_R_BAD_SRP_PARAMETERS                         371
2496ebfedea0SLionel Sambuc # define SSL_R_BAD_SRP_S_LENGTH                           351
2497ebfedea0SLionel Sambuc # define SSL_R_BAD_SRTP_MKI_VALUE                         352
2498ebfedea0SLionel Sambuc # define SSL_R_BAD_SRTP_PROTECTION_PROFILE_LIST           353
2499ebfedea0SLionel Sambuc # define SSL_R_BAD_SSL_FILETYPE                           124
2500ebfedea0SLionel Sambuc # define SSL_R_BAD_SSL_SESSION_ID_LENGTH                  125
2501ebfedea0SLionel Sambuc # define SSL_R_BAD_STATE                                  126
2502ebfedea0SLionel Sambuc # define SSL_R_BAD_WRITE_RETRY                            127
2503ebfedea0SLionel Sambuc # define SSL_R_BIO_NOT_SET                                128
2504ebfedea0SLionel Sambuc # define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG                  129
2505ebfedea0SLionel Sambuc # define SSL_R_BN_LIB                                     130
2506ebfedea0SLionel Sambuc # define SSL_R_CA_DN_LENGTH_MISMATCH                      131
2507ebfedea0SLionel Sambuc # define SSL_R_CA_DN_TOO_LONG                             132
2508ebfedea0SLionel Sambuc # define SSL_R_CCS_RECEIVED_EARLY                         133
2509ebfedea0SLionel Sambuc # define SSL_R_CERTIFICATE_VERIFY_FAILED                  134
2510ebfedea0SLionel Sambuc # define SSL_R_CERT_LENGTH_MISMATCH                       135
2511ebfedea0SLionel Sambuc # define SSL_R_CHALLENGE_IS_DIFFERENT                     136
2512ebfedea0SLionel Sambuc # define SSL_R_CIPHER_CODE_WRONG_LENGTH                   137
2513ebfedea0SLionel Sambuc # define SSL_R_CIPHER_OR_HASH_UNAVAILABLE                 138
2514ebfedea0SLionel Sambuc # define SSL_R_CIPHER_TABLE_SRC_ERROR                     139
2515ebfedea0SLionel Sambuc # define SSL_R_CLIENTHELLO_TLSEXT                         226
2516ebfedea0SLionel Sambuc # define SSL_R_COMPRESSED_LENGTH_TOO_LONG                 140
2517ebfedea0SLionel Sambuc # define SSL_R_COMPRESSION_DISABLED                       343
2518ebfedea0SLionel Sambuc # define SSL_R_COMPRESSION_FAILURE                        141
2519ebfedea0SLionel Sambuc # define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE    307
2520ebfedea0SLionel Sambuc # define SSL_R_COMPRESSION_LIBRARY_ERROR                  142
2521ebfedea0SLionel Sambuc # define SSL_R_CONNECTION_ID_IS_DIFFERENT                 143
2522ebfedea0SLionel Sambuc # define SSL_R_CONNECTION_TYPE_NOT_SET                    144
2523ebfedea0SLionel Sambuc # define SSL_R_COOKIE_MISMATCH                            308
2524ebfedea0SLionel Sambuc # define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED              145
2525ebfedea0SLionel Sambuc # define SSL_R_DATA_LENGTH_TOO_LONG                       146
2526ebfedea0SLionel Sambuc # define SSL_R_DECRYPTION_FAILED                          147
2527ebfedea0SLionel Sambuc # define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC        281
2528*0a6a1f1dSLionel Sambuc # define SSL_R_DH_KEY_TOO_SMALL                           372
2529ebfedea0SLionel Sambuc # define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG            148
2530ebfedea0SLionel Sambuc # define SSL_R_DIGEST_CHECK_FAILED                        149
2531ebfedea0SLionel Sambuc # define SSL_R_DTLS_MESSAGE_TOO_BIG                       334
2532ebfedea0SLionel Sambuc # define SSL_R_DUPLICATE_COMPRESSION_ID                   309
2533ebfedea0SLionel Sambuc # define SSL_R_ECC_CERT_NOT_FOR_KEY_AGREEMENT             317
2534ebfedea0SLionel Sambuc # define SSL_R_ECC_CERT_NOT_FOR_SIGNING                   318
2535ebfedea0SLionel Sambuc # define SSL_R_ECC_CERT_SHOULD_HAVE_RSA_SIGNATURE         322
2536ebfedea0SLionel Sambuc # define SSL_R_ECC_CERT_SHOULD_HAVE_SHA1_SIGNATURE        323
2537ebfedea0SLionel Sambuc # define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER               310
2538ebfedea0SLionel Sambuc # define SSL_R_EMPTY_SRTP_PROTECTION_PROFILE_LIST         354
2539ebfedea0SLionel Sambuc # define SSL_R_ENCRYPTED_LENGTH_TOO_LONG                  150
2540ebfedea0SLionel Sambuc # define SSL_R_ERROR_GENERATING_TMP_RSA_KEY               282
2541ebfedea0SLionel Sambuc # define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST              151
2542ebfedea0SLionel Sambuc # define SSL_R_EXCESSIVE_MESSAGE_SIZE                     152
2543ebfedea0SLionel Sambuc # define SSL_R_EXTRA_DATA_IN_MESSAGE                      153
2544ebfedea0SLionel Sambuc # define SSL_R_GOT_A_FIN_BEFORE_A_CCS                     154
2545ebfedea0SLionel Sambuc # define SSL_R_GOT_NEXT_PROTO_BEFORE_A_CCS                355
2546ebfedea0SLionel Sambuc # define SSL_R_GOT_NEXT_PROTO_WITHOUT_EXTENSION           356
2547ebfedea0SLionel Sambuc # define SSL_R_HTTPS_PROXY_REQUEST                        155
2548ebfedea0SLionel Sambuc # define SSL_R_HTTP_REQUEST                               156
2549ebfedea0SLionel Sambuc # define SSL_R_ILLEGAL_PADDING                            283
2550*0a6a1f1dSLionel Sambuc # define SSL_R_INAPPROPRIATE_FALLBACK                     373
2551ebfedea0SLionel Sambuc # define SSL_R_INCONSISTENT_COMPRESSION                   340
2552ebfedea0SLionel Sambuc # define SSL_R_INVALID_CHALLENGE_LENGTH                   158
2553ebfedea0SLionel Sambuc # define SSL_R_INVALID_COMMAND                            280
2554ebfedea0SLionel Sambuc # define SSL_R_INVALID_COMPRESSION_ALGORITHM              341
2555ebfedea0SLionel Sambuc # define SSL_R_INVALID_PURPOSE                            278
2556ebfedea0SLionel Sambuc # define SSL_R_INVALID_SRP_USERNAME                       357
2557ebfedea0SLionel Sambuc # define SSL_R_INVALID_STATUS_RESPONSE                    328
2558ebfedea0SLionel Sambuc # define SSL_R_INVALID_TICKET_KEYS_LENGTH                 325
2559ebfedea0SLionel Sambuc # define SSL_R_INVALID_TRUST                              279
2560ebfedea0SLionel Sambuc # define SSL_R_KEY_ARG_TOO_LONG                           284
2561ebfedea0SLionel Sambuc # define SSL_R_KRB5                                       285
2562ebfedea0SLionel Sambuc # define SSL_R_KRB5_C_CC_PRINC                            286
2563ebfedea0SLionel Sambuc # define SSL_R_KRB5_C_GET_CRED                            287
2564ebfedea0SLionel Sambuc # define SSL_R_KRB5_C_INIT                                288
2565ebfedea0SLionel Sambuc # define SSL_R_KRB5_C_MK_REQ                              289
2566ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_BAD_TICKET                          290
2567ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_INIT                                291
2568ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_RD_REQ                              292
2569ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_TKT_EXPIRED                         293
2570ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_TKT_NYV                             294
2571ebfedea0SLionel Sambuc # define SSL_R_KRB5_S_TKT_SKEW                            295
2572ebfedea0SLionel Sambuc # define SSL_R_LENGTH_MISMATCH                            159
2573ebfedea0SLionel Sambuc # define SSL_R_LENGTH_TOO_SHORT                           160
2574ebfedea0SLionel Sambuc # define SSL_R_LIBRARY_BUG                                274
2575ebfedea0SLionel Sambuc # define SSL_R_LIBRARY_HAS_NO_CIPHERS                     161
2576ebfedea0SLionel Sambuc # define SSL_R_MESSAGE_TOO_LONG                           296
2577ebfedea0SLionel Sambuc # define SSL_R_MISSING_DH_DSA_CERT                        162
2578ebfedea0SLionel Sambuc # define SSL_R_MISSING_DH_KEY                             163
2579ebfedea0SLionel Sambuc # define SSL_R_MISSING_DH_RSA_CERT                        164
2580ebfedea0SLionel Sambuc # define SSL_R_MISSING_DSA_SIGNING_CERT                   165
2581ebfedea0SLionel Sambuc # define SSL_R_MISSING_EXPORT_TMP_DH_KEY                  166
2582ebfedea0SLionel Sambuc # define SSL_R_MISSING_EXPORT_TMP_RSA_KEY                 167
2583ebfedea0SLionel Sambuc # define SSL_R_MISSING_RSA_CERTIFICATE                    168
2584ebfedea0SLionel Sambuc # define SSL_R_MISSING_RSA_ENCRYPTING_CERT                169
2585ebfedea0SLionel Sambuc # define SSL_R_MISSING_RSA_SIGNING_CERT                   170
2586ebfedea0SLionel Sambuc # define SSL_R_MISSING_SRP_PARAM                          358
2587ebfedea0SLionel Sambuc # define SSL_R_MISSING_TMP_DH_KEY                         171
2588ebfedea0SLionel Sambuc # define SSL_R_MISSING_TMP_ECDH_KEY                       311
2589ebfedea0SLionel Sambuc # define SSL_R_MISSING_TMP_RSA_KEY                        172
2590ebfedea0SLionel Sambuc # define SSL_R_MISSING_TMP_RSA_PKEY                       173
2591ebfedea0SLionel Sambuc # define SSL_R_MISSING_VERIFY_MESSAGE                     174
2592ebfedea0SLionel Sambuc # define SSL_R_MULTIPLE_SGC_RESTARTS                      346
2593ebfedea0SLionel Sambuc # define SSL_R_NON_SSLV2_INITIAL_PACKET                   175
2594ebfedea0SLionel Sambuc # define SSL_R_NO_CERTIFICATES_RETURNED                   176
2595ebfedea0SLionel Sambuc # define SSL_R_NO_CERTIFICATE_ASSIGNED                    177
2596ebfedea0SLionel Sambuc # define SSL_R_NO_CERTIFICATE_RETURNED                    178
2597ebfedea0SLionel Sambuc # define SSL_R_NO_CERTIFICATE_SET                         179
2598ebfedea0SLionel Sambuc # define SSL_R_NO_CERTIFICATE_SPECIFIED                   180
2599ebfedea0SLionel Sambuc # define SSL_R_NO_CIPHERS_AVAILABLE                       181
2600ebfedea0SLionel Sambuc # define SSL_R_NO_CIPHERS_PASSED                          182
2601ebfedea0SLionel Sambuc # define SSL_R_NO_CIPHERS_SPECIFIED                       183
2602ebfedea0SLionel Sambuc # define SSL_R_NO_CIPHER_LIST                             184
2603ebfedea0SLionel Sambuc # define SSL_R_NO_CIPHER_MATCH                            185
2604ebfedea0SLionel Sambuc # define SSL_R_NO_CLIENT_CERT_METHOD                      331
2605ebfedea0SLionel Sambuc # define SSL_R_NO_CLIENT_CERT_RECEIVED                    186
2606ebfedea0SLionel Sambuc # define SSL_R_NO_COMPRESSION_SPECIFIED                   187
2607ebfedea0SLionel Sambuc # define SSL_R_NO_GOST_CERTIFICATE_SENT_BY_PEER           330
2608ebfedea0SLionel Sambuc # define SSL_R_NO_METHOD_SPECIFIED                        188
2609ebfedea0SLionel Sambuc # define SSL_R_NO_PRIVATEKEY                              189
2610ebfedea0SLionel Sambuc # define SSL_R_NO_PRIVATE_KEY_ASSIGNED                    190
2611ebfedea0SLionel Sambuc # define SSL_R_NO_PROTOCOLS_AVAILABLE                     191
2612ebfedea0SLionel Sambuc # define SSL_R_NO_PUBLICKEY                               192
2613ebfedea0SLionel Sambuc # define SSL_R_NO_RENEGOTIATION                           339
2614ebfedea0SLionel Sambuc # define SSL_R_NO_REQUIRED_DIGEST                         324
2615ebfedea0SLionel Sambuc # define SSL_R_NO_SHARED_CIPHER                           193
2616ebfedea0SLionel Sambuc # define SSL_R_NO_SRTP_PROFILES                           359
2617ebfedea0SLionel Sambuc # define SSL_R_NO_VERIFY_CALLBACK                         194
2618ebfedea0SLionel Sambuc # define SSL_R_NULL_SSL_CTX                               195
2619ebfedea0SLionel Sambuc # define SSL_R_NULL_SSL_METHOD_PASSED                     196
2620ebfedea0SLionel Sambuc # define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED            197
2621ebfedea0SLionel Sambuc # define SSL_R_OLD_SESSION_COMPRESSION_ALGORITHM_NOT_RETURNED 344
2622ebfedea0SLionel Sambuc # define SSL_R_ONLY_TLS_ALLOWED_IN_FIPS_MODE              297
2623ebfedea0SLionel Sambuc # define SSL_R_OPAQUE_PRF_INPUT_TOO_LONG                  327
2624ebfedea0SLionel Sambuc # define SSL_R_PACKET_LENGTH_TOO_LONG                     198
2625ebfedea0SLionel Sambuc # define SSL_R_PARSE_TLSEXT                               227
2626ebfedea0SLionel Sambuc # define SSL_R_PATH_TOO_LONG                              270
2627ebfedea0SLionel Sambuc # define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE          199
2628ebfedea0SLionel Sambuc # define SSL_R_PEER_ERROR                                 200
2629ebfedea0SLionel Sambuc # define SSL_R_PEER_ERROR_CERTIFICATE                     201
2630ebfedea0SLionel Sambuc # define SSL_R_PEER_ERROR_NO_CERTIFICATE                  202
2631ebfedea0SLionel Sambuc # define SSL_R_PEER_ERROR_NO_CIPHER                       203
2632ebfedea0SLionel Sambuc # define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE    204
2633ebfedea0SLionel Sambuc # define SSL_R_PRE_MAC_LENGTH_TOO_LONG                    205
2634ebfedea0SLionel Sambuc # define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS          206
2635ebfedea0SLionel Sambuc # define SSL_R_PROTOCOL_IS_SHUTDOWN                       207
2636ebfedea0SLionel Sambuc # define SSL_R_PSK_IDENTITY_NOT_FOUND                     223
2637ebfedea0SLionel Sambuc # define SSL_R_PSK_NO_CLIENT_CB                           224
2638ebfedea0SLionel Sambuc # define SSL_R_PSK_NO_SERVER_CB                           225
2639ebfedea0SLionel Sambuc # define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR                   208
2640ebfedea0SLionel Sambuc # define SSL_R_PUBLIC_KEY_IS_NOT_RSA                      209
2641ebfedea0SLionel Sambuc # define SSL_R_PUBLIC_KEY_NOT_RSA                         210
2642ebfedea0SLionel Sambuc # define SSL_R_READ_BIO_NOT_SET                           211
2643ebfedea0SLionel Sambuc # define SSL_R_READ_TIMEOUT_EXPIRED                       312
2644ebfedea0SLionel Sambuc # define SSL_R_READ_WRONG_PACKET_TYPE                     212
2645ebfedea0SLionel Sambuc # define SSL_R_RECORD_LENGTH_MISMATCH                     213
2646ebfedea0SLionel Sambuc # define SSL_R_RECORD_TOO_LARGE                           214
2647ebfedea0SLionel Sambuc # define SSL_R_RECORD_TOO_SMALL                           298
2648ebfedea0SLionel Sambuc # define SSL_R_RENEGOTIATE_EXT_TOO_LONG                   335
2649ebfedea0SLionel Sambuc # define SSL_R_RENEGOTIATION_ENCODING_ERR                 336
2650ebfedea0SLionel Sambuc # define SSL_R_RENEGOTIATION_MISMATCH                     337
2651ebfedea0SLionel Sambuc # define SSL_R_REQUIRED_CIPHER_MISSING                    215
2652ebfedea0SLionel Sambuc # define SSL_R_REQUIRED_COMPRESSSION_ALGORITHM_MISSING    342
2653ebfedea0SLionel Sambuc # define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO                 216
2654ebfedea0SLionel Sambuc # define SSL_R_REUSE_CERT_TYPE_NOT_ZERO                   217
2655ebfedea0SLionel Sambuc # define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO                 218
2656ebfedea0SLionel Sambuc # define SSL_R_SCSV_RECEIVED_WHEN_RENEGOTIATING           345
2657ebfedea0SLionel Sambuc # define SSL_R_SERVERHELLO_TLSEXT                         275
2658ebfedea0SLionel Sambuc # define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED           277
2659ebfedea0SLionel Sambuc # define SSL_R_SHORT_READ                                 219
2660ebfedea0SLionel Sambuc # define SSL_R_SIGNATURE_ALGORITHMS_ERROR                 360
2661ebfedea0SLionel Sambuc # define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE      220
2662ebfedea0SLionel Sambuc # define SSL_R_SRP_A_CALC                                 361
2663ebfedea0SLionel Sambuc # define SSL_R_SRTP_COULD_NOT_ALLOCATE_PROFILES           362
2664ebfedea0SLionel Sambuc # define SSL_R_SRTP_PROTECTION_PROFILE_LIST_TOO_LONG      363
2665ebfedea0SLionel Sambuc # define SSL_R_SRTP_UNKNOWN_PROTECTION_PROFILE            364
2666ebfedea0SLionel Sambuc # define SSL_R_SSL23_DOING_SESSION_ID_REUSE               221
2667ebfedea0SLionel Sambuc # define SSL_R_SSL2_CONNECTION_ID_TOO_LONG                299
2668ebfedea0SLionel Sambuc # define SSL_R_SSL3_EXT_INVALID_ECPOINTFORMAT             321
2669ebfedea0SLionel Sambuc # define SSL_R_SSL3_EXT_INVALID_SERVERNAME                319
2670ebfedea0SLionel Sambuc # define SSL_R_SSL3_EXT_INVALID_SERVERNAME_TYPE           320
2671ebfedea0SLionel Sambuc # define SSL_R_SSL3_SESSION_ID_TOO_LONG                   300
2672ebfedea0SLionel Sambuc # define SSL_R_SSL3_SESSION_ID_TOO_SHORT                  222
2673ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE                1042
2674ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC                 1020
2675ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED            1045
2676ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED            1044
2677ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN            1046
2678ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE          1030
2679ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE              1040
2680ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER              1047
2681ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_NO_CERTIFICATE                 1041
2682ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE             1010
2683ebfedea0SLionel Sambuc # define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE        1043
2684ebfedea0SLionel Sambuc # define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION         228
2685ebfedea0SLionel Sambuc # define SSL_R_SSL_HANDSHAKE_FAILURE                      229
2686ebfedea0SLionel Sambuc # define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS                 230
2687ebfedea0SLionel Sambuc # define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED             301
2688ebfedea0SLionel Sambuc # define SSL_R_SSL_SESSION_ID_CONFLICT                    302
2689ebfedea0SLionel Sambuc # define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG            273
2690ebfedea0SLionel Sambuc # define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH              303
2691ebfedea0SLionel Sambuc # define SSL_R_SSL_SESSION_ID_IS_DIFFERENT                231
2692ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_ACCESS_DENIED                  1049
2693ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_DECODE_ERROR                   1050
2694ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED              1021
2695ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_DECRYPT_ERROR                  1051
2696ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION             1060
2697*0a6a1f1dSLionel Sambuc # define SSL_R_TLSV1_ALERT_INAPPROPRIATE_FALLBACK         1086
2698ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY          1071
2699ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_INTERNAL_ERROR                 1080
2700ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION               1100
2701ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION               1070
2702ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW                1022
2703ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_UNKNOWN_CA                     1048
2704ebfedea0SLionel Sambuc # define SSL_R_TLSV1_ALERT_USER_CANCELLED                 1090
2705ebfedea0SLionel Sambuc # define SSL_R_TLSV1_BAD_CERTIFICATE_HASH_VALUE           1114
2706ebfedea0SLionel Sambuc # define SSL_R_TLSV1_BAD_CERTIFICATE_STATUS_RESPONSE      1113
2707ebfedea0SLionel Sambuc # define SSL_R_TLSV1_CERTIFICATE_UNOBTAINABLE             1111
2708ebfedea0SLionel Sambuc # define SSL_R_TLSV1_UNRECOGNIZED_NAME                    1112
2709ebfedea0SLionel Sambuc # define SSL_R_TLSV1_UNSUPPORTED_EXTENSION                1110
2710ebfedea0SLionel Sambuc # define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER       232
2711ebfedea0SLionel Sambuc # define SSL_R_TLS_HEARTBEAT_PEER_DOESNT_ACCEPT           365
2712ebfedea0SLionel Sambuc # define SSL_R_TLS_HEARTBEAT_PENDING                      366
2713ebfedea0SLionel Sambuc # define SSL_R_TLS_ILLEGAL_EXPORTER_LABEL                 367
2714ebfedea0SLionel Sambuc # define SSL_R_TLS_INVALID_ECPOINTFORMAT_LIST             157
2715ebfedea0SLionel Sambuc # define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
2716ebfedea0SLionel Sambuc # define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG    234
2717ebfedea0SLionel Sambuc # define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER            235
2718ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_DECODE_DH_CERTS                  236
2719ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS                313
2720ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY               237
2721ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS               238
2722ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS             314
2723ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS       239
2724ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_FIND_SSL_METHOD                  240
2725ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES           241
2726ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES           242
2727ebfedea0SLionel Sambuc # define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES          243
2728ebfedea0SLionel Sambuc # define SSL_R_UNEXPECTED_MESSAGE                         244
2729ebfedea0SLionel Sambuc # define SSL_R_UNEXPECTED_RECORD                          245
2730ebfedea0SLionel Sambuc # define SSL_R_UNINITIALIZED                              276
2731ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_ALERT_TYPE                         246
2732ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_CERTIFICATE_TYPE                   247
2733ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_CIPHER_RETURNED                    248
2734ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_CIPHER_TYPE                        249
2735ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_DIGEST                             368
2736ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE                  250
2737ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_PKEY_TYPE                          251
2738ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_PROTOCOL                           252
2739ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE                  253
2740ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_SSL_VERSION                        254
2741ebfedea0SLionel Sambuc # define SSL_R_UNKNOWN_STATE                              255
2742ebfedea0SLionel Sambuc # define SSL_R_UNSAFE_LEGACY_RENEGOTIATION_DISABLED       338
2743ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_CIPHER                         256
2744ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM          257
2745ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_DIGEST_TYPE                    326
2746ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE                 315
2747ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_PROTOCOL                       258
2748ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_SSL_VERSION                    259
2749ebfedea0SLionel Sambuc # define SSL_R_UNSUPPORTED_STATUS_TYPE                    329
2750ebfedea0SLionel Sambuc # define SSL_R_USE_SRTP_NOT_NEGOTIATED                    369
2751ebfedea0SLionel Sambuc # define SSL_R_WRITE_BIO_NOT_SET                          260
2752ebfedea0SLionel Sambuc # define SSL_R_WRONG_CIPHER_RETURNED                      261
2753ebfedea0SLionel Sambuc # define SSL_R_WRONG_MESSAGE_TYPE                         262
2754ebfedea0SLionel Sambuc # define SSL_R_WRONG_NUMBER_OF_KEY_BITS                   263
2755ebfedea0SLionel Sambuc # define SSL_R_WRONG_SIGNATURE_LENGTH                     264
2756ebfedea0SLionel Sambuc # define SSL_R_WRONG_SIGNATURE_SIZE                       265
2757ebfedea0SLionel Sambuc # define SSL_R_WRONG_SIGNATURE_TYPE                       370
2758ebfedea0SLionel Sambuc # define SSL_R_WRONG_SSL_VERSION                          266
2759ebfedea0SLionel Sambuc # define SSL_R_WRONG_VERSION_NUMBER                       267
2760ebfedea0SLionel Sambuc # define SSL_R_X509_LIB                                   268
2761ebfedea0SLionel Sambuc # define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS           269
2762ebfedea0SLionel Sambuc 
2763ebfedea0SLionel Sambuc #ifdef  __cplusplus
2764ebfedea0SLionel Sambuc }
2765ebfedea0SLionel Sambuc #endif
2766ebfedea0SLionel Sambuc #endif
2767