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 /* 1710Sstevel@tonic-gate * The portions of this code that are #ifdef CRYPTO_UNLIMITED are 1720Sstevel@tonic-gate * 1732139Sjp161948 * Copyright 2006 Sun Microsystems, Inc. All rights reserved. 1740Sstevel@tonic-gate * Use is subject to license terms. 1750Sstevel@tonic-gate * 1760Sstevel@tonic-gate */ 1772139Sjp161948 1780Sstevel@tonic-gate #pragma ident "%Z%%M% %I% %E% SMI" 1790Sstevel@tonic-gate 1800Sstevel@tonic-gate #ifndef HEADER_SSL_H 1810Sstevel@tonic-gate #define HEADER_SSL_H 1820Sstevel@tonic-gate 1830Sstevel@tonic-gate #include <openssl/e_os2.h> 1840Sstevel@tonic-gate 1850Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP 1860Sstevel@tonic-gate #include <openssl/comp.h> 1870Sstevel@tonic-gate #endif 1880Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 1890Sstevel@tonic-gate #include <openssl/bio.h> 1900Sstevel@tonic-gate #endif 1912139Sjp161948 #ifndef OPENSSL_NO_DEPRECATED 1920Sstevel@tonic-gate #ifndef OPENSSL_NO_X509 1930Sstevel@tonic-gate #include <openssl/x509.h> 1940Sstevel@tonic-gate #endif 1952139Sjp161948 #include <openssl/crypto.h> 1962139Sjp161948 #include <openssl/lhash.h> 1972139Sjp161948 #include <openssl/buffer.h> 1982139Sjp161948 #endif 1992139Sjp161948 #include <openssl/pem.h> 2002139Sjp161948 2010Sstevel@tonic-gate #include <openssl/kssl.h> 2020Sstevel@tonic-gate #include <openssl/safestack.h> 2030Sstevel@tonic-gate #include <openssl/symhacks.h> 2040Sstevel@tonic-gate 2050Sstevel@tonic-gate #ifdef __cplusplus 2060Sstevel@tonic-gate extern "C" { 2070Sstevel@tonic-gate #endif 2080Sstevel@tonic-gate 2090Sstevel@tonic-gate /* SSLeay version number for ASN.1 encoding of the session information */ 2100Sstevel@tonic-gate /* Version 0 - initial version 2110Sstevel@tonic-gate * Version 1 - added the optional peer certificate 2120Sstevel@tonic-gate */ 2130Sstevel@tonic-gate #define SSL_SESSION_ASN1_VERSION 0x0001 2140Sstevel@tonic-gate 2150Sstevel@tonic-gate /* text strings for the ciphers */ 2160Sstevel@tonic-gate #define SSL_TXT_NULL_WITH_MD5 SSL2_TXT_NULL_WITH_MD5 2170Sstevel@tonic-gate #define SSL_TXT_RC4_128_WITH_MD5 SSL2_TXT_RC4_128_WITH_MD5 2180Sstevel@tonic-gate #define SSL_TXT_RC4_128_EXPORT40_WITH_MD5 SSL2_TXT_RC4_128_EXPORT40_WITH_MD5 2190Sstevel@tonic-gate #define SSL_TXT_RC2_128_CBC_WITH_MD5 SSL2_TXT_RC2_128_CBC_WITH_MD5 2200Sstevel@tonic-gate #define SSL_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 SSL2_TXT_RC2_128_CBC_EXPORT40_WITH_MD5 2210Sstevel@tonic-gate #define SSL_TXT_IDEA_128_CBC_WITH_MD5 SSL2_TXT_IDEA_128_CBC_WITH_MD5 2220Sstevel@tonic-gate #define SSL_TXT_DES_64_CBC_WITH_MD5 SSL2_TXT_DES_64_CBC_WITH_MD5 2230Sstevel@tonic-gate #define SSL_TXT_DES_64_CBC_WITH_SHA SSL2_TXT_DES_64_CBC_WITH_SHA 2240Sstevel@tonic-gate #define SSL_TXT_DES_192_EDE3_CBC_WITH_MD5 SSL2_TXT_DES_192_EDE3_CBC_WITH_MD5 2250Sstevel@tonic-gate #define SSL_TXT_DES_192_EDE3_CBC_WITH_SHA SSL2_TXT_DES_192_EDE3_CBC_WITH_SHA 2260Sstevel@tonic-gate 2270Sstevel@tonic-gate /* VRS Additional Kerberos5 entries 2280Sstevel@tonic-gate */ 2290Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA 2300Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA 2310Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_128_SHA SSL3_TXT_KRB5_RC4_128_SHA 2320Sstevel@tonic-gate #define SSL_TXT_KRB5_IDEA_128_CBC_SHA SSL3_TXT_KRB5_IDEA_128_CBC_SHA 2330Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 2340Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 2350Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_128_MD5 SSL3_TXT_KRB5_RC4_128_MD5 2360Sstevel@tonic-gate #define SSL_TXT_KRB5_IDEA_128_CBC_MD5 SSL3_TXT_KRB5_IDEA_128_CBC_MD5 2370Sstevel@tonic-gate 2380Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA 2390Sstevel@tonic-gate #define SSL_TXT_KRB5_RC2_40_CBC_SHA SSL3_TXT_KRB5_RC2_40_CBC_SHA 2400Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_40_SHA SSL3_TXT_KRB5_RC4_40_SHA 2410Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 2420Sstevel@tonic-gate #define SSL_TXT_KRB5_RC2_40_CBC_MD5 SSL3_TXT_KRB5_RC2_40_CBC_MD5 2430Sstevel@tonic-gate #define SSL_TXT_KRB5_RC4_40_MD5 SSL3_TXT_KRB5_RC4_40_MD5 2440Sstevel@tonic-gate 2450Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_SHA SSL3_TXT_KRB5_DES_40_CBC_SHA 2460Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_40_CBC_MD5 SSL3_TXT_KRB5_DES_40_CBC_MD5 2470Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_SHA SSL3_TXT_KRB5_DES_64_CBC_SHA 2480Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_64_CBC_MD5 SSL3_TXT_KRB5_DES_64_CBC_MD5 2490Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_SHA SSL3_TXT_KRB5_DES_192_CBC3_SHA 2500Sstevel@tonic-gate #define SSL_TXT_KRB5_DES_192_CBC3_MD5 SSL3_TXT_KRB5_DES_192_CBC3_MD5 2510Sstevel@tonic-gate #define SSL_MAX_KRB5_PRINCIPAL_LENGTH 256 2520Sstevel@tonic-gate 2530Sstevel@tonic-gate #define SSL_MAX_SSL_SESSION_ID_LENGTH 32 2540Sstevel@tonic-gate #define SSL_MAX_SID_CTX_LENGTH 32 2550Sstevel@tonic-gate 2560Sstevel@tonic-gate #define SSL_MIN_RSA_MODULUS_LENGTH_IN_BYTES (512/8) 2570Sstevel@tonic-gate #define SSL_MAX_KEY_ARG_LENGTH 8 2580Sstevel@tonic-gate #define SSL_MAX_MASTER_KEY_LENGTH 48 2590Sstevel@tonic-gate 2600Sstevel@tonic-gate /* These are used to specify which ciphers to use and not to use */ 2610Sstevel@tonic-gate #define SSL_TXT_LOW "LOW" 2620Sstevel@tonic-gate #define SSL_TXT_MEDIUM "MEDIUM" 2630Sstevel@tonic-gate #define SSL_TXT_HIGH "HIGH" 2640Sstevel@tonic-gate #define SSL_TXT_kFZA "kFZA" 2650Sstevel@tonic-gate #define SSL_TXT_aFZA "aFZA" 2660Sstevel@tonic-gate #define SSL_TXT_eFZA "eFZA" 2670Sstevel@tonic-gate #define SSL_TXT_FZA "FZA" 2680Sstevel@tonic-gate 2690Sstevel@tonic-gate #define SSL_TXT_aNULL "aNULL" 2700Sstevel@tonic-gate #define SSL_TXT_eNULL "eNULL" 2710Sstevel@tonic-gate #define SSL_TXT_NULL "NULL" 2720Sstevel@tonic-gate 2730Sstevel@tonic-gate #define SSL_TXT_kKRB5 "kKRB5" 2740Sstevel@tonic-gate #define SSL_TXT_aKRB5 "aKRB5" 2750Sstevel@tonic-gate #define SSL_TXT_KRB5 "KRB5" 2760Sstevel@tonic-gate 2770Sstevel@tonic-gate #define SSL_TXT_kRSA "kRSA" 2780Sstevel@tonic-gate #define SSL_TXT_kDHr "kDHr" 2790Sstevel@tonic-gate #define SSL_TXT_kDHd "kDHd" 2800Sstevel@tonic-gate #define SSL_TXT_kEDH "kEDH" 2810Sstevel@tonic-gate #define SSL_TXT_aRSA "aRSA" 2820Sstevel@tonic-gate #define SSL_TXT_aDSS "aDSS" 2830Sstevel@tonic-gate #define SSL_TXT_aDH "aDH" 2840Sstevel@tonic-gate #define SSL_TXT_DSS "DSS" 2850Sstevel@tonic-gate #define SSL_TXT_DH "DH" 2860Sstevel@tonic-gate #define SSL_TXT_EDH "EDH" 2870Sstevel@tonic-gate #define SSL_TXT_ADH "ADH" 2880Sstevel@tonic-gate #define SSL_TXT_RSA "RSA" 2890Sstevel@tonic-gate #define SSL_TXT_DES "DES" 2900Sstevel@tonic-gate #define SSL_TXT_3DES "3DES" 2910Sstevel@tonic-gate #define SSL_TXT_RC4 "RC4" 2920Sstevel@tonic-gate #define SSL_TXT_RC2 "RC2" 2930Sstevel@tonic-gate #define SSL_TXT_IDEA "IDEA" 2940Sstevel@tonic-gate #define SSL_TXT_AES "AES" 2950Sstevel@tonic-gate #define SSL_TXT_MD5 "MD5" 2960Sstevel@tonic-gate #define SSL_TXT_SHA1 "SHA1" 2970Sstevel@tonic-gate #define SSL_TXT_SHA "SHA" 2980Sstevel@tonic-gate #define SSL_TXT_EXP "EXP" 2990Sstevel@tonic-gate #define SSL_TXT_EXPORT "EXPORT" 3000Sstevel@tonic-gate #define SSL_TXT_EXP40 "EXPORT40" 3010Sstevel@tonic-gate #define SSL_TXT_EXP56 "EXPORT56" 3020Sstevel@tonic-gate #define SSL_TXT_SSLV2 "SSLv2" 3030Sstevel@tonic-gate #define SSL_TXT_SSLV3 "SSLv3" 3040Sstevel@tonic-gate #define SSL_TXT_TLSV1 "TLSv1" 3050Sstevel@tonic-gate #define SSL_TXT_ALL "ALL" 3062139Sjp161948 #define SSL_TXT_ECC "ECCdraft" /* ECC ciphersuites are not yet official */ 3070Sstevel@tonic-gate 3080Sstevel@tonic-gate /* 3090Sstevel@tonic-gate * COMPLEMENTOF* definitions. These identifiers are used to (de-select) 3100Sstevel@tonic-gate * ciphers normally not being used. 3110Sstevel@tonic-gate * Example: "RC4" will activate all ciphers using RC4 including ciphers 3120Sstevel@tonic-gate * without authentication, which would normally disabled by DEFAULT (due 3130Sstevel@tonic-gate * the "!ADH" being part of default). Therefore "RC4:!COMPLEMENTOFDEFAULT" 3140Sstevel@tonic-gate * will make sure that it is also disabled in the specific selection. 3150Sstevel@tonic-gate * COMPLEMENTOF* identifiers are portable between version, as adjustments 3160Sstevel@tonic-gate * to the default cipher setup will also be included here. 3170Sstevel@tonic-gate * 3180Sstevel@tonic-gate * COMPLEMENTOFDEFAULT does not experience the same special treatment that 3190Sstevel@tonic-gate * DEFAULT gets, as only selection is being done and no sorting as needed 3200Sstevel@tonic-gate * for DEFAULT. 3210Sstevel@tonic-gate */ 3220Sstevel@tonic-gate #define SSL_TXT_CMPALL "COMPLEMENTOFALL" 3230Sstevel@tonic-gate #define SSL_TXT_CMPDEF "COMPLEMENTOFDEFAULT" 3240Sstevel@tonic-gate 3250Sstevel@tonic-gate /* The following cipher list is used by default. 3260Sstevel@tonic-gate * It also is substituted when an application-defined cipher list string 3270Sstevel@tonic-gate * starts with 'DEFAULT'. */ 3280Sstevel@tonic-gate #ifdef CRYPTO_UNLIMITED 3290Sstevel@tonic-gate #define SSL_DEFAULT_CIPHER_LIST "ALL:!ADH:+RC4:@STRENGTH" /* low priority for RC4 */ 3300Sstevel@tonic-gate #else 3310Sstevel@tonic-gate #define SSL_DEFAULT_CIPHER_LIST "ALL:!DHE-RSA-AES256-SHA:!DHE-DSS-AES256-SHA:!AES256-SHA:!ADH:+RC4:@STRENGTH" /* low priority for RC4 */ 3320Sstevel@tonic-gate #endif /* CRYPTO_UNLIMITED */ 3330Sstevel@tonic-gate 3340Sstevel@tonic-gate /* Used in SSL_set_shutdown()/SSL_get_shutdown(); */ 3350Sstevel@tonic-gate #define SSL_SENT_SHUTDOWN 1 3360Sstevel@tonic-gate #define SSL_RECEIVED_SHUTDOWN 2 3370Sstevel@tonic-gate 3380Sstevel@tonic-gate #ifdef __cplusplus 3390Sstevel@tonic-gate } 3400Sstevel@tonic-gate #endif 3410Sstevel@tonic-gate 3420Sstevel@tonic-gate #ifdef __cplusplus 3430Sstevel@tonic-gate extern "C" { 3440Sstevel@tonic-gate #endif 3450Sstevel@tonic-gate 3460Sstevel@tonic-gate #if (defined(OPENSSL_NO_RSA) || defined(OPENSSL_NO_MD5)) && !defined(OPENSSL_NO_SSL2) 3470Sstevel@tonic-gate #define OPENSSL_NO_SSL2 3480Sstevel@tonic-gate #endif 3490Sstevel@tonic-gate 3500Sstevel@tonic-gate #define SSL_FILETYPE_ASN1 X509_FILETYPE_ASN1 3510Sstevel@tonic-gate #define SSL_FILETYPE_PEM X509_FILETYPE_PEM 3520Sstevel@tonic-gate 3530Sstevel@tonic-gate /* This is needed to stop compilers complaining about the 3540Sstevel@tonic-gate * 'struct ssl_st *' function parameters used to prototype callbacks 3550Sstevel@tonic-gate * in SSL_CTX. */ 3560Sstevel@tonic-gate typedef struct ssl_st *ssl_crock_st; 3570Sstevel@tonic-gate 3580Sstevel@tonic-gate /* used to hold info on the particular ciphers used */ 3590Sstevel@tonic-gate typedef struct ssl_cipher_st 3600Sstevel@tonic-gate { 3610Sstevel@tonic-gate int valid; 3620Sstevel@tonic-gate const char *name; /* text name */ 3630Sstevel@tonic-gate unsigned long id; /* id, 4 bytes, first is version */ 3640Sstevel@tonic-gate unsigned long algorithms; /* what ciphers are used */ 3650Sstevel@tonic-gate unsigned long algo_strength; /* strength and export flags */ 3660Sstevel@tonic-gate unsigned long algorithm2; /* Extra flags */ 3670Sstevel@tonic-gate int strength_bits; /* Number of bits really used */ 3680Sstevel@tonic-gate int alg_bits; /* Number of bits for algorithm */ 3690Sstevel@tonic-gate unsigned long mask; /* used for matching */ 3700Sstevel@tonic-gate unsigned long mask_strength; /* also used for matching */ 3710Sstevel@tonic-gate } SSL_CIPHER; 3720Sstevel@tonic-gate 3730Sstevel@tonic-gate DECLARE_STACK_OF(SSL_CIPHER) 3740Sstevel@tonic-gate 3750Sstevel@tonic-gate typedef struct ssl_st SSL; 3760Sstevel@tonic-gate typedef struct ssl_ctx_st SSL_CTX; 3770Sstevel@tonic-gate 3780Sstevel@tonic-gate /* Used to hold functions for SSLv2 or SSLv3/TLSv1 functions */ 3790Sstevel@tonic-gate typedef struct ssl_method_st 3800Sstevel@tonic-gate { 3810Sstevel@tonic-gate int version; 3820Sstevel@tonic-gate int (*ssl_new)(SSL *s); 3830Sstevel@tonic-gate void (*ssl_clear)(SSL *s); 3840Sstevel@tonic-gate void (*ssl_free)(SSL *s); 3850Sstevel@tonic-gate int (*ssl_accept)(SSL *s); 3860Sstevel@tonic-gate int (*ssl_connect)(SSL *s); 3870Sstevel@tonic-gate int (*ssl_read)(SSL *s,void *buf,int len); 3880Sstevel@tonic-gate int (*ssl_peek)(SSL *s,void *buf,int len); 3890Sstevel@tonic-gate int (*ssl_write)(SSL *s,const void *buf,int len); 3900Sstevel@tonic-gate int (*ssl_shutdown)(SSL *s); 3910Sstevel@tonic-gate int (*ssl_renegotiate)(SSL *s); 3920Sstevel@tonic-gate int (*ssl_renegotiate_check)(SSL *s); 3932139Sjp161948 long (*ssl_get_message)(SSL *s, int st1, int stn, int mt, long 3942139Sjp161948 max, int *ok); 3952139Sjp161948 int (*ssl_read_bytes)(SSL *s, int type, unsigned char *buf, int len, 3962139Sjp161948 int peek); 3972139Sjp161948 int (*ssl_write_bytes)(SSL *s, int type, const void *buf_, int len); 3982139Sjp161948 int (*ssl_dispatch_alert)(SSL *s); 3990Sstevel@tonic-gate long (*ssl_ctrl)(SSL *s,int cmd,long larg,void *parg); 4000Sstevel@tonic-gate long (*ssl_ctx_ctrl)(SSL_CTX *ctx,int cmd,long larg,void *parg); 4010Sstevel@tonic-gate SSL_CIPHER *(*get_cipher_by_char)(const unsigned char *ptr); 4020Sstevel@tonic-gate int (*put_cipher_by_char)(const SSL_CIPHER *cipher,unsigned char *ptr); 4032139Sjp161948 int (*ssl_pending)(const SSL *s); 4040Sstevel@tonic-gate int (*num_ciphers)(void); 4050Sstevel@tonic-gate SSL_CIPHER *(*get_cipher)(unsigned ncipher); 4060Sstevel@tonic-gate struct ssl_method_st *(*get_ssl_method)(int version); 4070Sstevel@tonic-gate long (*get_timeout)(void); 4080Sstevel@tonic-gate struct ssl3_enc_method *ssl3_enc; /* Extra SSLv3/TLS stuff */ 4092139Sjp161948 int (*ssl_version)(void); 4102139Sjp161948 long (*ssl_callback_ctrl)(SSL *s, int cb_id, void (*fp)(void)); 4112139Sjp161948 long (*ssl_ctx_callback_ctrl)(SSL_CTX *s, int cb_id, void (*fp)(void)); 4120Sstevel@tonic-gate } SSL_METHOD; 4130Sstevel@tonic-gate 4140Sstevel@tonic-gate /* Lets make this into an ASN.1 type structure as follows 4150Sstevel@tonic-gate * SSL_SESSION_ID ::= SEQUENCE { 4160Sstevel@tonic-gate * version INTEGER, -- structure version number 4170Sstevel@tonic-gate * SSLversion INTEGER, -- SSL version number 4180Sstevel@tonic-gate * Cipher OCTET_STRING, -- the 3 byte cipher ID 4190Sstevel@tonic-gate * Session_ID OCTET_STRING, -- the Session ID 4200Sstevel@tonic-gate * Master_key OCTET_STRING, -- the master key 4210Sstevel@tonic-gate * KRB5_principal OCTET_STRING -- optional Kerberos principal 4220Sstevel@tonic-gate * Key_Arg [ 0 ] IMPLICIT OCTET_STRING, -- the optional Key argument 4230Sstevel@tonic-gate * Time [ 1 ] EXPLICIT INTEGER, -- optional Start Time 4240Sstevel@tonic-gate * Timeout [ 2 ] EXPLICIT INTEGER, -- optional Timeout ins seconds 4250Sstevel@tonic-gate * Peer [ 3 ] EXPLICIT X509, -- optional Peer Certificate 4260Sstevel@tonic-gate * Session_ID_context [ 4 ] EXPLICIT OCTET_STRING, -- the Session ID context 4270Sstevel@tonic-gate * Verify_result [ 5 ] EXPLICIT INTEGER -- X509_V_... code for `Peer' 4280Sstevel@tonic-gate * Compression [6] IMPLICIT ASN1_OBJECT -- compression OID XXXXX 4290Sstevel@tonic-gate * } 4300Sstevel@tonic-gate * Look in ssl/ssl_asn1.c for more details 4310Sstevel@tonic-gate * I'm using EXPLICIT tags so I can read the damn things using asn1parse :-). 4320Sstevel@tonic-gate */ 4330Sstevel@tonic-gate typedef struct ssl_session_st 4340Sstevel@tonic-gate { 4350Sstevel@tonic-gate int ssl_version; /* what ssl version session info is 4360Sstevel@tonic-gate * being kept in here? */ 4370Sstevel@tonic-gate 4380Sstevel@tonic-gate /* only really used in SSLv2 */ 4390Sstevel@tonic-gate unsigned int key_arg_length; 4400Sstevel@tonic-gate unsigned char key_arg[SSL_MAX_KEY_ARG_LENGTH]; 4410Sstevel@tonic-gate int master_key_length; 4420Sstevel@tonic-gate unsigned char master_key[SSL_MAX_MASTER_KEY_LENGTH]; 4430Sstevel@tonic-gate /* session_id - valid? */ 4440Sstevel@tonic-gate unsigned int session_id_length; 4450Sstevel@tonic-gate unsigned char session_id[SSL_MAX_SSL_SESSION_ID_LENGTH]; 4460Sstevel@tonic-gate /* this is used to determine whether the session is being reused in 4470Sstevel@tonic-gate * the appropriate context. It is up to the application to set this, 4480Sstevel@tonic-gate * via SSL_new */ 4490Sstevel@tonic-gate unsigned int sid_ctx_length; 4500Sstevel@tonic-gate unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; 4510Sstevel@tonic-gate 4520Sstevel@tonic-gate #ifndef OPENSSL_NO_KRB5 4530Sstevel@tonic-gate unsigned int krb5_client_princ_len; 4540Sstevel@tonic-gate unsigned char krb5_client_princ[SSL_MAX_KRB5_PRINCIPAL_LENGTH]; 4550Sstevel@tonic-gate #endif /* OPENSSL_NO_KRB5 */ 4560Sstevel@tonic-gate 4570Sstevel@tonic-gate int not_resumable; 4580Sstevel@tonic-gate 4590Sstevel@tonic-gate /* The cert is the certificate used to establish this connection */ 4600Sstevel@tonic-gate struct sess_cert_st /* SESS_CERT */ *sess_cert; 4610Sstevel@tonic-gate 4620Sstevel@tonic-gate /* This is the cert for the other end. 4630Sstevel@tonic-gate * On clients, it will be the same as sess_cert->peer_key->x509 4640Sstevel@tonic-gate * (the latter is not enough as sess_cert is not retained 4650Sstevel@tonic-gate * in the external representation of sessions, see ssl_asn1.c). */ 4660Sstevel@tonic-gate X509 *peer; 4670Sstevel@tonic-gate /* when app_verify_callback accepts a session where the peer's certificate 4680Sstevel@tonic-gate * is not ok, we must remember the error for session reuse: */ 4690Sstevel@tonic-gate long verify_result; /* only for servers */ 4700Sstevel@tonic-gate 4710Sstevel@tonic-gate int references; 4720Sstevel@tonic-gate long timeout; 4730Sstevel@tonic-gate long time; 4740Sstevel@tonic-gate 4750Sstevel@tonic-gate int compress_meth; /* Need to lookup the method */ 4760Sstevel@tonic-gate 4770Sstevel@tonic-gate SSL_CIPHER *cipher; 4780Sstevel@tonic-gate unsigned long cipher_id; /* when ASN.1 loaded, this 4790Sstevel@tonic-gate * needs to be used to load 4800Sstevel@tonic-gate * the 'cipher' structure */ 4810Sstevel@tonic-gate 4820Sstevel@tonic-gate STACK_OF(SSL_CIPHER) *ciphers; /* shared ciphers? */ 4830Sstevel@tonic-gate 4840Sstevel@tonic-gate CRYPTO_EX_DATA ex_data; /* application specific data */ 4850Sstevel@tonic-gate 4860Sstevel@tonic-gate /* These are used to make removal of session-ids more 4870Sstevel@tonic-gate * efficient and to implement a maximum cache size. */ 4880Sstevel@tonic-gate struct ssl_session_st *prev,*next; 4890Sstevel@tonic-gate } SSL_SESSION; 4900Sstevel@tonic-gate 4910Sstevel@tonic-gate 4920Sstevel@tonic-gate #define SSL_OP_MICROSOFT_SESS_ID_BUG 0x00000001L 4930Sstevel@tonic-gate #define SSL_OP_NETSCAPE_CHALLENGE_BUG 0x00000002L 4940Sstevel@tonic-gate #define SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG 0x00000008L 4950Sstevel@tonic-gate #define SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG 0x00000010L 4960Sstevel@tonic-gate #define SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER 0x00000020L 497682Sjp161948 #define SSL_OP_MSIE_SSLV2_RSA_PADDING 0x00000040L /* no effect since 0.9.7h and 0.9.8b */ 4980Sstevel@tonic-gate #define SSL_OP_SSLEAY_080_CLIENT_DH_BUG 0x00000080L 4990Sstevel@tonic-gate #define SSL_OP_TLS_D5_BUG 0x00000100L 5000Sstevel@tonic-gate #define SSL_OP_TLS_BLOCK_PADDING_BUG 0x00000200L 5010Sstevel@tonic-gate 5020Sstevel@tonic-gate /* Disable SSL 3.0/TLS 1.0 CBC vulnerability workaround that was added 5030Sstevel@tonic-gate * in OpenSSL 0.9.6d. Usually (depending on the application protocol) 5040Sstevel@tonic-gate * the workaround is not needed. Unfortunately some broken SSL/TLS 5050Sstevel@tonic-gate * implementations cannot handle it at all, which is why we include 5060Sstevel@tonic-gate * it in SSL_OP_ALL. */ 5070Sstevel@tonic-gate #define SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS 0x00000800L /* added in 0.9.6e */ 5080Sstevel@tonic-gate 5090Sstevel@tonic-gate /* SSL_OP_ALL: various bug workarounds that should be rather harmless. 5100Sstevel@tonic-gate * This used to be 0x000FFFFFL before 0.9.7. */ 5110Sstevel@tonic-gate #define SSL_OP_ALL 0x00000FFFL 5120Sstevel@tonic-gate 5132139Sjp161948 /* DTLS options */ 5142139Sjp161948 #define SSL_OP_NO_QUERY_MTU 0x00001000L 5152139Sjp161948 /* Turn on Cookie Exchange (on relevant for servers) */ 5162139Sjp161948 #define SSL_OP_COOKIE_EXCHANGE 0x00002000L 5172139Sjp161948 5180Sstevel@tonic-gate /* As server, disallow session resumption on renegotiation */ 5190Sstevel@tonic-gate #define SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION 0x00010000L 5202139Sjp161948 /* If set, always create a new key when using tmp_ecdh parameters */ 5212139Sjp161948 #define SSL_OP_SINGLE_ECDH_USE 0x00080000L 5220Sstevel@tonic-gate /* If set, always create a new key when using tmp_dh parameters */ 5230Sstevel@tonic-gate #define SSL_OP_SINGLE_DH_USE 0x00100000L 5240Sstevel@tonic-gate /* Set to always use the tmp_rsa key when doing RSA operations, 5250Sstevel@tonic-gate * even when this violates protocol specs */ 5260Sstevel@tonic-gate #define SSL_OP_EPHEMERAL_RSA 0x00200000L 5270Sstevel@tonic-gate /* Set on servers to choose the cipher according to the server's 5280Sstevel@tonic-gate * preferences */ 5290Sstevel@tonic-gate #define SSL_OP_CIPHER_SERVER_PREFERENCE 0x00400000L 5300Sstevel@tonic-gate /* If set, a server will allow a client to issue a SSLv3.0 version number 5310Sstevel@tonic-gate * as latest version supported in the premaster secret, even when TLSv1.0 5320Sstevel@tonic-gate * (version 3.1) was announced in the client hello. Normally this is 5330Sstevel@tonic-gate * forbidden to prevent version rollback attacks. */ 5340Sstevel@tonic-gate #define SSL_OP_TLS_ROLLBACK_BUG 0x00800000L 5350Sstevel@tonic-gate 5360Sstevel@tonic-gate #define SSL_OP_NO_SSLv2 0x01000000L 5370Sstevel@tonic-gate #define SSL_OP_NO_SSLv3 0x02000000L 5380Sstevel@tonic-gate #define SSL_OP_NO_TLSv1 0x04000000L 5390Sstevel@tonic-gate 5400Sstevel@tonic-gate /* The next flag deliberately changes the ciphertest, this is a check 5410Sstevel@tonic-gate * for the PKCS#1 attack */ 5420Sstevel@tonic-gate #define SSL_OP_PKCS1_CHECK_1 0x08000000L 5430Sstevel@tonic-gate #define SSL_OP_PKCS1_CHECK_2 0x10000000L 5440Sstevel@tonic-gate #define SSL_OP_NETSCAPE_CA_DN_BUG 0x20000000L 5450Sstevel@tonic-gate #define SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG 0x40000000L 5460Sstevel@tonic-gate 5470Sstevel@tonic-gate 5480Sstevel@tonic-gate /* Allow SSL_write(..., n) to return r with 0 < r < n (i.e. report success 5490Sstevel@tonic-gate * when just a single record has been written): */ 5500Sstevel@tonic-gate #define SSL_MODE_ENABLE_PARTIAL_WRITE 0x00000001L 5510Sstevel@tonic-gate /* Make it possible to retry SSL_write() with changed buffer location 5520Sstevel@tonic-gate * (buffer contents must stay the same!); this is not the default to avoid 5530Sstevel@tonic-gate * the misconception that non-blocking SSL_write() behaves like 5540Sstevel@tonic-gate * non-blocking write(): */ 5550Sstevel@tonic-gate #define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER 0x00000002L 5560Sstevel@tonic-gate /* Never bother the application with retries if the transport 5570Sstevel@tonic-gate * is blocking: */ 5580Sstevel@tonic-gate #define SSL_MODE_AUTO_RETRY 0x00000004L 5590Sstevel@tonic-gate /* Don't attempt to automatically build certificate chain */ 5600Sstevel@tonic-gate #define SSL_MODE_NO_AUTO_CHAIN 0x00000008L 5610Sstevel@tonic-gate 5620Sstevel@tonic-gate 5630Sstevel@tonic-gate /* Note: SSL[_CTX]_set_{options,mode} use |= op on the previous value, 5640Sstevel@tonic-gate * they cannot be used to clear bits. */ 5650Sstevel@tonic-gate 5660Sstevel@tonic-gate #define SSL_CTX_set_options(ctx,op) \ 5670Sstevel@tonic-gate SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,(op),NULL) 5680Sstevel@tonic-gate #define SSL_CTX_get_options(ctx) \ 5690Sstevel@tonic-gate SSL_CTX_ctrl((ctx),SSL_CTRL_OPTIONS,0,NULL) 5700Sstevel@tonic-gate #define SSL_set_options(ssl,op) \ 5710Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_OPTIONS,(op),NULL) 5720Sstevel@tonic-gate #define SSL_get_options(ssl) \ 5730Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_OPTIONS,0,NULL) 5740Sstevel@tonic-gate 5750Sstevel@tonic-gate #define SSL_CTX_set_mode(ctx,op) \ 5760Sstevel@tonic-gate SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,(op),NULL) 5770Sstevel@tonic-gate #define SSL_CTX_get_mode(ctx) \ 5780Sstevel@tonic-gate SSL_CTX_ctrl((ctx),SSL_CTRL_MODE,0,NULL) 5790Sstevel@tonic-gate #define SSL_set_mode(ssl,op) \ 5800Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_MODE,(op),NULL) 5810Sstevel@tonic-gate #define SSL_get_mode(ssl) \ 5820Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_MODE,0,NULL) 5832139Sjp161948 #define SSL_set_mtu(ssl, mtu) \ 5842139Sjp161948 SSL_ctrl((ssl),SSL_CTRL_SET_MTU,(mtu),NULL) 5850Sstevel@tonic-gate 5860Sstevel@tonic-gate 5870Sstevel@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)); 5880Sstevel@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)); 5890Sstevel@tonic-gate #define SSL_CTX_set_msg_callback_arg(ctx, arg) SSL_CTX_ctrl((ctx), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) 5900Sstevel@tonic-gate #define SSL_set_msg_callback_arg(ssl, arg) SSL_ctrl((ssl), SSL_CTRL_SET_MSG_CALLBACK_ARG, 0, (arg)) 5910Sstevel@tonic-gate 5920Sstevel@tonic-gate 5930Sstevel@tonic-gate 5940Sstevel@tonic-gate #if defined(OPENSSL_SYS_MSDOS) && !defined(OPENSSL_SYS_WIN32) 5950Sstevel@tonic-gate #define SSL_MAX_CERT_LIST_DEFAULT 1024*30 /* 30k max cert list :-) */ 5960Sstevel@tonic-gate #else 5970Sstevel@tonic-gate #define SSL_MAX_CERT_LIST_DEFAULT 1024*100 /* 100k max cert list :-) */ 5980Sstevel@tonic-gate #endif 5990Sstevel@tonic-gate 6000Sstevel@tonic-gate #define SSL_SESSION_CACHE_MAX_SIZE_DEFAULT (1024*20) 6010Sstevel@tonic-gate 6020Sstevel@tonic-gate /* This callback type is used inside SSL_CTX, SSL, and in the functions that set 6030Sstevel@tonic-gate * them. It is used to override the generation of SSL/TLS session IDs in a 6040Sstevel@tonic-gate * server. Return value should be zero on an error, non-zero to proceed. Also, 6050Sstevel@tonic-gate * callbacks should themselves check if the id they generate is unique otherwise 6060Sstevel@tonic-gate * the SSL handshake will fail with an error - callbacks can do this using the 6070Sstevel@tonic-gate * 'ssl' value they're passed by; 6080Sstevel@tonic-gate * SSL_has_matching_session_id(ssl, id, *id_len) 6090Sstevel@tonic-gate * The length value passed in is set at the maximum size the session ID can be. 6100Sstevel@tonic-gate * In SSLv2 this is 16 bytes, whereas SSLv3/TLSv1 it is 32 bytes. The callback 6110Sstevel@tonic-gate * can alter this length to be less if desired, but under SSLv2 session IDs are 6120Sstevel@tonic-gate * supposed to be fixed at 16 bytes so the id will be padded after the callback 6130Sstevel@tonic-gate * returns in this case. It is also an error for the callback to set the size to 6140Sstevel@tonic-gate * zero. */ 6150Sstevel@tonic-gate typedef int (*GEN_SESSION_CB)(const SSL *ssl, unsigned char *id, 6160Sstevel@tonic-gate unsigned int *id_len); 6170Sstevel@tonic-gate 6180Sstevel@tonic-gate typedef struct ssl_comp_st 6190Sstevel@tonic-gate { 6200Sstevel@tonic-gate int id; 6212139Sjp161948 const char *name; 6220Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP 6230Sstevel@tonic-gate COMP_METHOD *method; 6240Sstevel@tonic-gate #else 6250Sstevel@tonic-gate char *method; 6260Sstevel@tonic-gate #endif 6270Sstevel@tonic-gate } SSL_COMP; 6280Sstevel@tonic-gate 6290Sstevel@tonic-gate DECLARE_STACK_OF(SSL_COMP) 6300Sstevel@tonic-gate 6310Sstevel@tonic-gate struct ssl_ctx_st 6320Sstevel@tonic-gate { 6330Sstevel@tonic-gate SSL_METHOD *method; 6340Sstevel@tonic-gate 6350Sstevel@tonic-gate STACK_OF(SSL_CIPHER) *cipher_list; 6360Sstevel@tonic-gate /* same as above but sorted for lookup */ 6370Sstevel@tonic-gate STACK_OF(SSL_CIPHER) *cipher_list_by_id; 6380Sstevel@tonic-gate 6390Sstevel@tonic-gate struct x509_store_st /* X509_STORE */ *cert_store; 6400Sstevel@tonic-gate struct lhash_st /* LHASH */ *sessions; /* a set of SSL_SESSIONs */ 6410Sstevel@tonic-gate /* Most session-ids that will be cached, default is 6420Sstevel@tonic-gate * SSL_SESSION_CACHE_MAX_SIZE_DEFAULT. 0 is unlimited. */ 6430Sstevel@tonic-gate unsigned long session_cache_size; 6440Sstevel@tonic-gate struct ssl_session_st *session_cache_head; 6450Sstevel@tonic-gate struct ssl_session_st *session_cache_tail; 6460Sstevel@tonic-gate 6470Sstevel@tonic-gate /* This can have one of 2 values, ored together, 6480Sstevel@tonic-gate * SSL_SESS_CACHE_CLIENT, 6490Sstevel@tonic-gate * SSL_SESS_CACHE_SERVER, 6500Sstevel@tonic-gate * Default is SSL_SESSION_CACHE_SERVER, which means only 6510Sstevel@tonic-gate * SSL_accept which cache SSL_SESSIONS. */ 6520Sstevel@tonic-gate int session_cache_mode; 6530Sstevel@tonic-gate 6540Sstevel@tonic-gate /* If timeout is not 0, it is the default timeout value set 6550Sstevel@tonic-gate * when SSL_new() is called. This has been put in to make 6560Sstevel@tonic-gate * life easier to set things up */ 6570Sstevel@tonic-gate long session_timeout; 6580Sstevel@tonic-gate 6590Sstevel@tonic-gate /* If this callback is not null, it will be called each 6600Sstevel@tonic-gate * time a session id is added to the cache. If this function 6610Sstevel@tonic-gate * returns 1, it means that the callback will do a 6620Sstevel@tonic-gate * SSL_SESSION_free() when it has finished using it. Otherwise, 6630Sstevel@tonic-gate * on 0, it means the callback has finished with it. 6640Sstevel@tonic-gate * If remove_session_cb is not null, it will be called when 6650Sstevel@tonic-gate * a session-id is removed from the cache. After the call, 6660Sstevel@tonic-gate * OpenSSL will SSL_SESSION_free() it. */ 6670Sstevel@tonic-gate int (*new_session_cb)(struct ssl_st *ssl,SSL_SESSION *sess); 6680Sstevel@tonic-gate void (*remove_session_cb)(struct ssl_ctx_st *ctx,SSL_SESSION *sess); 6690Sstevel@tonic-gate SSL_SESSION *(*get_session_cb)(struct ssl_st *ssl, 6700Sstevel@tonic-gate unsigned char *data,int len,int *copy); 6710Sstevel@tonic-gate 6720Sstevel@tonic-gate struct 6730Sstevel@tonic-gate { 6740Sstevel@tonic-gate int sess_connect; /* SSL new conn - started */ 6750Sstevel@tonic-gate int sess_connect_renegotiate;/* SSL reneg - requested */ 6760Sstevel@tonic-gate int sess_connect_good; /* SSL new conne/reneg - finished */ 6770Sstevel@tonic-gate int sess_accept; /* SSL new accept - started */ 6780Sstevel@tonic-gate int sess_accept_renegotiate;/* SSL reneg - requested */ 6790Sstevel@tonic-gate int sess_accept_good; /* SSL accept/reneg - finished */ 6800Sstevel@tonic-gate int sess_miss; /* session lookup misses */ 6810Sstevel@tonic-gate int sess_timeout; /* reuse attempt on timeouted session */ 6820Sstevel@tonic-gate int sess_cache_full; /* session removed due to full cache */ 6830Sstevel@tonic-gate int sess_hit; /* session reuse actually done */ 6840Sstevel@tonic-gate int sess_cb_hit; /* session-id that was not 6850Sstevel@tonic-gate * in the cache was 6860Sstevel@tonic-gate * passed back via the callback. This 6870Sstevel@tonic-gate * indicates that the application is 6880Sstevel@tonic-gate * supplying session-id's from other 6890Sstevel@tonic-gate * processes - spooky :-) */ 6900Sstevel@tonic-gate } stats; 6910Sstevel@tonic-gate 6920Sstevel@tonic-gate int references; 6930Sstevel@tonic-gate 6940Sstevel@tonic-gate /* if defined, these override the X509_verify_cert() calls */ 6950Sstevel@tonic-gate int (*app_verify_callback)(X509_STORE_CTX *, void *); 6960Sstevel@tonic-gate void *app_verify_arg; 6970Sstevel@tonic-gate /* before OpenSSL 0.9.7, 'app_verify_arg' was ignored 6980Sstevel@tonic-gate * ('app_verify_callback' was called with just one argument) */ 6990Sstevel@tonic-gate 7000Sstevel@tonic-gate /* Default password callback. */ 7010Sstevel@tonic-gate pem_password_cb *default_passwd_callback; 7020Sstevel@tonic-gate 7030Sstevel@tonic-gate /* Default password callback user data. */ 7040Sstevel@tonic-gate void *default_passwd_callback_userdata; 7050Sstevel@tonic-gate 7060Sstevel@tonic-gate /* get client cert callback */ 7070Sstevel@tonic-gate int (*client_cert_cb)(SSL *ssl, X509 **x509, EVP_PKEY **pkey); 7080Sstevel@tonic-gate 7092139Sjp161948 /* cookie generate callback */ 7102139Sjp161948 int (*app_gen_cookie_cb)(SSL *ssl, unsigned char *cookie, 7112139Sjp161948 unsigned int *cookie_len); 7122139Sjp161948 7132139Sjp161948 /* verify cookie callback */ 7142139Sjp161948 int (*app_verify_cookie_cb)(SSL *ssl, unsigned char *cookie, 7152139Sjp161948 unsigned int cookie_len); 7162139Sjp161948 7170Sstevel@tonic-gate CRYPTO_EX_DATA ex_data; 7180Sstevel@tonic-gate 7190Sstevel@tonic-gate const EVP_MD *rsa_md5;/* For SSLv2 - name is 'ssl2-md5' */ 7200Sstevel@tonic-gate const EVP_MD *md5; /* For SSLv3/TLSv1 'ssl3-md5' */ 7210Sstevel@tonic-gate const EVP_MD *sha1; /* For SSLv3/TLSv1 'ssl3->sha1' */ 7220Sstevel@tonic-gate 7230Sstevel@tonic-gate STACK_OF(X509) *extra_certs; 7240Sstevel@tonic-gate STACK_OF(SSL_COMP) *comp_methods; /* stack of SSL_COMP, SSLv3/TLSv1 */ 7250Sstevel@tonic-gate 7260Sstevel@tonic-gate 7270Sstevel@tonic-gate /* Default values used when no per-SSL value is defined follow */ 7280Sstevel@tonic-gate 7290Sstevel@tonic-gate void (*info_callback)(const SSL *ssl,int type,int val); /* used if SSL's info_callback is NULL */ 7300Sstevel@tonic-gate 7310Sstevel@tonic-gate /* what we put in client cert requests */ 7320Sstevel@tonic-gate STACK_OF(X509_NAME) *client_CA; 7330Sstevel@tonic-gate 7340Sstevel@tonic-gate 7350Sstevel@tonic-gate /* Default values to use in SSL structures follow (these are copied by SSL_new) */ 7360Sstevel@tonic-gate 7370Sstevel@tonic-gate unsigned long options; 7380Sstevel@tonic-gate unsigned long mode; 7390Sstevel@tonic-gate long max_cert_list; 7400Sstevel@tonic-gate 7410Sstevel@tonic-gate struct cert_st /* CERT */ *cert; 7420Sstevel@tonic-gate int read_ahead; 7430Sstevel@tonic-gate 7440Sstevel@tonic-gate /* callback that allows applications to peek at protocol messages */ 7450Sstevel@tonic-gate void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); 7460Sstevel@tonic-gate void *msg_callback_arg; 7470Sstevel@tonic-gate 7480Sstevel@tonic-gate int verify_mode; 7490Sstevel@tonic-gate unsigned int sid_ctx_length; 7500Sstevel@tonic-gate unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; 7510Sstevel@tonic-gate int (*default_verify_callback)(int ok,X509_STORE_CTX *ctx); /* called 'verify_callback' in the SSL */ 7520Sstevel@tonic-gate 7530Sstevel@tonic-gate /* Default generate session ID callback. */ 7540Sstevel@tonic-gate GEN_SESSION_CB generate_session_id; 7550Sstevel@tonic-gate 7562139Sjp161948 X509_VERIFY_PARAM *param; 7572139Sjp161948 7582139Sjp161948 #if 0 7590Sstevel@tonic-gate int purpose; /* Purpose setting */ 7600Sstevel@tonic-gate int trust; /* Trust setting */ 7612139Sjp161948 #endif 7620Sstevel@tonic-gate 7630Sstevel@tonic-gate int quiet_shutdown; 7640Sstevel@tonic-gate }; 7650Sstevel@tonic-gate 7660Sstevel@tonic-gate #define SSL_SESS_CACHE_OFF 0x0000 7670Sstevel@tonic-gate #define SSL_SESS_CACHE_CLIENT 0x0001 7680Sstevel@tonic-gate #define SSL_SESS_CACHE_SERVER 0x0002 7690Sstevel@tonic-gate #define SSL_SESS_CACHE_BOTH (SSL_SESS_CACHE_CLIENT|SSL_SESS_CACHE_SERVER) 7700Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_AUTO_CLEAR 0x0080 7710Sstevel@tonic-gate /* enough comments already ... see SSL_CTX_set_session_cache_mode(3) */ 7720Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP 0x0100 7730Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL_STORE 0x0200 7740Sstevel@tonic-gate #define SSL_SESS_CACHE_NO_INTERNAL \ 7750Sstevel@tonic-gate (SSL_SESS_CACHE_NO_INTERNAL_LOOKUP|SSL_SESS_CACHE_NO_INTERNAL_STORE) 7760Sstevel@tonic-gate 7770Sstevel@tonic-gate struct lhash_st *SSL_CTX_sessions(SSL_CTX *ctx); 7780Sstevel@tonic-gate #define SSL_CTX_sess_number(ctx) \ 7790Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_NUMBER,0,NULL) 7800Sstevel@tonic-gate #define SSL_CTX_sess_connect(ctx) \ 7810Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT,0,NULL) 7820Sstevel@tonic-gate #define SSL_CTX_sess_connect_good(ctx) \ 7830Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_GOOD,0,NULL) 7840Sstevel@tonic-gate #define SSL_CTX_sess_connect_renegotiate(ctx) \ 7850Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CONNECT_RENEGOTIATE,0,NULL) 7860Sstevel@tonic-gate #define SSL_CTX_sess_accept(ctx) \ 7870Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT,0,NULL) 7880Sstevel@tonic-gate #define SSL_CTX_sess_accept_renegotiate(ctx) \ 7890Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_RENEGOTIATE,0,NULL) 7900Sstevel@tonic-gate #define SSL_CTX_sess_accept_good(ctx) \ 7910Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_ACCEPT_GOOD,0,NULL) 7920Sstevel@tonic-gate #define SSL_CTX_sess_hits(ctx) \ 7930Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_HIT,0,NULL) 7940Sstevel@tonic-gate #define SSL_CTX_sess_cb_hits(ctx) \ 7950Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CB_HIT,0,NULL) 7960Sstevel@tonic-gate #define SSL_CTX_sess_misses(ctx) \ 7970Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_MISSES,0,NULL) 7980Sstevel@tonic-gate #define SSL_CTX_sess_timeouts(ctx) \ 7990Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_TIMEOUTS,0,NULL) 8000Sstevel@tonic-gate #define SSL_CTX_sess_cache_full(ctx) \ 8010Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SESS_CACHE_FULL,0,NULL) 8020Sstevel@tonic-gate 8030Sstevel@tonic-gate #define SSL_CTX_sess_set_new_cb(ctx,cb) ((ctx)->new_session_cb=(cb)) 8040Sstevel@tonic-gate #define SSL_CTX_sess_get_new_cb(ctx) ((ctx)->new_session_cb) 8050Sstevel@tonic-gate #define SSL_CTX_sess_set_remove_cb(ctx,cb) ((ctx)->remove_session_cb=(cb)) 8060Sstevel@tonic-gate #define SSL_CTX_sess_get_remove_cb(ctx) ((ctx)->remove_session_cb) 8070Sstevel@tonic-gate #define SSL_CTX_sess_set_get_cb(ctx,cb) ((ctx)->get_session_cb=(cb)) 8080Sstevel@tonic-gate #define SSL_CTX_sess_get_get_cb(ctx) ((ctx)->get_session_cb) 8090Sstevel@tonic-gate #define SSL_CTX_set_info_callback(ctx,cb) ((ctx)->info_callback=(cb)) 8100Sstevel@tonic-gate #define SSL_CTX_get_info_callback(ctx) ((ctx)->info_callback) 8110Sstevel@tonic-gate #define SSL_CTX_set_client_cert_cb(ctx,cb) ((ctx)->client_cert_cb=(cb)) 8120Sstevel@tonic-gate #define SSL_CTX_get_client_cert_cb(ctx) ((ctx)->client_cert_cb) 8132139Sjp161948 #define SSL_CTX_set_cookie_generate_cb(ctx,cb) ((ctx)->app_gen_cookie_cb=(cb)) 8142139Sjp161948 #define SSL_CTX_set_cookie_verify_cb(ctx,cb) ((ctx)->app_verify_cookie_cb=(cb)) 8150Sstevel@tonic-gate 8160Sstevel@tonic-gate #define SSL_NOTHING 1 8170Sstevel@tonic-gate #define SSL_WRITING 2 8180Sstevel@tonic-gate #define SSL_READING 3 8190Sstevel@tonic-gate #define SSL_X509_LOOKUP 4 8200Sstevel@tonic-gate 8210Sstevel@tonic-gate /* These will only be used when doing non-blocking IO */ 8220Sstevel@tonic-gate #define SSL_want_nothing(s) (SSL_want(s) == SSL_NOTHING) 8230Sstevel@tonic-gate #define SSL_want_read(s) (SSL_want(s) == SSL_READING) 8240Sstevel@tonic-gate #define SSL_want_write(s) (SSL_want(s) == SSL_WRITING) 8250Sstevel@tonic-gate #define SSL_want_x509_lookup(s) (SSL_want(s) == SSL_X509_LOOKUP) 8260Sstevel@tonic-gate 8270Sstevel@tonic-gate struct ssl_st 8280Sstevel@tonic-gate { 8290Sstevel@tonic-gate /* protocol version 8302139Sjp161948 * (one of SSL2_VERSION, SSL3_VERSION, TLS1_VERSION, DTLS1_VERSION) 8310Sstevel@tonic-gate */ 8320Sstevel@tonic-gate int version; 8330Sstevel@tonic-gate int type; /* SSL_ST_CONNECT or SSL_ST_ACCEPT */ 8340Sstevel@tonic-gate 8350Sstevel@tonic-gate SSL_METHOD *method; /* SSLv3 */ 8360Sstevel@tonic-gate 8370Sstevel@tonic-gate /* There are 2 BIO's even though they are normally both the 8380Sstevel@tonic-gate * same. This is so data can be read and written to different 8390Sstevel@tonic-gate * handlers */ 8400Sstevel@tonic-gate 8410Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 8420Sstevel@tonic-gate BIO *rbio; /* used by SSL_read */ 8430Sstevel@tonic-gate BIO *wbio; /* used by SSL_write */ 8440Sstevel@tonic-gate BIO *bbio; /* used during session-id reuse to concatenate 8450Sstevel@tonic-gate * messages */ 8460Sstevel@tonic-gate #else 8470Sstevel@tonic-gate char *rbio; /* used by SSL_read */ 8480Sstevel@tonic-gate char *wbio; /* used by SSL_write */ 8490Sstevel@tonic-gate char *bbio; 8500Sstevel@tonic-gate #endif 8510Sstevel@tonic-gate /* This holds a variable that indicates what we were doing 8520Sstevel@tonic-gate * when a 0 or -1 is returned. This is needed for 8530Sstevel@tonic-gate * non-blocking IO so we know what request needs re-doing when 8540Sstevel@tonic-gate * in SSL_accept or SSL_connect */ 8550Sstevel@tonic-gate int rwstate; 8560Sstevel@tonic-gate 8570Sstevel@tonic-gate /* true when we are actually in SSL_accept() or SSL_connect() */ 8580Sstevel@tonic-gate int in_handshake; 8592139Sjp161948 int (*handshake_func)(SSL *); 8600Sstevel@tonic-gate 8610Sstevel@tonic-gate /* Imagine that here's a boolean member "init" that is 8620Sstevel@tonic-gate * switched as soon as SSL_set_{accept/connect}_state 8630Sstevel@tonic-gate * is called for the first time, so that "state" and 8640Sstevel@tonic-gate * "handshake_func" are properly initialized. But as 8650Sstevel@tonic-gate * handshake_func is == 0 until then, we use this 8660Sstevel@tonic-gate * test instead of an "init" member. 8670Sstevel@tonic-gate */ 8680Sstevel@tonic-gate 8690Sstevel@tonic-gate int server; /* are we the server side? - mostly used by SSL_clear*/ 8700Sstevel@tonic-gate 8710Sstevel@tonic-gate int new_session;/* 1 if we are to use a new session. 8720Sstevel@tonic-gate * 2 if we are a server and are inside a handshake 8730Sstevel@tonic-gate * (i.e. not just sending a HelloRequest) 8740Sstevel@tonic-gate * NB: For servers, the 'new' session may actually be a previously 8750Sstevel@tonic-gate * cached session or even the previous session unless 8760Sstevel@tonic-gate * SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION is set */ 8770Sstevel@tonic-gate int quiet_shutdown;/* don't send shutdown packets */ 8780Sstevel@tonic-gate int shutdown; /* we have shut things down, 0x01 sent, 0x02 8790Sstevel@tonic-gate * for received */ 8800Sstevel@tonic-gate int state; /* where we are */ 8810Sstevel@tonic-gate int rstate; /* where we are when reading */ 8820Sstevel@tonic-gate 8830Sstevel@tonic-gate BUF_MEM *init_buf; /* buffer used during init */ 8840Sstevel@tonic-gate void *init_msg; /* pointer to handshake message body, set by ssl3_get_message() */ 8850Sstevel@tonic-gate int init_num; /* amount read/written */ 8860Sstevel@tonic-gate int init_off; /* amount read/written */ 8870Sstevel@tonic-gate 8880Sstevel@tonic-gate /* used internally to point at a raw packet */ 8890Sstevel@tonic-gate unsigned char *packet; 8900Sstevel@tonic-gate unsigned int packet_length; 8910Sstevel@tonic-gate 8920Sstevel@tonic-gate struct ssl2_state_st *s2; /* SSLv2 variables */ 8930Sstevel@tonic-gate struct ssl3_state_st *s3; /* SSLv3 variables */ 8942139Sjp161948 struct dtls1_state_st *d1; /* DTLSv1 variables */ 8950Sstevel@tonic-gate 8960Sstevel@tonic-gate int read_ahead; /* Read as many input bytes as possible 8970Sstevel@tonic-gate * (for non-blocking reads) */ 8980Sstevel@tonic-gate 8990Sstevel@tonic-gate /* callback that allows applications to peek at protocol messages */ 9000Sstevel@tonic-gate void (*msg_callback)(int write_p, int version, int content_type, const void *buf, size_t len, SSL *ssl, void *arg); 9010Sstevel@tonic-gate void *msg_callback_arg; 9020Sstevel@tonic-gate 9030Sstevel@tonic-gate int hit; /* reusing a previous session */ 9040Sstevel@tonic-gate 9052139Sjp161948 X509_VERIFY_PARAM *param; 9062139Sjp161948 9072139Sjp161948 #if 0 9080Sstevel@tonic-gate int purpose; /* Purpose setting */ 9090Sstevel@tonic-gate int trust; /* Trust setting */ 9102139Sjp161948 #endif 9110Sstevel@tonic-gate 9120Sstevel@tonic-gate /* crypto */ 9130Sstevel@tonic-gate STACK_OF(SSL_CIPHER) *cipher_list; 9140Sstevel@tonic-gate STACK_OF(SSL_CIPHER) *cipher_list_by_id; 9150Sstevel@tonic-gate 9160Sstevel@tonic-gate /* These are the ones being used, the ones in SSL_SESSION are 9170Sstevel@tonic-gate * the ones to be 'copied' into these ones */ 9180Sstevel@tonic-gate 9190Sstevel@tonic-gate EVP_CIPHER_CTX *enc_read_ctx; /* cryptographic state */ 9200Sstevel@tonic-gate const EVP_MD *read_hash; /* used for mac generation */ 9210Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP 9220Sstevel@tonic-gate COMP_CTX *expand; /* uncompress */ 9230Sstevel@tonic-gate #else 9240Sstevel@tonic-gate char *expand; 9250Sstevel@tonic-gate #endif 9260Sstevel@tonic-gate 9270Sstevel@tonic-gate EVP_CIPHER_CTX *enc_write_ctx; /* cryptographic state */ 9280Sstevel@tonic-gate const EVP_MD *write_hash; /* used for mac generation */ 9290Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP 9300Sstevel@tonic-gate COMP_CTX *compress; /* compression */ 9310Sstevel@tonic-gate #else 9320Sstevel@tonic-gate char *compress; 9330Sstevel@tonic-gate #endif 9340Sstevel@tonic-gate 9350Sstevel@tonic-gate /* session info */ 9360Sstevel@tonic-gate 9370Sstevel@tonic-gate /* client cert? */ 9380Sstevel@tonic-gate /* This is used to hold the server certificate used */ 9390Sstevel@tonic-gate struct cert_st /* CERT */ *cert; 9400Sstevel@tonic-gate 9410Sstevel@tonic-gate /* the session_id_context is used to ensure sessions are only reused 9420Sstevel@tonic-gate * in the appropriate context */ 9430Sstevel@tonic-gate unsigned int sid_ctx_length; 9440Sstevel@tonic-gate unsigned char sid_ctx[SSL_MAX_SID_CTX_LENGTH]; 9450Sstevel@tonic-gate 9460Sstevel@tonic-gate /* This can also be in the session once a session is established */ 9470Sstevel@tonic-gate SSL_SESSION *session; 9480Sstevel@tonic-gate 9490Sstevel@tonic-gate /* Default generate session ID callback. */ 9500Sstevel@tonic-gate GEN_SESSION_CB generate_session_id; 9510Sstevel@tonic-gate 9520Sstevel@tonic-gate /* Used in SSL2 and SSL3 */ 9530Sstevel@tonic-gate int verify_mode; /* 0 don't care about verify failure. 9540Sstevel@tonic-gate * 1 fail if verify fails */ 9550Sstevel@tonic-gate int (*verify_callback)(int ok,X509_STORE_CTX *ctx); /* fail if callback returns 0 */ 9560Sstevel@tonic-gate 9570Sstevel@tonic-gate void (*info_callback)(const SSL *ssl,int type,int val); /* optional informational callback */ 9580Sstevel@tonic-gate 9590Sstevel@tonic-gate int error; /* error bytes to be written */ 9600Sstevel@tonic-gate int error_code; /* actual code */ 9610Sstevel@tonic-gate 9620Sstevel@tonic-gate #ifndef OPENSSL_NO_KRB5 9630Sstevel@tonic-gate KSSL_CTX *kssl_ctx; /* Kerberos 5 context */ 9640Sstevel@tonic-gate #endif /* OPENSSL_NO_KRB5 */ 9650Sstevel@tonic-gate 9660Sstevel@tonic-gate SSL_CTX *ctx; 9670Sstevel@tonic-gate /* set this flag to 1 and a sleep(1) is put into all SSL_read() 9680Sstevel@tonic-gate * and SSL_write() calls, good for nbio debuging :-) */ 9690Sstevel@tonic-gate int debug; 9700Sstevel@tonic-gate 9710Sstevel@tonic-gate /* extra application data */ 9720Sstevel@tonic-gate long verify_result; 9730Sstevel@tonic-gate CRYPTO_EX_DATA ex_data; 9740Sstevel@tonic-gate 9750Sstevel@tonic-gate /* for server side, keep the list of CA_dn we can use */ 9760Sstevel@tonic-gate STACK_OF(X509_NAME) *client_CA; 9770Sstevel@tonic-gate 9780Sstevel@tonic-gate int references; 9790Sstevel@tonic-gate unsigned long options; /* protocol behaviour */ 9800Sstevel@tonic-gate unsigned long mode; /* API behaviour */ 9810Sstevel@tonic-gate long max_cert_list; 9820Sstevel@tonic-gate int first_packet; 9830Sstevel@tonic-gate int client_version; /* what was passed, used for 9840Sstevel@tonic-gate * SSLv3/TLS rollback check */ 9850Sstevel@tonic-gate }; 9860Sstevel@tonic-gate 9870Sstevel@tonic-gate #ifdef __cplusplus 9880Sstevel@tonic-gate } 9890Sstevel@tonic-gate #endif 9900Sstevel@tonic-gate 9910Sstevel@tonic-gate #include <openssl/ssl2.h> 9920Sstevel@tonic-gate #include <openssl/ssl3.h> 9930Sstevel@tonic-gate #include <openssl/tls1.h> /* This is mostly sslv3 with a few tweaks */ 9942139Sjp161948 #include <openssl/dtls1.h> /* Datagram TLS */ 9950Sstevel@tonic-gate #include <openssl/ssl23.h> 9960Sstevel@tonic-gate 9970Sstevel@tonic-gate #ifdef __cplusplus 9980Sstevel@tonic-gate extern "C" { 9990Sstevel@tonic-gate #endif 10000Sstevel@tonic-gate 10010Sstevel@tonic-gate /* compatibility */ 10020Sstevel@tonic-gate #define SSL_set_app_data(s,arg) (SSL_set_ex_data(s,0,(char *)arg)) 10030Sstevel@tonic-gate #define SSL_get_app_data(s) (SSL_get_ex_data(s,0)) 10040Sstevel@tonic-gate #define SSL_SESSION_set_app_data(s,a) (SSL_SESSION_set_ex_data(s,0,(char *)a)) 10050Sstevel@tonic-gate #define SSL_SESSION_get_app_data(s) (SSL_SESSION_get_ex_data(s,0)) 10060Sstevel@tonic-gate #define SSL_CTX_get_app_data(ctx) (SSL_CTX_get_ex_data(ctx,0)) 10070Sstevel@tonic-gate #define SSL_CTX_set_app_data(ctx,arg) (SSL_CTX_set_ex_data(ctx,0,(char *)arg)) 10080Sstevel@tonic-gate 10090Sstevel@tonic-gate /* The following are the possible values for ssl->state are are 10100Sstevel@tonic-gate * used to indicate where we are up to in the SSL connection establishment. 10110Sstevel@tonic-gate * The macros that follow are about the only things you should need to use 10120Sstevel@tonic-gate * and even then, only when using non-blocking IO. 10130Sstevel@tonic-gate * It can also be useful to work out where you were when the connection 10140Sstevel@tonic-gate * failed */ 10150Sstevel@tonic-gate 10160Sstevel@tonic-gate #define SSL_ST_CONNECT 0x1000 10170Sstevel@tonic-gate #define SSL_ST_ACCEPT 0x2000 10180Sstevel@tonic-gate #define SSL_ST_MASK 0x0FFF 10190Sstevel@tonic-gate #define SSL_ST_INIT (SSL_ST_CONNECT|SSL_ST_ACCEPT) 10200Sstevel@tonic-gate #define SSL_ST_BEFORE 0x4000 10210Sstevel@tonic-gate #define SSL_ST_OK 0x03 10220Sstevel@tonic-gate #define SSL_ST_RENEGOTIATE (0x04|SSL_ST_INIT) 10230Sstevel@tonic-gate 10240Sstevel@tonic-gate #define SSL_CB_LOOP 0x01 10250Sstevel@tonic-gate #define SSL_CB_EXIT 0x02 10260Sstevel@tonic-gate #define SSL_CB_READ 0x04 10270Sstevel@tonic-gate #define SSL_CB_WRITE 0x08 10280Sstevel@tonic-gate #define SSL_CB_ALERT 0x4000 /* used in callback */ 10290Sstevel@tonic-gate #define SSL_CB_READ_ALERT (SSL_CB_ALERT|SSL_CB_READ) 10300Sstevel@tonic-gate #define SSL_CB_WRITE_ALERT (SSL_CB_ALERT|SSL_CB_WRITE) 10310Sstevel@tonic-gate #define SSL_CB_ACCEPT_LOOP (SSL_ST_ACCEPT|SSL_CB_LOOP) 10320Sstevel@tonic-gate #define SSL_CB_ACCEPT_EXIT (SSL_ST_ACCEPT|SSL_CB_EXIT) 10330Sstevel@tonic-gate #define SSL_CB_CONNECT_LOOP (SSL_ST_CONNECT|SSL_CB_LOOP) 10340Sstevel@tonic-gate #define SSL_CB_CONNECT_EXIT (SSL_ST_CONNECT|SSL_CB_EXIT) 10350Sstevel@tonic-gate #define SSL_CB_HANDSHAKE_START 0x10 10360Sstevel@tonic-gate #define SSL_CB_HANDSHAKE_DONE 0x20 10370Sstevel@tonic-gate 10380Sstevel@tonic-gate /* Is the SSL_connection established? */ 10390Sstevel@tonic-gate #define SSL_get_state(a) SSL_state(a) 10400Sstevel@tonic-gate #define SSL_is_init_finished(a) (SSL_state(a) == SSL_ST_OK) 10410Sstevel@tonic-gate #define SSL_in_init(a) (SSL_state(a)&SSL_ST_INIT) 10420Sstevel@tonic-gate #define SSL_in_before(a) (SSL_state(a)&SSL_ST_BEFORE) 10430Sstevel@tonic-gate #define SSL_in_connect_init(a) (SSL_state(a)&SSL_ST_CONNECT) 10440Sstevel@tonic-gate #define SSL_in_accept_init(a) (SSL_state(a)&SSL_ST_ACCEPT) 10450Sstevel@tonic-gate 10460Sstevel@tonic-gate /* The following 2 states are kept in ssl->rstate when reads fail, 10470Sstevel@tonic-gate * you should not need these */ 10480Sstevel@tonic-gate #define SSL_ST_READ_HEADER 0xF0 10490Sstevel@tonic-gate #define SSL_ST_READ_BODY 0xF1 10500Sstevel@tonic-gate #define SSL_ST_READ_DONE 0xF2 10510Sstevel@tonic-gate 10520Sstevel@tonic-gate /* Obtain latest Finished message 10530Sstevel@tonic-gate * -- that we sent (SSL_get_finished) 10540Sstevel@tonic-gate * -- that we expected from peer (SSL_get_peer_finished). 10550Sstevel@tonic-gate * Returns length (0 == no Finished so far), copies up to 'count' bytes. */ 10562139Sjp161948 size_t SSL_get_finished(const SSL *s, void *buf, size_t count); 10572139Sjp161948 size_t SSL_get_peer_finished(const SSL *s, void *buf, size_t count); 10580Sstevel@tonic-gate 10590Sstevel@tonic-gate /* use either SSL_VERIFY_NONE or SSL_VERIFY_PEER, the last 2 options 10600Sstevel@tonic-gate * are 'ored' with SSL_VERIFY_PEER if they are desired */ 10610Sstevel@tonic-gate #define SSL_VERIFY_NONE 0x00 10620Sstevel@tonic-gate #define SSL_VERIFY_PEER 0x01 10630Sstevel@tonic-gate #define SSL_VERIFY_FAIL_IF_NO_PEER_CERT 0x02 10640Sstevel@tonic-gate #define SSL_VERIFY_CLIENT_ONCE 0x04 10650Sstevel@tonic-gate 10660Sstevel@tonic-gate #define OpenSSL_add_ssl_algorithms() SSL_library_init() 10670Sstevel@tonic-gate #define SSLeay_add_ssl_algorithms() SSL_library_init() 10680Sstevel@tonic-gate 10690Sstevel@tonic-gate /* this is for backward compatibility */ 10700Sstevel@tonic-gate #if 0 /* NEW_SSLEAY */ 10710Sstevel@tonic-gate #define SSL_CTX_set_default_verify(a,b,c) SSL_CTX_set_verify(a,b,c) 10720Sstevel@tonic-gate #define SSL_set_pref_cipher(c,n) SSL_set_cipher_list(c,n) 10730Sstevel@tonic-gate #define SSL_add_session(a,b) SSL_CTX_add_session((a),(b)) 10740Sstevel@tonic-gate #define SSL_remove_session(a,b) SSL_CTX_remove_session((a),(b)) 10750Sstevel@tonic-gate #define SSL_flush_sessions(a,b) SSL_CTX_flush_sessions((a),(b)) 10760Sstevel@tonic-gate #endif 10770Sstevel@tonic-gate /* More backward compatibility */ 10780Sstevel@tonic-gate #define SSL_get_cipher(s) \ 10790Sstevel@tonic-gate SSL_CIPHER_get_name(SSL_get_current_cipher(s)) 10800Sstevel@tonic-gate #define SSL_get_cipher_bits(s,np) \ 10810Sstevel@tonic-gate SSL_CIPHER_get_bits(SSL_get_current_cipher(s),np) 10820Sstevel@tonic-gate #define SSL_get_cipher_version(s) \ 10830Sstevel@tonic-gate SSL_CIPHER_get_version(SSL_get_current_cipher(s)) 10840Sstevel@tonic-gate #define SSL_get_cipher_name(s) \ 10850Sstevel@tonic-gate SSL_CIPHER_get_name(SSL_get_current_cipher(s)) 10860Sstevel@tonic-gate #define SSL_get_time(a) SSL_SESSION_get_time(a) 10870Sstevel@tonic-gate #define SSL_set_time(a,b) SSL_SESSION_set_time((a),(b)) 10880Sstevel@tonic-gate #define SSL_get_timeout(a) SSL_SESSION_get_timeout(a) 10890Sstevel@tonic-gate #define SSL_set_timeout(a,b) SSL_SESSION_set_timeout((a),(b)) 10900Sstevel@tonic-gate 10910Sstevel@tonic-gate #if 1 /*SSLEAY_MACROS*/ 10922139Sjp161948 #define d2i_SSL_SESSION_bio(bp,s_id) ASN1_d2i_bio_of(SSL_SESSION,SSL_SESSION_new,d2i_SSL_SESSION,bp,s_id) 10932139Sjp161948 #define i2d_SSL_SESSION_bio(bp,s_id) ASN1_i2d_bio_of(SSL_SESSION,i2d_SSL_SESSION,bp,s_id) 10940Sstevel@tonic-gate #define PEM_read_SSL_SESSION(fp,x,cb,u) (SSL_SESSION *)PEM_ASN1_read( \ 10950Sstevel@tonic-gate (char *(*)())d2i_SSL_SESSION,PEM_STRING_SSL_SESSION,fp,(char **)x,cb,u) 10962139Sjp161948 #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) 10970Sstevel@tonic-gate #define PEM_write_SSL_SESSION(fp,x) \ 10980Sstevel@tonic-gate PEM_ASN1_write((int (*)())i2d_SSL_SESSION, \ 10990Sstevel@tonic-gate PEM_STRING_SSL_SESSION,fp, (char *)x, NULL,NULL,0,NULL,NULL) 11000Sstevel@tonic-gate #define PEM_write_bio_SSL_SESSION(bp,x) \ 11012139Sjp161948 PEM_ASN1_write_bio_of(SSL_SESSION,i2d_SSL_SESSION,PEM_STRING_SSL_SESSION,bp,x,NULL,NULL,0,NULL,NULL) 11020Sstevel@tonic-gate #endif 11030Sstevel@tonic-gate 11040Sstevel@tonic-gate #define SSL_AD_REASON_OFFSET 1000 11050Sstevel@tonic-gate /* These alert types are for SSLv3 and TLSv1 */ 11060Sstevel@tonic-gate #define SSL_AD_CLOSE_NOTIFY SSL3_AD_CLOSE_NOTIFY 11070Sstevel@tonic-gate #define SSL_AD_UNEXPECTED_MESSAGE SSL3_AD_UNEXPECTED_MESSAGE /* fatal */ 11080Sstevel@tonic-gate #define SSL_AD_BAD_RECORD_MAC SSL3_AD_BAD_RECORD_MAC /* fatal */ 11090Sstevel@tonic-gate #define SSL_AD_DECRYPTION_FAILED TLS1_AD_DECRYPTION_FAILED 11100Sstevel@tonic-gate #define SSL_AD_RECORD_OVERFLOW TLS1_AD_RECORD_OVERFLOW 11110Sstevel@tonic-gate #define SSL_AD_DECOMPRESSION_FAILURE SSL3_AD_DECOMPRESSION_FAILURE/* fatal */ 11120Sstevel@tonic-gate #define SSL_AD_HANDSHAKE_FAILURE SSL3_AD_HANDSHAKE_FAILURE/* fatal */ 11130Sstevel@tonic-gate #define SSL_AD_NO_CERTIFICATE SSL3_AD_NO_CERTIFICATE /* Not for TLS */ 11140Sstevel@tonic-gate #define SSL_AD_BAD_CERTIFICATE SSL3_AD_BAD_CERTIFICATE 11150Sstevel@tonic-gate #define SSL_AD_UNSUPPORTED_CERTIFICATE SSL3_AD_UNSUPPORTED_CERTIFICATE 11160Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_REVOKED SSL3_AD_CERTIFICATE_REVOKED 11170Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_EXPIRED SSL3_AD_CERTIFICATE_EXPIRED 11180Sstevel@tonic-gate #define SSL_AD_CERTIFICATE_UNKNOWN SSL3_AD_CERTIFICATE_UNKNOWN 11190Sstevel@tonic-gate #define SSL_AD_ILLEGAL_PARAMETER SSL3_AD_ILLEGAL_PARAMETER /* fatal */ 11200Sstevel@tonic-gate #define SSL_AD_UNKNOWN_CA TLS1_AD_UNKNOWN_CA /* fatal */ 11210Sstevel@tonic-gate #define SSL_AD_ACCESS_DENIED TLS1_AD_ACCESS_DENIED /* fatal */ 11220Sstevel@tonic-gate #define SSL_AD_DECODE_ERROR TLS1_AD_DECODE_ERROR /* fatal */ 11230Sstevel@tonic-gate #define SSL_AD_DECRYPT_ERROR TLS1_AD_DECRYPT_ERROR 11240Sstevel@tonic-gate #define SSL_AD_EXPORT_RESTRICTION TLS1_AD_EXPORT_RESTRICTION/* fatal */ 11250Sstevel@tonic-gate #define SSL_AD_PROTOCOL_VERSION TLS1_AD_PROTOCOL_VERSION /* fatal */ 11260Sstevel@tonic-gate #define SSL_AD_INSUFFICIENT_SECURITY TLS1_AD_INSUFFICIENT_SECURITY/* fatal */ 11270Sstevel@tonic-gate #define SSL_AD_INTERNAL_ERROR TLS1_AD_INTERNAL_ERROR /* fatal */ 11280Sstevel@tonic-gate #define SSL_AD_USER_CANCELLED TLS1_AD_USER_CANCELLED 11290Sstevel@tonic-gate #define SSL_AD_NO_RENEGOTIATION TLS1_AD_NO_RENEGOTIATION 11300Sstevel@tonic-gate 11310Sstevel@tonic-gate #define SSL_ERROR_NONE 0 11320Sstevel@tonic-gate #define SSL_ERROR_SSL 1 11330Sstevel@tonic-gate #define SSL_ERROR_WANT_READ 2 11340Sstevel@tonic-gate #define SSL_ERROR_WANT_WRITE 3 11350Sstevel@tonic-gate #define SSL_ERROR_WANT_X509_LOOKUP 4 11360Sstevel@tonic-gate #define SSL_ERROR_SYSCALL 5 /* look at error stack/return value/errno */ 11370Sstevel@tonic-gate #define SSL_ERROR_ZERO_RETURN 6 11380Sstevel@tonic-gate #define SSL_ERROR_WANT_CONNECT 7 11390Sstevel@tonic-gate #define SSL_ERROR_WANT_ACCEPT 8 11400Sstevel@tonic-gate 11410Sstevel@tonic-gate #define SSL_CTRL_NEED_TMP_RSA 1 11420Sstevel@tonic-gate #define SSL_CTRL_SET_TMP_RSA 2 11430Sstevel@tonic-gate #define SSL_CTRL_SET_TMP_DH 3 11442139Sjp161948 #define SSL_CTRL_SET_TMP_ECDH 4 11452139Sjp161948 #define SSL_CTRL_SET_TMP_RSA_CB 5 11462139Sjp161948 #define SSL_CTRL_SET_TMP_DH_CB 6 11472139Sjp161948 #define SSL_CTRL_SET_TMP_ECDH_CB 7 11480Sstevel@tonic-gate 11492139Sjp161948 #define SSL_CTRL_GET_SESSION_REUSED 8 11502139Sjp161948 #define SSL_CTRL_GET_CLIENT_CERT_REQUEST 9 11512139Sjp161948 #define SSL_CTRL_GET_NUM_RENEGOTIATIONS 10 11522139Sjp161948 #define SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS 11 11532139Sjp161948 #define SSL_CTRL_GET_TOTAL_RENEGOTIATIONS 12 11542139Sjp161948 #define SSL_CTRL_GET_FLAGS 13 11552139Sjp161948 #define SSL_CTRL_EXTRA_CHAIN_CERT 14 11560Sstevel@tonic-gate 11572139Sjp161948 #define SSL_CTRL_SET_MSG_CALLBACK 15 11582139Sjp161948 #define SSL_CTRL_SET_MSG_CALLBACK_ARG 16 11590Sstevel@tonic-gate 11602139Sjp161948 /* only applies to datagram connections */ 11612139Sjp161948 #define SSL_CTRL_SET_MTU 17 11620Sstevel@tonic-gate /* Stats */ 11630Sstevel@tonic-gate #define SSL_CTRL_SESS_NUMBER 20 11640Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT 21 11650Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT_GOOD 22 11660Sstevel@tonic-gate #define SSL_CTRL_SESS_CONNECT_RENEGOTIATE 23 11670Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT 24 11680Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT_GOOD 25 11690Sstevel@tonic-gate #define SSL_CTRL_SESS_ACCEPT_RENEGOTIATE 26 11700Sstevel@tonic-gate #define SSL_CTRL_SESS_HIT 27 11710Sstevel@tonic-gate #define SSL_CTRL_SESS_CB_HIT 28 11720Sstevel@tonic-gate #define SSL_CTRL_SESS_MISSES 29 11730Sstevel@tonic-gate #define SSL_CTRL_SESS_TIMEOUTS 30 11740Sstevel@tonic-gate #define SSL_CTRL_SESS_CACHE_FULL 31 11750Sstevel@tonic-gate #define SSL_CTRL_OPTIONS 32 11760Sstevel@tonic-gate #define SSL_CTRL_MODE 33 11770Sstevel@tonic-gate 11780Sstevel@tonic-gate #define SSL_CTRL_GET_READ_AHEAD 40 11790Sstevel@tonic-gate #define SSL_CTRL_SET_READ_AHEAD 41 11800Sstevel@tonic-gate #define SSL_CTRL_SET_SESS_CACHE_SIZE 42 11810Sstevel@tonic-gate #define SSL_CTRL_GET_SESS_CACHE_SIZE 43 11820Sstevel@tonic-gate #define SSL_CTRL_SET_SESS_CACHE_MODE 44 11830Sstevel@tonic-gate #define SSL_CTRL_GET_SESS_CACHE_MODE 45 11840Sstevel@tonic-gate 11850Sstevel@tonic-gate #define SSL_CTRL_GET_MAX_CERT_LIST 50 11860Sstevel@tonic-gate #define SSL_CTRL_SET_MAX_CERT_LIST 51 11870Sstevel@tonic-gate 11880Sstevel@tonic-gate #define SSL_session_reused(ssl) \ 11890Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_GET_SESSION_REUSED,0,NULL) 11900Sstevel@tonic-gate #define SSL_num_renegotiations(ssl) \ 11910Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_GET_NUM_RENEGOTIATIONS,0,NULL) 11920Sstevel@tonic-gate #define SSL_clear_num_renegotiations(ssl) \ 11930Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_CLEAR_NUM_RENEGOTIATIONS,0,NULL) 11940Sstevel@tonic-gate #define SSL_total_renegotiations(ssl) \ 11950Sstevel@tonic-gate SSL_ctrl((ssl),SSL_CTRL_GET_TOTAL_RENEGOTIATIONS,0,NULL) 11960Sstevel@tonic-gate 11970Sstevel@tonic-gate #define SSL_CTX_need_tmp_RSA(ctx) \ 11980Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_NEED_TMP_RSA,0,NULL) 11990Sstevel@tonic-gate #define SSL_CTX_set_tmp_rsa(ctx,rsa) \ 12000Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) 12010Sstevel@tonic-gate #define SSL_CTX_set_tmp_dh(ctx,dh) \ 12020Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_DH,0,(char *)dh) 12032139Sjp161948 #define SSL_CTX_set_tmp_ecdh(ctx,ecdh) \ 12042139Sjp161948 SSL_CTX_ctrl(ctx,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) 12050Sstevel@tonic-gate 12060Sstevel@tonic-gate #define SSL_need_tmp_RSA(ssl) \ 12070Sstevel@tonic-gate SSL_ctrl(ssl,SSL_CTRL_NEED_TMP_RSA,0,NULL) 12080Sstevel@tonic-gate #define SSL_set_tmp_rsa(ssl,rsa) \ 12090Sstevel@tonic-gate SSL_ctrl(ssl,SSL_CTRL_SET_TMP_RSA,0,(char *)rsa) 12100Sstevel@tonic-gate #define SSL_set_tmp_dh(ssl,dh) \ 12110Sstevel@tonic-gate SSL_ctrl(ssl,SSL_CTRL_SET_TMP_DH,0,(char *)dh) 12122139Sjp161948 #define SSL_set_tmp_ecdh(ssl,ecdh) \ 12132139Sjp161948 SSL_ctrl(ssl,SSL_CTRL_SET_TMP_ECDH,0,(char *)ecdh) 12140Sstevel@tonic-gate 12150Sstevel@tonic-gate #define SSL_CTX_add_extra_chain_cert(ctx,x509) \ 12160Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_EXTRA_CHAIN_CERT,0,(char *)x509) 12170Sstevel@tonic-gate 12180Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 12190Sstevel@tonic-gate BIO_METHOD *BIO_f_ssl(void); 12200Sstevel@tonic-gate BIO *BIO_new_ssl(SSL_CTX *ctx,int client); 12210Sstevel@tonic-gate BIO *BIO_new_ssl_connect(SSL_CTX *ctx); 12220Sstevel@tonic-gate BIO *BIO_new_buffer_ssl_connect(SSL_CTX *ctx); 12230Sstevel@tonic-gate int BIO_ssl_copy_session_id(BIO *to,BIO *from); 12240Sstevel@tonic-gate void BIO_ssl_shutdown(BIO *ssl_bio); 12250Sstevel@tonic-gate 12260Sstevel@tonic-gate #endif 12270Sstevel@tonic-gate 12280Sstevel@tonic-gate int SSL_CTX_set_cipher_list(SSL_CTX *,const char *str); 12290Sstevel@tonic-gate SSL_CTX *SSL_CTX_new(SSL_METHOD *meth); 12300Sstevel@tonic-gate void SSL_CTX_free(SSL_CTX *); 12310Sstevel@tonic-gate long SSL_CTX_set_timeout(SSL_CTX *ctx,long t); 12322139Sjp161948 long SSL_CTX_get_timeout(const SSL_CTX *ctx); 12332139Sjp161948 X509_STORE *SSL_CTX_get_cert_store(const SSL_CTX *); 12340Sstevel@tonic-gate void SSL_CTX_set_cert_store(SSL_CTX *,X509_STORE *); 12352139Sjp161948 int SSL_want(const SSL *s); 12360Sstevel@tonic-gate int SSL_clear(SSL *s); 12370Sstevel@tonic-gate 12380Sstevel@tonic-gate void SSL_CTX_flush_sessions(SSL_CTX *ctx,long tm); 12390Sstevel@tonic-gate 12402139Sjp161948 SSL_CIPHER *SSL_get_current_cipher(const SSL *s); 12412139Sjp161948 int SSL_CIPHER_get_bits(const SSL_CIPHER *c,int *alg_bits); 12422139Sjp161948 char * SSL_CIPHER_get_version(const SSL_CIPHER *c); 12432139Sjp161948 const char * SSL_CIPHER_get_name(const SSL_CIPHER *c); 12440Sstevel@tonic-gate 12452139Sjp161948 int SSL_get_fd(const SSL *s); 12462139Sjp161948 int SSL_get_rfd(const SSL *s); 12472139Sjp161948 int SSL_get_wfd(const SSL *s); 12482139Sjp161948 const char * SSL_get_cipher_list(const SSL *s,int n); 12492139Sjp161948 char * SSL_get_shared_ciphers(const SSL *s, char *buf, int len); 12502139Sjp161948 int SSL_get_read_ahead(const SSL * s); 12512139Sjp161948 int SSL_pending(const SSL *s); 12520Sstevel@tonic-gate #ifndef OPENSSL_NO_SOCK 12530Sstevel@tonic-gate int SSL_set_fd(SSL *s, int fd); 12540Sstevel@tonic-gate int SSL_set_rfd(SSL *s, int fd); 12550Sstevel@tonic-gate int SSL_set_wfd(SSL *s, int fd); 12560Sstevel@tonic-gate #endif 12570Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 12580Sstevel@tonic-gate void SSL_set_bio(SSL *s, BIO *rbio,BIO *wbio); 12592139Sjp161948 BIO * SSL_get_rbio(const SSL *s); 12602139Sjp161948 BIO * SSL_get_wbio(const SSL *s); 12610Sstevel@tonic-gate #endif 12620Sstevel@tonic-gate int SSL_set_cipher_list(SSL *s, const char *str); 12630Sstevel@tonic-gate void SSL_set_read_ahead(SSL *s, int yes); 12642139Sjp161948 int SSL_get_verify_mode(const SSL *s); 12652139Sjp161948 int SSL_get_verify_depth(const SSL *s); 12662139Sjp161948 int (*SSL_get_verify_callback(const SSL *s))(int,X509_STORE_CTX *); 12670Sstevel@tonic-gate void SSL_set_verify(SSL *s, int mode, 12680Sstevel@tonic-gate int (*callback)(int ok,X509_STORE_CTX *ctx)); 12690Sstevel@tonic-gate void SSL_set_verify_depth(SSL *s, int depth); 12700Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA 12710Sstevel@tonic-gate int SSL_use_RSAPrivateKey(SSL *ssl, RSA *rsa); 12720Sstevel@tonic-gate #endif 12730Sstevel@tonic-gate int SSL_use_RSAPrivateKey_ASN1(SSL *ssl, unsigned char *d, long len); 12740Sstevel@tonic-gate int SSL_use_PrivateKey(SSL *ssl, EVP_PKEY *pkey); 12752139Sjp161948 int SSL_use_PrivateKey_ASN1(int pk,SSL *ssl, const unsigned char *d, long len); 12760Sstevel@tonic-gate int SSL_use_certificate(SSL *ssl, X509 *x); 12772139Sjp161948 int SSL_use_certificate_ASN1(SSL *ssl, const unsigned char *d, int len); 12780Sstevel@tonic-gate 12790Sstevel@tonic-gate #ifndef OPENSSL_NO_STDIO 12800Sstevel@tonic-gate int SSL_use_RSAPrivateKey_file(SSL *ssl, const char *file, int type); 12810Sstevel@tonic-gate int SSL_use_PrivateKey_file(SSL *ssl, const char *file, int type); 12820Sstevel@tonic-gate int SSL_use_certificate_file(SSL *ssl, const char *file, int type); 12830Sstevel@tonic-gate int SSL_CTX_use_RSAPrivateKey_file(SSL_CTX *ctx, const char *file, int type); 12840Sstevel@tonic-gate int SSL_CTX_use_PrivateKey_file(SSL_CTX *ctx, const char *file, int type); 12850Sstevel@tonic-gate int SSL_CTX_use_certificate_file(SSL_CTX *ctx, const char *file, int type); 12860Sstevel@tonic-gate int SSL_CTX_use_certificate_chain_file(SSL_CTX *ctx, const char *file); /* PEM type */ 12870Sstevel@tonic-gate STACK_OF(X509_NAME) *SSL_load_client_CA_file(const char *file); 12880Sstevel@tonic-gate int SSL_add_file_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, 12890Sstevel@tonic-gate const char *file); 12900Sstevel@tonic-gate #ifndef OPENSSL_SYS_VMS 12910Sstevel@tonic-gate #ifndef OPENSSL_SYS_MACINTOSH_CLASSIC /* XXXXX: Better scheme needed! [was: #ifndef MAC_OS_pre_X] */ 12920Sstevel@tonic-gate int SSL_add_dir_cert_subjects_to_stack(STACK_OF(X509_NAME) *stackCAs, 12930Sstevel@tonic-gate const char *dir); 12940Sstevel@tonic-gate #endif 12950Sstevel@tonic-gate #endif 12960Sstevel@tonic-gate 12970Sstevel@tonic-gate #endif 12980Sstevel@tonic-gate 12990Sstevel@tonic-gate void SSL_load_error_strings(void ); 13000Sstevel@tonic-gate const char *SSL_state_string(const SSL *s); 13010Sstevel@tonic-gate const char *SSL_rstate_string(const SSL *s); 13020Sstevel@tonic-gate const char *SSL_state_string_long(const SSL *s); 13030Sstevel@tonic-gate const char *SSL_rstate_string_long(const SSL *s); 13042139Sjp161948 long SSL_SESSION_get_time(const SSL_SESSION *s); 13050Sstevel@tonic-gate long SSL_SESSION_set_time(SSL_SESSION *s, long t); 13062139Sjp161948 long SSL_SESSION_get_timeout(const SSL_SESSION *s); 13070Sstevel@tonic-gate long SSL_SESSION_set_timeout(SSL_SESSION *s, long t); 13082139Sjp161948 void SSL_copy_session_id(SSL *to,const SSL *from); 13090Sstevel@tonic-gate 13100Sstevel@tonic-gate SSL_SESSION *SSL_SESSION_new(void); 13112139Sjp161948 unsigned long SSL_SESSION_hash(const SSL_SESSION *a); 13122139Sjp161948 int SSL_SESSION_cmp(const SSL_SESSION *a,const SSL_SESSION *b); 13132139Sjp161948 const unsigned char *SSL_SESSION_get_id(const SSL_SESSION *s, unsigned int *len); 13140Sstevel@tonic-gate #ifndef OPENSSL_NO_FP_API 13152139Sjp161948 int SSL_SESSION_print_fp(FILE *fp,const SSL_SESSION *ses); 13160Sstevel@tonic-gate #endif 13170Sstevel@tonic-gate #ifndef OPENSSL_NO_BIO 13182139Sjp161948 int SSL_SESSION_print(BIO *fp,const SSL_SESSION *ses); 13190Sstevel@tonic-gate #endif 13200Sstevel@tonic-gate void SSL_SESSION_free(SSL_SESSION *ses); 13210Sstevel@tonic-gate int i2d_SSL_SESSION(SSL_SESSION *in,unsigned char **pp); 13220Sstevel@tonic-gate int SSL_set_session(SSL *to, SSL_SESSION *session); 13230Sstevel@tonic-gate int SSL_CTX_add_session(SSL_CTX *s, SSL_SESSION *c); 13240Sstevel@tonic-gate int SSL_CTX_remove_session(SSL_CTX *,SSL_SESSION *c); 13250Sstevel@tonic-gate int SSL_CTX_set_generate_session_id(SSL_CTX *, GEN_SESSION_CB); 13260Sstevel@tonic-gate int SSL_set_generate_session_id(SSL *, GEN_SESSION_CB); 13270Sstevel@tonic-gate int SSL_has_matching_session_id(const SSL *ssl, const unsigned char *id, 13280Sstevel@tonic-gate unsigned int id_len); 13292139Sjp161948 SSL_SESSION *d2i_SSL_SESSION(SSL_SESSION **a,const unsigned char **pp, 13302139Sjp161948 long length); 13310Sstevel@tonic-gate 13320Sstevel@tonic-gate #ifdef HEADER_X509_H 13332139Sjp161948 X509 * SSL_get_peer_certificate(const SSL *s); 13340Sstevel@tonic-gate #endif 13350Sstevel@tonic-gate 13362139Sjp161948 STACK_OF(X509) *SSL_get_peer_cert_chain(const SSL *s); 13370Sstevel@tonic-gate 13382139Sjp161948 int SSL_CTX_get_verify_mode(const SSL_CTX *ctx); 13392139Sjp161948 int SSL_CTX_get_verify_depth(const SSL_CTX *ctx); 13402139Sjp161948 int (*SSL_CTX_get_verify_callback(const SSL_CTX *ctx))(int,X509_STORE_CTX *); 13410Sstevel@tonic-gate void SSL_CTX_set_verify(SSL_CTX *ctx,int mode, 13420Sstevel@tonic-gate int (*callback)(int, X509_STORE_CTX *)); 13430Sstevel@tonic-gate void SSL_CTX_set_verify_depth(SSL_CTX *ctx,int depth); 13440Sstevel@tonic-gate void SSL_CTX_set_cert_verify_callback(SSL_CTX *ctx, int (*cb)(X509_STORE_CTX *,void *), void *arg); 13450Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA 13460Sstevel@tonic-gate int SSL_CTX_use_RSAPrivateKey(SSL_CTX *ctx, RSA *rsa); 13470Sstevel@tonic-gate #endif 13482139Sjp161948 int SSL_CTX_use_RSAPrivateKey_ASN1(SSL_CTX *ctx, const unsigned char *d, long len); 13490Sstevel@tonic-gate int SSL_CTX_use_PrivateKey(SSL_CTX *ctx, EVP_PKEY *pkey); 13500Sstevel@tonic-gate int SSL_CTX_use_PrivateKey_ASN1(int pk,SSL_CTX *ctx, 13512139Sjp161948 const unsigned char *d, long len); 13520Sstevel@tonic-gate int SSL_CTX_use_certificate(SSL_CTX *ctx, X509 *x); 13532139Sjp161948 int SSL_CTX_use_certificate_ASN1(SSL_CTX *ctx, int len, const unsigned char *d); 13540Sstevel@tonic-gate 13550Sstevel@tonic-gate void SSL_CTX_set_default_passwd_cb(SSL_CTX *ctx, pem_password_cb *cb); 13560Sstevel@tonic-gate void SSL_CTX_set_default_passwd_cb_userdata(SSL_CTX *ctx, void *u); 13570Sstevel@tonic-gate 13582139Sjp161948 int SSL_CTX_check_private_key(const SSL_CTX *ctx); 13592139Sjp161948 int SSL_check_private_key(const SSL *ctx); 13600Sstevel@tonic-gate 13610Sstevel@tonic-gate int SSL_CTX_set_session_id_context(SSL_CTX *ctx,const unsigned char *sid_ctx, 13620Sstevel@tonic-gate unsigned int sid_ctx_len); 13630Sstevel@tonic-gate 13640Sstevel@tonic-gate SSL * SSL_new(SSL_CTX *ctx); 13650Sstevel@tonic-gate int SSL_set_session_id_context(SSL *ssl,const unsigned char *sid_ctx, 13660Sstevel@tonic-gate unsigned int sid_ctx_len); 13670Sstevel@tonic-gate 13680Sstevel@tonic-gate int SSL_CTX_set_purpose(SSL_CTX *s, int purpose); 13690Sstevel@tonic-gate int SSL_set_purpose(SSL *s, int purpose); 13700Sstevel@tonic-gate int SSL_CTX_set_trust(SSL_CTX *s, int trust); 13710Sstevel@tonic-gate int SSL_set_trust(SSL *s, int trust); 13720Sstevel@tonic-gate 13730Sstevel@tonic-gate void SSL_free(SSL *ssl); 13740Sstevel@tonic-gate int SSL_accept(SSL *ssl); 13750Sstevel@tonic-gate int SSL_connect(SSL *ssl); 13760Sstevel@tonic-gate int SSL_read(SSL *ssl,void *buf,int num); 13770Sstevel@tonic-gate int SSL_peek(SSL *ssl,void *buf,int num); 13780Sstevel@tonic-gate int SSL_write(SSL *ssl,const void *buf,int num); 13790Sstevel@tonic-gate long SSL_ctrl(SSL *ssl,int cmd, long larg, void *parg); 13802139Sjp161948 long SSL_callback_ctrl(SSL *, int, void (*)(void)); 13810Sstevel@tonic-gate long SSL_CTX_ctrl(SSL_CTX *ctx,int cmd, long larg, void *parg); 13822139Sjp161948 long SSL_CTX_callback_ctrl(SSL_CTX *, int, void (*)(void)); 13830Sstevel@tonic-gate 13842139Sjp161948 int SSL_get_error(const SSL *s,int ret_code); 13852139Sjp161948 const char *SSL_get_version(const SSL *s); 13860Sstevel@tonic-gate 13870Sstevel@tonic-gate /* This sets the 'default' SSL version that SSL_new() will create */ 13880Sstevel@tonic-gate int SSL_CTX_set_ssl_version(SSL_CTX *ctx,SSL_METHOD *meth); 13890Sstevel@tonic-gate 13900Sstevel@tonic-gate SSL_METHOD *SSLv2_method(void); /* SSLv2 */ 13910Sstevel@tonic-gate SSL_METHOD *SSLv2_server_method(void); /* SSLv2 */ 13920Sstevel@tonic-gate SSL_METHOD *SSLv2_client_method(void); /* SSLv2 */ 13930Sstevel@tonic-gate 13940Sstevel@tonic-gate SSL_METHOD *SSLv3_method(void); /* SSLv3 */ 13950Sstevel@tonic-gate SSL_METHOD *SSLv3_server_method(void); /* SSLv3 */ 13960Sstevel@tonic-gate SSL_METHOD *SSLv3_client_method(void); /* SSLv3 */ 13970Sstevel@tonic-gate 13980Sstevel@tonic-gate SSL_METHOD *SSLv23_method(void); /* SSLv3 but can rollback to v2 */ 13990Sstevel@tonic-gate SSL_METHOD *SSLv23_server_method(void); /* SSLv3 but can rollback to v2 */ 14000Sstevel@tonic-gate SSL_METHOD *SSLv23_client_method(void); /* SSLv3 but can rollback to v2 */ 14010Sstevel@tonic-gate 14020Sstevel@tonic-gate SSL_METHOD *TLSv1_method(void); /* TLSv1.0 */ 14030Sstevel@tonic-gate SSL_METHOD *TLSv1_server_method(void); /* TLSv1.0 */ 14040Sstevel@tonic-gate SSL_METHOD *TLSv1_client_method(void); /* TLSv1.0 */ 14050Sstevel@tonic-gate 14062139Sjp161948 SSL_METHOD *DTLSv1_method(void); /* DTLSv1.0 */ 14072139Sjp161948 SSL_METHOD *DTLSv1_server_method(void); /* DTLSv1.0 */ 14082139Sjp161948 SSL_METHOD *DTLSv1_client_method(void); /* DTLSv1.0 */ 14092139Sjp161948 14102139Sjp161948 STACK_OF(SSL_CIPHER) *SSL_get_ciphers(const SSL *s); 14110Sstevel@tonic-gate 14120Sstevel@tonic-gate int SSL_do_handshake(SSL *s); 14130Sstevel@tonic-gate int SSL_renegotiate(SSL *s); 14140Sstevel@tonic-gate int SSL_renegotiate_pending(SSL *s); 14150Sstevel@tonic-gate int SSL_shutdown(SSL *s); 14160Sstevel@tonic-gate 14170Sstevel@tonic-gate SSL_METHOD *SSL_get_ssl_method(SSL *s); 14180Sstevel@tonic-gate int SSL_set_ssl_method(SSL *s,SSL_METHOD *method); 14190Sstevel@tonic-gate const char *SSL_alert_type_string_long(int value); 14200Sstevel@tonic-gate const char *SSL_alert_type_string(int value); 14210Sstevel@tonic-gate const char *SSL_alert_desc_string_long(int value); 14220Sstevel@tonic-gate const char *SSL_alert_desc_string(int value); 14230Sstevel@tonic-gate 14240Sstevel@tonic-gate void SSL_set_client_CA_list(SSL *s, STACK_OF(X509_NAME) *name_list); 14250Sstevel@tonic-gate void SSL_CTX_set_client_CA_list(SSL_CTX *ctx, STACK_OF(X509_NAME) *name_list); 14262139Sjp161948 STACK_OF(X509_NAME) *SSL_get_client_CA_list(const SSL *s); 14272139Sjp161948 STACK_OF(X509_NAME) *SSL_CTX_get_client_CA_list(const SSL_CTX *s); 14280Sstevel@tonic-gate int SSL_add_client_CA(SSL *ssl,X509 *x); 14290Sstevel@tonic-gate int SSL_CTX_add_client_CA(SSL_CTX *ctx,X509 *x); 14300Sstevel@tonic-gate 14310Sstevel@tonic-gate void SSL_set_connect_state(SSL *s); 14320Sstevel@tonic-gate void SSL_set_accept_state(SSL *s); 14330Sstevel@tonic-gate 14342139Sjp161948 long SSL_get_default_timeout(const SSL *s); 14350Sstevel@tonic-gate 14360Sstevel@tonic-gate int SSL_library_init(void ); 14370Sstevel@tonic-gate 14380Sstevel@tonic-gate char *SSL_CIPHER_description(SSL_CIPHER *,char *buf,int size); 14390Sstevel@tonic-gate STACK_OF(X509_NAME) *SSL_dup_CA_list(STACK_OF(X509_NAME) *sk); 14400Sstevel@tonic-gate 14410Sstevel@tonic-gate SSL *SSL_dup(SSL *ssl); 14420Sstevel@tonic-gate 14432139Sjp161948 X509 *SSL_get_certificate(const SSL *ssl); 14440Sstevel@tonic-gate /* EVP_PKEY */ struct evp_pkey_st *SSL_get_privatekey(SSL *ssl); 14450Sstevel@tonic-gate 14460Sstevel@tonic-gate void SSL_CTX_set_quiet_shutdown(SSL_CTX *ctx,int mode); 14472139Sjp161948 int SSL_CTX_get_quiet_shutdown(const SSL_CTX *ctx); 14480Sstevel@tonic-gate void SSL_set_quiet_shutdown(SSL *ssl,int mode); 14492139Sjp161948 int SSL_get_quiet_shutdown(const SSL *ssl); 14500Sstevel@tonic-gate void SSL_set_shutdown(SSL *ssl,int mode); 14512139Sjp161948 int SSL_get_shutdown(const SSL *ssl); 14522139Sjp161948 int SSL_version(const SSL *ssl); 14530Sstevel@tonic-gate int SSL_CTX_set_default_verify_paths(SSL_CTX *ctx); 14540Sstevel@tonic-gate int SSL_CTX_load_verify_locations(SSL_CTX *ctx, const char *CAfile, 14550Sstevel@tonic-gate const char *CApath); 14560Sstevel@tonic-gate #define SSL_get0_session SSL_get_session /* just peek at pointer */ 14572139Sjp161948 SSL_SESSION *SSL_get_session(const SSL *ssl); 14580Sstevel@tonic-gate SSL_SESSION *SSL_get1_session(SSL *ssl); /* obtain a reference count */ 14592139Sjp161948 SSL_CTX *SSL_get_SSL_CTX(const SSL *ssl); 14600Sstevel@tonic-gate void SSL_set_info_callback(SSL *ssl, 14610Sstevel@tonic-gate void (*cb)(const SSL *ssl,int type,int val)); 14622139Sjp161948 void (*SSL_get_info_callback(const SSL *ssl))(const SSL *ssl,int type,int val); 14632139Sjp161948 int SSL_state(const SSL *ssl); 14640Sstevel@tonic-gate 14650Sstevel@tonic-gate void SSL_set_verify_result(SSL *ssl,long v); 14662139Sjp161948 long SSL_get_verify_result(const SSL *ssl); 14670Sstevel@tonic-gate 14680Sstevel@tonic-gate int SSL_set_ex_data(SSL *ssl,int idx,void *data); 14692139Sjp161948 void *SSL_get_ex_data(const SSL *ssl,int idx); 14700Sstevel@tonic-gate int SSL_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 14710Sstevel@tonic-gate CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 14720Sstevel@tonic-gate 14730Sstevel@tonic-gate int SSL_SESSION_set_ex_data(SSL_SESSION *ss,int idx,void *data); 14742139Sjp161948 void *SSL_SESSION_get_ex_data(const SSL_SESSION *ss,int idx); 14750Sstevel@tonic-gate int SSL_SESSION_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 14760Sstevel@tonic-gate CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 14770Sstevel@tonic-gate 14780Sstevel@tonic-gate int SSL_CTX_set_ex_data(SSL_CTX *ssl,int idx,void *data); 14792139Sjp161948 void *SSL_CTX_get_ex_data(const SSL_CTX *ssl,int idx); 14800Sstevel@tonic-gate int SSL_CTX_get_ex_new_index(long argl, void *argp, CRYPTO_EX_new *new_func, 14810Sstevel@tonic-gate CRYPTO_EX_dup *dup_func, CRYPTO_EX_free *free_func); 14820Sstevel@tonic-gate 14830Sstevel@tonic-gate int SSL_get_ex_data_X509_STORE_CTX_idx(void ); 14840Sstevel@tonic-gate 14850Sstevel@tonic-gate #define SSL_CTX_sess_set_cache_size(ctx,t) \ 14860Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_SIZE,t,NULL) 14870Sstevel@tonic-gate #define SSL_CTX_sess_get_cache_size(ctx) \ 14880Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_SIZE,0,NULL) 14890Sstevel@tonic-gate #define SSL_CTX_set_session_cache_mode(ctx,m) \ 14900Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_SESS_CACHE_MODE,m,NULL) 14910Sstevel@tonic-gate #define SSL_CTX_get_session_cache_mode(ctx) \ 14920Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_GET_SESS_CACHE_MODE,0,NULL) 14930Sstevel@tonic-gate 14940Sstevel@tonic-gate #define SSL_CTX_get_default_read_ahead(ctx) SSL_CTX_get_read_ahead(ctx) 14950Sstevel@tonic-gate #define SSL_CTX_set_default_read_ahead(ctx,m) SSL_CTX_set_read_ahead(ctx,m) 14960Sstevel@tonic-gate #define SSL_CTX_get_read_ahead(ctx) \ 14970Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_GET_READ_AHEAD,0,NULL) 14980Sstevel@tonic-gate #define SSL_CTX_set_read_ahead(ctx,m) \ 14990Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_READ_AHEAD,m,NULL) 15000Sstevel@tonic-gate #define SSL_CTX_get_max_cert_list(ctx) \ 15010Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) 15020Sstevel@tonic-gate #define SSL_CTX_set_max_cert_list(ctx,m) \ 15030Sstevel@tonic-gate SSL_CTX_ctrl(ctx,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) 15040Sstevel@tonic-gate #define SSL_get_max_cert_list(ssl) \ 15050Sstevel@tonic-gate SSL_ctrl(ssl,SSL_CTRL_GET_MAX_CERT_LIST,0,NULL) 15060Sstevel@tonic-gate #define SSL_set_max_cert_list(ssl,m) \ 15070Sstevel@tonic-gate SSL_ctrl(ssl,SSL_CTRL_SET_MAX_CERT_LIST,m,NULL) 15080Sstevel@tonic-gate 15090Sstevel@tonic-gate /* NB: the keylength is only applicable when is_export is true */ 15100Sstevel@tonic-gate #ifndef OPENSSL_NO_RSA 15110Sstevel@tonic-gate void SSL_CTX_set_tmp_rsa_callback(SSL_CTX *ctx, 15120Sstevel@tonic-gate RSA *(*cb)(SSL *ssl,int is_export, 15130Sstevel@tonic-gate int keylength)); 15140Sstevel@tonic-gate 15150Sstevel@tonic-gate void SSL_set_tmp_rsa_callback(SSL *ssl, 15160Sstevel@tonic-gate RSA *(*cb)(SSL *ssl,int is_export, 15170Sstevel@tonic-gate int keylength)); 15180Sstevel@tonic-gate #endif 15190Sstevel@tonic-gate #ifndef OPENSSL_NO_DH 15200Sstevel@tonic-gate void SSL_CTX_set_tmp_dh_callback(SSL_CTX *ctx, 15210Sstevel@tonic-gate DH *(*dh)(SSL *ssl,int is_export, 15220Sstevel@tonic-gate int keylength)); 15230Sstevel@tonic-gate void SSL_set_tmp_dh_callback(SSL *ssl, 15240Sstevel@tonic-gate DH *(*dh)(SSL *ssl,int is_export, 15250Sstevel@tonic-gate int keylength)); 15260Sstevel@tonic-gate #endif 15272139Sjp161948 #ifndef OPENSSL_NO_ECDH 15282139Sjp161948 void SSL_CTX_set_tmp_ecdh_callback(SSL_CTX *ctx, 15292139Sjp161948 EC_KEY *(*ecdh)(SSL *ssl,int is_export, 15302139Sjp161948 int keylength)); 15312139Sjp161948 void SSL_set_tmp_ecdh_callback(SSL *ssl, 15322139Sjp161948 EC_KEY *(*ecdh)(SSL *ssl,int is_export, 15332139Sjp161948 int keylength)); 15342139Sjp161948 #endif 15350Sstevel@tonic-gate 15360Sstevel@tonic-gate #ifndef OPENSSL_NO_COMP 15372139Sjp161948 const COMP_METHOD *SSL_get_current_compression(SSL *s); 15382139Sjp161948 const COMP_METHOD *SSL_get_current_expansion(SSL *s); 15392139Sjp161948 const char *SSL_COMP_get_name(const COMP_METHOD *comp); 15402139Sjp161948 STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); 15410Sstevel@tonic-gate int SSL_COMP_add_compression_method(int id,COMP_METHOD *cm); 15420Sstevel@tonic-gate #else 15432139Sjp161948 const void *SSL_get_current_compression(SSL *s); 15442139Sjp161948 const void *SSL_get_current_expansion(SSL *s); 15452139Sjp161948 const char *SSL_COMP_get_name(const void *comp); 15462139Sjp161948 void *SSL_COMP_get_compression_methods(void); 15472139Sjp161948 int SSL_COMP_add_compression_method(int id,void *cm); 15480Sstevel@tonic-gate #endif 15490Sstevel@tonic-gate 15500Sstevel@tonic-gate /* BEGIN ERROR CODES */ 15510Sstevel@tonic-gate /* The following lines are auto generated by the script mkerr.pl. Any changes 15520Sstevel@tonic-gate * made after this point may be overwritten when the script is next run. 15530Sstevel@tonic-gate */ 15540Sstevel@tonic-gate void ERR_load_SSL_strings(void); 15550Sstevel@tonic-gate 15560Sstevel@tonic-gate /* Error codes for the SSL functions. */ 15570Sstevel@tonic-gate 15580Sstevel@tonic-gate /* Function codes. */ 15590Sstevel@tonic-gate #define SSL_F_CLIENT_CERTIFICATE 100 15600Sstevel@tonic-gate #define SSL_F_CLIENT_FINISHED 238 15610Sstevel@tonic-gate #define SSL_F_CLIENT_HELLO 101 15620Sstevel@tonic-gate #define SSL_F_CLIENT_MASTER_KEY 102 15630Sstevel@tonic-gate #define SSL_F_D2I_SSL_SESSION 103 15642139Sjp161948 #define SSL_F_DO_DTLS1_WRITE 1003 15650Sstevel@tonic-gate #define SSL_F_DO_SSL3_WRITE 104 15662139Sjp161948 #define SSL_F_DTLS1_ACCEPT 1004 15672139Sjp161948 #define SSL_F_DTLS1_BUFFER_RECORD 1005 15682139Sjp161948 #define SSL_F_DTLS1_CLIENT_HELLO 1006 15692139Sjp161948 #define SSL_F_DTLS1_CONNECT 1007 15702139Sjp161948 #define SSL_F_DTLS1_ENC 1008 15712139Sjp161948 #define SSL_F_DTLS1_GET_HELLO_VERIFY 1009 15722139Sjp161948 #define SSL_F_DTLS1_GET_MESSAGE 1010 15732139Sjp161948 #define SSL_F_DTLS1_GET_MESSAGE_FRAGMENT 1011 15742139Sjp161948 #define SSL_F_DTLS1_GET_RECORD 1012 15752139Sjp161948 #define SSL_F_DTLS1_OUTPUT_CERT_CHAIN 1013 1576*5434Sjp161948 #define SSL_F_DTLS1_PREPROCESS_FRAGMENT 277 15772139Sjp161948 #define SSL_F_DTLS1_PROCESS_OUT_OF_SEQ_MESSAGE 1014 15782139Sjp161948 #define SSL_F_DTLS1_PROCESS_RECORD 1015 15792139Sjp161948 #define SSL_F_DTLS1_READ_BYTES 1016 15802139Sjp161948 #define SSL_F_DTLS1_READ_FAILED 1001 15812139Sjp161948 #define SSL_F_DTLS1_SEND_CERTIFICATE_REQUEST 1017 15822139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_CERTIFICATE 1018 15832139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_KEY_EXCHANGE 1019 15842139Sjp161948 #define SSL_F_DTLS1_SEND_CLIENT_VERIFY 1020 15852139Sjp161948 #define SSL_F_DTLS1_SEND_HELLO_VERIFY_REQUEST 1002 15862139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_CERTIFICATE 1021 15872139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_HELLO 1022 15882139Sjp161948 #define SSL_F_DTLS1_SEND_SERVER_KEY_EXCHANGE 1023 15892139Sjp161948 #define SSL_F_DTLS1_WRITE_APP_DATA_BYTES 1024 15900Sstevel@tonic-gate #define SSL_F_GET_CLIENT_FINISHED 105 15910Sstevel@tonic-gate #define SSL_F_GET_CLIENT_HELLO 106 15920Sstevel@tonic-gate #define SSL_F_GET_CLIENT_MASTER_KEY 107 15930Sstevel@tonic-gate #define SSL_F_GET_SERVER_FINISHED 108 15940Sstevel@tonic-gate #define SSL_F_GET_SERVER_HELLO 109 15950Sstevel@tonic-gate #define SSL_F_GET_SERVER_VERIFY 110 15960Sstevel@tonic-gate #define SSL_F_I2D_SSL_SESSION 111 15970Sstevel@tonic-gate #define SSL_F_READ_N 112 15980Sstevel@tonic-gate #define SSL_F_REQUEST_CERTIFICATE 113 15990Sstevel@tonic-gate #define SSL_F_SERVER_FINISH 239 16000Sstevel@tonic-gate #define SSL_F_SERVER_HELLO 114 16010Sstevel@tonic-gate #define SSL_F_SERVER_VERIFY 240 16020Sstevel@tonic-gate #define SSL_F_SSL23_ACCEPT 115 16030Sstevel@tonic-gate #define SSL_F_SSL23_CLIENT_HELLO 116 16040Sstevel@tonic-gate #define SSL_F_SSL23_CONNECT 117 16050Sstevel@tonic-gate #define SSL_F_SSL23_GET_CLIENT_HELLO 118 16060Sstevel@tonic-gate #define SSL_F_SSL23_GET_SERVER_HELLO 119 16070Sstevel@tonic-gate #define SSL_F_SSL23_PEEK 237 16080Sstevel@tonic-gate #define SSL_F_SSL23_READ 120 16090Sstevel@tonic-gate #define SSL_F_SSL23_WRITE 121 16100Sstevel@tonic-gate #define SSL_F_SSL2_ACCEPT 122 16110Sstevel@tonic-gate #define SSL_F_SSL2_CONNECT 123 16120Sstevel@tonic-gate #define SSL_F_SSL2_ENC_INIT 124 16130Sstevel@tonic-gate #define SSL_F_SSL2_GENERATE_KEY_MATERIAL 241 16140Sstevel@tonic-gate #define SSL_F_SSL2_PEEK 234 16150Sstevel@tonic-gate #define SSL_F_SSL2_READ 125 16160Sstevel@tonic-gate #define SSL_F_SSL2_READ_INTERNAL 236 16170Sstevel@tonic-gate #define SSL_F_SSL2_SET_CERTIFICATE 126 16180Sstevel@tonic-gate #define SSL_F_SSL2_WRITE 127 16190Sstevel@tonic-gate #define SSL_F_SSL3_ACCEPT 128 16200Sstevel@tonic-gate #define SSL_F_SSL3_CALLBACK_CTRL 233 16210Sstevel@tonic-gate #define SSL_F_SSL3_CHANGE_CIPHER_STATE 129 16220Sstevel@tonic-gate #define SSL_F_SSL3_CHECK_CERT_AND_ALGORITHM 130 16230Sstevel@tonic-gate #define SSL_F_SSL3_CLIENT_HELLO 131 16240Sstevel@tonic-gate #define SSL_F_SSL3_CONNECT 132 16250Sstevel@tonic-gate #define SSL_F_SSL3_CTRL 213 16260Sstevel@tonic-gate #define SSL_F_SSL3_CTX_CTRL 133 16270Sstevel@tonic-gate #define SSL_F_SSL3_ENC 134 16280Sstevel@tonic-gate #define SSL_F_SSL3_GENERATE_KEY_BLOCK 238 16290Sstevel@tonic-gate #define SSL_F_SSL3_GET_CERTIFICATE_REQUEST 135 16300Sstevel@tonic-gate #define SSL_F_SSL3_GET_CERT_VERIFY 136 16310Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_CERTIFICATE 137 16320Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_HELLO 138 16330Sstevel@tonic-gate #define SSL_F_SSL3_GET_CLIENT_KEY_EXCHANGE 139 16340Sstevel@tonic-gate #define SSL_F_SSL3_GET_FINISHED 140 16350Sstevel@tonic-gate #define SSL_F_SSL3_GET_KEY_EXCHANGE 141 16360Sstevel@tonic-gate #define SSL_F_SSL3_GET_MESSAGE 142 16370Sstevel@tonic-gate #define SSL_F_SSL3_GET_RECORD 143 16380Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_CERTIFICATE 144 16390Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_DONE 145 16400Sstevel@tonic-gate #define SSL_F_SSL3_GET_SERVER_HELLO 146 16410Sstevel@tonic-gate #define SSL_F_SSL3_OUTPUT_CERT_CHAIN 147 16420Sstevel@tonic-gate #define SSL_F_SSL3_PEEK 235 16430Sstevel@tonic-gate #define SSL_F_SSL3_READ_BYTES 148 16440Sstevel@tonic-gate #define SSL_F_SSL3_READ_N 149 16450Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CERTIFICATE_REQUEST 150 16460Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_CERTIFICATE 151 16470Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_KEY_EXCHANGE 152 16480Sstevel@tonic-gate #define SSL_F_SSL3_SEND_CLIENT_VERIFY 153 16490Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_CERTIFICATE 154 16500Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_HELLO 242 16510Sstevel@tonic-gate #define SSL_F_SSL3_SEND_SERVER_KEY_EXCHANGE 155 16520Sstevel@tonic-gate #define SSL_F_SSL3_SETUP_BUFFERS 156 16530Sstevel@tonic-gate #define SSL_F_SSL3_SETUP_KEY_BLOCK 157 16540Sstevel@tonic-gate #define SSL_F_SSL3_WRITE_BYTES 158 16550Sstevel@tonic-gate #define SSL_F_SSL3_WRITE_PENDING 159 16560Sstevel@tonic-gate #define SSL_F_SSL_ADD_DIR_CERT_SUBJECTS_TO_STACK 215 16570Sstevel@tonic-gate #define SSL_F_SSL_ADD_FILE_CERT_SUBJECTS_TO_STACK 216 16580Sstevel@tonic-gate #define SSL_F_SSL_BAD_METHOD 160 16590Sstevel@tonic-gate #define SSL_F_SSL_BYTES_TO_CIPHER_LIST 161 16600Sstevel@tonic-gate #define SSL_F_SSL_CERT_DUP 221 16610Sstevel@tonic-gate #define SSL_F_SSL_CERT_INST 222 16620Sstevel@tonic-gate #define SSL_F_SSL_CERT_INSTANTIATE 214 16630Sstevel@tonic-gate #define SSL_F_SSL_CERT_NEW 162 16640Sstevel@tonic-gate #define SSL_F_SSL_CHECK_PRIVATE_KEY 163 16650Sstevel@tonic-gate #define SSL_F_SSL_CIPHER_PROCESS_RULESTR 230 16660Sstevel@tonic-gate #define SSL_F_SSL_CIPHER_STRENGTH_SORT 231 16670Sstevel@tonic-gate #define SSL_F_SSL_CLEAR 164 16680Sstevel@tonic-gate #define SSL_F_SSL_COMP_ADD_COMPRESSION_METHOD 165 16690Sstevel@tonic-gate #define SSL_F_SSL_CREATE_CIPHER_LIST 166 16700Sstevel@tonic-gate #define SSL_F_SSL_CTRL 232 16710Sstevel@tonic-gate #define SSL_F_SSL_CTX_CHECK_PRIVATE_KEY 168 16720Sstevel@tonic-gate #define SSL_F_SSL_CTX_NEW 169 16732139Sjp161948 #define SSL_F_SSL_CTX_SET_CIPHER_LIST 1026 16740Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_PURPOSE 226 16750Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_SESSION_ID_CONTEXT 219 16760Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_SSL_VERSION 170 16770Sstevel@tonic-gate #define SSL_F_SSL_CTX_SET_TRUST 229 16780Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE 171 16790Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_ASN1 172 16800Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_CHAIN_FILE 220 16810Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_CERTIFICATE_FILE 173 16820Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY 174 16830Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY_ASN1 175 16840Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_PRIVATEKEY_FILE 176 16850Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY 177 16860Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_ASN1 178 16870Sstevel@tonic-gate #define SSL_F_SSL_CTX_USE_RSAPRIVATEKEY_FILE 179 16880Sstevel@tonic-gate #define SSL_F_SSL_DO_HANDSHAKE 180 16890Sstevel@tonic-gate #define SSL_F_SSL_GET_NEW_SESSION 181 16900Sstevel@tonic-gate #define SSL_F_SSL_GET_PREV_SESSION 217 16910Sstevel@tonic-gate #define SSL_F_SSL_GET_SERVER_SEND_CERT 182 16920Sstevel@tonic-gate #define SSL_F_SSL_GET_SIGN_PKEY 183 16930Sstevel@tonic-gate #define SSL_F_SSL_INIT_WBIO_BUFFER 184 16940Sstevel@tonic-gate #define SSL_F_SSL_LOAD_CLIENT_CA_FILE 185 16950Sstevel@tonic-gate #define SSL_F_SSL_NEW 186 16962139Sjp161948 #define SSL_F_SSL_PEEK 1025 16970Sstevel@tonic-gate #define SSL_F_SSL_READ 223 16980Sstevel@tonic-gate #define SSL_F_SSL_RSA_PRIVATE_DECRYPT 187 16990Sstevel@tonic-gate #define SSL_F_SSL_RSA_PUBLIC_ENCRYPT 188 17000Sstevel@tonic-gate #define SSL_F_SSL_SESSION_NEW 189 17010Sstevel@tonic-gate #define SSL_F_SSL_SESSION_PRINT_FP 190 17020Sstevel@tonic-gate #define SSL_F_SSL_SESS_CERT_NEW 225 17030Sstevel@tonic-gate #define SSL_F_SSL_SET_CERT 191 17042139Sjp161948 #define SSL_F_SSL_SET_CIPHER_LIST 1027 17050Sstevel@tonic-gate #define SSL_F_SSL_SET_FD 192 17060Sstevel@tonic-gate #define SSL_F_SSL_SET_PKEY 193 17070Sstevel@tonic-gate #define SSL_F_SSL_SET_PURPOSE 227 17080Sstevel@tonic-gate #define SSL_F_SSL_SET_RFD 194 17090Sstevel@tonic-gate #define SSL_F_SSL_SET_SESSION 195 17100Sstevel@tonic-gate #define SSL_F_SSL_SET_SESSION_ID_CONTEXT 218 17110Sstevel@tonic-gate #define SSL_F_SSL_SET_TRUST 228 17120Sstevel@tonic-gate #define SSL_F_SSL_SET_WFD 196 17130Sstevel@tonic-gate #define SSL_F_SSL_SHUTDOWN 224 17142139Sjp161948 #define SSL_F_SSL_UNDEFINED_CONST_FUNCTION 243 17150Sstevel@tonic-gate #define SSL_F_SSL_UNDEFINED_FUNCTION 197 17162139Sjp161948 #define SSL_F_SSL_UNDEFINED_VOID_FUNCTION 244 17170Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE 198 17180Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE_ASN1 199 17190Sstevel@tonic-gate #define SSL_F_SSL_USE_CERTIFICATE_FILE 200 17200Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY 201 17210Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY_ASN1 202 17220Sstevel@tonic-gate #define SSL_F_SSL_USE_PRIVATEKEY_FILE 203 17230Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY 204 17240Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY_ASN1 205 17250Sstevel@tonic-gate #define SSL_F_SSL_USE_RSAPRIVATEKEY_FILE 206 17260Sstevel@tonic-gate #define SSL_F_SSL_VERIFY_CERT_CHAIN 207 17270Sstevel@tonic-gate #define SSL_F_SSL_WRITE 208 17280Sstevel@tonic-gate #define SSL_F_TLS1_CHANGE_CIPHER_STATE 209 17290Sstevel@tonic-gate #define SSL_F_TLS1_ENC 210 17300Sstevel@tonic-gate #define SSL_F_TLS1_SETUP_KEY_BLOCK 211 17310Sstevel@tonic-gate #define SSL_F_WRITE_PENDING 212 17320Sstevel@tonic-gate 17330Sstevel@tonic-gate /* Reason codes. */ 17340Sstevel@tonic-gate #define SSL_R_APP_DATA_IN_HANDSHAKE 100 17350Sstevel@tonic-gate #define SSL_R_ATTEMPT_TO_REUSE_SESSION_IN_DIFFERENT_CONTEXT 272 17360Sstevel@tonic-gate #define SSL_R_BAD_ALERT_RECORD 101 17370Sstevel@tonic-gate #define SSL_R_BAD_AUTHENTICATION_TYPE 102 17380Sstevel@tonic-gate #define SSL_R_BAD_CHANGE_CIPHER_SPEC 103 17390Sstevel@tonic-gate #define SSL_R_BAD_CHECKSUM 104 17400Sstevel@tonic-gate #define SSL_R_BAD_DATA_RETURNED_BY_CALLBACK 106 17410Sstevel@tonic-gate #define SSL_R_BAD_DECOMPRESSION 107 17420Sstevel@tonic-gate #define SSL_R_BAD_DH_G_LENGTH 108 17430Sstevel@tonic-gate #define SSL_R_BAD_DH_PUB_KEY_LENGTH 109 17440Sstevel@tonic-gate #define SSL_R_BAD_DH_P_LENGTH 110 17450Sstevel@tonic-gate #define SSL_R_BAD_DIGEST_LENGTH 111 17460Sstevel@tonic-gate #define SSL_R_BAD_DSA_SIGNATURE 112 17472139Sjp161948 #define SSL_R_BAD_ECC_CERT 1117 17482139Sjp161948 #define SSL_R_BAD_ECDSA_SIGNATURE 1112 17492139Sjp161948 #define SSL_R_BAD_ECPOINT 1113 17500Sstevel@tonic-gate #define SSL_R_BAD_HELLO_REQUEST 105 17510Sstevel@tonic-gate #define SSL_R_BAD_LENGTH 271 17520Sstevel@tonic-gate #define SSL_R_BAD_MAC_DECODE 113 17530Sstevel@tonic-gate #define SSL_R_BAD_MESSAGE_TYPE 114 17540Sstevel@tonic-gate #define SSL_R_BAD_PACKET_LENGTH 115 17550Sstevel@tonic-gate #define SSL_R_BAD_PROTOCOL_VERSION_NUMBER 116 17560Sstevel@tonic-gate #define SSL_R_BAD_RESPONSE_ARGUMENT 117 17570Sstevel@tonic-gate #define SSL_R_BAD_RSA_DECRYPT 118 17580Sstevel@tonic-gate #define SSL_R_BAD_RSA_ENCRYPT 119 17590Sstevel@tonic-gate #define SSL_R_BAD_RSA_E_LENGTH 120 17600Sstevel@tonic-gate #define SSL_R_BAD_RSA_MODULUS_LENGTH 121 17610Sstevel@tonic-gate #define SSL_R_BAD_RSA_SIGNATURE 122 17620Sstevel@tonic-gate #define SSL_R_BAD_SIGNATURE 123 17630Sstevel@tonic-gate #define SSL_R_BAD_SSL_FILETYPE 124 17640Sstevel@tonic-gate #define SSL_R_BAD_SSL_SESSION_ID_LENGTH 125 17650Sstevel@tonic-gate #define SSL_R_BAD_STATE 126 17660Sstevel@tonic-gate #define SSL_R_BAD_WRITE_RETRY 127 17670Sstevel@tonic-gate #define SSL_R_BIO_NOT_SET 128 17680Sstevel@tonic-gate #define SSL_R_BLOCK_CIPHER_PAD_IS_WRONG 129 17690Sstevel@tonic-gate #define SSL_R_BN_LIB 130 17700Sstevel@tonic-gate #define SSL_R_CA_DN_LENGTH_MISMATCH 131 17710Sstevel@tonic-gate #define SSL_R_CA_DN_TOO_LONG 132 17720Sstevel@tonic-gate #define SSL_R_CCS_RECEIVED_EARLY 133 17730Sstevel@tonic-gate #define SSL_R_CERTIFICATE_VERIFY_FAILED 134 17740Sstevel@tonic-gate #define SSL_R_CERT_LENGTH_MISMATCH 135 17750Sstevel@tonic-gate #define SSL_R_CHALLENGE_IS_DIFFERENT 136 17760Sstevel@tonic-gate #define SSL_R_CIPHER_CODE_WRONG_LENGTH 137 17770Sstevel@tonic-gate #define SSL_R_CIPHER_OR_HASH_UNAVAILABLE 138 17780Sstevel@tonic-gate #define SSL_R_CIPHER_TABLE_SRC_ERROR 139 17790Sstevel@tonic-gate #define SSL_R_COMPRESSED_LENGTH_TOO_LONG 140 17800Sstevel@tonic-gate #define SSL_R_COMPRESSION_FAILURE 141 17812139Sjp161948 #define SSL_R_COMPRESSION_ID_NOT_WITHIN_PRIVATE_RANGE 1120 17820Sstevel@tonic-gate #define SSL_R_COMPRESSION_LIBRARY_ERROR 142 17830Sstevel@tonic-gate #define SSL_R_CONNECTION_ID_IS_DIFFERENT 143 17840Sstevel@tonic-gate #define SSL_R_CONNECTION_TYPE_NOT_SET 144 17852139Sjp161948 #define SSL_R_COOKIE_MISMATCH 2002 17860Sstevel@tonic-gate #define SSL_R_DATA_BETWEEN_CCS_AND_FINISHED 145 17870Sstevel@tonic-gate #define SSL_R_DATA_LENGTH_TOO_LONG 146 17880Sstevel@tonic-gate #define SSL_R_DECRYPTION_FAILED 147 17890Sstevel@tonic-gate #define SSL_R_DECRYPTION_FAILED_OR_BAD_RECORD_MAC 1109 17900Sstevel@tonic-gate #define SSL_R_DH_PUBLIC_VALUE_LENGTH_IS_WRONG 148 17910Sstevel@tonic-gate #define SSL_R_DIGEST_CHECK_FAILED 149 17922139Sjp161948 #define SSL_R_DUPLICATE_COMPRESSION_ID 1121 17932139Sjp161948 #define SSL_R_ECGROUP_TOO_LARGE_FOR_CIPHER 1119 17940Sstevel@tonic-gate #define SSL_R_ENCRYPTED_LENGTH_TOO_LONG 150 17950Sstevel@tonic-gate #define SSL_R_ERROR_GENERATING_TMP_RSA_KEY 1092 17960Sstevel@tonic-gate #define SSL_R_ERROR_IN_RECEIVED_CIPHER_LIST 151 17970Sstevel@tonic-gate #define SSL_R_EXCESSIVE_MESSAGE_SIZE 152 17980Sstevel@tonic-gate #define SSL_R_EXTRA_DATA_IN_MESSAGE 153 17990Sstevel@tonic-gate #define SSL_R_GOT_A_FIN_BEFORE_A_CCS 154 18000Sstevel@tonic-gate #define SSL_R_HTTPS_PROXY_REQUEST 155 18010Sstevel@tonic-gate #define SSL_R_HTTP_REQUEST 156 18020Sstevel@tonic-gate #define SSL_R_ILLEGAL_PADDING 1110 18030Sstevel@tonic-gate #define SSL_R_INVALID_CHALLENGE_LENGTH 158 18040Sstevel@tonic-gate #define SSL_R_INVALID_COMMAND 280 18050Sstevel@tonic-gate #define SSL_R_INVALID_PURPOSE 278 18060Sstevel@tonic-gate #define SSL_R_INVALID_TRUST 279 18070Sstevel@tonic-gate #define SSL_R_KEY_ARG_TOO_LONG 1112 18080Sstevel@tonic-gate #define SSL_R_KRB5 1104 18090Sstevel@tonic-gate #define SSL_R_KRB5_C_CC_PRINC 1094 18100Sstevel@tonic-gate #define SSL_R_KRB5_C_GET_CRED 1095 18110Sstevel@tonic-gate #define SSL_R_KRB5_C_INIT 1096 18120Sstevel@tonic-gate #define SSL_R_KRB5_C_MK_REQ 1097 18130Sstevel@tonic-gate #define SSL_R_KRB5_S_BAD_TICKET 1098 18140Sstevel@tonic-gate #define SSL_R_KRB5_S_INIT 1099 18150Sstevel@tonic-gate #define SSL_R_KRB5_S_RD_REQ 1108 18160Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_EXPIRED 1105 18170Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_NYV 1106 18180Sstevel@tonic-gate #define SSL_R_KRB5_S_TKT_SKEW 1107 18190Sstevel@tonic-gate #define SSL_R_LENGTH_MISMATCH 159 18200Sstevel@tonic-gate #define SSL_R_LENGTH_TOO_SHORT 160 18210Sstevel@tonic-gate #define SSL_R_LIBRARY_BUG 274 18220Sstevel@tonic-gate #define SSL_R_LIBRARY_HAS_NO_CIPHERS 161 18230Sstevel@tonic-gate #define SSL_R_MASTER_KEY_TOO_LONG 1112 18240Sstevel@tonic-gate #define SSL_R_MESSAGE_TOO_LONG 1111 18250Sstevel@tonic-gate #define SSL_R_MISSING_DH_DSA_CERT 162 18260Sstevel@tonic-gate #define SSL_R_MISSING_DH_KEY 163 18270Sstevel@tonic-gate #define SSL_R_MISSING_DH_RSA_CERT 164 18280Sstevel@tonic-gate #define SSL_R_MISSING_DSA_SIGNING_CERT 165 18290Sstevel@tonic-gate #define SSL_R_MISSING_EXPORT_TMP_DH_KEY 166 18300Sstevel@tonic-gate #define SSL_R_MISSING_EXPORT_TMP_RSA_KEY 167 18310Sstevel@tonic-gate #define SSL_R_MISSING_RSA_CERTIFICATE 168 18320Sstevel@tonic-gate #define SSL_R_MISSING_RSA_ENCRYPTING_CERT 169 18330Sstevel@tonic-gate #define SSL_R_MISSING_RSA_SIGNING_CERT 170 18340Sstevel@tonic-gate #define SSL_R_MISSING_TMP_DH_KEY 171 18352139Sjp161948 #define SSL_R_MISSING_TMP_ECDH_KEY 1114 18360Sstevel@tonic-gate #define SSL_R_MISSING_TMP_RSA_KEY 172 18370Sstevel@tonic-gate #define SSL_R_MISSING_TMP_RSA_PKEY 173 18380Sstevel@tonic-gate #define SSL_R_MISSING_VERIFY_MESSAGE 174 18390Sstevel@tonic-gate #define SSL_R_NON_SSLV2_INITIAL_PACKET 175 18400Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATES_RETURNED 176 18410Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_ASSIGNED 177 18420Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_RETURNED 178 18430Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_SET 179 18440Sstevel@tonic-gate #define SSL_R_NO_CERTIFICATE_SPECIFIED 180 18450Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_AVAILABLE 181 18460Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_PASSED 182 18470Sstevel@tonic-gate #define SSL_R_NO_CIPHERS_SPECIFIED 183 18480Sstevel@tonic-gate #define SSL_R_NO_CIPHER_LIST 184 18490Sstevel@tonic-gate #define SSL_R_NO_CIPHER_MATCH 185 18500Sstevel@tonic-gate #define SSL_R_NO_CLIENT_CERT_RECEIVED 186 18510Sstevel@tonic-gate #define SSL_R_NO_COMPRESSION_SPECIFIED 187 18520Sstevel@tonic-gate #define SSL_R_NO_METHOD_SPECIFIED 188 18530Sstevel@tonic-gate #define SSL_R_NO_PRIVATEKEY 189 18540Sstevel@tonic-gate #define SSL_R_NO_PRIVATE_KEY_ASSIGNED 190 18550Sstevel@tonic-gate #define SSL_R_NO_PROTOCOLS_AVAILABLE 191 18560Sstevel@tonic-gate #define SSL_R_NO_PUBLICKEY 192 18570Sstevel@tonic-gate #define SSL_R_NO_SHARED_CIPHER 193 18580Sstevel@tonic-gate #define SSL_R_NO_VERIFY_CALLBACK 194 18590Sstevel@tonic-gate #define SSL_R_NULL_SSL_CTX 195 18600Sstevel@tonic-gate #define SSL_R_NULL_SSL_METHOD_PASSED 196 18610Sstevel@tonic-gate #define SSL_R_OLD_SESSION_CIPHER_NOT_RETURNED 197 18620Sstevel@tonic-gate #define SSL_R_PACKET_LENGTH_TOO_LONG 198 18630Sstevel@tonic-gate #define SSL_R_PATH_TOO_LONG 270 18640Sstevel@tonic-gate #define SSL_R_PEER_DID_NOT_RETURN_A_CERTIFICATE 199 18650Sstevel@tonic-gate #define SSL_R_PEER_ERROR 200 18660Sstevel@tonic-gate #define SSL_R_PEER_ERROR_CERTIFICATE 201 18670Sstevel@tonic-gate #define SSL_R_PEER_ERROR_NO_CERTIFICATE 202 18680Sstevel@tonic-gate #define SSL_R_PEER_ERROR_NO_CIPHER 203 18690Sstevel@tonic-gate #define SSL_R_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 204 18700Sstevel@tonic-gate #define SSL_R_PRE_MAC_LENGTH_TOO_LONG 205 18710Sstevel@tonic-gate #define SSL_R_PROBLEMS_MAPPING_CIPHER_FUNCTIONS 206 18720Sstevel@tonic-gate #define SSL_R_PROTOCOL_IS_SHUTDOWN 207 18730Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_ENCRYPT_ERROR 208 18740Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_IS_NOT_RSA 209 18750Sstevel@tonic-gate #define SSL_R_PUBLIC_KEY_NOT_RSA 210 18760Sstevel@tonic-gate #define SSL_R_READ_BIO_NOT_SET 211 18772139Sjp161948 #define SSL_R_READ_TIMEOUT_EXPIRED 2001 18780Sstevel@tonic-gate #define SSL_R_READ_WRONG_PACKET_TYPE 212 18790Sstevel@tonic-gate #define SSL_R_RECORD_LENGTH_MISMATCH 213 18800Sstevel@tonic-gate #define SSL_R_RECORD_TOO_LARGE 214 18810Sstevel@tonic-gate #define SSL_R_RECORD_TOO_SMALL 1093 18820Sstevel@tonic-gate #define SSL_R_REQUIRED_CIPHER_MISSING 215 18830Sstevel@tonic-gate #define SSL_R_REUSE_CERT_LENGTH_NOT_ZERO 216 18840Sstevel@tonic-gate #define SSL_R_REUSE_CERT_TYPE_NOT_ZERO 217 18850Sstevel@tonic-gate #define SSL_R_REUSE_CIPHER_LIST_NOT_ZERO 218 18860Sstevel@tonic-gate #define SSL_R_SESSION_ID_CONTEXT_UNINITIALIZED 277 18870Sstevel@tonic-gate #define SSL_R_SHORT_READ 219 18880Sstevel@tonic-gate #define SSL_R_SIGNATURE_FOR_NON_SIGNING_CERTIFICATE 220 18890Sstevel@tonic-gate #define SSL_R_SSL23_DOING_SESSION_ID_REUSE 221 18900Sstevel@tonic-gate #define SSL_R_SSL2_CONNECTION_ID_TOO_LONG 1114 18910Sstevel@tonic-gate #define SSL_R_SSL3_SESSION_ID_TOO_LONG 1113 18920Sstevel@tonic-gate #define SSL_R_SSL3_SESSION_ID_TOO_SHORT 222 18930Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE 1042 18940Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_BAD_RECORD_MAC 1020 18950Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_EXPIRED 1045 18960Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_REVOKED 1044 18970Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN 1046 18980Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_DECOMPRESSION_FAILURE 1030 18990Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_HANDSHAKE_FAILURE 1040 19000Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_ILLEGAL_PARAMETER 1047 19010Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_NO_CERTIFICATE 1041 19020Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_CERTIFICATE 223 19030Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CERTIFICATE 224 19040Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_NO_CIPHER 225 19050Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_PEER_ERROR_UNSUPPORTED_CERTIFICATE_TYPE 226 19060Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNEXPECTED_MESSAGE 1010 19070Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNKNOWN_REMOTE_ERROR_TYPE 227 19080Sstevel@tonic-gate #define SSL_R_SSLV3_ALERT_UNSUPPORTED_CERTIFICATE 1043 19090Sstevel@tonic-gate #define SSL_R_SSL_CTX_HAS_NO_DEFAULT_SSL_VERSION 228 19100Sstevel@tonic-gate #define SSL_R_SSL_HANDSHAKE_FAILURE 229 19110Sstevel@tonic-gate #define SSL_R_SSL_LIBRARY_HAS_NO_CIPHERS 230 19120Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CALLBACK_FAILED 1102 19130Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CONFLICT 1103 19140Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_CONTEXT_TOO_LONG 273 19150Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_HAS_BAD_LENGTH 1101 19160Sstevel@tonic-gate #define SSL_R_SSL_SESSION_ID_IS_DIFFERENT 231 19170Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_ACCESS_DENIED 1049 19180Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECODE_ERROR 1050 19190Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECRYPTION_FAILED 1021 19200Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_DECRYPT_ERROR 1051 19210Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_EXPORT_RESTRICTION 1060 19220Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_INSUFFICIENT_SECURITY 1071 19230Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_INTERNAL_ERROR 1080 19240Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_NO_RENEGOTIATION 1100 19250Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_PROTOCOL_VERSION 1070 19260Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_RECORD_OVERFLOW 1022 19270Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_UNKNOWN_CA 1048 19280Sstevel@tonic-gate #define SSL_R_TLSV1_ALERT_USER_CANCELLED 1090 19290Sstevel@tonic-gate #define SSL_R_TLS_CLIENT_CERT_REQ_WITH_ANON_CIPHER 232 19300Sstevel@tonic-gate #define SSL_R_TLS_PEER_DID_NOT_RESPOND_WITH_CERTIFICATE_LIST 233 19310Sstevel@tonic-gate #define SSL_R_TLS_RSA_ENCRYPTED_VALUE_LENGTH_IS_WRONG 234 19320Sstevel@tonic-gate #define SSL_R_TRIED_TO_USE_UNSUPPORTED_CIPHER 235 19330Sstevel@tonic-gate #define SSL_R_UNABLE_TO_DECODE_DH_CERTS 236 19342139Sjp161948 #define SSL_R_UNABLE_TO_DECODE_ECDH_CERTS 1115 19350Sstevel@tonic-gate #define SSL_R_UNABLE_TO_EXTRACT_PUBLIC_KEY 237 19360Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_DH_PARAMETERS 238 19372139Sjp161948 #define SSL_R_UNABLE_TO_FIND_ECDH_PARAMETERS 1116 19380Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_PUBLIC_KEY_PARAMETERS 239 19390Sstevel@tonic-gate #define SSL_R_UNABLE_TO_FIND_SSL_METHOD 240 19400Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL2_MD5_ROUTINES 241 19410Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL3_MD5_ROUTINES 242 19420Sstevel@tonic-gate #define SSL_R_UNABLE_TO_LOAD_SSL3_SHA1_ROUTINES 243 19430Sstevel@tonic-gate #define SSL_R_UNEXPECTED_MESSAGE 244 19440Sstevel@tonic-gate #define SSL_R_UNEXPECTED_RECORD 245 19450Sstevel@tonic-gate #define SSL_R_UNINITIALIZED 276 19460Sstevel@tonic-gate #define SSL_R_UNKNOWN_ALERT_TYPE 246 19470Sstevel@tonic-gate #define SSL_R_UNKNOWN_CERTIFICATE_TYPE 247 19480Sstevel@tonic-gate #define SSL_R_UNKNOWN_CIPHER_RETURNED 248 19490Sstevel@tonic-gate #define SSL_R_UNKNOWN_CIPHER_TYPE 249 19500Sstevel@tonic-gate #define SSL_R_UNKNOWN_KEY_EXCHANGE_TYPE 250 19510Sstevel@tonic-gate #define SSL_R_UNKNOWN_PKEY_TYPE 251 19520Sstevel@tonic-gate #define SSL_R_UNKNOWN_PROTOCOL 252 19530Sstevel@tonic-gate #define SSL_R_UNKNOWN_REMOTE_ERROR_TYPE 253 19540Sstevel@tonic-gate #define SSL_R_UNKNOWN_SSL_VERSION 254 19550Sstevel@tonic-gate #define SSL_R_UNKNOWN_STATE 255 19560Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_CIPHER 256 19570Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_COMPRESSION_ALGORITHM 257 19582139Sjp161948 #define SSL_R_UNSUPPORTED_ELLIPTIC_CURVE 1118 19590Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_OPTION 1091 19600Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_PROTOCOL 258 19610Sstevel@tonic-gate #define SSL_R_UNSUPPORTED_SSL_VERSION 259 19620Sstevel@tonic-gate #define SSL_R_WRITE_BIO_NOT_SET 260 19630Sstevel@tonic-gate #define SSL_R_WRONG_CIPHER_RETURNED 261 19640Sstevel@tonic-gate #define SSL_R_WRONG_MESSAGE_TYPE 262 19650Sstevel@tonic-gate #define SSL_R_WRONG_NUMBER_OF_KEY_BITS 263 19660Sstevel@tonic-gate #define SSL_R_WRONG_SIGNATURE_LENGTH 264 19670Sstevel@tonic-gate #define SSL_R_WRONG_SIGNATURE_SIZE 265 19680Sstevel@tonic-gate #define SSL_R_WRONG_SSL_VERSION 266 19690Sstevel@tonic-gate #define SSL_R_WRONG_VERSION_NUMBER 267 19700Sstevel@tonic-gate #define SSL_R_X509_LIB 268 19710Sstevel@tonic-gate #define SSL_R_X509_VERIFICATION_SETUP_PROBLEMS 269 19720Sstevel@tonic-gate 19730Sstevel@tonic-gate #ifdef __cplusplus 19740Sstevel@tonic-gate } 19750Sstevel@tonic-gate #endif 19760Sstevel@tonic-gate #endif 1977