xref: /onnv-gate/usr/src/common/openssl/ssl/ssl.h (revision 6125:38a604bf8269)
10Sstevel@tonic-gate /* ssl/ssl.h */
20Sstevel@tonic-gate /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
30Sstevel@tonic-gate  * All rights reserved.
40Sstevel@tonic-gate  *
50Sstevel@tonic-gate  * This package is an SSL implementation written
60Sstevel@tonic-gate  * by Eric Young (eay@cryptsoft.com).
70Sstevel@tonic-gate  * The implementation was written so as to conform with Netscapes SSL.
80Sstevel@tonic-gate  *
90Sstevel@tonic-gate  * This library is free for commercial and non-commercial use as long as
100Sstevel@tonic-gate  * the following conditions are aheared to.  The following conditions
110Sstevel@tonic-gate  * apply to all code found in this distribution, be it the RC4, RSA,
120Sstevel@tonic-gate  * lhash, DES, etc., code; not just the SSL code.  The SSL documentation
130Sstevel@tonic-gate  * included with this distribution is covered by the same copyright terms
140Sstevel@tonic-gate  * except that the holder is Tim Hudson (tjh@cryptsoft.com).
150Sstevel@tonic-gate  *
160Sstevel@tonic-gate  * Copyright remains Eric Young's, and as such any Copyright notices in
170Sstevel@tonic-gate  * the code are not to be removed.
180Sstevel@tonic-gate  * If this package is used in a product, Eric Young should be given attribution
190Sstevel@tonic-gate  * as the author of the parts of the library used.
200Sstevel@tonic-gate  * This can be in the form of a textual message at program startup or
210Sstevel@tonic-gate  * in documentation (online or textual) provided with the package.
220Sstevel@tonic-gate  *
230Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
240Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
250Sstevel@tonic-gate  * are met:
260Sstevel@tonic-gate  * 1. Redistributions of source code must retain the copyright
270Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
280Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
290Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in the
300Sstevel@tonic-gate  *    documentation and/or other materials provided with the distribution.
310Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this software
320Sstevel@tonic-gate  *    must display the following acknowledgement:
330Sstevel@tonic-gate  *    "This product includes cryptographic software written by
340Sstevel@tonic-gate  *     Eric Young (eay@cryptsoft.com)"
350Sstevel@tonic-gate  *    The word 'cryptographic' can be left out if the rouines from the library
360Sstevel@tonic-gate  *    being used are not cryptographic related :-).
370Sstevel@tonic-gate  * 4. If you include any Windows specific code (or a derivative thereof) from
380Sstevel@tonic-gate  *    the apps directory (application code) you must include an acknowledgement:
390Sstevel@tonic-gate  *    "This product includes software written by Tim Hudson (tjh@cryptsoft.com)"
400Sstevel@tonic-gate  *
410Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND
420Sstevel@tonic-gate  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
430Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
440Sstevel@tonic-gate  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
450Sstevel@tonic-gate  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
460Sstevel@tonic-gate  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
470Sstevel@tonic-gate  * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
480Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
490Sstevel@tonic-gate  * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
500Sstevel@tonic-gate  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
510Sstevel@tonic-gate  * SUCH DAMAGE.
520Sstevel@tonic-gate  *
530Sstevel@tonic-gate  * The licence and distribution terms for any publically available version or
540Sstevel@tonic-gate  * derivative of this code cannot be changed.  i.e. this code cannot simply be
550Sstevel@tonic-gate  * copied and put under another distribution licence
560Sstevel@tonic-gate  * [including the GNU Public Licence.]
570Sstevel@tonic-gate  */
580Sstevel@tonic-gate /* ====================================================================
590Sstevel@tonic-gate  * Copyright (c) 1998-2001 The OpenSSL Project.  All rights reserved.
600Sstevel@tonic-gate  *
610Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
620Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
630Sstevel@tonic-gate  * are met:
640Sstevel@tonic-gate  *
650Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
660Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
670Sstevel@tonic-gate  *
680Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
690Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in
700Sstevel@tonic-gate  *    the documentation and/or other materials provided with the
710Sstevel@tonic-gate  *    distribution.
720Sstevel@tonic-gate  *
730Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this
740Sstevel@tonic-gate  *    software must display the following acknowledgment:
750Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
760Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
770Sstevel@tonic-gate  *
780Sstevel@tonic-gate  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
790Sstevel@tonic-gate  *    endorse or promote products derived from this software without
800Sstevel@tonic-gate  *    prior written permission. For written permission, please contact
810Sstevel@tonic-gate  *    openssl-core@openssl.org.
820Sstevel@tonic-gate  *
830Sstevel@tonic-gate  * 5. Products derived from this software may not be called "OpenSSL"
840Sstevel@tonic-gate  *    nor may "OpenSSL" appear in their names without prior written
850Sstevel@tonic-gate  *    permission of the OpenSSL Project.
860Sstevel@tonic-gate  *
870Sstevel@tonic-gate  * 6. Redistributions of any form whatsoever must retain the following
880Sstevel@tonic-gate  *    acknowledgment:
890Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
900Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
910Sstevel@tonic-gate  *
920Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
930Sstevel@tonic-gate  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
940Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
950Sstevel@tonic-gate  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
960Sstevel@tonic-gate  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
970Sstevel@tonic-gate  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
980Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
990Sstevel@tonic-gate  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1000Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1010Sstevel@tonic-gate  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1020Sstevel@tonic-gate  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1030Sstevel@tonic-gate  * OF THE POSSIBILITY OF SUCH DAMAGE.
1040Sstevel@tonic-gate  * ====================================================================
1050Sstevel@tonic-gate  *
1060Sstevel@tonic-gate  * This product includes cryptographic software written by Eric Young
1070Sstevel@tonic-gate  * (eay@cryptsoft.com).  This product includes software written by Tim
1080Sstevel@tonic-gate  * Hudson (tjh@cryptsoft.com).
1090Sstevel@tonic-gate  *
1100Sstevel@tonic-gate  */
1110Sstevel@tonic-gate /* ====================================================================
1120Sstevel@tonic-gate  * Copyright (c) 1998-2002 The OpenSSL Project.  All rights reserved.
1130Sstevel@tonic-gate  *
1140Sstevel@tonic-gate  * Redistribution and use in source and binary forms, with or without
1150Sstevel@tonic-gate  * modification, are permitted provided that the following conditions
1160Sstevel@tonic-gate  * are met:
1170Sstevel@tonic-gate  *
1180Sstevel@tonic-gate  * 1. Redistributions of source code must retain the above copyright
1190Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer.
1200Sstevel@tonic-gate  *
1210Sstevel@tonic-gate  * 2. Redistributions in binary form must reproduce the above copyright
1220Sstevel@tonic-gate  *    notice, this list of conditions and the following disclaimer in
1230Sstevel@tonic-gate  *    the documentation and/or other materials provided with the
1240Sstevel@tonic-gate  *    distribution.
1250Sstevel@tonic-gate  *
1260Sstevel@tonic-gate  * 3. All advertising materials mentioning features or use of this
1270Sstevel@tonic-gate  *    software must display the following acknowledgment:
1280Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
1290Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit. (http://www.openssl.org/)"
1300Sstevel@tonic-gate  *
1310Sstevel@tonic-gate  * 4. The names "OpenSSL Toolkit" and "OpenSSL Project" must not be used to
1320Sstevel@tonic-gate  *    endorse or promote products derived from this software without
1330Sstevel@tonic-gate  *    prior written permission. For written permission, please contact
1340Sstevel@tonic-gate  *    openssl-core@openssl.org.
1350Sstevel@tonic-gate  *
1360Sstevel@tonic-gate  * 5. Products derived from this software may not be called "OpenSSL"
1370Sstevel@tonic-gate  *    nor may "OpenSSL" appear in their names without prior written
1380Sstevel@tonic-gate  *    permission of the OpenSSL Project.
1390Sstevel@tonic-gate  *
1400Sstevel@tonic-gate  * 6. Redistributions of any form whatsoever must retain the following
1410Sstevel@tonic-gate  *    acknowledgment:
1420Sstevel@tonic-gate  *    "This product includes software developed by the OpenSSL Project
1430Sstevel@tonic-gate  *    for use in the OpenSSL Toolkit (http://www.openssl.org/)"
1440Sstevel@tonic-gate  *
1450Sstevel@tonic-gate  * THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY
1460Sstevel@tonic-gate  * EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
1470Sstevel@tonic-gate  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1480Sstevel@tonic-gate  * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL THE OpenSSL PROJECT OR
1490Sstevel@tonic-gate  * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
1500Sstevel@tonic-gate  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
1510Sstevel@tonic-gate  * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
1520Sstevel@tonic-gate  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
1530Sstevel@tonic-gate  * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
1540Sstevel@tonic-gate  * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
1550Sstevel@tonic-gate  * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
1560Sstevel@tonic-gate  * OF THE POSSIBILITY OF SUCH DAMAGE.
1570Sstevel@tonic-gate  * ====================================================================
1580Sstevel@tonic-gate  *
1590Sstevel@tonic-gate  * This product includes cryptographic software written by Eric Young
1600Sstevel@tonic-gate  * (eay@cryptsoft.com).  This product includes software written by Tim
1610Sstevel@tonic-gate  * Hudson (tjh@cryptsoft.com).
1620Sstevel@tonic-gate  *
1630Sstevel@tonic-gate  */
1642139Sjp161948 /* ====================================================================
1652139Sjp161948  * Copyright 2002 Sun Microsystems, Inc. ALL RIGHTS RESERVED.
1662139Sjp161948  * ECC cipher suite support in OpenSSL originally developed by
1672139Sjp161948  * SUN MICROSYSTEMS, INC., and contributed to the OpenSSL project.
1682139Sjp161948  */
1690Sstevel@tonic-gate 
1700Sstevel@tonic-gate #ifndef HEADER_SSL_H
1710Sstevel@tonic-gate #define HEADER_SSL_H
1720Sstevel@tonic-gate 
1730Sstevel@tonic-gate #include <openssl/e_os2.h>
1740Sstevel@tonic-gate 
1750Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP
1760Sstevel@tonic-gate #include <openssl/comp.h>
1770Sstevel@tonic-gate #endif
1780Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO
1790Sstevel@tonic-gate #include <openssl/bio.h>
1800Sstevel@tonic-gate #endif
1812139Sjp161948 #ifndef OPENSSL_NO_DEPRECATED
1820Sstevel@tonic-gate #ifndef OPENSSL_NO_X509
1830Sstevel@tonic-gate #include <openssl/x509.h>
1840Sstevel@tonic-gate #endif
1852139Sjp161948 #include <openssl/crypto.h>
1862139Sjp161948 #include <openssl/lhash.h>
1872139Sjp161948 #include <openssl/buffer.h>
1882139Sjp161948 #endif
1892139Sjp161948 #include <openssl/pem.h>
1902139Sjp161948 
1910Sstevel@tonic-gate #include <openssl/kssl.h>
1920Sstevel@tonic-gate #include <openssl/safestack.h>
1930Sstevel@tonic-gate #include <openssl/symhacks.h>
1940Sstevel@tonic-gate 
1950Sstevel@tonic-gate #ifdef  __cplusplus
1960Sstevel@tonic-gate extern "C" {
1970Sstevel@tonic-gate #endif
1980Sstevel@tonic-gate 
1990Sstevel@tonic-gate /* SSLeay version number for ASN.1 encoding of the session information */
2000Sstevel@tonic-gate /* Version 0 - initial version
2010Sstevel@tonic-gate  * Version 1 - added the optional peer certificate
2020Sstevel@tonic-gate  */
2030Sstevel@tonic-gate #define SSL_SESSION_ASN1_VERSION 0x0001
2040Sstevel@tonic-gate 
2050Sstevel@tonic-gate /* text strings for the ciphers */
2060Sstevel@tonic-gate #define SSL_TXT_NULL_WITH_MD5		SSL2_TXT_NULL_WITH_MD5
2070Sstevel@tonic-gate #define SSL_TXT_RC4_128_WITH_MD5	SSL2_TXT_RC4_128_WITH_MD5
2080Sstevel@tonic-gate #define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5
2090Sstevel@tonic-gate #define SSL_TXT_RC2_128_CBC_WITH_MD5	SSL2_TXT_RC2_128_CBC_WITH_MD5
2100Sstevel@tonic-gate #define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5
2110Sstevel@tonic-gate #define SSL_TXT_IDEA_128_CBC_WITH_MD5	SSL2_TXT_IDEA_128_CBC_WITH_MD5
2120Sstevel@tonic-gate #define SSL_TXT_DES_64_CBC_WITH_MD5	SSL2_TXT_DES_64_CBC_WITH_MD5
2130Sstevel@tonic-gate #define SSL_TXT_DES_64_CBC_WITH_SHA	SSL2_TXT_DES_64_CBC_WITH_SHA
2140Sstevel@tonic-gate #define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5
2150Sstevel@tonic-gate #define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA
2160Sstevel@tonic-gate 
2170Sstevel@tonic-gate /*    VRS Additional Kerberos5 entries
2180Sstevel@tonic-gate  */
2190Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA
2200Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
2210Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_128_SHA      SSL3_TXT_KRB5_RC4_128_SHA
2220Sstevel@tonic-gate #define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA
2230Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5
2240Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
2250Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_128_MD5      SSL3_TXT_KRB5_RC4_128_MD5
2260Sstevel@tonic-gate #define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5
2270Sstevel@tonic-gate 
2280Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA
2290Sstevel@tonic-gate #define SSL_TXT_KRB5_RC2_40_CBC_SHA   SSL3_TXT_KRB5_RC2_40_CBC_SHA
2300Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_40_SHA	      SSL3_TXT_KRB5_RC4_40_SHA
2310Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5
2320Sstevel@tonic-gate #define SSL_TXT_KRB5_RC2_40_CBC_MD5   SSL3_TXT_KRB5_RC2_40_CBC_MD5
2330Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_40_MD5	      SSL3_TXT_KRB5_RC4_40_MD5
2340Sstevel@tonic-gate 
2350Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_SHA   SSL3_TXT_KRB5_DES_40_CBC_SHA
2360Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_MD5   SSL3_TXT_KRB5_DES_40_CBC_MD5
2370Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_SHA   SSL3_TXT_KRB5_DES_64_CBC_SHA
2380Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_MD5   SSL3_TXT_KRB5_DES_64_CBC_MD5
2390Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA
2400Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5
2410Sstevel@tonic-gate #define SSL_MAX_KRB5_PRINCIPAL_LENGTH  256
2420Sstevel@tonic-gate 
2430Sstevel@tonic-gate #define SSL_MAX_SSL_SESSION_ID_LENGTH		32
2440Sstevel@tonic-gate #define SSL_MAX_SID_CTX_LENGTH			32
2450Sstevel@tonic-gate 
2460Sstevel@tonic-gate #define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES	(512/8)
2470Sstevel@tonic-gate #define SSL_MAX_KEY_ARG_LENGTH			8
2480Sstevel@tonic-gate #define SSL_MAX_MASTER_KEY_LENGTH		48
2490Sstevel@tonic-gate 
2500Sstevel@tonic-gate /* These are used to specify which ciphers to use and not to use */
2510Sstevel@tonic-gate #define SSL_TXT_LOW		"LOW"
2520Sstevel@tonic-gate #define SSL_TXT_MEDIUM		"MEDIUM"
2530Sstevel@tonic-gate #define SSL_TXT_HIGH		"HIGH"
2540Sstevel@tonic-gate #define SSL_TXT_kFZA		"kFZA"
2550Sstevel@tonic-gate #define	SSL_TXT_aFZA		"aFZA"
2560Sstevel@tonic-gate #define SSL_TXT_eFZA		"eFZA"
2570Sstevel@tonic-gate #define SSL_TXT_FZA		"FZA"
2580Sstevel@tonic-gate 
2590Sstevel@tonic-gate #define	SSL_TXT_aNULL		"aNULL"
2600Sstevel@tonic-gate #define	SSL_TXT_eNULL		"eNULL"
2610Sstevel@tonic-gate #define	SSL_TXT_NULL		"NULL"
2620Sstevel@tonic-gate 
2630Sstevel@tonic-gate #define SSL_TXT_kKRB5     	"kKRB5"
2640Sstevel@tonic-gate #define SSL_TXT_aKRB5     	"aKRB5"
2650Sstevel@tonic-gate #define SSL_TXT_KRB5      	"KRB5"
2660Sstevel@tonic-gate 
2670Sstevel@tonic-gate #define SSL_TXT_kRSA		"kRSA"
2680Sstevel@tonic-gate #define SSL_TXT_kDHr		"kDHr"
2690Sstevel@tonic-gate #define SSL_TXT_kDHd		"kDHd"
2700Sstevel@tonic-gate #define SSL_TXT_kEDH		"kEDH"
2710Sstevel@tonic-gate #define	SSL_TXT_aRSA		"aRSA"
2720Sstevel@tonic-gate #define	SSL_TXT_aDSS		"aDSS"
2730Sstevel@tonic-gate #define	SSL_TXT_aDH		"aDH"
2740Sstevel@tonic-gate #define	SSL_TXT_DSS		"DSS"
2750Sstevel@tonic-gate #define SSL_TXT_DH		"DH"
2760Sstevel@tonic-gate #define SSL_TXT_EDH		"EDH"
2770Sstevel@tonic-gate #define SSL_TXT_ADH		"ADH"
2780Sstevel@tonic-gate #define SSL_TXT_RSA		"RSA"
2790Sstevel@tonic-gate #define SSL_TXT_DES		"DES"
2800Sstevel@tonic-gate #define SSL_TXT_3DES		"3DES"
2810Sstevel@tonic-gate #define SSL_TXT_RC4		"RC4"
2820Sstevel@tonic-gate #define SSL_TXT_RC2		"RC2"
2830Sstevel@tonic-gate #define SSL_TXT_IDEA		"IDEA"
2840Sstevel@tonic-gate #define SSL_TXT_AES		"AES"
2850Sstevel@tonic-gate #define SSL_TXT_MD5		"MD5"
2860Sstevel@tonic-gate #define SSL_TXT_SHA1		"SHA1"
2870Sstevel@tonic-gate #define SSL_TXT_SHA		"SHA"
2880Sstevel@tonic-gate #define SSL_TXT_EXP		"EXP"
2890Sstevel@tonic-gate #define SSL_TXT_EXPORT		"EXPORT"
2900Sstevel@tonic-gate #define SSL_TXT_EXP40		"EXPORT40"
2910Sstevel@tonic-gate #define SSL_TXT_EXP56		"EXPORT56"
2920Sstevel@tonic-gate #define SSL_TXT_SSLV2		"SSLv2"
2930Sstevel@tonic-gate #define SSL_TXT_SSLV3		"SSLv3"
2940Sstevel@tonic-gate #define SSL_TXT_TLSV1		"TLSv1"
2950Sstevel@tonic-gate #define SSL_TXT_ALL		"ALL"
2962139Sjp161948 #define SSL_TXT_ECC		"ECCdraft" /* ECC ciphersuites are not yet official */
2970Sstevel@tonic-gate 
2980Sstevel@tonic-gate /*
2990Sstevel@tonic-gate  * COMPLEMENTOF* definitions. These identifiers are used to (de-select)
3000Sstevel@tonic-gate  * ciphers normally not being used.
3010Sstevel@tonic-gate  * Example: "RC4" will activate all ciphers using RC4 including ciphers
3020Sstevel@tonic-gate  * without authentication, which would normally disabled by DEFAULT (due
3030Sstevel@tonic-gate  * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT"
3040Sstevel@tonic-gate  * will make sure that it is also disabled in the specific selection.
3050Sstevel@tonic-gate  * COMPLEMENTOF* identifiers are portable between version, as adjustments
3060Sstevel@tonic-gate  * to the default cipher setup will also be included here.
3070Sstevel@tonic-gate  *
3080Sstevel@tonic-gate  * COMPLEMENTOFDEFAULT does not experience the same special treatment that
3090Sstevel@tonic-gate  * DEFAULT gets, as only selection is being done and no sorting as needed
3100Sstevel@tonic-gate  * for DEFAULT.
3110Sstevel@tonic-gate  */
3120Sstevel@tonic-gate #define SSL_TXT_CMPALL		"COMPLEMENTOFALL"
3130Sstevel@tonic-gate #define SSL_TXT_CMPDEF		"COMPLEMENTOFDEFAULT"
3140Sstevel@tonic-gate 
3150Sstevel@tonic-gate /* The following cipher list is used by default.
3160Sstevel@tonic-gate  * It also is substituted when an application-defined cipher list string
3170Sstevel@tonic-gate  * starts with 'DEFAULT'. */
3180Sstevel@tonic-gate #define SSL_DEFAULT_CIPHER_LIST	"ALL:!ADH:+RC4:@STRENGTH" /* low priority for RC4 */
3190Sstevel@tonic-gate 
3200Sstevel@tonic-gate /* Used in SSL_set_shutdown()/SSL_get_shutdown(); */
3210Sstevel@tonic-gate #define SSL_SENT_SHUTDOWN	1
3220Sstevel@tonic-gate #define SSL_RECEIVED_SHUTDOWN	2
3230Sstevel@tonic-gate 
3240Sstevel@tonic-gate #ifdef __cplusplus
3250Sstevel@tonic-gate }
3260Sstevel@tonic-gate #endif
3270Sstevel@tonic-gate 
3280Sstevel@tonic-gate #ifdef  __cplusplus
3290Sstevel@tonic-gate extern "C" {
3300Sstevel@tonic-gate #endif
3310Sstevel@tonic-gate 
3320Sstevel@tonic-gate #if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2)
3330Sstevel@tonic-gate #define OPENSSL_NO_SSL2
3340Sstevel@tonic-gate #endif
3350Sstevel@tonic-gate 
3360Sstevel@tonic-gate #define SSL_FILETYPE_ASN1	X509_FILETYPE_ASN1
3370Sstevel@tonic-gate #define SSL_FILETYPE_PEM	X509_FILETYPE_PEM
3380Sstevel@tonic-gate 
3390Sstevel@tonic-gate /* This is needed to stop compilers complaining about the
3400Sstevel@tonic-gate  * 'struct ssl_st *' function parameters used to prototype callbacks
3410Sstevel@tonic-gate  * in SSL_CTX. */
3420Sstevel@tonic-gate typedef struct ssl_st *ssl_crock_st;
3430Sstevel@tonic-gate 
3440Sstevel@tonic-gate /* used to hold info on the particular ciphers used */
3450Sstevel@tonic-gate typedef struct ssl_cipher_st
3460Sstevel@tonic-gate 	{
3470Sstevel@tonic-gate 	int valid;
3480Sstevel@tonic-gate 	const char *name;		/* text name */
3490Sstevel@tonic-gate 	unsigned long id;		/* id, 4 bytes, first is version */
3500Sstevel@tonic-gate 	unsigned long algorithms;	/* what ciphers are used */
3510Sstevel@tonic-gate 	unsigned long algo_strength;	/* strength and export flags */
3520Sstevel@tonic-gate 	unsigned long algorithm2;	/* Extra flags */
3530Sstevel@tonic-gate 	int strength_bits;		/* Number of bits really used */
3540Sstevel@tonic-gate 	int alg_bits;			/* Number of bits for algorithm */
3550Sstevel@tonic-gate 	unsigned long mask;		/* used for matching */
3560Sstevel@tonic-gate 	unsigned long mask_strength;	/* also used for matching */
3570Sstevel@tonic-gate 	} SSL_CIPHER;
3580Sstevel@tonic-gate 
3590Sstevel@tonic-gate DECLARE_STACK_OF(SSL_CIPHER)
3600Sstevel@tonic-gate 
3610Sstevel@tonic-gate typedef struct ssl_st SSL;
3620Sstevel@tonic-gate typedef struct ssl_ctx_st SSL_CTX;
3630Sstevel@tonic-gate 
3640Sstevel@tonic-gate /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */
3650Sstevel@tonic-gate typedef struct ssl_method_st
3660Sstevel@tonic-gate 	{
3670Sstevel@tonic-gate 	int version;
3680Sstevel@tonic-gate 	int (*ssl_new)(SSL *s);
3690Sstevel@tonic-gate 	void (*ssl_clear)(SSL *s);
3700Sstevel@tonic-gate 	void (*ssl_free)(SSL *s);
3710Sstevel@tonic-gate 	int (*ssl_accept)(SSL *s);
3720Sstevel@tonic-gate 	int (*ssl_connect)(SSL *s);
3730Sstevel@tonic-gate 	int (*ssl_read)(SSL *s,void *buf,int len);
3740Sstevel@tonic-gate 	int (*ssl_peek)(SSL *s,void *buf,int len);
3750Sstevel@tonic-gate 	int (*ssl_write)(SSL *s,const void *buf,int len);
3760Sstevel@tonic-gate 	int (*ssl_shutdown)(SSL *s);
3770Sstevel@tonic-gate 	int (*ssl_renegotiate)(SSL *s);
3780Sstevel@tonic-gate 	int (*ssl_renegotiate_check)(SSL *s);
3792139Sjp161948 	long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long
3802139Sjp161948 		max, int *ok);
3812139Sjp161948 	int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len,
3822139Sjp161948 		int peek);
3832139Sjp161948 	int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len);
3842139Sjp161948 	int (*ssl_dispatch_alert)(SSL *s);
3850Sstevel@tonic-gate 	long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg);
3860Sstevel@tonic-gate 	long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg);
3870Sstevel@tonic-gate 	SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr);
3880Sstevel@tonic-gate 	int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr);
3892139Sjp161948 	int (*ssl_pending)(const SSL *s);
3900Sstevel@tonic-gate 	int (*num_ciphers)(void);
3910Sstevel@tonic-gate 	SSL_CIPHER *(*get_cipher)(unsigned ncipher);
3920Sstevel@tonic-gate 	struct ssl_method_st *(*get_ssl_method)(int version);
3930Sstevel@tonic-gate 	long (*get_timeout)(void);
3940Sstevel@tonic-gate 	struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */
3952139Sjp161948 	int (*ssl_version)(void);
3962139Sjp161948 	long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void));
3972139Sjp161948 	long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void));
3980Sstevel@tonic-gate 	} SSL_METHOD;
3990Sstevel@tonic-gate 
4000Sstevel@tonic-gate /* Lets make this into an ASN.1 type structure as follows
4010Sstevel@tonic-gate  * SSL_SESSION_ID ::= SEQUENCE {
4020Sstevel@tonic-gate  *	version 		INTEGER,	-- structure version number
4030Sstevel@tonic-gate  *	SSLversion 		INTEGER,	-- SSL version number
4040Sstevel@tonic-gate  *	Cipher 			OCTET_STRING,	-- the 3 byte cipher ID
4050Sstevel@tonic-gate  *	Session_ID 		OCTET_STRING,	-- the Session ID
4060Sstevel@tonic-gate  *	Master_key 		OCTET_STRING,	-- the master key
4070Sstevel@tonic-gate  *	KRB5_principal		OCTET_STRING	-- optional Kerberos principal
4080Sstevel@tonic-gate  *	Key_Arg [ 0 ] IMPLICIT	OCTET_STRING,	-- the optional Key argument
4090Sstevel@tonic-gate  *	Time [ 1 ] EXPLICIT	INTEGER,	-- optional Start Time
4100Sstevel@tonic-gate  *	Timeout [ 2 ] EXPLICIT	INTEGER,	-- optional Timeout ins seconds
4110Sstevel@tonic-gate  *	Peer [ 3 ] EXPLICIT	X509,		-- optional Peer Certificate
4120Sstevel@tonic-gate  *	Session_ID_context [ 4 ] EXPLICIT OCTET_STRING,   -- the Session ID context
4130Sstevel@tonic-gate  *	Verify_result [ 5 ] EXPLICIT INTEGER    -- X509_V_... code for `Peer'
4140Sstevel@tonic-gate  *	Compression [6] IMPLICIT ASN1_OBJECT	-- compression OID XXXXX
4150Sstevel@tonic-gate  *	}
4160Sstevel@tonic-gate  * Look in ssl/ssl_asn1.c for more details
4170Sstevel@tonic-gate  * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-).
4180Sstevel@tonic-gate  */
4190Sstevel@tonic-gate typedef struct ssl_session_st
4200Sstevel@tonic-gate 	{
4210Sstevel@tonic-gate 	int ssl_version;	/* what ssl version session info is
4220Sstevel@tonic-gate 				 * being kept in here? */
4230Sstevel@tonic-gate 
4240Sstevel@tonic-gate 	/* only really used in SSLv2 */
4250Sstevel@tonic-gate 	unsigned int key_arg_length;
4260Sstevel@tonic-gate 	unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH];
4270Sstevel@tonic-gate 	int master_key_length;
4280Sstevel@tonic-gate 	unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH];
4290Sstevel@tonic-gate 	/* session_id - valid? */
4300Sstevel@tonic-gate 	unsigned int session_id_length;
4310Sstevel@tonic-gate 	unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH];
4320Sstevel@tonic-gate 	/* this is used to determine whether the session is being reused in
4330Sstevel@tonic-gate 	 * the appropriate context. It is up to the application to set this,
4340Sstevel@tonic-gate 	 * via SSL_new */
4350Sstevel@tonic-gate 	unsigned int sid_ctx_length;
4360Sstevel@tonic-gate 	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
4370Sstevel@tonic-gate 
4380Sstevel@tonic-gate #ifndef OPENSSL_NO_KRB5
4390Sstevel@tonic-gate         unsigned int krb5_client_princ_len;
4400Sstevel@tonic-gate         unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH];
4410Sstevel@tonic-gate #endif /* OPENSSL_NO_KRB5 */
4420Sstevel@tonic-gate 
4430Sstevel@tonic-gate 	int not_resumable;
4440Sstevel@tonic-gate 
4450Sstevel@tonic-gate 	/* The cert is the certificate used to establish this connection */
4460Sstevel@tonic-gate 	struct sess_cert_st /* SESS_CERT */ *sess_cert;
4470Sstevel@tonic-gate 
4480Sstevel@tonic-gate 	/* This is the cert for the other end.
4490Sstevel@tonic-gate 	 * On clients, it will be the same as sess_cert->peer_key->x509
4500Sstevel@tonic-gate 	 * (the latter is not enough as sess_cert is not retained
4510Sstevel@tonic-gate 	 * in the external representation of sessions, see ssl_asn1.c). */
4520Sstevel@tonic-gate 	X509 *peer;
4530Sstevel@tonic-gate 	/* when app_verify_callback accepts a session where the peer's certificate
4540Sstevel@tonic-gate 	 * is not ok, we must remember the error for session reuse: */
4550Sstevel@tonic-gate 	long verify_result; /* only for servers */
4560Sstevel@tonic-gate 
4570Sstevel@tonic-gate 	int references;
4580Sstevel@tonic-gate 	long timeout;
4590Sstevel@tonic-gate 	long time;
4600Sstevel@tonic-gate 
4610Sstevel@tonic-gate 	int compress_meth;		/* Need to lookup the method */
4620Sstevel@tonic-gate 
4630Sstevel@tonic-gate 	SSL_CIPHER *cipher;
4640Sstevel@tonic-gate 	unsigned long cipher_id;	/* when ASN.1 loaded, this
4650Sstevel@tonic-gate 					 * needs to be used to load
4660Sstevel@tonic-gate 					 * the 'cipher' structure */
4670Sstevel@tonic-gate 
4680Sstevel@tonic-gate 	STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */
4690Sstevel@tonic-gate 
4700Sstevel@tonic-gate 	CRYPTO_EX_DATA ex_data; /* application specific data */
4710Sstevel@tonic-gate 
4720Sstevel@tonic-gate 	/* These are used to make removal of session-ids more
4730Sstevel@tonic-gate 	 * efficient and to implement a maximum cache size. */
4740Sstevel@tonic-gate 	struct ssl_session_st *prev,*next;
4750Sstevel@tonic-gate 	} SSL_SESSION;
4760Sstevel@tonic-gate 
4770Sstevel@tonic-gate 
4780Sstevel@tonic-gate #define SSL_OP_MICROSOFT_SESS_ID_BUG			0x00000001L
4790Sstevel@tonic-gate #define SSL_OP_NETSCAPE_CHALLENGE_BUG			0x00000002L
4800Sstevel@tonic-gate #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG		0x00000008L
4810Sstevel@tonic-gate #define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG		0x00000010L
4820Sstevel@tonic-gate #define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER		0x00000020L
483682Sjp161948 #define SSL_OP_MSIE_SSLV2_RSA_PADDING			0x00000040L /* no effect since 0.9.7h and 0.9.8b */
4840Sstevel@tonic-gate #define SSL_OP_SSLEAY_080_CLIENT_DH_BUG			0x00000080L
4850Sstevel@tonic-gate #define SSL_OP_TLS_D5_BUG				0x00000100L
4860Sstevel@tonic-gate #define SSL_OP_TLS_BLOCK_PADDING_BUG			0x00000200L
4870Sstevel@tonic-gate 
4880Sstevel@tonic-gate /* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added
4890Sstevel@tonic-gate  * in OpenSSL 0.9.6d.  Usually (depending on the application protocol)
4900Sstevel@tonic-gate  * the workaround is not needed.  Unfortunately some broken SSL/TLS
4910Sstevel@tonic-gate  * implementations cannot handle it at all, which is why we include
4920Sstevel@tonic-gate  * it in SSL_OP_ALL. */
4930Sstevel@tonic-gate #define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS              0x00000800L /* added in 0.9.6e */
4940Sstevel@tonic-gate 
4950Sstevel@tonic-gate /* SSL_OP_ALL: various bug workarounds that should be rather harmless.
4960Sstevel@tonic-gate  *             This used to be 0x000FFFFFL before 0.9.7. */
4970Sstevel@tonic-gate #define SSL_OP_ALL					0x00000FFFL
4980Sstevel@tonic-gate 
4992139Sjp161948 /* DTLS options */
5002139Sjp161948 #define SSL_OP_NO_QUERY_MTU                 0x00001000L
5012139Sjp161948 /* Turn on Cookie Exchange (on relevant for servers) */
5022139Sjp161948 #define SSL_OP_COOKIE_EXCHANGE              0x00002000L
5032139Sjp161948 
5040Sstevel@tonic-gate /* As server, disallow session resumption on renegotiation */
5050Sstevel@tonic-gate #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION	0x00010000L
5062139Sjp161948 /* If set, always create a new key when using tmp_ecdh parameters */
5072139Sjp161948 #define SSL_OP_SINGLE_ECDH_USE				0x00080000L
5080Sstevel@tonic-gate /* If set, always create a new key when using tmp_dh parameters */
5090Sstevel@tonic-gate #define SSL_OP_SINGLE_DH_USE				0x00100000L
5100Sstevel@tonic-gate /* Set to always use the tmp_rsa key when doing RSA operations,
5110Sstevel@tonic-gate  * even when this violates protocol specs */
5120Sstevel@tonic-gate #define SSL_OP_EPHEMERAL_RSA				0x00200000L
5130Sstevel@tonic-gate /* Set on servers to choose the cipher according to the server's
5140Sstevel@tonic-gate  * preferences */
5150Sstevel@tonic-gate #define SSL_OP_CIPHER_SERVER_PREFERENCE			0x00400000L
5160Sstevel@tonic-gate /* If set, a server will allow a client to issue a SSLv3.0 version number
5170Sstevel@tonic-gate  * as latest version supported in the premaster secret, even when TLSv1.0
5180Sstevel@tonic-gate  * (version 3.1) was announced in the client hello. Normally this is
5190Sstevel@tonic-gate  * forbidden to prevent version rollback attacks. */
5200Sstevel@tonic-gate #define SSL_OP_TLS_ROLLBACK_BUG				0x00800000L
5210Sstevel@tonic-gate 
5220Sstevel@tonic-gate #define SSL_OP_NO_SSLv2					0x01000000L
5230Sstevel@tonic-gate #define SSL_OP_NO_SSLv3					0x02000000L
5240Sstevel@tonic-gate #define SSL_OP_NO_TLSv1					0x04000000L
5250Sstevel@tonic-gate 
5260Sstevel@tonic-gate /* The next flag deliberately changes the ciphertest, this is a check
5270Sstevel@tonic-gate  * for the PKCS#1 attack */
5280Sstevel@tonic-gate #define SSL_OP_PKCS1_CHECK_1				0x08000000L
5290Sstevel@tonic-gate #define SSL_OP_PKCS1_CHECK_2				0x10000000L
5300Sstevel@tonic-gate #define SSL_OP_NETSCAPE_CA_DN_BUG			0x20000000L
5310Sstevel@tonic-gate #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG		0x40000000L
5320Sstevel@tonic-gate 
5330Sstevel@tonic-gate 
5340Sstevel@tonic-gate /* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success
5350Sstevel@tonic-gate  * when just a single record has been written): */
5360Sstevel@tonic-gate #define SSL_MODE_ENABLE_PARTIAL_WRITE       0x00000001L
5370Sstevel@tonic-gate /* Make it possible to retry SSL_write() with changed buffer location
5380Sstevel@tonic-gate  * (buffer contents must stay the same!); this is not the default to avoid
5390Sstevel@tonic-gate  * the misconception that non-blocking SSL_write() behaves like
5400Sstevel@tonic-gate  * non-blocking write(): */
5410Sstevel@tonic-gate #define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L
5420Sstevel@tonic-gate /* Never bother the application with retries if the transport
5430Sstevel@tonic-gate  * is blocking: */
5440Sstevel@tonic-gate #define SSL_MODE_AUTO_RETRY 0x00000004L
5450Sstevel@tonic-gate /* Don't attempt to automatically build certificate chain */
5460Sstevel@tonic-gate #define SSL_MODE_NO_AUTO_CHAIN 0x00000008L
5470Sstevel@tonic-gate 
5480Sstevel@tonic-gate 
5490Sstevel@tonic-gate /* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value,
5500Sstevel@tonic-gate  * they cannot be used to clear bits. */
5510Sstevel@tonic-gate 
5520Sstevel@tonic-gate #define SSL_CTX_set_options(ctx,op) \
5530Sstevel@tonic-gate 	SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL)
5540Sstevel@tonic-gate #define SSL_CTX_get_options(ctx) \
5550Sstevel@tonic-gate 	SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL)
5560Sstevel@tonic-gate #define SSL_set_options(ssl,op) \
5570Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL)
5580Sstevel@tonic-gate #define SSL_get_options(ssl) \
5590Sstevel@tonic-gate         SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL)
5600Sstevel@tonic-gate 
5610Sstevel@tonic-gate #define SSL_CTX_set_mode(ctx,op) \
5620Sstevel@tonic-gate 	SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL)
5630Sstevel@tonic-gate #define SSL_CTX_get_mode(ctx) \
5640Sstevel@tonic-gate 	SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL)
5650Sstevel@tonic-gate #define SSL_set_mode(ssl,op) \
5660Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL)
5670Sstevel@tonic-gate #define SSL_get_mode(ssl) \
5680Sstevel@tonic-gate         SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL)
5692139Sjp161948 #define SSL_set_mtu(ssl, mtu) \
5702139Sjp161948         SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL)
5710Sstevel@tonic-gate 
5720Sstevel@tonic-gate 
5730Sstevel@tonic-gate void SSL_CTX_set_msg_callback(SSL_CTX *ctx, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
5740Sstevel@tonic-gate void SSL_set_msg_callback(SSL *ssl, void (*cb)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg));
5750Sstevel@tonic-gate #define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
5760Sstevel@tonic-gate #define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg))
5770Sstevel@tonic-gate 
5780Sstevel@tonic-gate 
5790Sstevel@tonic-gate 
5800Sstevel@tonic-gate #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32)
5810Sstevel@tonic-gate #define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */
5820Sstevel@tonic-gate #else
5830Sstevel@tonic-gate #define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */
5840Sstevel@tonic-gate #endif
5850Sstevel@tonic-gate 
5860Sstevel@tonic-gate #define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT	(1024*20)
5870Sstevel@tonic-gate 
5880Sstevel@tonic-gate /* This callback type is used inside SSL_CTX, SSL, and in the functions that set
5890Sstevel@tonic-gate  * them. It is used to override the generation of SSL/TLS session IDs in a
5900Sstevel@tonic-gate  * server. Return value should be zero on an error, non-zero to proceed. Also,
5910Sstevel@tonic-gate  * callbacks should themselves check if the id they generate is unique otherwise
5920Sstevel@tonic-gate  * the SSL handshake will fail with an error - callbacks can do this using the
5930Sstevel@tonic-gate  * 'ssl' value they're passed by;
5940Sstevel@tonic-gate  *      SSL_has_matching_session_id(ssl, id, *id_len)
5950Sstevel@tonic-gate  * The length value passed in is set at the maximum size the session ID can be.
5960Sstevel@tonic-gate  * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback
5970Sstevel@tonic-gate  * can alter this length to be less if desired, but under SSLv2 session IDs are
5980Sstevel@tonic-gate  * supposed to be fixed at 16 bytes so the id will be padded after the callback
5990Sstevel@tonic-gate  * returns in this case. It is also an error for the callback to set the size to
6000Sstevel@tonic-gate  * zero. */
6010Sstevel@tonic-gate typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id,
6020Sstevel@tonic-gate 				unsigned int *id_len);
6030Sstevel@tonic-gate 
6040Sstevel@tonic-gate typedef struct ssl_comp_st
6050Sstevel@tonic-gate 	{
6060Sstevel@tonic-gate 	int id;
6072139Sjp161948 	const char *name;
6080Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP
6090Sstevel@tonic-gate 	COMP_METHOD *method;
6100Sstevel@tonic-gate #else
6110Sstevel@tonic-gate 	char *method;
6120Sstevel@tonic-gate #endif
6130Sstevel@tonic-gate 	} SSL_COMP;
6140Sstevel@tonic-gate 
6150Sstevel@tonic-gate DECLARE_STACK_OF(SSL_COMP)
6160Sstevel@tonic-gate 
6170Sstevel@tonic-gate struct ssl_ctx_st
6180Sstevel@tonic-gate 	{
6190Sstevel@tonic-gate 	SSL_METHOD *method;
6200Sstevel@tonic-gate 
6210Sstevel@tonic-gate 	STACK_OF(SSL_CIPHER) *cipher_list;
6220Sstevel@tonic-gate 	/* same as above but sorted for lookup */
6230Sstevel@tonic-gate 	STACK_OF(SSL_CIPHER) *cipher_list_by_id;
6240Sstevel@tonic-gate 
6250Sstevel@tonic-gate 	struct x509_store_st /* X509_STORE */ *cert_store;
6260Sstevel@tonic-gate 	struct lhash_st /* LHASH */ *sessions;	/* a set of SSL_SESSIONs */
6270Sstevel@tonic-gate 	/* Most session-ids that will be cached, default is
6280Sstevel@tonic-gate 	 * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */
6290Sstevel@tonic-gate 	unsigned long session_cache_size;
6300Sstevel@tonic-gate 	struct ssl_session_st *session_cache_head;
6310Sstevel@tonic-gate 	struct ssl_session_st *session_cache_tail;
6320Sstevel@tonic-gate 
6330Sstevel@tonic-gate 	/* This can have one of 2 values, ored together,
6340Sstevel@tonic-gate 	 * SSL_SESS_CACHE_CLIENT,
6350Sstevel@tonic-gate 	 * SSL_SESS_CACHE_SERVER,
6360Sstevel@tonic-gate 	 * Default is SSL_SESSION_CACHE_SERVER, which means only
6370Sstevel@tonic-gate 	 * SSL_accept which cache SSL_SESSIONS. */
6380Sstevel@tonic-gate 	int session_cache_mode;
6390Sstevel@tonic-gate 
6400Sstevel@tonic-gate 	/* If timeout is not 0, it is the default timeout value set
6410Sstevel@tonic-gate 	 * when SSL_new() is called.  This has been put in to make
6420Sstevel@tonic-gate 	 * life easier to set things up */
6430Sstevel@tonic-gate 	long session_timeout;
6440Sstevel@tonic-gate 
6450Sstevel@tonic-gate 	/* If this callback is not null, it will be called each
6460Sstevel@tonic-gate 	 * time a session id is added to the cache.  If this function
6470Sstevel@tonic-gate 	 * returns 1, it means that the callback will do a
6480Sstevel@tonic-gate 	 * SSL_SESSION_free() when it has finished using it.  Otherwise,
6490Sstevel@tonic-gate 	 * on 0, it means the callback has finished with it.
6500Sstevel@tonic-gate 	 * If remove_session_cb is not null, it will be called when
6510Sstevel@tonic-gate 	 * a session-id is removed from the cache.  After the call,
6520Sstevel@tonic-gate 	 * OpenSSL will SSL_SESSION_free() it. */
6530Sstevel@tonic-gate 	int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess);
6540Sstevel@tonic-gate 	void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess);
6550Sstevel@tonic-gate 	SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl,
6560Sstevel@tonic-gate 		unsigned char *data,int len,int *copy);
6570Sstevel@tonic-gate 
6580Sstevel@tonic-gate 	struct
6590Sstevel@tonic-gate 		{
6600Sstevel@tonic-gate 		int sess_connect;	/* SSL new conn - started */
6610Sstevel@tonic-gate 		int sess_connect_renegotiate;/* SSL reneg - requested */
6620Sstevel@tonic-gate 		int sess_connect_good;	/* SSL new conne/reneg - finished */
6630Sstevel@tonic-gate 		int sess_accept;	/* SSL new accept - started */
6640Sstevel@tonic-gate 		int sess_accept_renegotiate;/* SSL reneg - requested */
6650Sstevel@tonic-gate 		int sess_accept_good;	/* SSL accept/reneg - finished */
6660Sstevel@tonic-gate 		int sess_miss;		/* session lookup misses  */
6670Sstevel@tonic-gate 		int sess_timeout;	/* reuse attempt on timeouted session */
6680Sstevel@tonic-gate 		int sess_cache_full;	/* session removed due to full cache */
6690Sstevel@tonic-gate 		int sess_hit;		/* session reuse actually done */
6700Sstevel@tonic-gate 		int sess_cb_hit;	/* session-id that was not
6710Sstevel@tonic-gate 					 * in the cache was
6720Sstevel@tonic-gate 					 * passed back via the callback.  This
6730Sstevel@tonic-gate 					 * indicates that the application is
6740Sstevel@tonic-gate 					 * supplying session-id's from other
6750Sstevel@tonic-gate 					 * processes - spooky :-) */
6760Sstevel@tonic-gate 		} stats;
6770Sstevel@tonic-gate 
6780Sstevel@tonic-gate 	int references;
6790Sstevel@tonic-gate 
6800Sstevel@tonic-gate 	/* if defined, these override the X509_verify_cert() calls */
6810Sstevel@tonic-gate 	int (*app_verify_callback)(X509_STORE_CTX *, void *);
6820Sstevel@tonic-gate 	void *app_verify_arg;
6830Sstevel@tonic-gate 	/* before OpenSSL 0.9.7, 'app_verify_arg' was ignored
6840Sstevel@tonic-gate 	 * ('app_verify_callback' was called with just one argument) */
6850Sstevel@tonic-gate 
6860Sstevel@tonic-gate 	/* Default password callback. */
6870Sstevel@tonic-gate 	pem_password_cb *default_passwd_callback;
6880Sstevel@tonic-gate 
6890Sstevel@tonic-gate 	/* Default password callback user data. */
6900Sstevel@tonic-gate 	void *default_passwd_callback_userdata;
6910Sstevel@tonic-gate 
6920Sstevel@tonic-gate 	/* get client cert callback */
6930Sstevel@tonic-gate 	int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey);
6940Sstevel@tonic-gate 
6952139Sjp161948     /* cookie generate callback */
6962139Sjp161948     int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie,
6972139Sjp161948         unsigned int *cookie_len);
6982139Sjp161948 
6992139Sjp161948     /* verify cookie callback */
7002139Sjp161948     int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie,
7012139Sjp161948         unsigned int cookie_len);
7022139Sjp161948 
7030Sstevel@tonic-gate 	CRYPTO_EX_DATA ex_data;
7040Sstevel@tonic-gate 
7050Sstevel@tonic-gate 	const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */
7060Sstevel@tonic-gate 	const EVP_MD *md5;	/* For SSLv3/TLSv1 'ssl3-md5' */
7070Sstevel@tonic-gate 	const EVP_MD *sha1;   /* For SSLv3/TLSv1 'ssl3->sha1' */
7080Sstevel@tonic-gate 
7090Sstevel@tonic-gate 	STACK_OF(X509) *extra_certs;
7100Sstevel@tonic-gate 	STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */
7110Sstevel@tonic-gate 
7120Sstevel@tonic-gate 
7130Sstevel@tonic-gate 	/* Default values used when no per-SSL value is defined follow */
7140Sstevel@tonic-gate 
7150Sstevel@tonic-gate 	void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */
7160Sstevel@tonic-gate 
7170Sstevel@tonic-gate 	/* what we put in client cert requests */
7180Sstevel@tonic-gate 	STACK_OF(X509_NAME) *client_CA;
7190Sstevel@tonic-gate 
7200Sstevel@tonic-gate 
7210Sstevel@tonic-gate 	/* Default values to use in SSL structures follow (these are copied by SSL_new) */
7220Sstevel@tonic-gate 
7230Sstevel@tonic-gate 	unsigned long options;
7240Sstevel@tonic-gate 	unsigned long mode;
7250Sstevel@tonic-gate 	long max_cert_list;
7260Sstevel@tonic-gate 
7270Sstevel@tonic-gate 	struct cert_st /* CERT */ *cert;
7280Sstevel@tonic-gate 	int read_ahead;
7290Sstevel@tonic-gate 
7300Sstevel@tonic-gate 	/* callback that allows applications to peek at protocol messages */
7310Sstevel@tonic-gate 	void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
7320Sstevel@tonic-gate 	void *msg_callback_arg;
7330Sstevel@tonic-gate 
7340Sstevel@tonic-gate 	int verify_mode;
7350Sstevel@tonic-gate 	unsigned int sid_ctx_length;
7360Sstevel@tonic-gate 	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
7370Sstevel@tonic-gate 	int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */
7380Sstevel@tonic-gate 
7390Sstevel@tonic-gate 	/* Default generate session ID callback. */
7400Sstevel@tonic-gate 	GEN_SESSION_CB generate_session_id;
7410Sstevel@tonic-gate 
7422139Sjp161948 	X509_VERIFY_PARAM *param;
7432139Sjp161948 
7442139Sjp161948 #if 0
7450Sstevel@tonic-gate 	int purpose;		/* Purpose setting */
7460Sstevel@tonic-gate 	int trust;		/* Trust setting */
7472139Sjp161948 #endif
7480Sstevel@tonic-gate 
7490Sstevel@tonic-gate 	int quiet_shutdown;
7500Sstevel@tonic-gate 	};
7510Sstevel@tonic-gate 
7520Sstevel@tonic-gate #define SSL_SESS_CACHE_OFF			0x0000
7530Sstevel@tonic-gate #define SSL_SESS_CACHE_CLIENT			0x0001
7540Sstevel@tonic-gate #define SSL_SESS_CACHE_SERVER			0x0002
7550Sstevel@tonic-gate #define SSL_SESS_CACHE_BOTH	(SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER)
7560Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_AUTO_CLEAR		0x0080
7570Sstevel@tonic-gate /* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */
7580Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP	0x0100
7590Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL_STORE	0x0200
7600Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL \
7610Sstevel@tonic-gate 	(SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE)
7620Sstevel@tonic-gate 
7630Sstevel@tonic-gate   struct lhash_st *SSL_CTX_sessions(SSL_CTX *ctx);
7640Sstevel@tonic-gate #define SSL_CTX_sess_number(ctx) \
7650Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL)
7660Sstevel@tonic-gate #define SSL_CTX_sess_connect(ctx) \
7670Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL)
7680Sstevel@tonic-gate #define SSL_CTX_sess_connect_good(ctx) \
7690Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL)
7700Sstevel@tonic-gate #define SSL_CTX_sess_connect_renegotiate(ctx) \
7710Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL)
7720Sstevel@tonic-gate #define SSL_CTX_sess_accept(ctx) \
7730Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL)
7740Sstevel@tonic-gate #define SSL_CTX_sess_accept_renegotiate(ctx) \
7750Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL)
7760Sstevel@tonic-gate #define SSL_CTX_sess_accept_good(ctx) \
7770Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL)
7780Sstevel@tonic-gate #define SSL_CTX_sess_hits(ctx) \
7790Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL)
7800Sstevel@tonic-gate #define SSL_CTX_sess_cb_hits(ctx) \
7810Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL)
7820Sstevel@tonic-gate #define SSL_CTX_sess_misses(ctx) \
7830Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL)
7840Sstevel@tonic-gate #define SSL_CTX_sess_timeouts(ctx) \
7850Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL)
7860Sstevel@tonic-gate #define SSL_CTX_sess_cache_full(ctx) \
7870Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL)
7880Sstevel@tonic-gate 
7890Sstevel@tonic-gate #define SSL_CTX_sess_set_new_cb(ctx,cb)	((ctx)->new_session_cb=(cb))
7900Sstevel@tonic-gate #define SSL_CTX_sess_get_new_cb(ctx)	((ctx)->new_session_cb)
7910Sstevel@tonic-gate #define SSL_CTX_sess_set_remove_cb(ctx,cb)	((ctx)->remove_session_cb=(cb))
7920Sstevel@tonic-gate #define SSL_CTX_sess_get_remove_cb(ctx)	((ctx)->remove_session_cb)
7930Sstevel@tonic-gate #define SSL_CTX_sess_set_get_cb(ctx,cb)	((ctx)->get_session_cb=(cb))
7940Sstevel@tonic-gate #define SSL_CTX_sess_get_get_cb(ctx)	((ctx)->get_session_cb)
7950Sstevel@tonic-gate #define SSL_CTX_set_info_callback(ctx,cb)	((ctx)->info_callback=(cb))
7960Sstevel@tonic-gate #define SSL_CTX_get_info_callback(ctx)		((ctx)->info_callback)
7970Sstevel@tonic-gate #define SSL_CTX_set_client_cert_cb(ctx,cb)	((ctx)->client_cert_cb=(cb))
7980Sstevel@tonic-gate #define SSL_CTX_get_client_cert_cb(ctx)		((ctx)->client_cert_cb)
7992139Sjp161948 #define SSL_CTX_set_cookie_generate_cb(ctx,cb) ((ctx)->app_gen_cookie_cb=(cb))
8002139Sjp161948 #define SSL_CTX_set_cookie_verify_cb(ctx,cb) ((ctx)->app_verify_cookie_cb=(cb))
8010Sstevel@tonic-gate 
8020Sstevel@tonic-gate #define SSL_NOTHING	1
8030Sstevel@tonic-gate #define SSL_WRITING	2
8040Sstevel@tonic-gate #define SSL_READING	3
8050Sstevel@tonic-gate #define SSL_X509_LOOKUP	4
8060Sstevel@tonic-gate 
8070Sstevel@tonic-gate /* These will only be used when doing non-blocking IO */
8080Sstevel@tonic-gate #define SSL_want_nothing(s)	(SSL_want(s) == SSL_NOTHING)
8090Sstevel@tonic-gate #define SSL_want_read(s)	(SSL_want(s) == SSL_READING)
8100Sstevel@tonic-gate #define SSL_want_write(s)	(SSL_want(s) == SSL_WRITING)
8110Sstevel@tonic-gate #define SSL_want_x509_lookup(s)	(SSL_want(s) == SSL_X509_LOOKUP)
8120Sstevel@tonic-gate 
8130Sstevel@tonic-gate struct ssl_st
8140Sstevel@tonic-gate 	{
8150Sstevel@tonic-gate 	/* protocol version
8162139Sjp161948 	 * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION)
8170Sstevel@tonic-gate 	 */
8180Sstevel@tonic-gate 	int version;
8190Sstevel@tonic-gate 	int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */
8200Sstevel@tonic-gate 
8210Sstevel@tonic-gate 	SSL_METHOD *method; /* SSLv3 */
8220Sstevel@tonic-gate 
8230Sstevel@tonic-gate 	/* There are 2 BIO's even though they are normally both the
8240Sstevel@tonic-gate 	 * same.  This is so data can be read and written to different
8250Sstevel@tonic-gate 	 * handlers */
8260Sstevel@tonic-gate 
8270Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO
8280Sstevel@tonic-gate 	BIO *rbio; /* used by SSL_read */
8290Sstevel@tonic-gate 	BIO *wbio; /* used by SSL_write */
8300Sstevel@tonic-gate 	BIO *bbio; /* used during session-id reuse to concatenate
8310Sstevel@tonic-gate 		    * messages */
8320Sstevel@tonic-gate #else
8330Sstevel@tonic-gate 	char *rbio; /* used by SSL_read */
8340Sstevel@tonic-gate 	char *wbio; /* used by SSL_write */
8350Sstevel@tonic-gate 	char *bbio;
8360Sstevel@tonic-gate #endif
8370Sstevel@tonic-gate 	/* This holds a variable that indicates what we were doing
8380Sstevel@tonic-gate 	 * when a 0 or -1 is returned.  This is needed for
8390Sstevel@tonic-gate 	 * non-blocking IO so we know what request needs re-doing when
8400Sstevel@tonic-gate 	 * in SSL_accept or SSL_connect */
8410Sstevel@tonic-gate 	int rwstate;
8420Sstevel@tonic-gate 
8430Sstevel@tonic-gate 	/* true when we are actually in SSL_accept() or SSL_connect() */
8440Sstevel@tonic-gate 	int in_handshake;
8452139Sjp161948 	int (*handshake_func)(SSL *);
8460Sstevel@tonic-gate 
8470Sstevel@tonic-gate 	/* Imagine that here's a boolean member "init" that is
8480Sstevel@tonic-gate 	 * switched as soon as SSL_set_{accept/connect}_state
8490Sstevel@tonic-gate 	 * is called for the first time, so that "state" and
8500Sstevel@tonic-gate 	 * "handshake_func" are properly initialized.  But as
8510Sstevel@tonic-gate 	 * handshake_func is == 0 until then, we use this
8520Sstevel@tonic-gate 	 * test instead of an "init" member.
8530Sstevel@tonic-gate 	 */
8540Sstevel@tonic-gate 
8550Sstevel@tonic-gate 	int server;	/* are we the server side? - mostly used by SSL_clear*/
8560Sstevel@tonic-gate 
8570Sstevel@tonic-gate 	int new_session;/* 1 if we are to use a new session.
8580Sstevel@tonic-gate 	                 * 2 if we are a server and are inside a handshake
8590Sstevel@tonic-gate 	                 *   (i.e. not just sending a HelloRequest)
8600Sstevel@tonic-gate 	                 * NB: For servers, the 'new' session may actually be a previously
8610Sstevel@tonic-gate 	                 * cached session or even the previous session unless
8620Sstevel@tonic-gate 	                 * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */
8630Sstevel@tonic-gate 	int quiet_shutdown;/* don't send shutdown packets */
8640Sstevel@tonic-gate 	int shutdown;	/* we have shut things down, 0x01 sent, 0x02
8650Sstevel@tonic-gate 			 * for received */
8660Sstevel@tonic-gate 	int state;	/* where we are */
8670Sstevel@tonic-gate 	int rstate;	/* where we are when reading */
8680Sstevel@tonic-gate 
8690Sstevel@tonic-gate 	BUF_MEM *init_buf;	/* buffer used during init */
8700Sstevel@tonic-gate 	void *init_msg;   	/* pointer to handshake message body, set by ssl3_get_message() */
8710Sstevel@tonic-gate 	int init_num;		/* amount read/written */
8720Sstevel@tonic-gate 	int init_off;		/* amount read/written */
8730Sstevel@tonic-gate 
8740Sstevel@tonic-gate 	/* used internally to point at a raw packet */
8750Sstevel@tonic-gate 	unsigned char *packet;
8760Sstevel@tonic-gate 	unsigned int packet_length;
8770Sstevel@tonic-gate 
8780Sstevel@tonic-gate 	struct ssl2_state_st *s2; /* SSLv2 variables */
8790Sstevel@tonic-gate 	struct ssl3_state_st *s3; /* SSLv3 variables */
8802139Sjp161948 	struct dtls1_state_st *d1; /* DTLSv1 variables */
8810Sstevel@tonic-gate 
8820Sstevel@tonic-gate 	int read_ahead;		/* Read as many input bytes as possible
8830Sstevel@tonic-gate 	               	 	 * (for non-blocking reads) */
8840Sstevel@tonic-gate 
8850Sstevel@tonic-gate 	/* callback that allows applications to peek at protocol messages */
8860Sstevel@tonic-gate 	void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg);
8870Sstevel@tonic-gate 	void *msg_callback_arg;
8880Sstevel@tonic-gate 
8890Sstevel@tonic-gate 	int hit;		/* reusing a previous session */
8900Sstevel@tonic-gate 
8912139Sjp161948 	X509_VERIFY_PARAM *param;
8922139Sjp161948 
8932139Sjp161948 #if 0
8940Sstevel@tonic-gate 	int purpose;		/* Purpose setting */
8950Sstevel@tonic-gate 	int trust;		/* Trust setting */
8962139Sjp161948 #endif
8970Sstevel@tonic-gate 
8980Sstevel@tonic-gate 	/* crypto */
8990Sstevel@tonic-gate 	STACK_OF(SSL_CIPHER) *cipher_list;
9000Sstevel@tonic-gate 	STACK_OF(SSL_CIPHER) *cipher_list_by_id;
9010Sstevel@tonic-gate 
9020Sstevel@tonic-gate 	/* These are the ones being used, the ones in SSL_SESSION are
9030Sstevel@tonic-gate 	 * the ones to be 'copied' into these ones */
9040Sstevel@tonic-gate 
9050Sstevel@tonic-gate 	EVP_CIPHER_CTX *enc_read_ctx;		/* cryptographic state */
9060Sstevel@tonic-gate 	const EVP_MD *read_hash;		/* used for mac generation */
9070Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP
9080Sstevel@tonic-gate 	COMP_CTX *expand;			/* uncompress */
9090Sstevel@tonic-gate #else
9100Sstevel@tonic-gate 	char *expand;
9110Sstevel@tonic-gate #endif
9120Sstevel@tonic-gate 
9130Sstevel@tonic-gate 	EVP_CIPHER_CTX *enc_write_ctx;		/* cryptographic state */
9140Sstevel@tonic-gate 	const EVP_MD *write_hash;		/* used for mac generation */
9150Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP
9160Sstevel@tonic-gate 	COMP_CTX *compress;			/* compression */
9170Sstevel@tonic-gate #else
9180Sstevel@tonic-gate 	char *compress;
9190Sstevel@tonic-gate #endif
9200Sstevel@tonic-gate 
9210Sstevel@tonic-gate 	/* session info */
9220Sstevel@tonic-gate 
9230Sstevel@tonic-gate 	/* client cert? */
9240Sstevel@tonic-gate 	/* This is used to hold the server certificate used */
9250Sstevel@tonic-gate 	struct cert_st /* CERT */ *cert;
9260Sstevel@tonic-gate 
9270Sstevel@tonic-gate 	/* the session_id_context is used to ensure sessions are only reused
9280Sstevel@tonic-gate 	 * in the appropriate context */
9290Sstevel@tonic-gate 	unsigned int sid_ctx_length;
9300Sstevel@tonic-gate 	unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH];
9310Sstevel@tonic-gate 
9320Sstevel@tonic-gate 	/* This can also be in the session once a session is established */
9330Sstevel@tonic-gate 	SSL_SESSION *session;
9340Sstevel@tonic-gate 
9350Sstevel@tonic-gate 	/* Default generate session ID callback. */
9360Sstevel@tonic-gate 	GEN_SESSION_CB generate_session_id;
9370Sstevel@tonic-gate 
9380Sstevel@tonic-gate 	/* Used in SSL2 and SSL3 */
9390Sstevel@tonic-gate 	int verify_mode;	/* 0 don't care about verify failure.
9400Sstevel@tonic-gate 				 * 1 fail if verify fails */
9410Sstevel@tonic-gate 	int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */
9420Sstevel@tonic-gate 
9430Sstevel@tonic-gate 	void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */
9440Sstevel@tonic-gate 
9450Sstevel@tonic-gate 	int error;		/* error bytes to be written */
9460Sstevel@tonic-gate 	int error_code;		/* actual code */
9470Sstevel@tonic-gate 
9480Sstevel@tonic-gate #ifndef OPENSSL_NO_KRB5
9490Sstevel@tonic-gate 	KSSL_CTX *kssl_ctx;     /* Kerberos 5 context */
9500Sstevel@tonic-gate #endif	/* OPENSSL_NO_KRB5 */
9510Sstevel@tonic-gate 
9520Sstevel@tonic-gate 	SSL_CTX *ctx;
9530Sstevel@tonic-gate 	/* set this flag to 1 and a sleep(1) is put into all SSL_read()
9540Sstevel@tonic-gate 	 * and SSL_write() calls, good for nbio debuging :-) */
9550Sstevel@tonic-gate 	int debug;
9560Sstevel@tonic-gate 
9570Sstevel@tonic-gate 	/* extra application data */
9580Sstevel@tonic-gate 	long verify_result;
9590Sstevel@tonic-gate 	CRYPTO_EX_DATA ex_data;
9600Sstevel@tonic-gate 
9610Sstevel@tonic-gate 	/* for server side, keep the list of CA_dn we can use */
9620Sstevel@tonic-gate 	STACK_OF(X509_NAME) *client_CA;
9630Sstevel@tonic-gate 
9640Sstevel@tonic-gate 	int references;
9650Sstevel@tonic-gate 	unsigned long options; /* protocol behaviour */
9660Sstevel@tonic-gate 	unsigned long mode; /* API behaviour */
9670Sstevel@tonic-gate 	long max_cert_list;
9680Sstevel@tonic-gate 	int first_packet;
9690Sstevel@tonic-gate 	int client_version;	/* what was passed, used for
9700Sstevel@tonic-gate 				 * SSLv3/TLS rollback check */
9710Sstevel@tonic-gate 	};
9720Sstevel@tonic-gate 
9730Sstevel@tonic-gate #ifdef __cplusplus
9740Sstevel@tonic-gate }
9750Sstevel@tonic-gate #endif
9760Sstevel@tonic-gate 
9770Sstevel@tonic-gate #include <openssl/ssl2.h>
9780Sstevel@tonic-gate #include <openssl/ssl3.h>
9790Sstevel@tonic-gate #include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */
9802139Sjp161948 #include <openssl/dtls1.h> /* Datagram TLS */
9810Sstevel@tonic-gate #include <openssl/ssl23.h>
9820Sstevel@tonic-gate 
9830Sstevel@tonic-gate #ifdef  __cplusplus
9840Sstevel@tonic-gate extern "C" {
9850Sstevel@tonic-gate #endif
9860Sstevel@tonic-gate 
9870Sstevel@tonic-gate /* compatibility */
9880Sstevel@tonic-gate #define SSL_set_app_data(s,arg)		(SSL_set_ex_data(s,0,(char *)arg))
9890Sstevel@tonic-gate #define SSL_get_app_data(s)		(SSL_get_ex_data(s,0))
9900Sstevel@tonic-gate #define SSL_SESSION_set_app_data(s,a)	(SSL_SESSION_set_ex_data(s,0,(char *)a))
9910Sstevel@tonic-gate #define SSL_SESSION_get_app_data(s)	(SSL_SESSION_get_ex_data(s,0))
9920Sstevel@tonic-gate #define SSL_CTX_get_app_data(ctx)	(SSL_CTX_get_ex_data(ctx,0))
9930Sstevel@tonic-gate #define SSL_CTX_set_app_data(ctx,arg)	(SSL_CTX_set_ex_data(ctx,0,(char *)arg))
9940Sstevel@tonic-gate 
9950Sstevel@tonic-gate /* The following are the possible values for ssl->state are are
9960Sstevel@tonic-gate  * used to indicate where we are up to in the SSL connection establishment.
9970Sstevel@tonic-gate  * The macros that follow are about the only things you should need to use
9980Sstevel@tonic-gate  * and even then, only when using non-blocking IO.
9990Sstevel@tonic-gate  * It can also be useful to work out where you were when the connection
10000Sstevel@tonic-gate  * failed */
10010Sstevel@tonic-gate 
10020Sstevel@tonic-gate #define SSL_ST_CONNECT			0x1000
10030Sstevel@tonic-gate #define SSL_ST_ACCEPT			0x2000
10040Sstevel@tonic-gate #define SSL_ST_MASK			0x0FFF
10050Sstevel@tonic-gate #define SSL_ST_INIT			(SSL_ST_CONNECT|SSL_ST_ACCEPT)
10060Sstevel@tonic-gate #define SSL_ST_BEFORE			0x4000
10070Sstevel@tonic-gate #define SSL_ST_OK			0x03
10080Sstevel@tonic-gate #define SSL_ST_RENEGOTIATE		(0x04|SSL_ST_INIT)
10090Sstevel@tonic-gate 
10100Sstevel@tonic-gate #define SSL_CB_LOOP			0x01
10110Sstevel@tonic-gate #define SSL_CB_EXIT			0x02
10120Sstevel@tonic-gate #define SSL_CB_READ			0x04
10130Sstevel@tonic-gate #define SSL_CB_WRITE			0x08
10140Sstevel@tonic-gate #define SSL_CB_ALERT			0x4000 /* used in callback */
10150Sstevel@tonic-gate #define SSL_CB_READ_ALERT		(SSL_CB_ALERT|SSL_CB_READ)
10160Sstevel@tonic-gate #define SSL_CB_WRITE_ALERT		(SSL_CB_ALERT|SSL_CB_WRITE)
10170Sstevel@tonic-gate #define SSL_CB_ACCEPT_LOOP		(SSL_ST_ACCEPT|SSL_CB_LOOP)
10180Sstevel@tonic-gate #define SSL_CB_ACCEPT_EXIT		(SSL_ST_ACCEPT|SSL_CB_EXIT)
10190Sstevel@tonic-gate #define SSL_CB_CONNECT_LOOP		(SSL_ST_CONNECT|SSL_CB_LOOP)
10200Sstevel@tonic-gate #define SSL_CB_CONNECT_EXIT		(SSL_ST_CONNECT|SSL_CB_EXIT)
10210Sstevel@tonic-gate #define SSL_CB_HANDSHAKE_START		0x10
10220Sstevel@tonic-gate #define SSL_CB_HANDSHAKE_DONE		0x20
10230Sstevel@tonic-gate 
10240Sstevel@tonic-gate /* Is the SSL_connection established? */
10250Sstevel@tonic-gate #define SSL_get_state(a)		SSL_state(a)
10260Sstevel@tonic-gate #define SSL_is_init_finished(a)		(SSL_state(a) == SSL_ST_OK)
10270Sstevel@tonic-gate #define SSL_in_init(a)			(SSL_state(a)&SSL_ST_INIT)
10280Sstevel@tonic-gate #define SSL_in_before(a)		(SSL_state(a)&SSL_ST_BEFORE)
10290Sstevel@tonic-gate #define SSL_in_connect_init(a)		(SSL_state(a)&SSL_ST_CONNECT)
10300Sstevel@tonic-gate #define SSL_in_accept_init(a)		(SSL_state(a)&SSL_ST_ACCEPT)
10310Sstevel@tonic-gate 
10320Sstevel@tonic-gate /* The following 2 states are kept in ssl->rstate when reads fail,
10330Sstevel@tonic-gate  * you should not need these */
10340Sstevel@tonic-gate #define SSL_ST_READ_HEADER			0xF0
10350Sstevel@tonic-gate #define SSL_ST_READ_BODY			0xF1
10360Sstevel@tonic-gate #define SSL_ST_READ_DONE			0xF2
10370Sstevel@tonic-gate 
10380Sstevel@tonic-gate /* Obtain latest Finished message
10390Sstevel@tonic-gate  *   -- that we sent (SSL_get_finished)
10400Sstevel@tonic-gate  *   -- that we expected from peer (SSL_get_peer_finished).
10410Sstevel@tonic-gate  * Returns length (0 == no Finished so far), copies up to 'count' bytes. */
10422139Sjp161948 size_t SSL_get_finished(const SSL *s, void *buf, size_t count);
10432139Sjp161948 size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count);
10440Sstevel@tonic-gate 
10450Sstevel@tonic-gate /* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options
10460Sstevel@tonic-gate  * are 'ored' with SSL_VERIFY_PEER if they are desired */
10470Sstevel@tonic-gate #define SSL_VERIFY_NONE			0x00
10480Sstevel@tonic-gate #define SSL_VERIFY_PEER			0x01
10490Sstevel@tonic-gate #define SSL_VERIFY_FAIL_IF_NO_PEER_CERT	0x02
10500Sstevel@tonic-gate #define SSL_VERIFY_CLIENT_ONCE		0x04
10510Sstevel@tonic-gate 
10520Sstevel@tonic-gate #define OpenSSL_add_ssl_algorithms()	SSL_library_init()
10530Sstevel@tonic-gate #define SSLeay_add_ssl_algorithms()	SSL_library_init()
10540Sstevel@tonic-gate 
10550Sstevel@tonic-gate /* this is for backward compatibility */
10560Sstevel@tonic-gate #if 0 /* NEW_SSLEAY */
10570Sstevel@tonic-gate #define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c)
10580Sstevel@tonic-gate #define SSL_set_pref_cipher(c,n)	SSL_set_cipher_list(c,n)
10590Sstevel@tonic-gate #define SSL_add_session(a,b)            SSL_CTX_add_session((a),(b))
10600Sstevel@tonic-gate #define SSL_remove_session(a,b)		SSL_CTX_remove_session((a),(b))
10610Sstevel@tonic-gate #define SSL_flush_sessions(a,b)		SSL_CTX_flush_sessions((a),(b))
10620Sstevel@tonic-gate #endif
10630Sstevel@tonic-gate /* More backward compatibility */
10640Sstevel@tonic-gate #define SSL_get_cipher(s) \
10650Sstevel@tonic-gate 		SSL_CIPHER_get_name(SSL_get_current_cipher(s))
10660Sstevel@tonic-gate #define SSL_get_cipher_bits(s,np) \
10670Sstevel@tonic-gate 		SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np)
10680Sstevel@tonic-gate #define SSL_get_cipher_version(s) \
10690Sstevel@tonic-gate 		SSL_CIPHER_get_version(SSL_get_current_cipher(s))
10700Sstevel@tonic-gate #define SSL_get_cipher_name(s) \
10710Sstevel@tonic-gate 		SSL_CIPHER_get_name(SSL_get_current_cipher(s))
10720Sstevel@tonic-gate #define SSL_get_time(a)		SSL_SESSION_get_time(a)
10730Sstevel@tonic-gate #define SSL_set_time(a,b)	SSL_SESSION_set_time((a),(b))
10740Sstevel@tonic-gate #define SSL_get_timeout(a)	SSL_SESSION_get_timeout(a)
10750Sstevel@tonic-gate #define SSL_set_timeout(a,b)	SSL_SESSION_set_timeout((a),(b))
10760Sstevel@tonic-gate 
10770Sstevel@tonic-gate #if 1 /*SSLEAY_MACROS*/
10782139Sjp161948 #define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id)
10792139Sjp161948 #define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id)
10800Sstevel@tonic-gate #define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \
10810Sstevel@tonic-gate 	(char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u)
10822139Sjp161948 #define PEM_read_bio_SSL_SESSION(bp,x,cb,u) PEM_ASN1_read_bio_of(SSL_SESSION,d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,cb,u)
10830Sstevel@tonic-gate #define PEM_write_SSL_SESSION(fp,x) \
10840Sstevel@tonic-gate 	PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \
10850Sstevel@tonic-gate 		PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL)
10860Sstevel@tonic-gate #define PEM_write_bio_SSL_SESSION(bp,x) \
10872139Sjp161948 	PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL)
10880Sstevel@tonic-gate #endif
10890Sstevel@tonic-gate 
10900Sstevel@tonic-gate #define SSL_AD_REASON_OFFSET		1000
10910Sstevel@tonic-gate /* These alert types are for SSLv3 and TLSv1 */
10920Sstevel@tonic-gate #define SSL_AD_CLOSE_NOTIFY		SSL3_AD_CLOSE_NOTIFY
10930Sstevel@tonic-gate #define SSL_AD_UNEXPECTED_MESSAGE	SSL3_AD_UNEXPECTED_MESSAGE /* fatal */
10940Sstevel@tonic-gate #define SSL_AD_BAD_RECORD_MAC		SSL3_AD_BAD_RECORD_MAC     /* fatal */
10950Sstevel@tonic-gate #define SSL_AD_DECRYPTION_FAILED	TLS1_AD_DECRYPTION_FAILED
10960Sstevel@tonic-gate #define SSL_AD_RECORD_OVERFLOW		TLS1_AD_RECORD_OVERFLOW
10970Sstevel@tonic-gate #define SSL_AD_DECOMPRESSION_FAILURE	SSL3_AD_DECOMPRESSION_FAILURE/* fatal */
10980Sstevel@tonic-gate #define SSL_AD_HANDSHAKE_FAILURE	SSL3_AD_HANDSHAKE_FAILURE/* fatal */
10990Sstevel@tonic-gate #define SSL_AD_NO_CERTIFICATE		SSL3_AD_NO_CERTIFICATE /* Not for TLS */
11000Sstevel@tonic-gate #define SSL_AD_BAD_CERTIFICATE		SSL3_AD_BAD_CERTIFICATE
11010Sstevel@tonic-gate #define SSL_AD_UNSUPPORTED_CERTIFICATE	SSL3_AD_UNSUPPORTED_CERTIFICATE
11020Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_REVOKED	SSL3_AD_CERTIFICATE_REVOKED
11030Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_EXPIRED	SSL3_AD_CERTIFICATE_EXPIRED
11040Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_UNKNOWN	SSL3_AD_CERTIFICATE_UNKNOWN
11050Sstevel@tonic-gate #define SSL_AD_ILLEGAL_PARAMETER	SSL3_AD_ILLEGAL_PARAMETER   /* fatal */
11060Sstevel@tonic-gate #define SSL_AD_UNKNOWN_CA		TLS1_AD_UNKNOWN_CA	/* fatal */
11070Sstevel@tonic-gate #define SSL_AD_ACCESS_DENIED		TLS1_AD_ACCESS_DENIED	/* fatal */
11080Sstevel@tonic-gate #define SSL_AD_DECODE_ERROR		TLS1_AD_DECODE_ERROR	/* fatal */
11090Sstevel@tonic-gate #define SSL_AD_DECRYPT_ERROR		TLS1_AD_DECRYPT_ERROR
11100Sstevel@tonic-gate #define SSL_AD_EXPORT_RESTRICTION	TLS1_AD_EXPORT_RESTRICTION/* fatal */
11110Sstevel@tonic-gate #define SSL_AD_PROTOCOL_VERSION		TLS1_AD_PROTOCOL_VERSION /* fatal */
11120Sstevel@tonic-gate #define SSL_AD_INSUFFICIENT_SECURITY	TLS1_AD_INSUFFICIENT_SECURITY/* fatal */
11130Sstevel@tonic-gate #define SSL_AD_INTERNAL_ERROR		TLS1_AD_INTERNAL_ERROR	/* fatal */
11140Sstevel@tonic-gate #define SSL_AD_USER_CANCELLED		TLS1_AD_USER_CANCELLED
11150Sstevel@tonic-gate #define SSL_AD_NO_RENEGOTIATION		TLS1_AD_NO_RENEGOTIATION
11160Sstevel@tonic-gate 
11170Sstevel@tonic-gate #define SSL_ERROR_NONE			0
11180Sstevel@tonic-gate #define SSL_ERROR_SSL			1
11190Sstevel@tonic-gate #define SSL_ERROR_WANT_READ		2
11200Sstevel@tonic-gate #define SSL_ERROR_WANT_WRITE		3
11210Sstevel@tonic-gate #define SSL_ERROR_WANT_X509_LOOKUP	4
11220Sstevel@tonic-gate #define SSL_ERROR_SYSCALL		5 /* look at error stack/return value/errno */
11230Sstevel@tonic-gate #define SSL_ERROR_ZERO_RETURN		6
11240Sstevel@tonic-gate #define SSL_ERROR_WANT_CONNECT		7
11250Sstevel@tonic-gate #define SSL_ERROR_WANT_ACCEPT		8
11260Sstevel@tonic-gate 
11270Sstevel@tonic-gate #define SSL_CTRL_NEED_TMP_RSA			1
11280Sstevel@tonic-gate #define SSL_CTRL_SET_TMP_RSA			2
11290Sstevel@tonic-gate #define SSL_CTRL_SET_TMP_DH			3
11302139Sjp161948 #define SSL_CTRL_SET_TMP_ECDH			4
11312139Sjp161948 #define SSL_CTRL_SET_TMP_RSA_CB			5
11322139Sjp161948 #define SSL_CTRL_SET_TMP_DH_CB			6
11332139Sjp161948 #define SSL_CTRL_SET_TMP_ECDH_CB		7
11340Sstevel@tonic-gate 
11352139Sjp161948 #define SSL_CTRL_GET_SESSION_REUSED		8
11362139Sjp161948 #define SSL_CTRL_GET_CLIENT_CERT_REQUEST	9
11372139Sjp161948 #define SSL_CTRL_GET_NUM_RENEGOTIATIONS		10
11382139Sjp161948 #define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS	11
11392139Sjp161948 #define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS	12
11402139Sjp161948 #define SSL_CTRL_GET_FLAGS			13
11412139Sjp161948 #define SSL_CTRL_EXTRA_CHAIN_CERT		14
11420Sstevel@tonic-gate 
11432139Sjp161948 #define SSL_CTRL_SET_MSG_CALLBACK               15
11442139Sjp161948 #define SSL_CTRL_SET_MSG_CALLBACK_ARG           16
11450Sstevel@tonic-gate 
11462139Sjp161948 /* only applies to datagram connections */
11472139Sjp161948 #define SSL_CTRL_SET_MTU                17
11480Sstevel@tonic-gate /* Stats */
11490Sstevel@tonic-gate #define SSL_CTRL_SESS_NUMBER			20
11500Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT			21
11510Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT_GOOD		22
11520Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT_RENEGOTIATE	23
11530Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT			24
11540Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT_GOOD		25
11550Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE	26
11560Sstevel@tonic-gate #define SSL_CTRL_SESS_HIT			27
11570Sstevel@tonic-gate #define SSL_CTRL_SESS_CB_HIT			28
11580Sstevel@tonic-gate #define SSL_CTRL_SESS_MISSES			29
11590Sstevel@tonic-gate #define SSL_CTRL_SESS_TIMEOUTS			30
11600Sstevel@tonic-gate #define SSL_CTRL_SESS_CACHE_FULL		31
11610Sstevel@tonic-gate #define SSL_CTRL_OPTIONS			32
11620Sstevel@tonic-gate #define SSL_CTRL_MODE				33
11630Sstevel@tonic-gate 
11640Sstevel@tonic-gate #define SSL_CTRL_GET_READ_AHEAD			40
11650Sstevel@tonic-gate #define SSL_CTRL_SET_READ_AHEAD			41
11660Sstevel@tonic-gate #define SSL_CTRL_SET_SESS_CACHE_SIZE		42
11670Sstevel@tonic-gate #define SSL_CTRL_GET_SESS_CACHE_SIZE		43
11680Sstevel@tonic-gate #define SSL_CTRL_SET_SESS_CACHE_MODE		44
11690Sstevel@tonic-gate #define SSL_CTRL_GET_SESS_CACHE_MODE		45
11700Sstevel@tonic-gate 
11710Sstevel@tonic-gate #define SSL_CTRL_GET_MAX_CERT_LIST		50
11720Sstevel@tonic-gate #define SSL_CTRL_SET_MAX_CERT_LIST		51
11730Sstevel@tonic-gate 
11740Sstevel@tonic-gate #define SSL_session_reused(ssl) \
11750Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL)
11760Sstevel@tonic-gate #define SSL_num_renegotiations(ssl) \
11770Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL)
11780Sstevel@tonic-gate #define SSL_clear_num_renegotiations(ssl) \
11790Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL)
11800Sstevel@tonic-gate #define SSL_total_renegotiations(ssl) \
11810Sstevel@tonic-gate 	SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL)
11820Sstevel@tonic-gate 
11830Sstevel@tonic-gate #define SSL_CTX_need_tmp_RSA(ctx) \
11840Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL)
11850Sstevel@tonic-gate #define SSL_CTX_set_tmp_rsa(ctx,rsa) \
11860Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
11870Sstevel@tonic-gate #define SSL_CTX_set_tmp_dh(ctx,dh) \
11880Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
11892139Sjp161948 #define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \
11902139Sjp161948 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
11910Sstevel@tonic-gate 
11920Sstevel@tonic-gate #define SSL_need_tmp_RSA(ssl) \
11930Sstevel@tonic-gate 	SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL)
11940Sstevel@tonic-gate #define SSL_set_tmp_rsa(ssl,rsa) \
11950Sstevel@tonic-gate 	SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa)
11960Sstevel@tonic-gate #define SSL_set_tmp_dh(ssl,dh) \
11970Sstevel@tonic-gate 	SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh)
11982139Sjp161948 #define SSL_set_tmp_ecdh(ssl,ecdh) \
11992139Sjp161948 	SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh)
12000Sstevel@tonic-gate 
12010Sstevel@tonic-gate #define SSL_CTX_add_extra_chain_cert(ctx,x509) \
12020Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509)
12030Sstevel@tonic-gate 
12040Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO
12050Sstevel@tonic-gate BIO_METHOD *BIO_f_ssl(void);
12060Sstevel@tonic-gate BIO *BIO_new_ssl(SSL_CTX *ctx,int client);
12070Sstevel@tonic-gate BIO *BIO_new_ssl_connect(SSL_CTX *ctx);
12080Sstevel@tonic-gate BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx);
12090Sstevel@tonic-gate int BIO_ssl_copy_session_id(BIO *to,BIO *from);
12100Sstevel@tonic-gate void BIO_ssl_shutdown(BIO *ssl_bio);
12110Sstevel@tonic-gate 
12120Sstevel@tonic-gate #endif
12130Sstevel@tonic-gate 
12140Sstevel@tonic-gate int	SSL_CTX_set_cipher_list(SSL_CTX *,const char *str);
12150Sstevel@tonic-gate SSL_CTX *SSL_CTX_new(SSL_METHOD *meth);
12160Sstevel@tonic-gate void	SSL_CTX_free(SSL_CTX *);
12170Sstevel@tonic-gate long SSL_CTX_set_timeout(SSL_CTX *ctx,long t);
12182139Sjp161948 long SSL_CTX_get_timeout(const SSL_CTX *ctx);
12192139Sjp161948 X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *);
12200Sstevel@tonic-gate void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *);
12212139Sjp161948 int SSL_want(const SSL *s);
12220Sstevel@tonic-gate int	SSL_clear(SSL *s);
12230Sstevel@tonic-gate 
12240Sstevel@tonic-gate void	SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm);
12250Sstevel@tonic-gate 
12262139Sjp161948 SSL_CIPHER *SSL_get_current_cipher(const SSL *s);
12272139Sjp161948 int	SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits);
12282139Sjp161948 char *	SSL_CIPHER_get_version(const SSL_CIPHER *c);
12292139Sjp161948 const char *	SSL_CIPHER_get_name(const SSL_CIPHER *c);
12300Sstevel@tonic-gate 
12312139Sjp161948 int	SSL_get_fd(const SSL *s);
12322139Sjp161948 int	SSL_get_rfd(const SSL *s);
12332139Sjp161948 int	SSL_get_wfd(const SSL *s);
12342139Sjp161948 const char  * SSL_get_cipher_list(const SSL *s,int n);
12352139Sjp161948 char *	SSL_get_shared_ciphers(const SSL *s, char *buf, int len);
12362139Sjp161948 int	SSL_get_read_ahead(const SSL * s);
12372139Sjp161948 int	SSL_pending(const SSL *s);
12380Sstevel@tonic-gate #ifndef OPENSSL_NO_SOCK
12390Sstevel@tonic-gate int	SSL_set_fd(SSL *s, int fd);
12400Sstevel@tonic-gate int	SSL_set_rfd(SSL *s, int fd);
12410Sstevel@tonic-gate int	SSL_set_wfd(SSL *s, int fd);
12420Sstevel@tonic-gate #endif
12430Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO
12440Sstevel@tonic-gate void	SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio);
12452139Sjp161948 BIO *	SSL_get_rbio(const SSL *s);
12462139Sjp161948 BIO *	SSL_get_wbio(const SSL *s);
12470Sstevel@tonic-gate #endif
12480Sstevel@tonic-gate int	SSL_set_cipher_list(SSL *s, const char *str);
12490Sstevel@tonic-gate void	SSL_set_read_ahead(SSL *s, int yes);
12502139Sjp161948 int	SSL_get_verify_mode(const SSL *s);
12512139Sjp161948 int	SSL_get_verify_depth(const SSL *s);
12522139Sjp161948 int	(*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *);
12530Sstevel@tonic-gate void	SSL_set_verify(SSL *s, int mode,
12540Sstevel@tonic-gate 		       int (*callback)(int ok,X509_STORE_CTX *ctx));
12550Sstevel@tonic-gate void	SSL_set_verify_depth(SSL *s, int depth);
12560Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA
12570Sstevel@tonic-gate int	SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa);
12580Sstevel@tonic-gate #endif
12590Sstevel@tonic-gate int	SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len);
12600Sstevel@tonic-gate int	SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey);
12612139Sjp161948 int	SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len);
12620Sstevel@tonic-gate int	SSL_use_certificate(SSL *ssl, X509 *x);
12632139Sjp161948 int	SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len);
12640Sstevel@tonic-gate 
12650Sstevel@tonic-gate #ifndef OPENSSL_NO_STDIO
12660Sstevel@tonic-gate int	SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type);
12670Sstevel@tonic-gate int	SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type);
12680Sstevel@tonic-gate int	SSL_use_certificate_file(SSL *ssl, const char *file, int type);
12690Sstevel@tonic-gate int	SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type);
12700Sstevel@tonic-gate int	SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type);
12710Sstevel@tonic-gate int	SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type);
12720Sstevel@tonic-gate int	SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */
12730Sstevel@tonic-gate STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file);
12740Sstevel@tonic-gate int	SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
12750Sstevel@tonic-gate 					    const char *file);
12760Sstevel@tonic-gate #ifndef OPENSSL_SYS_VMS
12770Sstevel@tonic-gate #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */
12780Sstevel@tonic-gate int	SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs,
12790Sstevel@tonic-gate 					   const char *dir);
12800Sstevel@tonic-gate #endif
12810Sstevel@tonic-gate #endif
12820Sstevel@tonic-gate 
12830Sstevel@tonic-gate #endif
12840Sstevel@tonic-gate 
12850Sstevel@tonic-gate void	SSL_load_error_strings(void );
12860Sstevel@tonic-gate const char *SSL_state_string(const SSL *s);
12870Sstevel@tonic-gate const char *SSL_rstate_string(const SSL *s);
12880Sstevel@tonic-gate const char *SSL_state_string_long(const SSL *s);
12890Sstevel@tonic-gate const char *SSL_rstate_string_long(const SSL *s);
12902139Sjp161948 long	SSL_SESSION_get_time(const SSL_SESSION *s);
12910Sstevel@tonic-gate long	SSL_SESSION_set_time(SSL_SESSION *s, long t);
12922139Sjp161948 long	SSL_SESSION_get_timeout(const SSL_SESSION *s);
12930Sstevel@tonic-gate long	SSL_SESSION_set_timeout(SSL_SESSION *s, long t);
12942139Sjp161948 void	SSL_copy_session_id(SSL *to,const SSL *from);
12950Sstevel@tonic-gate 
12960Sstevel@tonic-gate SSL_SESSION *SSL_SESSION_new(void);
12972139Sjp161948 unsigned long SSL_SESSION_hash(const SSL_SESSION *a);
12982139Sjp161948 int	SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b);
12992139Sjp161948 const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len);
13000Sstevel@tonic-gate #ifndef OPENSSL_NO_FP_API
13012139Sjp161948 int	SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses);
13020Sstevel@tonic-gate #endif
13030Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO
13042139Sjp161948 int	SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses);
13050Sstevel@tonic-gate #endif
13060Sstevel@tonic-gate void	SSL_SESSION_free(SSL_SESSION *ses);
13070Sstevel@tonic-gate int	i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp);
13080Sstevel@tonic-gate int	SSL_set_session(SSL *to, SSL_SESSION *session);
13090Sstevel@tonic-gate int	SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c);
13100Sstevel@tonic-gate int	SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c);
13110Sstevel@tonic-gate int	SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB);
13120Sstevel@tonic-gate int	SSL_set_generate_session_id(SSL *, GEN_SESSION_CB);
13130Sstevel@tonic-gate int	SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id,
13140Sstevel@tonic-gate 					unsigned int id_len);
13152139Sjp161948 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp,
13162139Sjp161948 			     long length);
13170Sstevel@tonic-gate 
13180Sstevel@tonic-gate #ifdef HEADER_X509_H
13192139Sjp161948 X509 *	SSL_get_peer_certificate(const SSL *s);
13200Sstevel@tonic-gate #endif
13210Sstevel@tonic-gate 
13222139Sjp161948 STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s);
13230Sstevel@tonic-gate 
13242139Sjp161948 int SSL_CTX_get_verify_mode(const SSL_CTX *ctx);
13252139Sjp161948 int SSL_CTX_get_verify_depth(const SSL_CTX *ctx);
13262139Sjp161948 int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int,X509_STORE_CTX *);
13270Sstevel@tonic-gate void SSL_CTX_set_verify(SSL_CTX *ctx,int mode,
13280Sstevel@tonic-gate 			int (*callback)(int, X509_STORE_CTX *));
13290Sstevel@tonic-gate void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth);
13300Sstevel@tonic-gate void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *,void *), void *arg);
13310Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA
13320Sstevel@tonic-gate int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa);
13330Sstevel@tonic-gate #endif
13342139Sjp161948 int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len);
13350Sstevel@tonic-gate int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey);
13360Sstevel@tonic-gate int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx,
13372139Sjp161948 	const unsigned char *d, long len);
13380Sstevel@tonic-gate int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x);
13392139Sjp161948 int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d);
13400Sstevel@tonic-gate 
13410Sstevel@tonic-gate void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb);
13420Sstevel@tonic-gate void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u);
13430Sstevel@tonic-gate 
13442139Sjp161948 int SSL_CTX_check_private_key(const SSL_CTX *ctx);
13452139Sjp161948 int SSL_check_private_key(const SSL *ctx);
13460Sstevel@tonic-gate 
13470Sstevel@tonic-gate int	SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx,
13480Sstevel@tonic-gate 				       unsigned int sid_ctx_len);
13490Sstevel@tonic-gate 
13500Sstevel@tonic-gate SSL *	SSL_new(SSL_CTX *ctx);
13510Sstevel@tonic-gate int	SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx,
13520Sstevel@tonic-gate 				   unsigned int sid_ctx_len);
13530Sstevel@tonic-gate 
13540Sstevel@tonic-gate int SSL_CTX_set_purpose(SSL_CTX *s, int purpose);
13550Sstevel@tonic-gate int SSL_set_purpose(SSL *s, int purpose);
13560Sstevel@tonic-gate int SSL_CTX_set_trust(SSL_CTX *s, int trust);
13570Sstevel@tonic-gate int SSL_set_trust(SSL *s, int trust);
13580Sstevel@tonic-gate 
13590Sstevel@tonic-gate void	SSL_free(SSL *ssl);
13600Sstevel@tonic-gate int 	SSL_accept(SSL *ssl);
13610Sstevel@tonic-gate int 	SSL_connect(SSL *ssl);
13620Sstevel@tonic-gate int 	SSL_read(SSL *ssl,void *buf,int num);
13630Sstevel@tonic-gate int 	SSL_peek(SSL *ssl,void *buf,int num);
13640Sstevel@tonic-gate int 	SSL_write(SSL *ssl,const void *buf,int num);
13650Sstevel@tonic-gate long	SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg);
13662139Sjp161948 long	SSL_callback_ctrl(SSL *, int, void (*)(void));
13670Sstevel@tonic-gate long	SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg);
13682139Sjp161948 long	SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void));
13690Sstevel@tonic-gate 
13702139Sjp161948 int	SSL_get_error(const SSL *s,int ret_code);
13712139Sjp161948 const char *SSL_get_version(const SSL *s);
13720Sstevel@tonic-gate 
13730Sstevel@tonic-gate /* This sets the 'default' SSL version that SSL_new() will create */
13740Sstevel@tonic-gate int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth);
13750Sstevel@tonic-gate 
13760Sstevel@tonic-gate SSL_METHOD *SSLv2_method(void);		/* SSLv2 */
13770Sstevel@tonic-gate SSL_METHOD *SSLv2_server_method(void);	/* SSLv2 */
13780Sstevel@tonic-gate SSL_METHOD *SSLv2_client_method(void);	/* SSLv2 */
13790Sstevel@tonic-gate 
13800Sstevel@tonic-gate SSL_METHOD *SSLv3_method(void);		/* SSLv3 */
13810Sstevel@tonic-gate SSL_METHOD *SSLv3_server_method(void);	/* SSLv3 */
13820Sstevel@tonic-gate SSL_METHOD *SSLv3_client_method(void);	/* SSLv3 */
13830Sstevel@tonic-gate 
13840Sstevel@tonic-gate SSL_METHOD *SSLv23_method(void);	/* SSLv3 but can rollback to v2 */
13850Sstevel@tonic-gate SSL_METHOD *SSLv23_server_method(void);	/* SSLv3 but can rollback to v2 */
13860Sstevel@tonic-gate SSL_METHOD *SSLv23_client_method(void);	/* SSLv3 but can rollback to v2 */
13870Sstevel@tonic-gate 
13880Sstevel@tonic-gate SSL_METHOD *TLSv1_method(void);		/* TLSv1.0 */
13890Sstevel@tonic-gate SSL_METHOD *TLSv1_server_method(void);	/* TLSv1.0 */
13900Sstevel@tonic-gate SSL_METHOD *TLSv1_client_method(void);	/* TLSv1.0 */
13910Sstevel@tonic-gate 
13922139Sjp161948 SSL_METHOD *DTLSv1_method(void);		/* DTLSv1.0 */
13932139Sjp161948 SSL_METHOD *DTLSv1_server_method(void);	/* DTLSv1.0 */
13942139Sjp161948 SSL_METHOD *DTLSv1_client_method(void);	/* DTLSv1.0 */
13952139Sjp161948 
13962139Sjp161948 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s);
13970Sstevel@tonic-gate 
13980Sstevel@tonic-gate int SSL_do_handshake(SSL *s);
13990Sstevel@tonic-gate int SSL_renegotiate(SSL *s);
14000Sstevel@tonic-gate int SSL_renegotiate_pending(SSL *s);
14010Sstevel@tonic-gate int SSL_shutdown(SSL *s);
14020Sstevel@tonic-gate 
14030Sstevel@tonic-gate SSL_METHOD *SSL_get_ssl_method(SSL *s);
14040Sstevel@tonic-gate int SSL_set_ssl_method(SSL *s,SSL_METHOD *method);
14050Sstevel@tonic-gate const char *SSL_alert_type_string_long(int value);
14060Sstevel@tonic-gate const char *SSL_alert_type_string(int value);
14070Sstevel@tonic-gate const char *SSL_alert_desc_string_long(int value);
14080Sstevel@tonic-gate const char *SSL_alert_desc_string(int value);
14090Sstevel@tonic-gate 
14100Sstevel@tonic-gate void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list);
14110Sstevel@tonic-gate void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list);
14122139Sjp161948 STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s);
14132139Sjp161948 STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s);
14140Sstevel@tonic-gate int SSL_add_client_CA(SSL *ssl,X509 *x);
14150Sstevel@tonic-gate int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x);
14160Sstevel@tonic-gate 
14170Sstevel@tonic-gate void SSL_set_connect_state(SSL *s);
14180Sstevel@tonic-gate void SSL_set_accept_state(SSL *s);
14190Sstevel@tonic-gate 
14202139Sjp161948 long SSL_get_default_timeout(const SSL *s);
14210Sstevel@tonic-gate 
14220Sstevel@tonic-gate int SSL_library_init(void );
14230Sstevel@tonic-gate 
14240Sstevel@tonic-gate char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size);
14250Sstevel@tonic-gate STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk);
14260Sstevel@tonic-gate 
14270Sstevel@tonic-gate SSL *SSL_dup(SSL *ssl);
14280Sstevel@tonic-gate 
14292139Sjp161948 X509 *SSL_get_certificate(const SSL *ssl);
14300Sstevel@tonic-gate /* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl);
14310Sstevel@tonic-gate 
14320Sstevel@tonic-gate void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode);
14332139Sjp161948 int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx);
14340Sstevel@tonic-gate void SSL_set_quiet_shutdown(SSL *ssl,int mode);
14352139Sjp161948 int SSL_get_quiet_shutdown(const SSL *ssl);
14360Sstevel@tonic-gate void SSL_set_shutdown(SSL *ssl,int mode);
14372139Sjp161948 int SSL_get_shutdown(const SSL *ssl);
14382139Sjp161948 int SSL_version(const SSL *ssl);
14390Sstevel@tonic-gate int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx);
14400Sstevel@tonic-gate int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile,
14410Sstevel@tonic-gate 	const char *CApath);
14420Sstevel@tonic-gate #define SSL_get0_session SSL_get_session /* just peek at pointer */
14432139Sjp161948 SSL_SESSION *SSL_get_session(const SSL *ssl);
14440Sstevel@tonic-gate SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */
14452139Sjp161948 SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl);
14460Sstevel@tonic-gate void SSL_set_info_callback(SSL *ssl,
14470Sstevel@tonic-gate 			   void (*cb)(const SSL *ssl,int type,int val));
14482139Sjp161948 void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val);
14492139Sjp161948 int SSL_state(const SSL *ssl);
14500Sstevel@tonic-gate 
14510Sstevel@tonic-gate void SSL_set_verify_result(SSL *ssl,long v);
14522139Sjp161948 long SSL_get_verify_result(const SSL *ssl);
14530Sstevel@tonic-gate 
14540Sstevel@tonic-gate int SSL_set_ex_data(SSL *ssl,int idx,void *data);
14552139Sjp161948 void *SSL_get_ex_data(const SSL *ssl,int idx);
14560Sstevel@tonic-gate int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
14570Sstevel@tonic-gate 	CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
14580Sstevel@tonic-gate 
14590Sstevel@tonic-gate int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data);
14602139Sjp161948 void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss,int idx);
14610Sstevel@tonic-gate int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
14620Sstevel@tonic-gate 	CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
14630Sstevel@tonic-gate 
14640Sstevel@tonic-gate int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data);
14652139Sjp161948 void *SSL_CTX_get_ex_data(const SSL_CTX *ssl,int idx);
14660Sstevel@tonic-gate int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func,
14670Sstevel@tonic-gate 	CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func);
14680Sstevel@tonic-gate 
14690Sstevel@tonic-gate int SSL_get_ex_data_X509_STORE_CTX_idx(void );
14700Sstevel@tonic-gate 
14710Sstevel@tonic-gate #define SSL_CTX_sess_set_cache_size(ctx,t) \
14720Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL)
14730Sstevel@tonic-gate #define SSL_CTX_sess_get_cache_size(ctx) \
14740Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL)
14750Sstevel@tonic-gate #define SSL_CTX_set_session_cache_mode(ctx,m) \
14760Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL)
14770Sstevel@tonic-gate #define SSL_CTX_get_session_cache_mode(ctx) \
14780Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL)
14790Sstevel@tonic-gate 
14800Sstevel@tonic-gate #define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx)
14810Sstevel@tonic-gate #define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m)
14820Sstevel@tonic-gate #define SSL_CTX_get_read_ahead(ctx) \
14830Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL)
14840Sstevel@tonic-gate #define SSL_CTX_set_read_ahead(ctx,m) \
14850Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL)
14860Sstevel@tonic-gate #define SSL_CTX_get_max_cert_list(ctx) \
14870Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
14880Sstevel@tonic-gate #define SSL_CTX_set_max_cert_list(ctx,m) \
14890Sstevel@tonic-gate 	SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
14900Sstevel@tonic-gate #define SSL_get_max_cert_list(ssl) \
14910Sstevel@tonic-gate 	SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL)
14920Sstevel@tonic-gate #define SSL_set_max_cert_list(ssl,m) \
14930Sstevel@tonic-gate 	SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL)
14940Sstevel@tonic-gate 
14950Sstevel@tonic-gate      /* NB: the keylength is only applicable when is_export is true */
14960Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA
14970Sstevel@tonic-gate void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx,
14980Sstevel@tonic-gate 				  RSA *(*cb)(SSL *ssl,int is_export,
14990Sstevel@tonic-gate 					     int keylength));
15000Sstevel@tonic-gate 
15010Sstevel@tonic-gate void SSL_set_tmp_rsa_callback(SSL *ssl,
15020Sstevel@tonic-gate 				  RSA *(*cb)(SSL *ssl,int is_export,
15030Sstevel@tonic-gate 					     int keylength));
15040Sstevel@tonic-gate #endif
15050Sstevel@tonic-gate #ifndef OPENSSL_NO_DH
15060Sstevel@tonic-gate void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx,
15070Sstevel@tonic-gate 				 DH *(*dh)(SSL *ssl,int is_export,
15080Sstevel@tonic-gate 					   int keylength));
15090Sstevel@tonic-gate void SSL_set_tmp_dh_callback(SSL *ssl,
15100Sstevel@tonic-gate 				 DH *(*dh)(SSL *ssl,int is_export,
15110Sstevel@tonic-gate 					   int keylength));
15120Sstevel@tonic-gate #endif
15132139Sjp161948 #ifndef OPENSSL_NO_ECDH
15142139Sjp161948 void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx,
15152139Sjp161948 				 EC_KEY *(*ecdh)(SSL *ssl,int is_export,
15162139Sjp161948 					   int keylength));
15172139Sjp161948 void SSL_set_tmp_ecdh_callback(SSL *ssl,
15182139Sjp161948 				 EC_KEY *(*ecdh)(SSL *ssl,int is_export,
15192139Sjp161948 					   int keylength));
15202139Sjp161948 #endif
15210Sstevel@tonic-gate 
15220Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP
15232139Sjp161948 const COMP_METHOD *SSL_get_current_compression(SSL *s);
15242139Sjp161948 const COMP_METHOD *SSL_get_current_expansion(SSL *s);
15252139Sjp161948 const char *SSL_COMP_get_name(const COMP_METHOD *comp);
15262139Sjp161948 STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
15270Sstevel@tonic-gate int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm);
15280Sstevel@tonic-gate #else
15292139Sjp161948 const void *SSL_get_current_compression(SSL *s);
15302139Sjp161948 const void *SSL_get_current_expansion(SSL *s);
15312139Sjp161948 const char *SSL_COMP_get_name(const void *comp);
15322139Sjp161948 void *SSL_COMP_get_compression_methods(void);
15332139Sjp161948 int SSL_COMP_add_compression_method(int id,void *cm);
15340Sstevel@tonic-gate #endif
15350Sstevel@tonic-gate 
15360Sstevel@tonic-gate /* BEGIN ERROR CODES */
15370Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes
15380Sstevel@tonic-gate  * made after this point may be overwritten when the script is next run.
15390Sstevel@tonic-gate  */
15400Sstevel@tonic-gate void ERR_load_SSL_strings(void);
15410Sstevel@tonic-gate 
15420Sstevel@tonic-gate /* Error codes for the SSL functions. */
15430Sstevel@tonic-gate 
15440Sstevel@tonic-gate /* Function codes. */
15450Sstevel@tonic-gate #define SSL_F_CLIENT_CERTIFICATE			 100
15460Sstevel@tonic-gate #define SSL_F_CLIENT_FINISHED				 238
15470Sstevel@tonic-gate #define SSL_F_CLIENT_HELLO				 101
15480Sstevel@tonic-gate #define SSL_F_CLIENT_MASTER_KEY				 102
15490Sstevel@tonic-gate #define SSL_F_D2I_SSL_SESSION				 103
15502139Sjp161948 #define SSL_F_DO_DTLS1_WRITE				 1003
15510Sstevel@tonic-gate #define SSL_F_DO_SSL3_WRITE				 104
15522139Sjp161948 #define SSL_F_DTLS1_ACCEPT				 1004
15532139Sjp161948 #define SSL_F_DTLS1_BUFFER_RECORD			 1005
15542139Sjp161948 #define SSL_F_DTLS1_CLIENT_HELLO			 1006
15552139Sjp161948 #define SSL_F_DTLS1_CONNECT				 1007
15562139Sjp161948 #define SSL_F_DTLS1_ENC					 1008
15572139Sjp161948 #define SSL_F_DTLS1_GET_HELLO_VERIFY			 1009
15582139Sjp161948 #define SSL_F_DTLS1_GET_MESSAGE				 1010
15592139Sjp161948 #define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT		 1011
15602139Sjp161948 #define SSL_F_DTLS1_GET_RECORD				 1012
15612139Sjp161948 #define SSL_F_DTLS1_OUTPUT_CERT_CHAIN			 1013
1562*5434Sjp161948 #define SSL_F_DTLS1_PREPROCESS_FRAGMENT			 277
15632139Sjp161948 #define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE		 1014
15642139Sjp161948 #define SSL_F_DTLS1_PROCESS_RECORD			 1015
15652139Sjp161948 #define SSL_F_DTLS1_READ_BYTES				 1016
15662139Sjp161948 #define SSL_F_DTLS1_READ_FAILED				 1001
15672139Sjp161948 #define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST		 1017
15682139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE		 1018
15692139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE		 1019
15702139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_VERIFY			 1020
15712139Sjp161948 #define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST		 1002
15722139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE		 1021
15732139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_HELLO			 1022
15742139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE		 1023
15752139Sjp161948 #define SSL_F_DTLS1_WRITE_APP_DATA_BYTES		 1024
15760Sstevel@tonic-gate #define SSL_F_GET_CLIENT_FINISHED			 105
15770Sstevel@tonic-gate #define SSL_F_GET_CLIENT_HELLO				 106
15780Sstevel@tonic-gate #define SSL_F_GET_CLIENT_MASTER_KEY			 107
15790Sstevel@tonic-gate #define SSL_F_GET_SERVER_FINISHED			 108
15800Sstevel@tonic-gate #define SSL_F_GET_SERVER_HELLO				 109
15810Sstevel@tonic-gate #define SSL_F_GET_SERVER_VERIFY				 110
15820Sstevel@tonic-gate #define SSL_F_I2D_SSL_SESSION				 111
15830Sstevel@tonic-gate #define SSL_F_READ_N					 112
15840Sstevel@tonic-gate #define SSL_F_REQUEST_CERTIFICATE			 113
15850Sstevel@tonic-gate #define SSL_F_SERVER_FINISH				 239
15860Sstevel@tonic-gate #define SSL_F_SERVER_HELLO				 114
15870Sstevel@tonic-gate #define SSL_F_SERVER_VERIFY				 240
15880Sstevel@tonic-gate #define SSL_F_SSL23_ACCEPT				 115
15890Sstevel@tonic-gate #define SSL_F_SSL23_CLIENT_HELLO			 116
15900Sstevel@tonic-gate #define SSL_F_SSL23_CONNECT				 117
15910Sstevel@tonic-gate #define SSL_F_SSL23_GET_CLIENT_HELLO			 118
15920Sstevel@tonic-gate #define SSL_F_SSL23_GET_SERVER_HELLO			 119
15930Sstevel@tonic-gate #define SSL_F_SSL23_PEEK				 237
15940Sstevel@tonic-gate #define SSL_F_SSL23_READ				 120
15950Sstevel@tonic-gate #define SSL_F_SSL23_WRITE				 121
15960Sstevel@tonic-gate #define SSL_F_SSL2_ACCEPT				 122
15970Sstevel@tonic-gate #define SSL_F_SSL2_CONNECT				 123
15980Sstevel@tonic-gate #define SSL_F_SSL2_ENC_INIT				 124
15990Sstevel@tonic-gate #define SSL_F_SSL2_GENERATE_KEY_MATERIAL		 241
16000Sstevel@tonic-gate #define SSL_F_SSL2_PEEK					 234
16010Sstevel@tonic-gate #define SSL_F_SSL2_READ					 125
16020Sstevel@tonic-gate #define SSL_F_SSL2_READ_INTERNAL			 236
16030Sstevel@tonic-gate #define SSL_F_SSL2_SET_CERTIFICATE			 126
16040Sstevel@tonic-gate #define SSL_F_SSL2_WRITE				 127
16050Sstevel@tonic-gate #define SSL_F_SSL3_ACCEPT				 128
16060Sstevel@tonic-gate #define SSL_F_SSL3_CALLBACK_CTRL			 233
16070Sstevel@tonic-gate #define SSL_F_SSL3_CHANGE_CIPHER_STATE			 129
16080Sstevel@tonic-gate #define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM		 130
16090Sstevel@tonic-gate #define SSL_F_SSL3_CLIENT_HELLO				 131
16100Sstevel@tonic-gate #define SSL_F_SSL3_CONNECT				 132
16110Sstevel@tonic-gate #define SSL_F_SSL3_CTRL					 213
16120Sstevel@tonic-gate #define SSL_F_SSL3_CTX_CTRL				 133
16130Sstevel@tonic-gate #define SSL_F_SSL3_ENC					 134
16140Sstevel@tonic-gate #define SSL_F_SSL3_GENERATE_KEY_BLOCK			 238
16150Sstevel@tonic-gate #define SSL_F_SSL3_GET_CERTIFICATE_REQUEST		 135
16160Sstevel@tonic-gate #define SSL_F_SSL3_GET_CERT_VERIFY			 136
16170Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_CERTIFICATE		 137
16180Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_HELLO			 138
16190Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE		 139
16200Sstevel@tonic-gate #define SSL_F_SSL3_GET_FINISHED				 140
16210Sstevel@tonic-gate #define SSL_F_SSL3_GET_KEY_EXCHANGE			 141
16220Sstevel@tonic-gate #define SSL_F_SSL3_GET_MESSAGE				 142
16230Sstevel@tonic-gate #define SSL_F_SSL3_GET_RECORD				 143
16240Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_CERTIFICATE		 144
16250Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_DONE			 145
16260Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_HELLO			 146
16270Sstevel@tonic-gate #define SSL_F_SSL3_OUTPUT_CERT_CHAIN			 147
16280Sstevel@tonic-gate #define SSL_F_SSL3_PEEK					 235
16290Sstevel@tonic-gate #define SSL_F_SSL3_READ_BYTES				 148
16300Sstevel@tonic-gate #define SSL_F_SSL3_READ_N				 149
16310Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST		 150
16320Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE		 151
16330Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE		 152
16340Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_VERIFY			 153
16350Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_CERTIFICATE		 154
16360Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_HELLO			 242
16370Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE		 155
16380Sstevel@tonic-gate #define SSL_F_SSL3_SETUP_BUFFERS			 156
16390Sstevel@tonic-gate #define SSL_F_SSL3_SETUP_KEY_BLOCK			 157
16400Sstevel@tonic-gate #define SSL_F_SSL3_WRITE_BYTES				 158
16410Sstevel@tonic-gate #define SSL_F_SSL3_WRITE_PENDING			 159
16420Sstevel@tonic-gate #define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK	 215
16430Sstevel@tonic-gate #define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK	 216
16440Sstevel@tonic-gate #define SSL_F_SSL_BAD_METHOD				 160
16450Sstevel@tonic-gate #define SSL_F_SSL_BYTES_TO_CIPHER_LIST			 161
16460Sstevel@tonic-gate #define SSL_F_SSL_CERT_DUP				 221
16470Sstevel@tonic-gate #define SSL_F_SSL_CERT_INST				 222
16480Sstevel@tonic-gate #define SSL_F_SSL_CERT_INSTANTIATE			 214
16490Sstevel@tonic-gate #define SSL_F_SSL_CERT_NEW				 162
16500Sstevel@tonic-gate #define SSL_F_SSL_CHECK_PRIVATE_KEY			 163
16510Sstevel@tonic-gate #define SSL_F_SSL_CIPHER_PROCESS_RULESTR		 230
16520Sstevel@tonic-gate #define SSL_F_SSL_CIPHER_STRENGTH_SORT			 231
16530Sstevel@tonic-gate #define SSL_F_SSL_CLEAR					 164
16540Sstevel@tonic-gate #define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD		 165
16550Sstevel@tonic-gate #define SSL_F_SSL_CREATE_CIPHER_LIST			 166
16560Sstevel@tonic-gate #define SSL_F_SSL_CTRL					 232
16570Sstevel@tonic-gate #define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY			 168
16580Sstevel@tonic-gate #define SSL_F_SSL_CTX_NEW				 169
16592139Sjp161948 #define SSL_F_SSL_CTX_SET_CIPHER_LIST			 1026
16600Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_PURPOSE			 226
16610Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT		 219
16620Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_SSL_VERSION			 170
16630Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_TRUST				 229
16640Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE			 171
16650Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1		 172
16660Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE	 220
16670Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE		 173
16680Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY			 174
16690Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1		 175
16700Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE		 176
16710Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY			 177
16720Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1		 178
16730Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE		 179
16740Sstevel@tonic-gate #define SSL_F_SSL_DO_HANDSHAKE				 180
16750Sstevel@tonic-gate #define SSL_F_SSL_GET_NEW_SESSION			 181
16760Sstevel@tonic-gate #define SSL_F_SSL_GET_PREV_SESSION			 217
16770Sstevel@tonic-gate #define SSL_F_SSL_GET_SERVER_SEND_CERT			 182
16780Sstevel@tonic-gate #define SSL_F_SSL_GET_SIGN_PKEY				 183
16790Sstevel@tonic-gate #define SSL_F_SSL_INIT_WBIO_BUFFER			 184
16800Sstevel@tonic-gate #define SSL_F_SSL_LOAD_CLIENT_CA_FILE			 185
16810Sstevel@tonic-gate #define SSL_F_SSL_NEW					 186
16822139Sjp161948 #define SSL_F_SSL_PEEK					 1025
16830Sstevel@tonic-gate #define SSL_F_SSL_READ					 223
16840Sstevel@tonic-gate #define SSL_F_SSL_RSA_PRIVATE_DECRYPT			 187
16850Sstevel@tonic-gate #define SSL_F_SSL_RSA_PUBLIC_ENCRYPT			 188
16860Sstevel@tonic-gate #define SSL_F_SSL_SESSION_NEW				 189
16870Sstevel@tonic-gate #define SSL_F_SSL_SESSION_PRINT_FP			 190
16880Sstevel@tonic-gate #define SSL_F_SSL_SESS_CERT_NEW				 225
16890Sstevel@tonic-gate #define SSL_F_SSL_SET_CERT				 191
16902139Sjp161948 #define SSL_F_SSL_SET_CIPHER_LIST			 1027
16910Sstevel@tonic-gate #define SSL_F_SSL_SET_FD				 192
16920Sstevel@tonic-gate #define SSL_F_SSL_SET_PKEY				 193
16930Sstevel@tonic-gate #define SSL_F_SSL_SET_PURPOSE				 227
16940Sstevel@tonic-gate #define SSL_F_SSL_SET_RFD				 194
16950Sstevel@tonic-gate #define SSL_F_SSL_SET_SESSION				 195
16960Sstevel@tonic-gate #define SSL_F_SSL_SET_SESSION_ID_CONTEXT		 218
16970Sstevel@tonic-gate #define SSL_F_SSL_SET_TRUST				 228
16980Sstevel@tonic-gate #define SSL_F_SSL_SET_WFD				 196
16990Sstevel@tonic-gate #define SSL_F_SSL_SHUTDOWN				 224
17002139Sjp161948 #define SSL_F_SSL_UNDEFINED_CONST_FUNCTION		 243
17010Sstevel@tonic-gate #define SSL_F_SSL_UNDEFINED_FUNCTION			 197
17022139Sjp161948 #define SSL_F_SSL_UNDEFINED_VOID_FUNCTION		 244
17030Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE			 198
17040Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE_ASN1			 199
17050Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE_FILE			 200
17060Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY			 201
17070Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY_ASN1			 202
17080Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY_FILE			 203
17090Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY			 204
17100Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1		 205
17110Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE		 206
17120Sstevel@tonic-gate #define SSL_F_SSL_VERIFY_CERT_CHAIN			 207
17130Sstevel@tonic-gate #define SSL_F_SSL_WRITE					 208
17140Sstevel@tonic-gate #define SSL_F_TLS1_CHANGE_CIPHER_STATE			 209
17150Sstevel@tonic-gate #define SSL_F_TLS1_ENC					 210
17160Sstevel@tonic-gate #define SSL_F_TLS1_SETUP_KEY_BLOCK			 211
17170Sstevel@tonic-gate #define SSL_F_WRITE_PENDING				 212
17180Sstevel@tonic-gate 
17190Sstevel@tonic-gate /* Reason codes. */
17200Sstevel@tonic-gate #define SSL_R_APP_DATA_IN_HANDSHAKE			 100
17210Sstevel@tonic-gate #define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272
17220Sstevel@tonic-gate #define SSL_R_BAD_ALERT_RECORD				 101
17230Sstevel@tonic-gate #define SSL_R_BAD_AUTHENTICATION_TYPE			 102
17240Sstevel@tonic-gate #define SSL_R_BAD_CHANGE_CIPHER_SPEC			 103
17250Sstevel@tonic-gate #define SSL_R_BAD_CHECKSUM				 104
17260Sstevel@tonic-gate #define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK		 106
17270Sstevel@tonic-gate #define SSL_R_BAD_DECOMPRESSION				 107
17280Sstevel@tonic-gate #define SSL_R_BAD_DH_G_LENGTH				 108
17290Sstevel@tonic-gate #define SSL_R_BAD_DH_PUB_KEY_LENGTH			 109
17300Sstevel@tonic-gate #define SSL_R_BAD_DH_P_LENGTH				 110
17310Sstevel@tonic-gate #define SSL_R_BAD_DIGEST_LENGTH				 111
17320Sstevel@tonic-gate #define SSL_R_BAD_DSA_SIGNATURE				 112
17332139Sjp161948 #define SSL_R_BAD_ECC_CERT				 1117
17342139Sjp161948 #define SSL_R_BAD_ECDSA_SIGNATURE			 1112
17352139Sjp161948 #define SSL_R_BAD_ECPOINT				 1113
17360Sstevel@tonic-gate #define SSL_R_BAD_HELLO_REQUEST				 105
17370Sstevel@tonic-gate #define SSL_R_BAD_LENGTH				 271
17380Sstevel@tonic-gate #define SSL_R_BAD_MAC_DECODE				 113
17390Sstevel@tonic-gate #define SSL_R_BAD_MESSAGE_TYPE				 114
17400Sstevel@tonic-gate #define SSL_R_BAD_PACKET_LENGTH				 115
17410Sstevel@tonic-gate #define SSL_R_BAD_PROTOCOL_VERSION_NUMBER		 116
17420Sstevel@tonic-gate #define SSL_R_BAD_RESPONSE_ARGUMENT			 117
17430Sstevel@tonic-gate #define SSL_R_BAD_RSA_DECRYPT				 118
17440Sstevel@tonic-gate #define SSL_R_BAD_RSA_ENCRYPT				 119
17450Sstevel@tonic-gate #define SSL_R_BAD_RSA_E_LENGTH				 120
17460Sstevel@tonic-gate #define SSL_R_BAD_RSA_MODULUS_LENGTH			 121
17470Sstevel@tonic-gate #define SSL_R_BAD_RSA_SIGNATURE				 122
17480Sstevel@tonic-gate #define SSL_R_BAD_SIGNATURE				 123
17490Sstevel@tonic-gate #define SSL_R_BAD_SSL_FILETYPE				 124
17500Sstevel@tonic-gate #define SSL_R_BAD_SSL_SESSION_ID_LENGTH			 125
17510Sstevel@tonic-gate #define SSL_R_BAD_STATE					 126
17520Sstevel@tonic-gate #define SSL_R_BAD_WRITE_RETRY				 127
17530Sstevel@tonic-gate #define SSL_R_BIO_NOT_SET				 128
17540Sstevel@tonic-gate #define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG			 129
17550Sstevel@tonic-gate #define SSL_R_BN_LIB					 130
17560Sstevel@tonic-gate #define SSL_R_CA_DN_LENGTH_MISMATCH			 131
17570Sstevel@tonic-gate #define SSL_R_CA_DN_TOO_LONG				 132
17580Sstevel@tonic-gate #define SSL_R_CCS_RECEIVED_EARLY			 133
17590Sstevel@tonic-gate #define SSL_R_CERTIFICATE_VERIFY_FAILED			 134
17600Sstevel@tonic-gate #define SSL_R_CERT_LENGTH_MISMATCH			 135
17610Sstevel@tonic-gate #define SSL_R_CHALLENGE_IS_DIFFERENT			 136
17620Sstevel@tonic-gate #define SSL_R_CIPHER_CODE_WRONG_LENGTH			 137
17630Sstevel@tonic-gate #define SSL_R_CIPHER_OR_HASH_UNAVAILABLE		 138
17640Sstevel@tonic-gate #define SSL_R_CIPHER_TABLE_SRC_ERROR			 139
17650Sstevel@tonic-gate #define SSL_R_COMPRESSED_LENGTH_TOO_LONG		 140
17660Sstevel@tonic-gate #define SSL_R_COMPRESSION_FAILURE			 141
17672139Sjp161948 #define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE	 1120
17680Sstevel@tonic-gate #define SSL_R_COMPRESSION_LIBRARY_ERROR			 142
17690Sstevel@tonic-gate #define SSL_R_CONNECTION_ID_IS_DIFFERENT		 143
17700Sstevel@tonic-gate #define SSL_R_CONNECTION_TYPE_NOT_SET			 144
17712139Sjp161948 #define SSL_R_COOKIE_MISMATCH				 2002
17720Sstevel@tonic-gate #define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED		 145
17730Sstevel@tonic-gate #define SSL_R_DATA_LENGTH_TOO_LONG			 146
17740Sstevel@tonic-gate #define SSL_R_DECRYPTION_FAILED				 147
17750Sstevel@tonic-gate #define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC	 1109
17760Sstevel@tonic-gate #define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG		 148
17770Sstevel@tonic-gate #define SSL_R_DIGEST_CHECK_FAILED			 149
17782139Sjp161948 #define SSL_R_DUPLICATE_COMPRESSION_ID			 1121
17792139Sjp161948 #define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER		 1119
17800Sstevel@tonic-gate #define SSL_R_ENCRYPTED_LENGTH_TOO_LONG			 150
17810Sstevel@tonic-gate #define SSL_R_ERROR_GENERATING_TMP_RSA_KEY		 1092
17820Sstevel@tonic-gate #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST		 151
17830Sstevel@tonic-gate #define SSL_R_EXCESSIVE_MESSAGE_SIZE			 152
17840Sstevel@tonic-gate #define SSL_R_EXTRA_DATA_IN_MESSAGE			 153
17850Sstevel@tonic-gate #define SSL_R_GOT_A_FIN_BEFORE_A_CCS			 154
17860Sstevel@tonic-gate #define SSL_R_HTTPS_PROXY_REQUEST			 155
17870Sstevel@tonic-gate #define SSL_R_HTTP_REQUEST				 156
17880Sstevel@tonic-gate #define SSL_R_ILLEGAL_PADDING				 1110
17890Sstevel@tonic-gate #define SSL_R_INVALID_CHALLENGE_LENGTH			 158
17900Sstevel@tonic-gate #define SSL_R_INVALID_COMMAND				 280
17910Sstevel@tonic-gate #define SSL_R_INVALID_PURPOSE				 278
17920Sstevel@tonic-gate #define SSL_R_INVALID_TRUST				 279
17930Sstevel@tonic-gate #define SSL_R_KEY_ARG_TOO_LONG				 1112
17940Sstevel@tonic-gate #define SSL_R_KRB5					 1104
17950Sstevel@tonic-gate #define SSL_R_KRB5_C_CC_PRINC				 1094
17960Sstevel@tonic-gate #define SSL_R_KRB5_C_GET_CRED				 1095
17970Sstevel@tonic-gate #define SSL_R_KRB5_C_INIT				 1096
17980Sstevel@tonic-gate #define SSL_R_KRB5_C_MK_REQ				 1097
17990Sstevel@tonic-gate #define SSL_R_KRB5_S_BAD_TICKET				 1098
18000Sstevel@tonic-gate #define SSL_R_KRB5_S_INIT				 1099
18010Sstevel@tonic-gate #define SSL_R_KRB5_S_RD_REQ				 1108
18020Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_EXPIRED			 1105
18030Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_NYV				 1106
18040Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_SKEW				 1107
18050Sstevel@tonic-gate #define SSL_R_LENGTH_MISMATCH				 159
18060Sstevel@tonic-gate #define SSL_R_LENGTH_TOO_SHORT				 160
18070Sstevel@tonic-gate #define SSL_R_LIBRARY_BUG				 274
18080Sstevel@tonic-gate #define SSL_R_LIBRARY_HAS_NO_CIPHERS			 161
18090Sstevel@tonic-gate #define SSL_R_MASTER_KEY_TOO_LONG			 1112
18100Sstevel@tonic-gate #define SSL_R_MESSAGE_TOO_LONG				 1111
18110Sstevel@tonic-gate #define SSL_R_MISSING_DH_DSA_CERT			 162
18120Sstevel@tonic-gate #define SSL_R_MISSING_DH_KEY				 163
18130Sstevel@tonic-gate #define SSL_R_MISSING_DH_RSA_CERT			 164
18140Sstevel@tonic-gate #define SSL_R_MISSING_DSA_SIGNING_CERT			 165
18150Sstevel@tonic-gate #define SSL_R_MISSING_EXPORT_TMP_DH_KEY			 166
18160Sstevel@tonic-gate #define SSL_R_MISSING_EXPORT_TMP_RSA_KEY		 167
18170Sstevel@tonic-gate #define SSL_R_MISSING_RSA_CERTIFICATE			 168
18180Sstevel@tonic-gate #define SSL_R_MISSING_RSA_ENCRYPTING_CERT		 169
18190Sstevel@tonic-gate #define SSL_R_MISSING_RSA_SIGNING_CERT			 170
18200Sstevel@tonic-gate #define SSL_R_MISSING_TMP_DH_KEY			 171
18212139Sjp161948 #define SSL_R_MISSING_TMP_ECDH_KEY			 1114
18220Sstevel@tonic-gate #define SSL_R_MISSING_TMP_RSA_KEY			 172
18230Sstevel@tonic-gate #define SSL_R_MISSING_TMP_RSA_PKEY			 173
18240Sstevel@tonic-gate #define SSL_R_MISSING_VERIFY_MESSAGE			 174
18250Sstevel@tonic-gate #define SSL_R_NON_SSLV2_INITIAL_PACKET			 175
18260Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATES_RETURNED			 176
18270Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_ASSIGNED			 177
18280Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_RETURNED			 178
18290Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_SET			 179
18300Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_SPECIFIED			 180
18310Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_AVAILABLE			 181
18320Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_PASSED				 182
18330Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_SPECIFIED			 183
18340Sstevel@tonic-gate #define SSL_R_NO_CIPHER_LIST				 184
18350Sstevel@tonic-gate #define SSL_R_NO_CIPHER_MATCH				 185
18360Sstevel@tonic-gate #define SSL_R_NO_CLIENT_CERT_RECEIVED			 186
18370Sstevel@tonic-gate #define SSL_R_NO_COMPRESSION_SPECIFIED			 187
18380Sstevel@tonic-gate #define SSL_R_NO_METHOD_SPECIFIED			 188
18390Sstevel@tonic-gate #define SSL_R_NO_PRIVATEKEY				 189
18400Sstevel@tonic-gate #define SSL_R_NO_PRIVATE_KEY_ASSIGNED			 190
18410Sstevel@tonic-gate #define SSL_R_NO_PROTOCOLS_AVAILABLE			 191
18420Sstevel@tonic-gate #define SSL_R_NO_PUBLICKEY				 192
18430Sstevel@tonic-gate #define SSL_R_NO_SHARED_CIPHER				 193
18440Sstevel@tonic-gate #define SSL_R_NO_VERIFY_CALLBACK			 194
18450Sstevel@tonic-gate #define SSL_R_NULL_SSL_CTX				 195
18460Sstevel@tonic-gate #define SSL_R_NULL_SSL_METHOD_PASSED			 196
18470Sstevel@tonic-gate #define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED		 197
18480Sstevel@tonic-gate #define SSL_R_PACKET_LENGTH_TOO_LONG			 198
18490Sstevel@tonic-gate #define SSL_R_PATH_TOO_LONG				 270
18500Sstevel@tonic-gate #define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE		 199
18510Sstevel@tonic-gate #define SSL_R_PEER_ERROR				 200
18520Sstevel@tonic-gate #define SSL_R_PEER_ERROR_CERTIFICATE			 201
18530Sstevel@tonic-gate #define SSL_R_PEER_ERROR_NO_CERTIFICATE			 202
18540Sstevel@tonic-gate #define SSL_R_PEER_ERROR_NO_CIPHER			 203
18550Sstevel@tonic-gate #define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE	 204
18560Sstevel@tonic-gate #define SSL_R_PRE_MAC_LENGTH_TOO_LONG			 205
18570Sstevel@tonic-gate #define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS		 206
18580Sstevel@tonic-gate #define SSL_R_PROTOCOL_IS_SHUTDOWN			 207
18590Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR			 208
18600Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_IS_NOT_RSA			 209
18610Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_NOT_RSA			 210
18620Sstevel@tonic-gate #define SSL_R_READ_BIO_NOT_SET				 211
18632139Sjp161948 #define SSL_R_READ_TIMEOUT_EXPIRED			 2001
18640Sstevel@tonic-gate #define SSL_R_READ_WRONG_PACKET_TYPE			 212
18650Sstevel@tonic-gate #define SSL_R_RECORD_LENGTH_MISMATCH			 213
18660Sstevel@tonic-gate #define SSL_R_RECORD_TOO_LARGE				 214
18670Sstevel@tonic-gate #define SSL_R_RECORD_TOO_SMALL				 1093
18680Sstevel@tonic-gate #define SSL_R_REQUIRED_CIPHER_MISSING			 215
18690Sstevel@tonic-gate #define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO		 216
18700Sstevel@tonic-gate #define SSL_R_REUSE_CERT_TYPE_NOT_ZERO			 217
18710Sstevel@tonic-gate #define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO		 218
18720Sstevel@tonic-gate #define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED		 277
18730Sstevel@tonic-gate #define SSL_R_SHORT_READ				 219
18740Sstevel@tonic-gate #define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE	 220
18750Sstevel@tonic-gate #define SSL_R_SSL23_DOING_SESSION_ID_REUSE		 221
18760Sstevel@tonic-gate #define SSL_R_SSL2_CONNECTION_ID_TOO_LONG		 1114
18770Sstevel@tonic-gate #define SSL_R_SSL3_SESSION_ID_TOO_LONG			 1113
18780Sstevel@tonic-gate #define SSL_R_SSL3_SESSION_ID_TOO_SHORT			 222
18790Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE		 1042
18800Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC		 1020
18810Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED		 1045
18820Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED		 1044
18830Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN		 1046
18840Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE		 1030
18850Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE		 1040
18860Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER		 1047
18870Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_NO_CERTIFICATE		 1041
18880Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE	 223
18890Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE	 224
18900Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER		 225
18910Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 226
18920Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE		 1010
18930Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE	 227
18940Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE	 1043
18950Sstevel@tonic-gate #define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION	 228
18960Sstevel@tonic-gate #define SSL_R_SSL_HANDSHAKE_FAILURE			 229
18970Sstevel@tonic-gate #define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS		 230
18980Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED		 1102
18990Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CONFLICT			 1103
19000Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG		 273
19010Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH		 1101
19020Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_IS_DIFFERENT		 231
19030Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_ACCESS_DENIED			 1049
19040Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECODE_ERROR			 1050
19050Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED		 1021
19060Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECRYPT_ERROR			 1051
19070Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION		 1060
19080Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY		 1071
19090Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_INTERNAL_ERROR		 1080
19100Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION		 1100
19110Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION		 1070
19120Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW		 1022
19130Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_UNKNOWN_CA			 1048
19140Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_USER_CANCELLED		 1090
19150Sstevel@tonic-gate #define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER	 232
19160Sstevel@tonic-gate #define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233
19170Sstevel@tonic-gate #define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG	 234
19180Sstevel@tonic-gate #define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER		 235
19190Sstevel@tonic-gate #define SSL_R_UNABLE_TO_DECODE_DH_CERTS			 236
19202139Sjp161948 #define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS		 1115
19210Sstevel@tonic-gate #define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY		 237
19220Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS		 238
19232139Sjp161948 #define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS		 1116
19240Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS	 239
19250Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_SSL_METHOD			 240
19260Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES		 241
19270Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES		 242
19280Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES		 243
19290Sstevel@tonic-gate #define SSL_R_UNEXPECTED_MESSAGE			 244
19300Sstevel@tonic-gate #define SSL_R_UNEXPECTED_RECORD				 245
19310Sstevel@tonic-gate #define SSL_R_UNINITIALIZED				 276
19320Sstevel@tonic-gate #define SSL_R_UNKNOWN_ALERT_TYPE			 246
19330Sstevel@tonic-gate #define SSL_R_UNKNOWN_CERTIFICATE_TYPE			 247
19340Sstevel@tonic-gate #define SSL_R_UNKNOWN_CIPHER_RETURNED			 248
19350Sstevel@tonic-gate #define SSL_R_UNKNOWN_CIPHER_TYPE			 249
19360Sstevel@tonic-gate #define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE			 250
19370Sstevel@tonic-gate #define SSL_R_UNKNOWN_PKEY_TYPE				 251
19380Sstevel@tonic-gate #define SSL_R_UNKNOWN_PROTOCOL				 252
19390Sstevel@tonic-gate #define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE			 253
19400Sstevel@tonic-gate #define SSL_R_UNKNOWN_SSL_VERSION			 254
19410Sstevel@tonic-gate #define SSL_R_UNKNOWN_STATE				 255
19420Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_CIPHER			 256
19430Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM		 257
19442139Sjp161948 #define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE		 1118
19450Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_OPTION			 1091
19460Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_PROTOCOL			 258
19470Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_SSL_VERSION			 259
19480Sstevel@tonic-gate #define SSL_R_WRITE_BIO_NOT_SET				 260
19490Sstevel@tonic-gate #define SSL_R_WRONG_CIPHER_RETURNED			 261
19500Sstevel@tonic-gate #define SSL_R_WRONG_MESSAGE_TYPE			 262
19510Sstevel@tonic-gate #define SSL_R_WRONG_NUMBER_OF_KEY_BITS			 263
19520Sstevel@tonic-gate #define SSL_R_WRONG_SIGNATURE_LENGTH			 264
19530Sstevel@tonic-gate #define SSL_R_WRONG_SIGNATURE_SIZE			 265
19540Sstevel@tonic-gate #define SSL_R_WRONG_SSL_VERSION				 266
19550Sstevel@tonic-gate #define SSL_R_WRONG_VERSION_NUMBER			 267
19560Sstevel@tonic-gate #define SSL_R_X509_LIB					 268
19570Sstevel@tonic-gate #define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS		 269
19580Sstevel@tonic-gate 
19590Sstevel@tonic-gate #ifdef  __cplusplus
19600Sstevel@tonic-gate }
19610Sstevel@tonic-gate #endif
19620Sstevel@tonic-gate #endif
1963