Xuyi Wang / wolfSSL

Dependents:   OS

Committer:
sPymbed
Date:
Wed Nov 20 13:27:48 2019 +0000
Revision:
17:ff9d1e86ad5f
Parent:
15:117db924cf7c
removed: wolfcrypt

Who changed what in which revision?

UserRevisionLine numberNew contents of line
sPymbed 17:ff9d1e86ad5f 1 /* ssl.h
sPymbed 17:ff9d1e86ad5f 2 *
sPymbed 17:ff9d1e86ad5f 3 * Copyright (C) 2006-2017 wolfSSL Inc.
sPymbed 17:ff9d1e86ad5f 4 *
sPymbed 17:ff9d1e86ad5f 5 * This file is part of wolfSSL.
sPymbed 17:ff9d1e86ad5f 6 *
sPymbed 17:ff9d1e86ad5f 7 * wolfSSL is free software; you can redistribute it and/or modify
sPymbed 17:ff9d1e86ad5f 8 * it under the terms of the GNU General Public License as published by
sPymbed 17:ff9d1e86ad5f 9 * the Free Software Foundation; either version 2 of the License, or
sPymbed 17:ff9d1e86ad5f 10 * (at your option) any later version.
sPymbed 17:ff9d1e86ad5f 11 *
sPymbed 17:ff9d1e86ad5f 12 * wolfSSL is distributed in the hope that it will be useful,
sPymbed 17:ff9d1e86ad5f 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
sPymbed 17:ff9d1e86ad5f 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
sPymbed 17:ff9d1e86ad5f 15 * GNU General Public License for more details.
sPymbed 17:ff9d1e86ad5f 16 *
sPymbed 17:ff9d1e86ad5f 17 * You should have received a copy of the GNU General Public License
sPymbed 17:ff9d1e86ad5f 18 * along with this program; if not, write to the Free Software
sPymbed 17:ff9d1e86ad5f 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
sPymbed 17:ff9d1e86ad5f 20 */
sPymbed 17:ff9d1e86ad5f 21 /*!
sPymbed 17:ff9d1e86ad5f 22 \file ../wolfssl/ssl.h
sPymbed 17:ff9d1e86ad5f 23 \brief Header file containing key wolfSSL API
sPymbed 17:ff9d1e86ad5f 24 */
sPymbed 17:ff9d1e86ad5f 25
sPymbed 17:ff9d1e86ad5f 26 /* wolfSSL API */
sPymbed 17:ff9d1e86ad5f 27
sPymbed 17:ff9d1e86ad5f 28 #ifndef WOLFSSL_SSL_H
sPymbed 17:ff9d1e86ad5f 29 #define WOLFSSL_SSL_H
sPymbed 17:ff9d1e86ad5f 30
sPymbed 17:ff9d1e86ad5f 31
sPymbed 17:ff9d1e86ad5f 32 /* for users not using preprocessor flags*/
sPymbed 17:ff9d1e86ad5f 33 #include <wolfcrypt/settings.h>
sPymbed 17:ff9d1e86ad5f 34 #include <wolfssl/version.h>
sPymbed 17:ff9d1e86ad5f 35 #include <wolfcrypt/logging.h>
sPymbed 17:ff9d1e86ad5f 36 #include <wolfcrypt/asn_public.h>
sPymbed 17:ff9d1e86ad5f 37
sPymbed 17:ff9d1e86ad5f 38 #ifdef HAVE_WOLF_EVENT
sPymbed 17:ff9d1e86ad5f 39 #include <wolfcrypt/wolfevent.h>
sPymbed 17:ff9d1e86ad5f 40 #endif
sPymbed 17:ff9d1e86ad5f 41
sPymbed 17:ff9d1e86ad5f 42 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 43 #if defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX)
sPymbed 17:ff9d1e86ad5f 44 #if MQX_USE_IO_OLD
sPymbed 17:ff9d1e86ad5f 45 #include <fio.h>
sPymbed 17:ff9d1e86ad5f 46 #else
sPymbed 17:ff9d1e86ad5f 47 #include <nio.h>
sPymbed 17:ff9d1e86ad5f 48 #endif
sPymbed 17:ff9d1e86ad5f 49 #endif
sPymbed 17:ff9d1e86ad5f 50 #endif
sPymbed 17:ff9d1e86ad5f 51
sPymbed 17:ff9d1e86ad5f 52 #ifdef WOLFSSL_PREFIX
sPymbed 17:ff9d1e86ad5f 53 #include "prefix_ssl.h"
sPymbed 17:ff9d1e86ad5f 54 #endif
sPymbed 17:ff9d1e86ad5f 55
sPymbed 17:ff9d1e86ad5f 56 #ifdef LIBWOLFSSL_VERSION_STRING
sPymbed 17:ff9d1e86ad5f 57 #define WOLFSSL_VERSION LIBWOLFSSL_VERSION_STRING
sPymbed 17:ff9d1e86ad5f 58 #endif
sPymbed 17:ff9d1e86ad5f 59
sPymbed 17:ff9d1e86ad5f 60 #ifdef _WIN32
sPymbed 17:ff9d1e86ad5f 61 /* wincrypt.h clashes */
sPymbed 17:ff9d1e86ad5f 62 #undef OCSP_REQUEST
sPymbed 17:ff9d1e86ad5f 63 #undef OCSP_RESPONSE
sPymbed 17:ff9d1e86ad5f 64 #endif
sPymbed 17:ff9d1e86ad5f 65
sPymbed 17:ff9d1e86ad5f 66 #ifdef OPENSSL_COEXIST
sPymbed 17:ff9d1e86ad5f 67 /* mode to allow wolfSSL and OpenSSL to exist together */
sPymbed 17:ff9d1e86ad5f 68 #ifdef TEST_OPENSSL_COEXIST
sPymbed 17:ff9d1e86ad5f 69 /*
sPymbed 17:ff9d1e86ad5f 70 ./configure --enable-opensslcoexist \
sPymbed 17:ff9d1e86ad5f 71 CFLAGS="-I/usr/local/opt/openssl/include -DTEST_OPENSSL_COEXIST" \
sPymbed 17:ff9d1e86ad5f 72 LDFLAGS="-L/usr/local/opt/openssl/lib -lcrypto"
sPymbed 17:ff9d1e86ad5f 73 */
sPymbed 17:ff9d1e86ad5f 74 #include <openssl/ssl.h>
sPymbed 17:ff9d1e86ad5f 75 #include <openssl/rand.h>
sPymbed 17:ff9d1e86ad5f 76 #include <openssl/err.h>
sPymbed 17:ff9d1e86ad5f 77 #include <openssl/ec.h>
sPymbed 17:ff9d1e86ad5f 78 #include <openssl/hmac.h>
sPymbed 17:ff9d1e86ad5f 79 #include <openssl/bn.h>
sPymbed 17:ff9d1e86ad5f 80 #endif
sPymbed 17:ff9d1e86ad5f 81
sPymbed 17:ff9d1e86ad5f 82 /* make sure old names are disabled */
sPymbed 17:ff9d1e86ad5f 83 #ifndef NO_OLD_SSL_NAMES
sPymbed 17:ff9d1e86ad5f 84 #define NO_OLD_SSL_NAMES
sPymbed 17:ff9d1e86ad5f 85 #endif
sPymbed 17:ff9d1e86ad5f 86 #ifndef NO_OLD_WC_NAMES
sPymbed 17:ff9d1e86ad5f 87 #define NO_OLD_WC_NAMES
sPymbed 17:ff9d1e86ad5f 88 #endif
sPymbed 17:ff9d1e86ad5f 89
sPymbed 17:ff9d1e86ad5f 90 #elif (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
sPymbed 17:ff9d1e86ad5f 91 #include <wolfssl/openssl/bn.h>
sPymbed 17:ff9d1e86ad5f 92 #include <wolfssl/openssl/hmac.h>
sPymbed 17:ff9d1e86ad5f 93
sPymbed 17:ff9d1e86ad5f 94 /* We need the old SSL names */
sPymbed 17:ff9d1e86ad5f 95 #ifdef NO_OLD_SSL_NAMES
sPymbed 17:ff9d1e86ad5f 96 #undef NO_OLD_SSL_NAMES
sPymbed 17:ff9d1e86ad5f 97 #endif
sPymbed 17:ff9d1e86ad5f 98 #ifdef NO_OLD_WC_NAMES
sPymbed 17:ff9d1e86ad5f 99 #undef NO_OLD_WC_NAMES
sPymbed 17:ff9d1e86ad5f 100 #endif
sPymbed 17:ff9d1e86ad5f 101 #endif
sPymbed 17:ff9d1e86ad5f 102
sPymbed 17:ff9d1e86ad5f 103
sPymbed 17:ff9d1e86ad5f 104 #ifdef __cplusplus
sPymbed 17:ff9d1e86ad5f 105 extern "C" {
sPymbed 17:ff9d1e86ad5f 106 #endif
sPymbed 17:ff9d1e86ad5f 107
sPymbed 17:ff9d1e86ad5f 108 #ifndef WOLFSSL_WOLFSSL_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 109 #define WOLFSSL_WOLFSSL_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 110 typedef struct WOLFSSL WOLFSSL;
sPymbed 17:ff9d1e86ad5f 111 #endif
sPymbed 17:ff9d1e86ad5f 112 typedef struct WOLFSSL_SESSION WOLFSSL_SESSION;
sPymbed 17:ff9d1e86ad5f 113 typedef struct WOLFSSL_METHOD WOLFSSL_METHOD;
sPymbed 17:ff9d1e86ad5f 114 #ifndef WOLFSSL_WOLFSSL_CTX_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 115 #define WOLFSSL_WOLFSSL_CTX_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 116 typedef struct WOLFSSL_CTX WOLFSSL_CTX;
sPymbed 17:ff9d1e86ad5f 117 #endif
sPymbed 17:ff9d1e86ad5f 118
sPymbed 17:ff9d1e86ad5f 119 typedef struct WOLFSSL_STACK WOLFSSL_STACK;
sPymbed 17:ff9d1e86ad5f 120 typedef struct WOLFSSL_X509 WOLFSSL_X509;
sPymbed 17:ff9d1e86ad5f 121 typedef struct WOLFSSL_X509_NAME WOLFSSL_X509_NAME;
sPymbed 17:ff9d1e86ad5f 122 typedef struct WOLFSSL_X509_NAME_ENTRY WOLFSSL_X509_NAME_ENTRY;
sPymbed 17:ff9d1e86ad5f 123 typedef struct WOLFSSL_X509_CHAIN WOLFSSL_X509_CHAIN;
sPymbed 17:ff9d1e86ad5f 124 typedef struct WC_PKCS12 WOLFSSL_X509_PKCS12;
sPymbed 17:ff9d1e86ad5f 125
sPymbed 17:ff9d1e86ad5f 126 typedef struct WOLFSSL_CERT_MANAGER WOLFSSL_CERT_MANAGER;
sPymbed 17:ff9d1e86ad5f 127 typedef struct WOLFSSL_SOCKADDR WOLFSSL_SOCKADDR;
sPymbed 17:ff9d1e86ad5f 128 typedef struct WOLFSSL_CRL WOLFSSL_CRL;
sPymbed 17:ff9d1e86ad5f 129
sPymbed 17:ff9d1e86ad5f 130 typedef void *WOLFSSL_X509_STORE_CTX_verify_cb; /* verify callback */
sPymbed 17:ff9d1e86ad5f 131
sPymbed 17:ff9d1e86ad5f 132 /* redeclare guard */
sPymbed 17:ff9d1e86ad5f 133 #define WOLFSSL_TYPES_DEFINED
sPymbed 17:ff9d1e86ad5f 134
sPymbed 17:ff9d1e86ad5f 135 #include <wolfssl/wolfio.h>
sPymbed 17:ff9d1e86ad5f 136
sPymbed 17:ff9d1e86ad5f 137
sPymbed 17:ff9d1e86ad5f 138 #ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 139 typedef struct WOLFSSL_RSA WOLFSSL_RSA;
sPymbed 17:ff9d1e86ad5f 140 #define WOLFSSL_RSA_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 141 #endif
sPymbed 17:ff9d1e86ad5f 142
sPymbed 17:ff9d1e86ad5f 143 #ifndef WC_RNG_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 144 typedef struct WC_RNG WC_RNG;
sPymbed 17:ff9d1e86ad5f 145 #define WC_RNG_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 146 #endif
sPymbed 17:ff9d1e86ad5f 147
sPymbed 17:ff9d1e86ad5f 148 #ifndef WOLFSSL_DSA_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 149 typedef struct WOLFSSL_DSA WOLFSSL_DSA;
sPymbed 17:ff9d1e86ad5f 150 #define WOLFSSL_DSA_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 151 #endif
sPymbed 17:ff9d1e86ad5f 152
sPymbed 17:ff9d1e86ad5f 153 #ifndef WOLFSSL_EC_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 154 typedef struct WOLFSSL_EC_KEY WOLFSSL_EC_KEY;
sPymbed 17:ff9d1e86ad5f 155 typedef struct WOLFSSL_EC_POINT WOLFSSL_EC_POINT;
sPymbed 17:ff9d1e86ad5f 156 typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_GROUP;
sPymbed 17:ff9d1e86ad5f 157 #define WOLFSSL_EC_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 158 #endif
sPymbed 17:ff9d1e86ad5f 159
sPymbed 17:ff9d1e86ad5f 160 #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 161 typedef struct WOLFSSL_ECDSA_SIG WOLFSSL_ECDSA_SIG;
sPymbed 17:ff9d1e86ad5f 162 #define WOLFSSL_ECDSA_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 163 #endif
sPymbed 17:ff9d1e86ad5f 164
sPymbed 17:ff9d1e86ad5f 165 typedef struct WOLFSSL_CIPHER WOLFSSL_CIPHER;
sPymbed 17:ff9d1e86ad5f 166 typedef struct WOLFSSL_X509_LOOKUP WOLFSSL_X509_LOOKUP;
sPymbed 17:ff9d1e86ad5f 167 typedef struct WOLFSSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD;
sPymbed 17:ff9d1e86ad5f 168 typedef struct WOLFSSL_CRL WOLFSSL_X509_CRL;
sPymbed 17:ff9d1e86ad5f 169 typedef struct WOLFSSL_X509_STORE WOLFSSL_X509_STORE;
sPymbed 17:ff9d1e86ad5f 170 typedef struct WOLFSSL_X509_VERIFY_PARAM WOLFSSL_X509_VERIFY_PARAM;
sPymbed 17:ff9d1e86ad5f 171 typedef struct WOLFSSL_BIO WOLFSSL_BIO;
sPymbed 17:ff9d1e86ad5f 172 typedef struct WOLFSSL_BIO_METHOD WOLFSSL_BIO_METHOD;
sPymbed 17:ff9d1e86ad5f 173 typedef struct WOLFSSL_X509_EXTENSION WOLFSSL_X509_EXTENSION;
sPymbed 17:ff9d1e86ad5f 174 typedef struct WOLFSSL_ASN1_TIME WOLFSSL_ASN1_TIME;
sPymbed 17:ff9d1e86ad5f 175 typedef struct WOLFSSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER;
sPymbed 17:ff9d1e86ad5f 176 typedef struct WOLFSSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT;
sPymbed 17:ff9d1e86ad5f 177
sPymbed 17:ff9d1e86ad5f 178 typedef struct WOLFSSL_ASN1_STRING WOLFSSL_ASN1_STRING;
sPymbed 17:ff9d1e86ad5f 179 typedef struct WOLFSSL_dynlock_value WOLFSSL_dynlock_value;
sPymbed 17:ff9d1e86ad5f 180 typedef struct WOLFSSL_DH WOLFSSL_DH;
sPymbed 17:ff9d1e86ad5f 181 typedef struct WOLFSSL_ASN1_BIT_STRING WOLFSSL_ASN1_BIT_STRING;
sPymbed 17:ff9d1e86ad5f 182
sPymbed 17:ff9d1e86ad5f 183 #define WOLFSSL_ASN1_UTCTIME WOLFSSL_ASN1_TIME
sPymbed 17:ff9d1e86ad5f 184 #define WOLFSSL_ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME
sPymbed 17:ff9d1e86ad5f 185
sPymbed 17:ff9d1e86ad5f 186 #define WOLFSSL_ASN1_INTEGER_MAX 20
sPymbed 17:ff9d1e86ad5f 187 struct WOLFSSL_ASN1_INTEGER {
sPymbed 17:ff9d1e86ad5f 188 /* size can be increased set at 20 for tag, length then to hold at least 16
sPymbed 17:ff9d1e86ad5f 189 * byte type */
sPymbed 17:ff9d1e86ad5f 190 unsigned char intData[WOLFSSL_ASN1_INTEGER_MAX];
sPymbed 17:ff9d1e86ad5f 191 /* ASN_INTEGER | LENGTH | hex of number */
sPymbed 17:ff9d1e86ad5f 192 unsigned char negative; /* negative number flag */
sPymbed 17:ff9d1e86ad5f 193
sPymbed 17:ff9d1e86ad5f 194 unsigned char* data;
sPymbed 17:ff9d1e86ad5f 195 unsigned int dataMax; /* max size of data buffer */
sPymbed 17:ff9d1e86ad5f 196 unsigned int isDynamic:1; /* flag for if data pointer dynamic (1 is yes 0 is no) */
sPymbed 17:ff9d1e86ad5f 197 };
sPymbed 17:ff9d1e86ad5f 198
sPymbed 17:ff9d1e86ad5f 199 struct WOLFSSL_ASN1_TIME {
sPymbed 17:ff9d1e86ad5f 200 /* MAX_DATA_SIZE is 32 */
sPymbed 17:ff9d1e86ad5f 201 unsigned char data[32 + 2];
sPymbed 17:ff9d1e86ad5f 202 /* ASN_TIME | LENGTH | date bytes */
sPymbed 17:ff9d1e86ad5f 203 };
sPymbed 17:ff9d1e86ad5f 204
sPymbed 17:ff9d1e86ad5f 205 struct WOLFSSL_ASN1_STRING {
sPymbed 17:ff9d1e86ad5f 206 int length;
sPymbed 17:ff9d1e86ad5f 207 int type; /* type of string i.e. CTC_UTF8 */
sPymbed 17:ff9d1e86ad5f 208 char* data;
sPymbed 17:ff9d1e86ad5f 209 long flags;
sPymbed 17:ff9d1e86ad5f 210 };
sPymbed 17:ff9d1e86ad5f 211
sPymbed 17:ff9d1e86ad5f 212 #define WOLFSSL_MAX_SNAME 40
sPymbed 17:ff9d1e86ad5f 213 struct WOLFSSL_ASN1_OBJECT {
sPymbed 17:ff9d1e86ad5f 214 void* heap;
sPymbed 17:ff9d1e86ad5f 215 unsigned char* obj;
sPymbed 17:ff9d1e86ad5f 216 /* sName is short name i.e sha256 rather than oid (null terminated) */
sPymbed 17:ff9d1e86ad5f 217 char sName[WOLFSSL_MAX_SNAME];
sPymbed 17:ff9d1e86ad5f 218 int type; /* oid */
sPymbed 17:ff9d1e86ad5f 219 int grp; /* type of OID, i.e. oidCertPolicyType */
sPymbed 17:ff9d1e86ad5f 220 unsigned int objSz;
sPymbed 17:ff9d1e86ad5f 221 unsigned char dynamic; /* if 1 then obj was dynamiclly created, 0 otherwise */
sPymbed 17:ff9d1e86ad5f 222 struct d { /* derefrenced */
sPymbed 17:ff9d1e86ad5f 223 WOLFSSL_ASN1_STRING ia5_internal;
sPymbed 17:ff9d1e86ad5f 224 WOLFSSL_ASN1_STRING* ia5; /* points to ia5_internal */
sPymbed 17:ff9d1e86ad5f 225 WOLFSSL_ASN1_STRING* dNSName;
sPymbed 17:ff9d1e86ad5f 226 WOLFSSL_ASN1_STRING* iPAddress;
sPymbed 17:ff9d1e86ad5f 227 } d;
sPymbed 17:ff9d1e86ad5f 228 };
sPymbed 17:ff9d1e86ad5f 229
sPymbed 17:ff9d1e86ad5f 230 struct WOLFSSL_EVP_PKEY {
sPymbed 17:ff9d1e86ad5f 231 void* heap;
sPymbed 17:ff9d1e86ad5f 232 int type; /* openssh dereference */
sPymbed 17:ff9d1e86ad5f 233 int save_type; /* openssh dereference */
sPymbed 17:ff9d1e86ad5f 234 int pkey_sz;
sPymbed 17:ff9d1e86ad5f 235 union {
sPymbed 17:ff9d1e86ad5f 236 char* ptr; /* der format of key / or raw for NTRU */
sPymbed 17:ff9d1e86ad5f 237 } pkey;
sPymbed 17:ff9d1e86ad5f 238 #if (defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL))
sPymbed 17:ff9d1e86ad5f 239 #ifndef NO_RSA
sPymbed 17:ff9d1e86ad5f 240 WOLFSSL_RSA* rsa;
sPymbed 17:ff9d1e86ad5f 241 byte ownRsa; /* if struct owns RSA and should free it */
sPymbed 17:ff9d1e86ad5f 242 #endif
sPymbed 17:ff9d1e86ad5f 243 #ifdef HAVE_ECC
sPymbed 17:ff9d1e86ad5f 244 WOLFSSL_EC_KEY* ecc;
sPymbed 17:ff9d1e86ad5f 245 byte ownEcc; /* if struct owns ECC and should free it */
sPymbed 17:ff9d1e86ad5f 246 #endif
sPymbed 17:ff9d1e86ad5f 247 WC_RNG rng;
sPymbed 17:ff9d1e86ad5f 248 #endif /* OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
sPymbed 17:ff9d1e86ad5f 249 #ifdef HAVE_ECC
sPymbed 17:ff9d1e86ad5f 250 int pkey_curve;
sPymbed 17:ff9d1e86ad5f 251 #endif
sPymbed 17:ff9d1e86ad5f 252 };
sPymbed 17:ff9d1e86ad5f 253 typedef struct WOLFSSL_EVP_PKEY WOLFSSL_PKCS8_PRIV_KEY_INFO;
sPymbed 17:ff9d1e86ad5f 254
sPymbed 17:ff9d1e86ad5f 255 #ifndef WOLFSSL_EVP_TYPE_DEFINED /* guard on redeclaration */
sPymbed 17:ff9d1e86ad5f 256 typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY;
sPymbed 17:ff9d1e86ad5f 257 typedef char WOLFSSL_EVP_MD;
sPymbed 17:ff9d1e86ad5f 258 #define WOLFSSL_EVP_TYPE_DEFINED
sPymbed 17:ff9d1e86ad5f 259 #endif
sPymbed 17:ff9d1e86ad5f 260
sPymbed 17:ff9d1e86ad5f 261 #define WOLFSSL_EVP_PKEY_DEFAULT EVP_PKEY_RSA /* default key type */
sPymbed 17:ff9d1e86ad5f 262
sPymbed 17:ff9d1e86ad5f 263
sPymbed 17:ff9d1e86ad5f 264 enum BIO_TYPE {
sPymbed 17:ff9d1e86ad5f 265 WOLFSSL_BIO_BUFFER = 1,
sPymbed 17:ff9d1e86ad5f 266 WOLFSSL_BIO_SOCKET = 2,
sPymbed 17:ff9d1e86ad5f 267 WOLFSSL_BIO_SSL = 3,
sPymbed 17:ff9d1e86ad5f 268 WOLFSSL_BIO_MEMORY = 4,
sPymbed 17:ff9d1e86ad5f 269 WOLFSSL_BIO_BIO = 5,
sPymbed 17:ff9d1e86ad5f 270 WOLFSSL_BIO_FILE = 6,
sPymbed 17:ff9d1e86ad5f 271 WOLFSSL_BIO_BASE64 = 7
sPymbed 17:ff9d1e86ad5f 272 };
sPymbed 17:ff9d1e86ad5f 273
sPymbed 17:ff9d1e86ad5f 274 enum BIO_FLAGS {
sPymbed 17:ff9d1e86ad5f 275 WOLFSSL_BIO_FLAG_BASE64_NO_NL = 0x01,
sPymbed 17:ff9d1e86ad5f 276 WOLFSSL_BIO_FLAG_READ = 0x02,
sPymbed 17:ff9d1e86ad5f 277 WOLFSSL_BIO_FLAG_WRITE = 0x04,
sPymbed 17:ff9d1e86ad5f 278 WOLFSSL_BIO_FLAG_IO_SPECIAL = 0x08,
sPymbed 17:ff9d1e86ad5f 279 WOLFSSL_BIO_FLAG_RETRY = 0x10
sPymbed 17:ff9d1e86ad5f 280 };
sPymbed 17:ff9d1e86ad5f 281
sPymbed 17:ff9d1e86ad5f 282 typedef struct WOLFSSL_BUF_MEM {
sPymbed 17:ff9d1e86ad5f 283 char* data; /* dereferenced */
sPymbed 17:ff9d1e86ad5f 284 size_t length; /* current length */
sPymbed 17:ff9d1e86ad5f 285 size_t max; /* maximum length */
sPymbed 17:ff9d1e86ad5f 286 } WOLFSSL_BUF_MEM;
sPymbed 17:ff9d1e86ad5f 287
sPymbed 17:ff9d1e86ad5f 288 typedef struct WOLFSSL_COMP_METHOD {
sPymbed 17:ff9d1e86ad5f 289 int type; /* stunnel dereference */
sPymbed 17:ff9d1e86ad5f 290 } WOLFSSL_COMP_METHOD;
sPymbed 17:ff9d1e86ad5f 291
sPymbed 17:ff9d1e86ad5f 292 struct WOLFSSL_X509_LOOKUP_METHOD {
sPymbed 17:ff9d1e86ad5f 293 int type;
sPymbed 17:ff9d1e86ad5f 294 };
sPymbed 17:ff9d1e86ad5f 295
sPymbed 17:ff9d1e86ad5f 296 struct WOLFSSL_X509_LOOKUP {
sPymbed 17:ff9d1e86ad5f 297 WOLFSSL_X509_STORE *store;
sPymbed 17:ff9d1e86ad5f 298 };
sPymbed 17:ff9d1e86ad5f 299
sPymbed 17:ff9d1e86ad5f 300 struct WOLFSSL_X509_STORE {
sPymbed 17:ff9d1e86ad5f 301 int cache; /* stunnel dereference */
sPymbed 17:ff9d1e86ad5f 302 WOLFSSL_CERT_MANAGER* cm;
sPymbed 17:ff9d1e86ad5f 303 WOLFSSL_X509_LOOKUP lookup;
sPymbed 17:ff9d1e86ad5f 304 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 305 int isDynamic;
sPymbed 17:ff9d1e86ad5f 306 #endif
sPymbed 17:ff9d1e86ad5f 307 #if defined(OPENSSL_EXTRA) && defined(HAVE_CRL)
sPymbed 17:ff9d1e86ad5f 308 WOLFSSL_X509_CRL *crl;
sPymbed 17:ff9d1e86ad5f 309 #endif
sPymbed 17:ff9d1e86ad5f 310 };
sPymbed 17:ff9d1e86ad5f 311
sPymbed 17:ff9d1e86ad5f 312 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 313 #define WOLFSSL_USE_CHECK_TIME 0x2
sPymbed 17:ff9d1e86ad5f 314 #define WOLFSSL_NO_CHECK_TIME 0x200000
sPymbed 17:ff9d1e86ad5f 315 #define WOLFSSL_NO_WILDCARDS 0x4
sPymbed 17:ff9d1e86ad5f 316 struct WOLFSSL_X509_VERIFY_PARAM {
sPymbed 17:ff9d1e86ad5f 317 time_t check_time;
sPymbed 17:ff9d1e86ad5f 318 unsigned long flags;
sPymbed 17:ff9d1e86ad5f 319 };
sPymbed 17:ff9d1e86ad5f 320 #endif
sPymbed 17:ff9d1e86ad5f 321
sPymbed 17:ff9d1e86ad5f 322 typedef struct WOLFSSL_ALERT {
sPymbed 17:ff9d1e86ad5f 323 int code;
sPymbed 17:ff9d1e86ad5f 324 int level;
sPymbed 17:ff9d1e86ad5f 325 } WOLFSSL_ALERT;
sPymbed 17:ff9d1e86ad5f 326
sPymbed 17:ff9d1e86ad5f 327 typedef struct WOLFSSL_ALERT_HISTORY {
sPymbed 17:ff9d1e86ad5f 328 WOLFSSL_ALERT last_rx;
sPymbed 17:ff9d1e86ad5f 329 WOLFSSL_ALERT last_tx;
sPymbed 17:ff9d1e86ad5f 330 } WOLFSSL_ALERT_HISTORY;
sPymbed 17:ff9d1e86ad5f 331
sPymbed 17:ff9d1e86ad5f 332 typedef struct WOLFSSL_X509_REVOKED {
sPymbed 17:ff9d1e86ad5f 333 WOLFSSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */
sPymbed 17:ff9d1e86ad5f 334 } WOLFSSL_X509_REVOKED;
sPymbed 17:ff9d1e86ad5f 335
sPymbed 17:ff9d1e86ad5f 336
sPymbed 17:ff9d1e86ad5f 337 typedef struct WOLFSSL_X509_OBJECT {
sPymbed 17:ff9d1e86ad5f 338 union {
sPymbed 17:ff9d1e86ad5f 339 char* ptr;
sPymbed 17:ff9d1e86ad5f 340 WOLFSSL_X509 *x509;
sPymbed 17:ff9d1e86ad5f 341 WOLFSSL_X509_CRL* crl; /* stunnel dereference */
sPymbed 17:ff9d1e86ad5f 342 } data;
sPymbed 17:ff9d1e86ad5f 343 } WOLFSSL_X509_OBJECT;
sPymbed 17:ff9d1e86ad5f 344
sPymbed 17:ff9d1e86ad5f 345 typedef struct WOLFSSL_BUFFER_INFO {
sPymbed 17:ff9d1e86ad5f 346 unsigned char* buffer;
sPymbed 17:ff9d1e86ad5f 347 unsigned int length;
sPymbed 17:ff9d1e86ad5f 348 } WOLFSSL_BUFFER_INFO;
sPymbed 17:ff9d1e86ad5f 349
sPymbed 17:ff9d1e86ad5f 350 typedef struct WOLFSSL_X509_STORE_CTX {
sPymbed 17:ff9d1e86ad5f 351 WOLFSSL_X509_STORE* store; /* Store full of a CA cert chain */
sPymbed 17:ff9d1e86ad5f 352 WOLFSSL_X509* current_cert; /* stunnel dereference */
sPymbed 17:ff9d1e86ad5f 353 WOLFSSL_X509* current_issuer; /* asio dereference */
sPymbed 17:ff9d1e86ad5f 354 WOLFSSL_X509_CHAIN* sesChain; /* pointer to WOLFSSL_SESSION peer chain */
sPymbed 17:ff9d1e86ad5f 355 WOLFSSL_STACK* chain;
sPymbed 17:ff9d1e86ad5f 356 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 357 WOLFSSL_X509_VERIFY_PARAM* param; /* certificate validation parameter */
sPymbed 17:ff9d1e86ad5f 358 #endif
sPymbed 17:ff9d1e86ad5f 359 char* domain; /* subject CN domain name */
sPymbed 17:ff9d1e86ad5f 360 void* ex_data; /* external data, for fortress build */
sPymbed 17:ff9d1e86ad5f 361 void* userCtx; /* user ctx */
sPymbed 17:ff9d1e86ad5f 362 int error; /* current error */
sPymbed 17:ff9d1e86ad5f 363 int error_depth; /* index of cert depth for this error */
sPymbed 17:ff9d1e86ad5f 364 int discardSessionCerts; /* so verify callback can flag for discard */
sPymbed 17:ff9d1e86ad5f 365 int totalCerts; /* number of peer cert buffers */
sPymbed 17:ff9d1e86ad5f 366 WOLFSSL_BUFFER_INFO* certs; /* peer certs */
sPymbed 17:ff9d1e86ad5f 367 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb; /* verify callback */
sPymbed 17:ff9d1e86ad5f 368 } WOLFSSL_X509_STORE_CTX;
sPymbed 17:ff9d1e86ad5f 369
sPymbed 17:ff9d1e86ad5f 370 typedef char* WOLFSSL_STRING;
sPymbed 17:ff9d1e86ad5f 371
sPymbed 17:ff9d1e86ad5f 372 /* Valid Alert types from page 16/17
sPymbed 17:ff9d1e86ad5f 373 * Add alert string to the function wolfSSL_alert_type_string_long in src/ssl.c
sPymbed 17:ff9d1e86ad5f 374 */
sPymbed 17:ff9d1e86ad5f 375 enum AlertDescription {
sPymbed 17:ff9d1e86ad5f 376 close_notify = 0,
sPymbed 17:ff9d1e86ad5f 377 unexpected_message = 10,
sPymbed 17:ff9d1e86ad5f 378 bad_record_mac = 20,
sPymbed 17:ff9d1e86ad5f 379 record_overflow = 22,
sPymbed 17:ff9d1e86ad5f 380 decompression_failure = 30,
sPymbed 17:ff9d1e86ad5f 381 handshake_failure = 40,
sPymbed 17:ff9d1e86ad5f 382 no_certificate = 41,
sPymbed 17:ff9d1e86ad5f 383 bad_certificate = 42,
sPymbed 17:ff9d1e86ad5f 384 unsupported_certificate = 43,
sPymbed 17:ff9d1e86ad5f 385 certificate_revoked = 44,
sPymbed 17:ff9d1e86ad5f 386 certificate_expired = 45,
sPymbed 17:ff9d1e86ad5f 387 certificate_unknown = 46,
sPymbed 17:ff9d1e86ad5f 388 illegal_parameter = 47,
sPymbed 17:ff9d1e86ad5f 389 decode_error = 50,
sPymbed 17:ff9d1e86ad5f 390 decrypt_error = 51,
sPymbed 17:ff9d1e86ad5f 391 #ifdef WOLFSSL_MYSQL_COMPATIBLE
sPymbed 17:ff9d1e86ad5f 392 /* catch name conflict for enum protocol with MYSQL build */
sPymbed 17:ff9d1e86ad5f 393 wc_protocol_version = 70,
sPymbed 17:ff9d1e86ad5f 394 #else
sPymbed 17:ff9d1e86ad5f 395 protocol_version = 70,
sPymbed 17:ff9d1e86ad5f 396 #endif
sPymbed 17:ff9d1e86ad5f 397 no_renegotiation = 100,
sPymbed 17:ff9d1e86ad5f 398 unsupported_extension = 110, /**< RFC 5246, section 7.2.2 */
sPymbed 17:ff9d1e86ad5f 399 unrecognized_name = 112, /**< RFC 6066, section 3 */
sPymbed 17:ff9d1e86ad5f 400 bad_certificate_status_response = 113, /**< RFC 6066, section 8 */
sPymbed 17:ff9d1e86ad5f 401 unknown_psk_identity = 115, /**< RFC 4279, section 2 */
sPymbed 17:ff9d1e86ad5f 402 no_application_protocol = 120
sPymbed 17:ff9d1e86ad5f 403 };
sPymbed 17:ff9d1e86ad5f 404
sPymbed 17:ff9d1e86ad5f 405
sPymbed 17:ff9d1e86ad5f 406 enum AlertLevel {
sPymbed 17:ff9d1e86ad5f 407 alert_warning = 1,
sPymbed 17:ff9d1e86ad5f 408 alert_fatal = 2
sPymbed 17:ff9d1e86ad5f 409 };
sPymbed 17:ff9d1e86ad5f 410
sPymbed 17:ff9d1e86ad5f 411 /* Maximum master key length (SECRET_LEN) */
sPymbed 17:ff9d1e86ad5f 412 #define WOLFSSL_MAX_MASTER_KEY_LENGTH 48
sPymbed 17:ff9d1e86ad5f 413 /* Maximum number of groups that can be set */
sPymbed 17:ff9d1e86ad5f 414 #define WOLFSSL_MAX_GROUP_COUNT 10
sPymbed 17:ff9d1e86ad5f 415
sPymbed 17:ff9d1e86ad5f 416 typedef WOLFSSL_METHOD* (*wolfSSL_method_func)(void* heap);
sPymbed 17:ff9d1e86ad5f 417 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 418 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 419 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 420 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 421 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 422 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 423 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 424 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 425 #ifdef WOLFSSL_TLS13
sPymbed 17:ff9d1e86ad5f 426 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 427 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 428 #endif
sPymbed 17:ff9d1e86ad5f 429 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 430 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 431
sPymbed 17:ff9d1e86ad5f 432 #ifdef WOLFSSL_DTLS
sPymbed 17:ff9d1e86ad5f 433 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 434 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 435 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 436 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 437 #endif
sPymbed 17:ff9d1e86ad5f 438 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_method(void);
sPymbed 17:ff9d1e86ad5f 439 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method(void);
sPymbed 17:ff9d1e86ad5f 440 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method(void);
sPymbed 17:ff9d1e86ad5f 441 WOLFSSL_API WOLFSSL_METHOD* wolfTLSv1_method(void);
sPymbed 17:ff9d1e86ad5f 442 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method(void);
sPymbed 17:ff9d1e86ad5f 443 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method(void);
sPymbed 17:ff9d1e86ad5f 444 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_method(void);
sPymbed 17:ff9d1e86ad5f 445 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method(void);
sPymbed 17:ff9d1e86ad5f 446 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method(void);
sPymbed 17:ff9d1e86ad5f 447 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_method(void);
sPymbed 17:ff9d1e86ad5f 448 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method(void);
sPymbed 17:ff9d1e86ad5f 449 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method(void);
sPymbed 17:ff9d1e86ad5f 450 #ifdef WOLFSSL_TLS13
sPymbed 17:ff9d1e86ad5f 451 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_server_method(void);
sPymbed 17:ff9d1e86ad5f 452 WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_3_client_method(void);
sPymbed 17:ff9d1e86ad5f 453 #endif
sPymbed 17:ff9d1e86ad5f 454
sPymbed 17:ff9d1e86ad5f 455 #ifdef WOLFSSL_DTLS
sPymbed 17:ff9d1e86ad5f 456 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method(void);
sPymbed 17:ff9d1e86ad5f 457 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method(void);
sPymbed 17:ff9d1e86ad5f 458 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method(void);
sPymbed 17:ff9d1e86ad5f 459 WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method(void);
sPymbed 17:ff9d1e86ad5f 460 #endif
sPymbed 17:ff9d1e86ad5f 461
sPymbed 17:ff9d1e86ad5f 462 #ifdef HAVE_POLY1305
sPymbed 17:ff9d1e86ad5f 463 WOLFSSL_API int wolfSSL_use_old_poly(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 464 #endif
sPymbed 17:ff9d1e86ad5f 465
sPymbed 17:ff9d1e86ad5f 466 #ifdef WOLFSSL_SESSION_EXPORT
sPymbed 17:ff9d1e86ad5f 467 #ifdef WOLFSSL_DTLS
sPymbed 17:ff9d1e86ad5f 468
sPymbed 17:ff9d1e86ad5f 469 #ifndef WOLFSSL_DTLS_EXPORT_TYPES
sPymbed 17:ff9d1e86ad5f 470 typedef int (*wc_dtls_export)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 471 unsigned char* exportBuffer, unsigned int sz, void* userCtx);
sPymbed 17:ff9d1e86ad5f 472 #define WOLFSSL_DTLS_EXPORT_TYPES
sPymbed 17:ff9d1e86ad5f 473 #endif /* WOLFSSL_DTLS_EXPORT_TYPES */
sPymbed 17:ff9d1e86ad5f 474
sPymbed 17:ff9d1e86ad5f 475 WOLFSSL_API int wolfSSL_dtls_import(WOLFSSL* ssl, unsigned char* buf,
sPymbed 17:ff9d1e86ad5f 476 unsigned int sz);
sPymbed 17:ff9d1e86ad5f 477 WOLFSSL_API int wolfSSL_CTX_dtls_set_export(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 478 wc_dtls_export func);
sPymbed 17:ff9d1e86ad5f 479 WOLFSSL_API int wolfSSL_dtls_set_export(WOLFSSL* ssl, wc_dtls_export func);
sPymbed 17:ff9d1e86ad5f 480 WOLFSSL_API int wolfSSL_dtls_export(WOLFSSL* ssl, unsigned char* buf,
sPymbed 17:ff9d1e86ad5f 481 unsigned int* sz);
sPymbed 17:ff9d1e86ad5f 482 #endif /* WOLFSSL_DTLS */
sPymbed 17:ff9d1e86ad5f 483 #endif /* WOLFSSL_SESSION_EXPORT */
sPymbed 17:ff9d1e86ad5f 484
sPymbed 17:ff9d1e86ad5f 485 #ifdef WOLFSSL_STATIC_MEMORY
sPymbed 17:ff9d1e86ad5f 486 #ifndef WOLFSSL_MEM_GUARD
sPymbed 17:ff9d1e86ad5f 487 #define WOLFSSL_MEM_GUARD
sPymbed 17:ff9d1e86ad5f 488 typedef struct WOLFSSL_MEM_STATS WOLFSSL_MEM_STATS;
sPymbed 17:ff9d1e86ad5f 489 typedef struct WOLFSSL_MEM_CONN_STATS WOLFSSL_MEM_CONN_STATS;
sPymbed 17:ff9d1e86ad5f 490 #endif
sPymbed 17:ff9d1e86ad5f 491 WOLFSSL_API int wolfSSL_CTX_load_static_memory(WOLFSSL_CTX** ctx,
sPymbed 17:ff9d1e86ad5f 492 wolfSSL_method_func method,
sPymbed 17:ff9d1e86ad5f 493 unsigned char* buf, unsigned int sz,
sPymbed 17:ff9d1e86ad5f 494 int flag, int max);
sPymbed 17:ff9d1e86ad5f 495 WOLFSSL_API int wolfSSL_CTX_is_static_memory(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 496 WOLFSSL_MEM_STATS* mem_stats);
sPymbed 17:ff9d1e86ad5f 497 WOLFSSL_API int wolfSSL_is_static_memory(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 498 WOLFSSL_MEM_CONN_STATS* mem_stats);
sPymbed 17:ff9d1e86ad5f 499 #endif
sPymbed 17:ff9d1e86ad5f 500
sPymbed 17:ff9d1e86ad5f 501 #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS)
sPymbed 17:ff9d1e86ad5f 502
sPymbed 17:ff9d1e86ad5f 503 WOLFSSL_API int wolfSSL_CTX_use_certificate_file(WOLFSSL_CTX*, const char*, int);
sPymbed 17:ff9d1e86ad5f 504 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*, const char*, int);
sPymbed 17:ff9d1e86ad5f 505 WOLFSSL_API int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX*, const char*,
sPymbed 17:ff9d1e86ad5f 506 const char*);
sPymbed 17:ff9d1e86ad5f 507 #ifdef WOLFSSL_TRUST_PEER_CERT
sPymbed 17:ff9d1e86ad5f 508 WOLFSSL_API int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX*, const char*, int);
sPymbed 17:ff9d1e86ad5f 509 #endif
sPymbed 17:ff9d1e86ad5f 510 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 511 const char *file);
sPymbed 17:ff9d1e86ad5f 512 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file_format(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 513 const char *file, int format);
sPymbed 17:ff9d1e86ad5f 514 WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey_file(WOLFSSL_CTX*, const char*, int);
sPymbed 17:ff9d1e86ad5f 515
sPymbed 17:ff9d1e86ad5f 516 WOLFSSL_API long wolfSSL_get_verify_depth(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 517 WOLFSSL_API long wolfSSL_CTX_get_verify_depth(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 518 WOLFSSL_API void wolfSSL_CTX_set_verify_depth(WOLFSSL_CTX *ctx,int depth);
sPymbed 17:ff9d1e86ad5f 519 WOLFSSL_API int wolfSSL_use_certificate_file(WOLFSSL*, const char*, int);
sPymbed 17:ff9d1e86ad5f 520 WOLFSSL_API int wolfSSL_use_PrivateKey_file(WOLFSSL*, const char*, int);
sPymbed 17:ff9d1e86ad5f 521 WOLFSSL_API int wolfSSL_use_certificate_chain_file(WOLFSSL*, const char *file);
sPymbed 17:ff9d1e86ad5f 522 WOLFSSL_API int wolfSSL_use_certificate_chain_file_format(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 523 const char *file, int format);
sPymbed 17:ff9d1e86ad5f 524 WOLFSSL_API int wolfSSL_use_RSAPrivateKey_file(WOLFSSL*, const char*, int);
sPymbed 17:ff9d1e86ad5f 525
sPymbed 17:ff9d1e86ad5f 526 #ifdef WOLFSSL_DER_LOAD
sPymbed 17:ff9d1e86ad5f 527 WOLFSSL_API int wolfSSL_CTX_der_load_verify_locations(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 528 const char*, int);
sPymbed 17:ff9d1e86ad5f 529 #endif
sPymbed 17:ff9d1e86ad5f 530
sPymbed 17:ff9d1e86ad5f 531 #ifdef HAVE_NTRU
sPymbed 17:ff9d1e86ad5f 532 WOLFSSL_API int wolfSSL_CTX_use_NTRUPrivateKey_file(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 533 /* load NTRU private key blob */
sPymbed 17:ff9d1e86ad5f 534 #endif
sPymbed 17:ff9d1e86ad5f 535
sPymbed 17:ff9d1e86ad5f 536 #endif /* !NO_FILESYSTEM && !NO_CERTS */
sPymbed 17:ff9d1e86ad5f 537
sPymbed 17:ff9d1e86ad5f 538 WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD*);
sPymbed 17:ff9d1e86ad5f 539 WOLFSSL_API WOLFSSL* wolfSSL_new(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 540 WOLFSSL_API int wolfSSL_is_server(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 541 WOLFSSL_API WOLFSSL* wolfSSL_write_dup(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 542 WOLFSSL_API int wolfSSL_set_fd (WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 543 WOLFSSL_API int wolfSSL_set_write_fd (WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 544 WOLFSSL_API int wolfSSL_set_read_fd (WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 545 WOLFSSL_API char* wolfSSL_get_cipher_list(int priority);
sPymbed 17:ff9d1e86ad5f 546 WOLFSSL_API char* wolfSSL_get_cipher_list_ex(WOLFSSL* ssl, int priority);
sPymbed 17:ff9d1e86ad5f 547 WOLFSSL_API int wolfSSL_get_ciphers(char*, int);
sPymbed 17:ff9d1e86ad5f 548 WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 549 WOLFSSL_API const char* wolfSSL_get_cipher_name_from_suite(const unsigned char,
sPymbed 17:ff9d1e86ad5f 550 const unsigned char);
sPymbed 17:ff9d1e86ad5f 551 WOLFSSL_API const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf,
sPymbed 17:ff9d1e86ad5f 552 int len);
sPymbed 17:ff9d1e86ad5f 553 WOLFSSL_API const char* wolfSSL_get_curve_name(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 554 WOLFSSL_API int wolfSSL_get_fd(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 555 /* please see note at top of README if you get an error from connect */
sPymbed 17:ff9d1e86ad5f 556 WOLFSSL_API int wolfSSL_connect(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 557 WOLFSSL_API int wolfSSL_write(WOLFSSL*, const void*, int);
sPymbed 17:ff9d1e86ad5f 558 WOLFSSL_API int wolfSSL_read(WOLFSSL*, void*, int);
sPymbed 17:ff9d1e86ad5f 559 WOLFSSL_API int wolfSSL_peek(WOLFSSL*, void*, int);
sPymbed 17:ff9d1e86ad5f 560 WOLFSSL_API int wolfSSL_accept(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 561 #ifdef WOLFSSL_TLS13
sPymbed 17:ff9d1e86ad5f 562 WOLFSSL_API int wolfSSL_send_hrr_cookie(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 563 const unsigned char* secret, unsigned int secretSz);
sPymbed 17:ff9d1e86ad5f 564 WOLFSSL_API int wolfSSL_CTX_no_ticket_TLSv13(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 565 WOLFSSL_API int wolfSSL_no_ticket_TLSv13(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 566 WOLFSSL_API int wolfSSL_CTX_no_dhe_psk(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 567 WOLFSSL_API int wolfSSL_no_dhe_psk(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 568 WOLFSSL_API int wolfSSL_update_keys(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 569 WOLFSSL_API int wolfSSL_CTX_allow_post_handshake_auth(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 570 WOLFSSL_API int wolfSSL_allow_post_handshake_auth(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 571 WOLFSSL_API int wolfSSL_request_certificate(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 572
sPymbed 17:ff9d1e86ad5f 573 WOLFSSL_API int wolfSSL_preferred_group(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 574 WOLFSSL_API int wolfSSL_CTX_set_groups(WOLFSSL_CTX* ctx, int* groups,
sPymbed 17:ff9d1e86ad5f 575 int count);
sPymbed 17:ff9d1e86ad5f 576 WOLFSSL_API int wolfSSL_set_groups(WOLFSSL* ssl, int* groups, int count);
sPymbed 17:ff9d1e86ad5f 577
sPymbed 17:ff9d1e86ad5f 578 WOLFSSL_API int wolfSSL_connect_TLSv13(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 579 WOLFSSL_API int wolfSSL_accept_TLSv13(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 580
sPymbed 17:ff9d1e86ad5f 581 #ifdef WOLFSSL_EARLY_DATA
sPymbed 17:ff9d1e86ad5f 582 WOLFSSL_API int wolfSSL_CTX_set_max_early_data(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 583 unsigned int sz);
sPymbed 17:ff9d1e86ad5f 584 WOLFSSL_API int wolfSSL_set_max_early_data(WOLFSSL* ssl, unsigned int sz);
sPymbed 17:ff9d1e86ad5f 585 WOLFSSL_API int wolfSSL_write_early_data(WOLFSSL*, const void*, int, int*);
sPymbed 17:ff9d1e86ad5f 586 WOLFSSL_API int wolfSSL_read_early_data(WOLFSSL*, void*, int, int*);
sPymbed 17:ff9d1e86ad5f 587 #endif
sPymbed 17:ff9d1e86ad5f 588 #endif
sPymbed 17:ff9d1e86ad5f 589 WOLFSSL_API void wolfSSL_CTX_free(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 590 WOLFSSL_API void wolfSSL_free(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 591 WOLFSSL_API int wolfSSL_shutdown(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 592 WOLFSSL_API int wolfSSL_send(WOLFSSL*, const void*, int sz, int flags);
sPymbed 17:ff9d1e86ad5f 593 WOLFSSL_API int wolfSSL_recv(WOLFSSL*, void*, int sz, int flags);
sPymbed 17:ff9d1e86ad5f 594
sPymbed 17:ff9d1e86ad5f 595 WOLFSSL_API void wolfSSL_CTX_set_quiet_shutdown(WOLFSSL_CTX*, int);
sPymbed 17:ff9d1e86ad5f 596 WOLFSSL_API void wolfSSL_set_quiet_shutdown(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 597
sPymbed 17:ff9d1e86ad5f 598 WOLFSSL_API int wolfSSL_get_error(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 599 WOLFSSL_API int wolfSSL_get_alert_history(WOLFSSL*, WOLFSSL_ALERT_HISTORY *);
sPymbed 17:ff9d1e86ad5f 600
sPymbed 17:ff9d1e86ad5f 601 WOLFSSL_API int wolfSSL_set_session(WOLFSSL*, WOLFSSL_SESSION*);
sPymbed 17:ff9d1e86ad5f 602 WOLFSSL_API long wolfSSL_SSL_SESSION_set_timeout(WOLFSSL_SESSION*, long);
sPymbed 17:ff9d1e86ad5f 603 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get_session(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 604 WOLFSSL_API void wolfSSL_flush_sessions(WOLFSSL_CTX*, long);
sPymbed 17:ff9d1e86ad5f 605 WOLFSSL_API int wolfSSL_SetServerID(WOLFSSL*, const unsigned char*, int, int);
sPymbed 17:ff9d1e86ad5f 606
sPymbed 17:ff9d1e86ad5f 607 #if defined(OPENSSL_ALL) || defined(WOLFSSL_ASIO)
sPymbed 17:ff9d1e86ad5f 608 WOLFSSL_API int wolfSSL_BIO_new_bio_pair(WOLFSSL_BIO**, size_t,
sPymbed 17:ff9d1e86ad5f 609 WOLFSSL_BIO**, size_t);
sPymbed 17:ff9d1e86ad5f 610
sPymbed 17:ff9d1e86ad5f 611 WOLFSSL_API WOLFSSL_RSA* wolfSSL_d2i_RSAPrivateKey_bio(WOLFSSL_BIO*, WOLFSSL_RSA**);
sPymbed 17:ff9d1e86ad5f 612 WOLFSSL_API int wolfSSL_CTX_use_certificate_ASN1(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 613 int, const unsigned char*);
sPymbed 17:ff9d1e86ad5f 614 WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey(WOLFSSL_CTX*, WOLFSSL_RSA*);
sPymbed 17:ff9d1e86ad5f 615 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey_bio(WOLFSSL_BIO*, WOLFSSL_EVP_PKEY**);
sPymbed 17:ff9d1e86ad5f 616 #endif /* OPENSSL_ALL || WOLFSSL_ASIO */
sPymbed 17:ff9d1e86ad5f 617
sPymbed 17:ff9d1e86ad5f 618 #ifdef SESSION_INDEX
sPymbed 17:ff9d1e86ad5f 619 WOLFSSL_API int wolfSSL_GetSessionIndex(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 620 WOLFSSL_API int wolfSSL_GetSessionAtIndex(int index, WOLFSSL_SESSION* session);
sPymbed 17:ff9d1e86ad5f 621 #endif /* SESSION_INDEX */
sPymbed 17:ff9d1e86ad5f 622
sPymbed 17:ff9d1e86ad5f 623 #if defined(SESSION_INDEX) && defined(SESSION_CERTS)
sPymbed 17:ff9d1e86ad5f 624 WOLFSSL_API
sPymbed 17:ff9d1e86ad5f 625 WOLFSSL_X509_CHAIN* wolfSSL_SESSION_get_peer_chain(WOLFSSL_SESSION* session);
sPymbed 17:ff9d1e86ad5f 626 #endif /* SESSION_INDEX && SESSION_CERTS */
sPymbed 17:ff9d1e86ad5f 627
sPymbed 17:ff9d1e86ad5f 628 typedef int (*VerifyCallback)(int, WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 629 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 630 typedef void (CallbackInfoState)(const WOLFSSL*, int, int);
sPymbed 17:ff9d1e86ad5f 631
sPymbed 17:ff9d1e86ad5f 632 typedef struct WOLFSSL_CRYPTO_EX_DATA {
sPymbed 17:ff9d1e86ad5f 633 WOLFSSL_STACK* data;
sPymbed 17:ff9d1e86ad5f 634 } WOLFSSL_CRYPTO_EX_DATA;
sPymbed 17:ff9d1e86ad5f 635
sPymbed 17:ff9d1e86ad5f 636 typedef int (WOLFSSL_CRYPTO_EX_new)(void* p, void* ptr,
sPymbed 17:ff9d1e86ad5f 637 WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
sPymbed 17:ff9d1e86ad5f 638 typedef int (WOLFSSL_CRYPTO_EX_dup)(WOLFSSL_CRYPTO_EX_DATA* out,
sPymbed 17:ff9d1e86ad5f 639 WOLFSSL_CRYPTO_EX_DATA* in, void* inPtr, int idx, long argV, void* arg);
sPymbed 17:ff9d1e86ad5f 640 typedef void (WOLFSSL_CRYPTO_EX_free)(void* p, void* ptr,
sPymbed 17:ff9d1e86ad5f 641 WOLFSSL_CRYPTO_EX_DATA* a, int idx, long argValue, void* arg);
sPymbed 17:ff9d1e86ad5f 642
sPymbed 17:ff9d1e86ad5f 643 WOLFSSL_API int wolfSSL_get_ex_new_index(long argValue, void* arg,
sPymbed 17:ff9d1e86ad5f 644 WOLFSSL_CRYPTO_EX_new* a, WOLFSSL_CRYPTO_EX_dup* b,
sPymbed 17:ff9d1e86ad5f 645 WOLFSSL_CRYPTO_EX_free* c);
sPymbed 17:ff9d1e86ad5f 646 #endif
sPymbed 17:ff9d1e86ad5f 647
sPymbed 17:ff9d1e86ad5f 648 WOLFSSL_API void wolfSSL_CTX_set_verify(WOLFSSL_CTX*, int,
sPymbed 17:ff9d1e86ad5f 649 VerifyCallback verify_callback);
sPymbed 17:ff9d1e86ad5f 650 WOLFSSL_API void wolfSSL_set_verify(WOLFSSL*, int, VerifyCallback verify_callback);
sPymbed 17:ff9d1e86ad5f 651 WOLFSSL_API void wolfSSL_SetCertCbCtx(WOLFSSL*, void*);
sPymbed 17:ff9d1e86ad5f 652
sPymbed 17:ff9d1e86ad5f 653 WOLFSSL_API int wolfSSL_pending(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 654
sPymbed 17:ff9d1e86ad5f 655 WOLFSSL_API void wolfSSL_load_error_strings(void);
sPymbed 17:ff9d1e86ad5f 656 WOLFSSL_API int wolfSSL_library_init(void);
sPymbed 17:ff9d1e86ad5f 657 WOLFSSL_API long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX*, long);
sPymbed 17:ff9d1e86ad5f 658
sPymbed 17:ff9d1e86ad5f 659 #ifdef HAVE_SECRET_CALLBACK
sPymbed 17:ff9d1e86ad5f 660 typedef int (*SessionSecretCb)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 661 void* secret, int* secretSz, void* ctx);
sPymbed 17:ff9d1e86ad5f 662 WOLFSSL_API int wolfSSL_set_session_secret_cb(WOLFSSL*, SessionSecretCb, void*);
sPymbed 17:ff9d1e86ad5f 663 #endif /* HAVE_SECRET_CALLBACK */
sPymbed 17:ff9d1e86ad5f 664
sPymbed 17:ff9d1e86ad5f 665 /* session cache persistence */
sPymbed 17:ff9d1e86ad5f 666 WOLFSSL_API int wolfSSL_save_session_cache(const char*);
sPymbed 17:ff9d1e86ad5f 667 WOLFSSL_API int wolfSSL_restore_session_cache(const char*);
sPymbed 17:ff9d1e86ad5f 668 WOLFSSL_API int wolfSSL_memsave_session_cache(void*, int);
sPymbed 17:ff9d1e86ad5f 669 WOLFSSL_API int wolfSSL_memrestore_session_cache(const void*, int);
sPymbed 17:ff9d1e86ad5f 670 WOLFSSL_API int wolfSSL_get_session_cache_memsize(void);
sPymbed 17:ff9d1e86ad5f 671
sPymbed 17:ff9d1e86ad5f 672 /* certificate cache persistence, uses ctx since certs are per ctx */
sPymbed 17:ff9d1e86ad5f 673 WOLFSSL_API int wolfSSL_CTX_save_cert_cache(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 674 WOLFSSL_API int wolfSSL_CTX_restore_cert_cache(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 675 WOLFSSL_API int wolfSSL_CTX_memsave_cert_cache(WOLFSSL_CTX*, void*, int, int*);
sPymbed 17:ff9d1e86ad5f 676 WOLFSSL_API int wolfSSL_CTX_memrestore_cert_cache(WOLFSSL_CTX*, const void*, int);
sPymbed 17:ff9d1e86ad5f 677 WOLFSSL_API int wolfSSL_CTX_get_cert_cache_memsize(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 678
sPymbed 17:ff9d1e86ad5f 679 /* only supports full name from cipher_name[] delimited by : */
sPymbed 17:ff9d1e86ad5f 680 WOLFSSL_API int wolfSSL_CTX_set_cipher_list(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 681 WOLFSSL_API int wolfSSL_set_cipher_list(WOLFSSL*, const char*);
sPymbed 17:ff9d1e86ad5f 682
sPymbed 17:ff9d1e86ad5f 683 /* Nonblocking DTLS helper functions */
sPymbed 17:ff9d1e86ad5f 684 WOLFSSL_API void wolfSSL_dtls_set_using_nonblock(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 685 WOLFSSL_API int wolfSSL_dtls_get_using_nonblock(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 686 #define wolfSSL_set_using_nonblock wolfSSL_dtls_set_using_nonblock
sPymbed 17:ff9d1e86ad5f 687 #define wolfSSL_get_using_nonblock wolfSSL_dtls_get_using_nonblock
sPymbed 17:ff9d1e86ad5f 688 /* The old names are deprecated. */
sPymbed 17:ff9d1e86ad5f 689 WOLFSSL_API int wolfSSL_dtls_get_current_timeout(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 690 WOLFSSL_API int wolfSSL_dtls_set_timeout_init(WOLFSSL* ssl, int);
sPymbed 17:ff9d1e86ad5f 691 WOLFSSL_API int wolfSSL_dtls_set_timeout_max(WOLFSSL* ssl, int);
sPymbed 17:ff9d1e86ad5f 692 WOLFSSL_API int wolfSSL_dtls_got_timeout(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 693 WOLFSSL_API int wolfSSL_dtls(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 694
sPymbed 17:ff9d1e86ad5f 695 WOLFSSL_API int wolfSSL_dtls_set_peer(WOLFSSL*, void*, unsigned int);
sPymbed 17:ff9d1e86ad5f 696 WOLFSSL_API int wolfSSL_dtls_get_peer(WOLFSSL*, void*, unsigned int*);
sPymbed 17:ff9d1e86ad5f 697
sPymbed 17:ff9d1e86ad5f 698 WOLFSSL_API int wolfSSL_CTX_dtls_set_sctp(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 699 WOLFSSL_API int wolfSSL_dtls_set_sctp(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 700 WOLFSSL_API int wolfSSL_CTX_dtls_set_mtu(WOLFSSL_CTX*, unsigned short);
sPymbed 17:ff9d1e86ad5f 701 WOLFSSL_API int wolfSSL_dtls_set_mtu(WOLFSSL*, unsigned short);
sPymbed 17:ff9d1e86ad5f 702
sPymbed 17:ff9d1e86ad5f 703 WOLFSSL_API int wolfSSL_dtls_get_drop_stats(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 704 unsigned int*, unsigned int*);
sPymbed 17:ff9d1e86ad5f 705 WOLFSSL_API int wolfSSL_CTX_mcast_set_member_id(WOLFSSL_CTX*, unsigned short);
sPymbed 17:ff9d1e86ad5f 706 WOLFSSL_API int wolfSSL_set_secret(WOLFSSL*, unsigned short,
sPymbed 17:ff9d1e86ad5f 707 const unsigned char*, unsigned int,
sPymbed 17:ff9d1e86ad5f 708 const unsigned char*, const unsigned char*,
sPymbed 17:ff9d1e86ad5f 709 const unsigned char*);
sPymbed 17:ff9d1e86ad5f 710 WOLFSSL_API int wolfSSL_mcast_read(WOLFSSL*, unsigned short*, void*, int);
sPymbed 17:ff9d1e86ad5f 711 WOLFSSL_API int wolfSSL_mcast_peer_add(WOLFSSL*, unsigned short, int);
sPymbed 17:ff9d1e86ad5f 712 WOLFSSL_API int wolfSSL_mcast_peer_known(WOLFSSL*, unsigned short);
sPymbed 17:ff9d1e86ad5f 713 WOLFSSL_API int wolfSSL_mcast_get_max_peers(void);
sPymbed 17:ff9d1e86ad5f 714 typedef int (*CallbackMcastHighwater)(unsigned short peerId,
sPymbed 17:ff9d1e86ad5f 715 unsigned int maxSeq,
sPymbed 17:ff9d1e86ad5f 716 unsigned int curSeq, void* ctx);
sPymbed 17:ff9d1e86ad5f 717 WOLFSSL_API int wolfSSL_CTX_mcast_set_highwater_cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 718 unsigned int,
sPymbed 17:ff9d1e86ad5f 719 unsigned int,
sPymbed 17:ff9d1e86ad5f 720 unsigned int,
sPymbed 17:ff9d1e86ad5f 721 CallbackMcastHighwater);
sPymbed 17:ff9d1e86ad5f 722 WOLFSSL_API int wolfSSL_mcast_set_highwater_ctx(WOLFSSL*, void*);
sPymbed 17:ff9d1e86ad5f 723
sPymbed 17:ff9d1e86ad5f 724 WOLFSSL_API int wolfSSL_ERR_GET_REASON(unsigned long err);
sPymbed 17:ff9d1e86ad5f 725 WOLFSSL_API char* wolfSSL_ERR_error_string(unsigned long,char*);
sPymbed 17:ff9d1e86ad5f 726 WOLFSSL_API void wolfSSL_ERR_error_string_n(unsigned long e, char* buf,
sPymbed 17:ff9d1e86ad5f 727 unsigned long sz);
sPymbed 17:ff9d1e86ad5f 728 WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long);
sPymbed 17:ff9d1e86ad5f 729
sPymbed 17:ff9d1e86ad5f 730 /* extras */
sPymbed 17:ff9d1e86ad5f 731
sPymbed 17:ff9d1e86ad5f 732 #ifndef WOLF_STACK_OF
sPymbed 17:ff9d1e86ad5f 733 #define WOLF_STACK_OF(x) WOLFSSL_STACK
sPymbed 17:ff9d1e86ad5f 734 #endif
sPymbed 17:ff9d1e86ad5f 735 #ifndef DECLARE_STACK_OF
sPymbed 17:ff9d1e86ad5f 736 #define DECLARE_STACK_OF(x) WOLF_STACK_OF(x);
sPymbed 17:ff9d1e86ad5f 737 #endif
sPymbed 17:ff9d1e86ad5f 738
sPymbed 17:ff9d1e86ad5f 739 WOLFSSL_API int wolfSSL_sk_X509_push(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk,
sPymbed 17:ff9d1e86ad5f 740 WOLFSSL_X509* x509);
sPymbed 17:ff9d1e86ad5f 741 WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_pop(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk);
sPymbed 17:ff9d1e86ad5f 742 WOLFSSL_API void wolfSSL_sk_X509_free(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk);
sPymbed 17:ff9d1e86ad5f 743 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_sk_GENERAL_NAME_value(
sPymbed 17:ff9d1e86ad5f 744 WOLFSSL_STACK* sk, int i);
sPymbed 17:ff9d1e86ad5f 745 WOLFSSL_API int wolfSSL_sk_GENERAL_NAME_num(WOLFSSL_STACK* sk);
sPymbed 17:ff9d1e86ad5f 746 WOLFSSL_API void wolfSSL_sk_GENERAL_NAME_pop_free(WOLFSSL_STACK* sk,
sPymbed 17:ff9d1e86ad5f 747 void f (WOLFSSL_ASN1_OBJECT*));
sPymbed 17:ff9d1e86ad5f 748 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_ASN1_OBJECT_new(void);
sPymbed 17:ff9d1e86ad5f 749 WOLFSSL_API void wolfSSL_ASN1_OBJECT_free(WOLFSSL_ASN1_OBJECT* obj);
sPymbed 17:ff9d1e86ad5f 750 WOLFSSL_API int wolfSSL_sk_ASN1_OBJECT_push(WOLF_STACK_OF(WOLFSSL_ASN1_OBJEXT)* sk,
sPymbed 17:ff9d1e86ad5f 751 WOLFSSL_ASN1_OBJECT* obj);
sPymbed 17:ff9d1e86ad5f 752 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_sk_ASN1_OBJCET_pop(
sPymbed 17:ff9d1e86ad5f 753 WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)* sk);
sPymbed 17:ff9d1e86ad5f 754 WOLFSSL_API void wolfSSL_sk_ASN1_OBJECT_free(WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)* sk);
sPymbed 17:ff9d1e86ad5f 755 WOLFSSL_API int wolfSSL_ASN1_STRING_to_UTF8(unsigned char **out, WOLFSSL_ASN1_STRING *in);
sPymbed 17:ff9d1e86ad5f 756
sPymbed 17:ff9d1e86ad5f 757 WOLFSSL_API int wolfSSL_set_ex_data(WOLFSSL*, int, void*);
sPymbed 17:ff9d1e86ad5f 758 WOLFSSL_API int wolfSSL_get_shutdown(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 759 WOLFSSL_API int wolfSSL_set_rfd(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 760 WOLFSSL_API int wolfSSL_set_wfd(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 761 WOLFSSL_API void wolfSSL_set_shutdown(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 762 WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL*, const unsigned char*,
sPymbed 17:ff9d1e86ad5f 763 unsigned int);
sPymbed 17:ff9d1e86ad5f 764 WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 765 WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 766 WOLFSSL_API int wolfSSL_session_reused(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 767 WOLFSSL_API void wolfSSL_SESSION_free(WOLFSSL_SESSION* session);
sPymbed 17:ff9d1e86ad5f 768 WOLFSSL_API int wolfSSL_is_init_finished(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 769
sPymbed 17:ff9d1e86ad5f 770 WOLFSSL_API const char* wolfSSL_get_version(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 771 WOLFSSL_API int wolfSSL_get_current_cipher_suite(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 772 WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_get_current_cipher(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 773 WOLFSSL_API char* wolfSSL_CIPHER_description(const WOLFSSL_CIPHER*, char*, int);
sPymbed 17:ff9d1e86ad5f 774 WOLFSSL_API const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher);
sPymbed 17:ff9d1e86ad5f 775 WOLFSSL_API const char* wolfSSL_SESSION_CIPHER_get_name(WOLFSSL_SESSION* session);
sPymbed 17:ff9d1e86ad5f 776 WOLFSSL_API const char* wolfSSL_get_cipher(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 777 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 778 /* what's ref count */
sPymbed 17:ff9d1e86ad5f 779
sPymbed 17:ff9d1e86ad5f 780 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_new(void);
sPymbed 17:ff9d1e86ad5f 781
sPymbed 17:ff9d1e86ad5f 782 WOLFSSL_API int wolfSSL_OCSP_parse_url(char* url, char** host, char** port,
sPymbed 17:ff9d1e86ad5f 783 char** path, int* ssl);
sPymbed 17:ff9d1e86ad5f 784
sPymbed 17:ff9d1e86ad5f 785 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv23_client_method(void);
sPymbed 17:ff9d1e86ad5f 786 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_client_method(void);
sPymbed 17:ff9d1e86ad5f 787 WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_server_method(void);
sPymbed 17:ff9d1e86ad5f 788
sPymbed 17:ff9d1e86ad5f 789 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new(WOLFSSL_BIO_METHOD*);
sPymbed 17:ff9d1e86ad5f 790 WOLFSSL_API int wolfSSL_BIO_free(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 791 WOLFSSL_API int wolfSSL_BIO_free_all(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 792 WOLFSSL_API int wolfSSL_BIO_gets(WOLFSSL_BIO* bio, char* buf, int sz);
sPymbed 17:ff9d1e86ad5f 793 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_next(WOLFSSL_BIO* bio);
sPymbed 17:ff9d1e86ad5f 794 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_find_type(WOLFSSL_BIO* bio, int type);
sPymbed 17:ff9d1e86ad5f 795 WOLFSSL_API int wolfSSL_BIO_read(WOLFSSL_BIO*, void*, int);
sPymbed 17:ff9d1e86ad5f 796 WOLFSSL_API int wolfSSL_BIO_write(WOLFSSL_BIO*, const void*, int);
sPymbed 17:ff9d1e86ad5f 797 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_push(WOLFSSL_BIO*, WOLFSSL_BIO* append);
sPymbed 17:ff9d1e86ad5f 798 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_pop(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 799 WOLFSSL_API int wolfSSL_BIO_flush(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 800 WOLFSSL_API int wolfSSL_BIO_pending(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 801
sPymbed 17:ff9d1e86ad5f 802 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_buffer(void);
sPymbed 17:ff9d1e86ad5f 803 WOLFSSL_API long wolfSSL_BIO_set_write_buffer_size(WOLFSSL_BIO*, long size);
sPymbed 17:ff9d1e86ad5f 804 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_ssl(void);
sPymbed 17:ff9d1e86ad5f 805 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_socket(int sfd, int flag);
sPymbed 17:ff9d1e86ad5f 806 WOLFSSL_API int wolfSSL_BIO_eof(WOLFSSL_BIO*);
sPymbed 17:ff9d1e86ad5f 807
sPymbed 17:ff9d1e86ad5f 808 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_s_mem(void);
sPymbed 17:ff9d1e86ad5f 809 WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_base64(void);
sPymbed 17:ff9d1e86ad5f 810 WOLFSSL_API void wolfSSL_BIO_set_flags(WOLFSSL_BIO*, int);
sPymbed 17:ff9d1e86ad5f 811
sPymbed 17:ff9d1e86ad5f 812 WOLFSSL_API int wolfSSL_BIO_get_mem_data(WOLFSSL_BIO* bio,void* p);
sPymbed 17:ff9d1e86ad5f 813 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_mem_buf(void* buf, int len);
sPymbed 17:ff9d1e86ad5f 814
sPymbed 17:ff9d1e86ad5f 815
sPymbed 17:ff9d1e86ad5f 816 WOLFSSL_API long wolfSSL_BIO_set_ssl(WOLFSSL_BIO*, WOLFSSL*, int flag);
sPymbed 17:ff9d1e86ad5f 817 WOLFSSL_API long wolfSSL_BIO_set_fd(WOLFSSL_BIO* b, int fd, int flag);
sPymbed 17:ff9d1e86ad5f 818 WOLFSSL_API void wolfSSL_set_bio(WOLFSSL*, WOLFSSL_BIO* rd, WOLFSSL_BIO* wr);
sPymbed 17:ff9d1e86ad5f 819
sPymbed 17:ff9d1e86ad5f 820 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 821 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_file(void);
sPymbed 17:ff9d1e86ad5f 822 #endif
sPymbed 17:ff9d1e86ad5f 823
sPymbed 17:ff9d1e86ad5f 824 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_bio(void);
sPymbed 17:ff9d1e86ad5f 825 WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_socket(void);
sPymbed 17:ff9d1e86ad5f 826
sPymbed 17:ff9d1e86ad5f 827 WOLFSSL_API long wolfSSL_BIO_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, void *parg);
sPymbed 17:ff9d1e86ad5f 828 WOLFSSL_API long wolfSSL_BIO_int_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, int iarg);
sPymbed 17:ff9d1e86ad5f 829
sPymbed 17:ff9d1e86ad5f 830 WOLFSSL_API int wolfSSL_BIO_set_write_buf_size(WOLFSSL_BIO *b, long size);
sPymbed 17:ff9d1e86ad5f 831 WOLFSSL_API int wolfSSL_BIO_make_bio_pair(WOLFSSL_BIO *b1, WOLFSSL_BIO *b2);
sPymbed 17:ff9d1e86ad5f 832 WOLFSSL_API int wolfSSL_BIO_ctrl_reset_read_request(WOLFSSL_BIO *b);
sPymbed 17:ff9d1e86ad5f 833 WOLFSSL_API int wolfSSL_BIO_nread0(WOLFSSL_BIO *bio, char **buf);
sPymbed 17:ff9d1e86ad5f 834 WOLFSSL_API int wolfSSL_BIO_nread(WOLFSSL_BIO *bio, char **buf, int num);
sPymbed 17:ff9d1e86ad5f 835 WOLFSSL_API int wolfSSL_BIO_nwrite(WOLFSSL_BIO *bio, char **buf, int num);
sPymbed 17:ff9d1e86ad5f 836 WOLFSSL_API int wolfSSL_BIO_reset(WOLFSSL_BIO *bio);
sPymbed 17:ff9d1e86ad5f 837
sPymbed 17:ff9d1e86ad5f 838 WOLFSSL_API int wolfSSL_BIO_seek(WOLFSSL_BIO *bio, int ofs);
sPymbed 17:ff9d1e86ad5f 839 WOLFSSL_API int wolfSSL_BIO_write_filename(WOLFSSL_BIO *bio, char *name);
sPymbed 17:ff9d1e86ad5f 840 WOLFSSL_API long wolfSSL_BIO_set_mem_eof_return(WOLFSSL_BIO *bio, int v);
sPymbed 17:ff9d1e86ad5f 841 WOLFSSL_API long wolfSSL_BIO_get_mem_ptr(WOLFSSL_BIO *bio, WOLFSSL_BUF_MEM **m);
sPymbed 17:ff9d1e86ad5f 842
sPymbed 17:ff9d1e86ad5f 843 WOLFSSL_API void wolfSSL_RAND_screen(void);
sPymbed 17:ff9d1e86ad5f 844 WOLFSSL_API const char* wolfSSL_RAND_file_name(char*, unsigned long);
sPymbed 17:ff9d1e86ad5f 845 WOLFSSL_API int wolfSSL_RAND_write_file(const char*);
sPymbed 17:ff9d1e86ad5f 846 WOLFSSL_API int wolfSSL_RAND_load_file(const char*, long);
sPymbed 17:ff9d1e86ad5f 847 WOLFSSL_API int wolfSSL_RAND_egd(const char*);
sPymbed 17:ff9d1e86ad5f 848 WOLFSSL_API int wolfSSL_RAND_seed(const void*, int);
sPymbed 17:ff9d1e86ad5f 849 WOLFSSL_API void wolfSSL_RAND_Cleanup(void);
sPymbed 17:ff9d1e86ad5f 850 WOLFSSL_API void wolfSSL_RAND_add(const void*, int, double);
sPymbed 17:ff9d1e86ad5f 851 WOLFSSL_API int wolfSSL_RAND_poll(void);
sPymbed 17:ff9d1e86ad5f 852
sPymbed 17:ff9d1e86ad5f 853 WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_zlib(void);
sPymbed 17:ff9d1e86ad5f 854 WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_rle(void);
sPymbed 17:ff9d1e86ad5f 855 WOLFSSL_API int wolfSSL_COMP_add_compression_method(int, void*);
sPymbed 17:ff9d1e86ad5f 856
sPymbed 17:ff9d1e86ad5f 857 WOLFSSL_API unsigned long wolfSSL_thread_id(void);
sPymbed 17:ff9d1e86ad5f 858 WOLFSSL_API void wolfSSL_set_id_callback(unsigned long (*f)(void));
sPymbed 17:ff9d1e86ad5f 859 WOLFSSL_API void wolfSSL_set_locking_callback(void (*f)(int, int, const char*,
sPymbed 17:ff9d1e86ad5f 860 int));
sPymbed 17:ff9d1e86ad5f 861 WOLFSSL_API void wolfSSL_set_dynlock_create_callback(WOLFSSL_dynlock_value* (*f)
sPymbed 17:ff9d1e86ad5f 862 (const char*, int));
sPymbed 17:ff9d1e86ad5f 863 WOLFSSL_API void wolfSSL_set_dynlock_lock_callback(void (*f)(int,
sPymbed 17:ff9d1e86ad5f 864 WOLFSSL_dynlock_value*, const char*, int));
sPymbed 17:ff9d1e86ad5f 865 WOLFSSL_API void wolfSSL_set_dynlock_destroy_callback(void (*f)
sPymbed 17:ff9d1e86ad5f 866 (WOLFSSL_dynlock_value*, const char*, int));
sPymbed 17:ff9d1e86ad5f 867 WOLFSSL_API int wolfSSL_num_locks(void);
sPymbed 17:ff9d1e86ad5f 868
sPymbed 17:ff9d1e86ad5f 869 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get_current_cert(
sPymbed 17:ff9d1e86ad5f 870 WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 871 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error(WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 872 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error_depth(WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 873
sPymbed 17:ff9d1e86ad5f 874 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_verify_cb(WOLFSSL_X509_STORE_CTX *ctx,
sPymbed 17:ff9d1e86ad5f 875 WOLFSSL_X509_STORE_CTX_verify_cb verify_cb);
sPymbed 17:ff9d1e86ad5f 876 WOLFSSL_API int wolfSSL_i2d_X509_NAME(WOLFSSL_X509_NAME* n,
sPymbed 17:ff9d1e86ad5f 877 unsigned char** out);
sPymbed 17:ff9d1e86ad5f 878 WOLFSSL_API int wolfSSL_X509_print(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
sPymbed 17:ff9d1e86ad5f 879 WOLFSSL_API char* wolfSSL_X509_NAME_oneline(WOLFSSL_X509_NAME*, char*, int);
sPymbed 17:ff9d1e86ad5f 880 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_issuer_name(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 881 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_subject_name(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 882 WOLFSSL_API int wolfSSL_X509_ext_isSet_by_NID(WOLFSSL_X509*, int);
sPymbed 17:ff9d1e86ad5f 883 WOLFSSL_API int wolfSSL_X509_ext_get_critical_by_NID(WOLFSSL_X509*, int);
sPymbed 17:ff9d1e86ad5f 884 WOLFSSL_API int wolfSSL_X509_get_isCA(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 885 WOLFSSL_API int wolfSSL_X509_get_isSet_pathLength(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 886 WOLFSSL_API unsigned int wolfSSL_X509_get_pathLength(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 887 WOLFSSL_API unsigned int wolfSSL_X509_get_keyUsage(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 888 WOLFSSL_API unsigned char* wolfSSL_X509_get_authorityKeyID(
sPymbed 17:ff9d1e86ad5f 889 WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 890 WOLFSSL_API unsigned char* wolfSSL_X509_get_subjectKeyID(
sPymbed 17:ff9d1e86ad5f 891 WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 892 WOLFSSL_API int wolfSSL_X509_NAME_entry_count(WOLFSSL_X509_NAME*);
sPymbed 17:ff9d1e86ad5f 893 WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID(
sPymbed 17:ff9d1e86ad5f 894 WOLFSSL_X509_NAME*, int, char*, int);
sPymbed 17:ff9d1e86ad5f 895 WOLFSSL_API int wolfSSL_X509_NAME_get_index_by_NID(
sPymbed 17:ff9d1e86ad5f 896 WOLFSSL_X509_NAME*, int, int);
sPymbed 17:ff9d1e86ad5f 897 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY*);
sPymbed 17:ff9d1e86ad5f 898 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_ASN1_STRING_new(void);
sPymbed 17:ff9d1e86ad5f 899 WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_ASN1_STRING_type_new(int type);
sPymbed 17:ff9d1e86ad5f 900 WOLFSSL_API void wolfSSL_ASN1_STRING_free(WOLFSSL_ASN1_STRING* asn1);
sPymbed 17:ff9d1e86ad5f 901 WOLFSSL_API int wolfSSL_ASN1_STRING_set(WOLFSSL_ASN1_STRING* asn1,
sPymbed 17:ff9d1e86ad5f 902 const void* data, int dataSz);
sPymbed 17:ff9d1e86ad5f 903 WOLFSSL_API unsigned char* wolfSSL_ASN1_STRING_data(WOLFSSL_ASN1_STRING*);
sPymbed 17:ff9d1e86ad5f 904 WOLFSSL_API int wolfSSL_ASN1_STRING_length(WOLFSSL_ASN1_STRING*);
sPymbed 17:ff9d1e86ad5f 905 WOLFSSL_API int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 906 WOLFSSL_API const char* wolfSSL_X509_verify_cert_error_string(long);
sPymbed 17:ff9d1e86ad5f 907 WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 908 WOLFSSL_API int wolfSSL_X509_get_signature(WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 909
sPymbed 17:ff9d1e86ad5f 910 WOLFSSL_API int wolfSSL_X509_LOOKUP_add_dir(WOLFSSL_X509_LOOKUP*,const char*,long);
sPymbed 17:ff9d1e86ad5f 911 WOLFSSL_API int wolfSSL_X509_LOOKUP_load_file(WOLFSSL_X509_LOOKUP*, const char*,
sPymbed 17:ff9d1e86ad5f 912 long);
sPymbed 17:ff9d1e86ad5f 913 WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_hash_dir(void);
sPymbed 17:ff9d1e86ad5f 914 WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_file(void);
sPymbed 17:ff9d1e86ad5f 915
sPymbed 17:ff9d1e86ad5f 916 WOLFSSL_API WOLFSSL_X509_LOOKUP* wolfSSL_X509_STORE_add_lookup(WOLFSSL_X509_STORE*,
sPymbed 17:ff9d1e86ad5f 917 WOLFSSL_X509_LOOKUP_METHOD*);
sPymbed 17:ff9d1e86ad5f 918 WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_X509_STORE_new(void);
sPymbed 17:ff9d1e86ad5f 919 WOLFSSL_API void wolfSSL_X509_STORE_free(WOLFSSL_X509_STORE*);
sPymbed 17:ff9d1e86ad5f 920 WOLFSSL_API int wolfSSL_X509_STORE_add_cert(
sPymbed 17:ff9d1e86ad5f 921 WOLFSSL_X509_STORE*, WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 922 WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain(
sPymbed 17:ff9d1e86ad5f 923 WOLFSSL_X509_STORE_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 924 WOLFSSL_API int wolfSSL_X509_STORE_set_flags(WOLFSSL_X509_STORE* store,
sPymbed 17:ff9d1e86ad5f 925 unsigned long flag);
sPymbed 17:ff9d1e86ad5f 926 WOLFSSL_API int wolfSSL_X509_STORE_set_default_paths(WOLFSSL_X509_STORE*);
sPymbed 17:ff9d1e86ad5f 927 WOLFSSL_API int wolfSSL_X509_STORE_get_by_subject(WOLFSSL_X509_STORE_CTX*,
sPymbed 17:ff9d1e86ad5f 928 int, WOLFSSL_X509_NAME*, WOLFSSL_X509_OBJECT*);
sPymbed 17:ff9d1e86ad5f 929 WOLFSSL_API WOLFSSL_X509_STORE_CTX* wolfSSL_X509_STORE_CTX_new(void);
sPymbed 17:ff9d1e86ad5f 930 WOLFSSL_API int wolfSSL_X509_STORE_CTX_init(WOLFSSL_X509_STORE_CTX*,
sPymbed 17:ff9d1e86ad5f 931 WOLFSSL_X509_STORE*, WOLFSSL_X509*, WOLF_STACK_OF(WOLFSSL_X509)*);
sPymbed 17:ff9d1e86ad5f 932 WOLFSSL_API void wolfSSL_X509_STORE_CTX_free(WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 933 WOLFSSL_API void wolfSSL_X509_STORE_CTX_cleanup(WOLFSSL_X509_STORE_CTX*);
sPymbed 17:ff9d1e86ad5f 934
sPymbed 17:ff9d1e86ad5f 935 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_lastUpdate(WOLFSSL_X509_CRL*);
sPymbed 17:ff9d1e86ad5f 936 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_nextUpdate(WOLFSSL_X509_CRL*);
sPymbed 17:ff9d1e86ad5f 937
sPymbed 17:ff9d1e86ad5f 938 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 939 WOLFSSL_API int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL*, WOLFSSL_EVP_PKEY*);
sPymbed 17:ff9d1e86ad5f 940 WOLFSSL_API void wolfSSL_X509_OBJECT_free_contents(WOLFSSL_X509_OBJECT*);
sPymbed 17:ff9d1e86ad5f 941 WOLFSSL_API WOLFSSL_PKCS8_PRIV_KEY_INFO* wolfSSL_d2i_PKCS8_PKEY_bio(
sPymbed 17:ff9d1e86ad5f 942 WOLFSSL_BIO* bio, WOLFSSL_PKCS8_PRIV_KEY_INFO** pkey);
sPymbed 17:ff9d1e86ad5f 943 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PUBKEY_bio(WOLFSSL_BIO* bio,
sPymbed 17:ff9d1e86ad5f 944 WOLFSSL_EVP_PKEY** out);
sPymbed 17:ff9d1e86ad5f 945 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PUBKEY(WOLFSSL_EVP_PKEY** key,
sPymbed 17:ff9d1e86ad5f 946 unsigned char** in, long inSz);
sPymbed 17:ff9d1e86ad5f 947 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey(int type,
sPymbed 17:ff9d1e86ad5f 948 WOLFSSL_EVP_PKEY** out, const unsigned char **in, long inSz);
sPymbed 17:ff9d1e86ad5f 949 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey_EVP(WOLFSSL_EVP_PKEY** key,
sPymbed 17:ff9d1e86ad5f 950 unsigned char** in, long inSz);
sPymbed 17:ff9d1e86ad5f 951 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_PKEY_new_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 952 WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_PKEY_new(void);
sPymbed 17:ff9d1e86ad5f 953 WOLFSSL_API int wolfSSL_X509_cmp_current_time(const WOLFSSL_ASN1_TIME*);
sPymbed 17:ff9d1e86ad5f 954 WOLFSSL_API int wolfSSL_sk_X509_REVOKED_num(WOLFSSL_X509_REVOKED*);
sPymbed 17:ff9d1e86ad5f 955 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 956 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_time(WOLFSSL_X509_STORE_CTX*,
sPymbed 17:ff9d1e86ad5f 957 unsigned long flags,
sPymbed 17:ff9d1e86ad5f 958 time_t t);
sPymbed 17:ff9d1e86ad5f 959 #endif
sPymbed 17:ff9d1e86ad5f 960 WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_X509_CRL_get_REVOKED(WOLFSSL_X509_CRL*);
sPymbed 17:ff9d1e86ad5f 961 WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_sk_X509_REVOKED_value(
sPymbed 17:ff9d1e86ad5f 962 WOLFSSL_X509_REVOKED*,int);
sPymbed 17:ff9d1e86ad5f 963 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_X509_get_serialNumber(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 964 WOLFSSL_API void wolfSSL_ASN1_INTEGER_free(WOLFSSL_ASN1_INTEGER*);
sPymbed 17:ff9d1e86ad5f 965 WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_ASN1_INTEGER_new(void);
sPymbed 17:ff9d1e86ad5f 966
sPymbed 17:ff9d1e86ad5f 967 WOLFSSL_API int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO*, const WOLFSSL_ASN1_TIME*);
sPymbed 17:ff9d1e86ad5f 968
sPymbed 17:ff9d1e86ad5f 969 WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* t,
sPymbed 17:ff9d1e86ad5f 970 char* buf, int len);
sPymbed 17:ff9d1e86ad5f 971 WOLFSSL_API int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER*,
sPymbed 17:ff9d1e86ad5f 972 const WOLFSSL_ASN1_INTEGER*);
sPymbed 17:ff9d1e86ad5f 973 WOLFSSL_API long wolfSSL_ASN1_INTEGER_get(const WOLFSSL_ASN1_INTEGER*);
sPymbed 17:ff9d1e86ad5f 974
sPymbed 17:ff9d1e86ad5f 975 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 976 WOLFSSL_API WOLFSSL_BIGNUM *wolfSSL_ASN1_INTEGER_to_BN(const WOLFSSL_ASN1_INTEGER *ai,
sPymbed 17:ff9d1e86ad5f 977 WOLFSSL_BIGNUM *bn);
sPymbed 17:ff9d1e86ad5f 978 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_load_client_CA_file(const char*);
sPymbed 17:ff9d1e86ad5f 979 WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_ASN1_TIME_adj(WOLFSSL_ASN1_TIME*, time_t,
sPymbed 17:ff9d1e86ad5f 980 int, long);
sPymbed 17:ff9d1e86ad5f 981 #endif
sPymbed 17:ff9d1e86ad5f 982
sPymbed 17:ff9d1e86ad5f 983 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_SSL_CTX_get_client_CA_list(
sPymbed 17:ff9d1e86ad5f 984 const WOLFSSL_CTX *s);
sPymbed 17:ff9d1e86ad5f 985 WOLFSSL_API void wolfSSL_CTX_set_client_CA_list(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 986 WOLF_STACK_OF(WOLFSSL_X509_NAME)*);
sPymbed 17:ff9d1e86ad5f 987 WOLFSSL_API void* wolfSSL_X509_STORE_CTX_get_ex_data(WOLFSSL_X509_STORE_CTX*, int);
sPymbed 17:ff9d1e86ad5f 988 WOLFSSL_API int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void);
sPymbed 17:ff9d1e86ad5f 989 WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(
sPymbed 17:ff9d1e86ad5f 990 WOLFSSL_X509_STORE_CTX* ctx, int er);
sPymbed 17:ff9d1e86ad5f 991 WOLFSSL_API void* wolfSSL_get_ex_data(const WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 992
sPymbed 17:ff9d1e86ad5f 993 WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 994 void* userdata);
sPymbed 17:ff9d1e86ad5f 995 WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 996 pem_password_cb*);
sPymbed 17:ff9d1e86ad5f 997 WOLFSSL_API pem_password_cb* wolfSSL_CTX_get_default_passwd_cb(WOLFSSL_CTX *ctx);
sPymbed 17:ff9d1e86ad5f 998 WOLFSSL_API void *wolfSSL_CTX_get_default_passwd_cb_userdata(WOLFSSL_CTX *ctx);
sPymbed 17:ff9d1e86ad5f 999
sPymbed 17:ff9d1e86ad5f 1000 WOLFSSL_API void wolfSSL_CTX_set_info_callback(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1001 void (*)(const WOLFSSL* ssl, int type, int val));
sPymbed 17:ff9d1e86ad5f 1002
sPymbed 17:ff9d1e86ad5f 1003 WOLFSSL_API unsigned long wolfSSL_ERR_peek_error(void);
sPymbed 17:ff9d1e86ad5f 1004 WOLFSSL_API int wolfSSL_GET_REASON(int);
sPymbed 17:ff9d1e86ad5f 1005
sPymbed 17:ff9d1e86ad5f 1006 WOLFSSL_API const char* wolfSSL_alert_type_string_long(int);
sPymbed 17:ff9d1e86ad5f 1007 WOLFSSL_API const char* wolfSSL_alert_desc_string_long(int);
sPymbed 17:ff9d1e86ad5f 1008 WOLFSSL_API const char* wolfSSL_state_string_long(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1009
sPymbed 17:ff9d1e86ad5f 1010 WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_generate_key(int, unsigned long,
sPymbed 17:ff9d1e86ad5f 1011 void(*)(int, int, void*), void*);
sPymbed 17:ff9d1e86ad5f 1012 WOLFSSL_API WOLFSSL_RSA *wolfSSL_d2i_RSAPublicKey(WOLFSSL_RSA **r,
sPymbed 17:ff9d1e86ad5f 1013 const unsigned char **pp, long len);
sPymbed 17:ff9d1e86ad5f 1014 WOLFSSL_API WOLFSSL_RSA *wolfSSL_d2i_RSAPrivateKey(WOLFSSL_RSA**,
sPymbed 17:ff9d1e86ad5f 1015 const unsigned char**, long);
sPymbed 17:ff9d1e86ad5f 1016 WOLFSSL_API int wolfSSL_i2d_RSAPublicKey(WOLFSSL_RSA *r, const unsigned char **pp);
sPymbed 17:ff9d1e86ad5f 1017 WOLFSSL_API int wolfSSL_i2d_RSAPrivateKey(WOLFSSL_RSA *r, unsigned char **pp);
sPymbed 17:ff9d1e86ad5f 1018 WOLFSSL_API void wolfSSL_CTX_set_tmp_rsa_callback(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 1019 WOLFSSL_RSA *(*)(WOLFSSL *, int, int));
sPymbed 17:ff9d1e86ad5f 1020
sPymbed 17:ff9d1e86ad5f 1021 WOLFSSL_API int wolfSSL_PEM_def_callback(char*, int num, int w, void* key);
sPymbed 17:ff9d1e86ad5f 1022
sPymbed 17:ff9d1e86ad5f 1023 WOLFSSL_API long wolfSSL_CTX_sess_accept(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1024 WOLFSSL_API long wolfSSL_CTX_sess_connect(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1025 WOLFSSL_API long wolfSSL_CTX_sess_accept_good(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1026 WOLFSSL_API long wolfSSL_CTX_sess_connect_good(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1027 WOLFSSL_API long wolfSSL_CTX_sess_accept_renegotiate(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1028 WOLFSSL_API long wolfSSL_CTX_sess_connect_renegotiate(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1029 WOLFSSL_API long wolfSSL_CTX_sess_hits(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1030 WOLFSSL_API long wolfSSL_CTX_sess_cb_hits(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1031 WOLFSSL_API long wolfSSL_CTX_sess_cache_full(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1032 WOLFSSL_API long wolfSSL_CTX_sess_misses(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1033 WOLFSSL_API long wolfSSL_CTX_sess_timeouts(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1034 WOLFSSL_API long wolfSSL_CTX_sess_number(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1035
sPymbed 17:ff9d1e86ad5f 1036 WOLFSSL_API long wolfSSL_CTX_add_extra_chain_cert(WOLFSSL_CTX*, WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1037 WOLFSSL_API long wolfSSL_CTX_sess_set_cache_size(WOLFSSL_CTX*, long);
sPymbed 17:ff9d1e86ad5f 1038 WOLFSSL_API long wolfSSL_CTX_sess_get_cache_size(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1039
sPymbed 17:ff9d1e86ad5f 1040 WOLFSSL_API long wolfSSL_CTX_get_session_cache_mode(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1041 WOLFSSL_API int wolfSSL_CTX_get_read_ahead(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1042 WOLFSSL_API int wolfSSL_CTX_set_read_ahead(WOLFSSL_CTX*, int v);
sPymbed 17:ff9d1e86ad5f 1043 WOLFSSL_API long wolfSSL_CTX_set_tlsext_status_arg(WOLFSSL_CTX*, void* arg);
sPymbed 17:ff9d1e86ad5f 1044 WOLFSSL_API long wolfSSL_CTX_set_tlsext_opaque_prf_input_callback_arg(
sPymbed 17:ff9d1e86ad5f 1045 WOLFSSL_CTX*, void* arg);
sPymbed 17:ff9d1e86ad5f 1046 WOLFSSL_API int wolfSSL_CTX_add_client_CA(WOLFSSL_CTX*, WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1047 WOLFSSL_API int wolfSSL_CTX_set_srp_password(WOLFSSL_CTX*, char*);
sPymbed 17:ff9d1e86ad5f 1048 WOLFSSL_API int wolfSSL_CTX_set_srp_username(WOLFSSL_CTX*, char*);
sPymbed 17:ff9d1e86ad5f 1049
sPymbed 17:ff9d1e86ad5f 1050 WOLFSSL_API long wolfSSL_set_options(WOLFSSL *s, long op);
sPymbed 17:ff9d1e86ad5f 1051 WOLFSSL_API long wolfSSL_get_options(const WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 1052 WOLFSSL_API long wolfSSL_clear_options(WOLFSSL *s, long op);
sPymbed 17:ff9d1e86ad5f 1053 WOLFSSL_API long wolfSSL_clear_num_renegotiations(WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 1054 WOLFSSL_API long wolfSSL_total_renegotiations(WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 1055 WOLFSSL_API long wolfSSL_set_tmp_dh(WOLFSSL *s, WOLFSSL_DH *dh);
sPymbed 17:ff9d1e86ad5f 1056 WOLFSSL_API long wolfSSL_set_tlsext_debug_arg(WOLFSSL *s, void *arg);
sPymbed 17:ff9d1e86ad5f 1057 WOLFSSL_API long wolfSSL_set_tlsext_status_type(WOLFSSL *s, int type);
sPymbed 17:ff9d1e86ad5f 1058 WOLFSSL_API long wolfSSL_set_tlsext_status_exts(WOLFSSL *s, void *arg);
sPymbed 17:ff9d1e86ad5f 1059 WOLFSSL_API long wolfSSL_get_tlsext_status_ids(WOLFSSL *s, void *arg);
sPymbed 17:ff9d1e86ad5f 1060 WOLFSSL_API long wolfSSL_set_tlsext_status_ids(WOLFSSL *s, void *arg);
sPymbed 17:ff9d1e86ad5f 1061 WOLFSSL_API long wolfSSL_get_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char **resp);
sPymbed 17:ff9d1e86ad5f 1062 WOLFSSL_API long wolfSSL_set_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char *resp, int len);
sPymbed 17:ff9d1e86ad5f 1063
sPymbed 17:ff9d1e86ad5f 1064 WOLFSSL_API void wolfSSL_CONF_modules_unload(int all);
sPymbed 17:ff9d1e86ad5f 1065 WOLFSSL_API long wolfSSL_get_tlsext_status_exts(WOLFSSL *s, void *arg);
sPymbed 17:ff9d1e86ad5f 1066 WOLFSSL_API long wolfSSL_get_verify_result(const WOLFSSL *ssl);
sPymbed 17:ff9d1e86ad5f 1067
sPymbed 17:ff9d1e86ad5f 1068 #define WOLFSSL_DEFAULT_CIPHER_LIST "" /* default all */
sPymbed 17:ff9d1e86ad5f 1069
sPymbed 17:ff9d1e86ad5f 1070 enum {
sPymbed 17:ff9d1e86ad5f 1071 WOLFSSL_OCSP_URL_OVERRIDE = 1,
sPymbed 17:ff9d1e86ad5f 1072 WOLFSSL_OCSP_NO_NONCE = 2,
sPymbed 17:ff9d1e86ad5f 1073 WOLFSSL_OCSP_CHECKALL = 4,
sPymbed 17:ff9d1e86ad5f 1074
sPymbed 17:ff9d1e86ad5f 1075 WOLFSSL_CRL_CHECKALL = 1,
sPymbed 17:ff9d1e86ad5f 1076 WOLFSSL_CRL_CHECK = 27,
sPymbed 17:ff9d1e86ad5f 1077 };
sPymbed 17:ff9d1e86ad5f 1078
sPymbed 17:ff9d1e86ad5f 1079 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 1080 /* seperated out from other enums because of size */
sPymbed 17:ff9d1e86ad5f 1081 enum {
sPymbed 17:ff9d1e86ad5f 1082 SSL_OP_MICROSOFT_SESS_ID_BUG = 0x00000001,
sPymbed 17:ff9d1e86ad5f 1083 SSL_OP_NETSCAPE_CHALLENGE_BUG = 0x00000002,
sPymbed 17:ff9d1e86ad5f 1084 SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 0x00000004,
sPymbed 17:ff9d1e86ad5f 1085 SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0x00000008,
sPymbed 17:ff9d1e86ad5f 1086 SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 0x00000010,
sPymbed 17:ff9d1e86ad5f 1087 SSL_OP_MSIE_SSLV2_RSA_PADDING = 0x00000020,
sPymbed 17:ff9d1e86ad5f 1088 SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 0x00000040,
sPymbed 17:ff9d1e86ad5f 1089 SSL_OP_TLS_D5_BUG = 0x00000080,
sPymbed 17:ff9d1e86ad5f 1090 SSL_OP_TLS_BLOCK_PADDING_BUG = 0x00000100,
sPymbed 17:ff9d1e86ad5f 1091 SSL_OP_TLS_ROLLBACK_BUG = 0x00000200,
sPymbed 17:ff9d1e86ad5f 1092 SSL_OP_ALL = 0x00000400,
sPymbed 17:ff9d1e86ad5f 1093 SSL_OP_EPHEMERAL_RSA = 0x00000800,
sPymbed 17:ff9d1e86ad5f 1094 SSL_OP_NO_SSLv3 = 0x00001000,
sPymbed 17:ff9d1e86ad5f 1095 SSL_OP_NO_TLSv1 = 0x00002000,
sPymbed 17:ff9d1e86ad5f 1096 SSL_OP_PKCS1_CHECK_1 = 0x00004000,
sPymbed 17:ff9d1e86ad5f 1097 SSL_OP_PKCS1_CHECK_2 = 0x00008000,
sPymbed 17:ff9d1e86ad5f 1098 SSL_OP_NETSCAPE_CA_DN_BUG = 0x00010000,
sPymbed 17:ff9d1e86ad5f 1099 SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x00020000,
sPymbed 17:ff9d1e86ad5f 1100 SSL_OP_SINGLE_DH_USE = 0x00040000,
sPymbed 17:ff9d1e86ad5f 1101 SSL_OP_NO_TICKET = 0x00080000,
sPymbed 17:ff9d1e86ad5f 1102 SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00100000,
sPymbed 17:ff9d1e86ad5f 1103 SSL_OP_NO_QUERY_MTU = 0x00200000,
sPymbed 17:ff9d1e86ad5f 1104 SSL_OP_COOKIE_EXCHANGE = 0x00400000,
sPymbed 17:ff9d1e86ad5f 1105 SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 0x00800000,
sPymbed 17:ff9d1e86ad5f 1106 SSL_OP_SINGLE_ECDH_USE = 0x01000000,
sPymbed 17:ff9d1e86ad5f 1107 SSL_OP_CIPHER_SERVER_PREFERENCE = 0x02000000,
sPymbed 17:ff9d1e86ad5f 1108 SSL_OP_NO_TLSv1_1 = 0x04000000,
sPymbed 17:ff9d1e86ad5f 1109 SSL_OP_NO_TLSv1_2 = 0x08000000,
sPymbed 17:ff9d1e86ad5f 1110 SSL_OP_NO_COMPRESSION = 0x10000000,
sPymbed 17:ff9d1e86ad5f 1111 SSL_OP_NO_TLSv1_3 = 0x20000000,
sPymbed 17:ff9d1e86ad5f 1112 };
sPymbed 17:ff9d1e86ad5f 1113
sPymbed 17:ff9d1e86ad5f 1114 enum {
sPymbed 17:ff9d1e86ad5f 1115 #ifdef HAVE_OCSP
sPymbed 17:ff9d1e86ad5f 1116 /* OCSP Flags */
sPymbed 17:ff9d1e86ad5f 1117 OCSP_NOCERTS = 1,
sPymbed 17:ff9d1e86ad5f 1118 OCSP_NOINTERN = 2,
sPymbed 17:ff9d1e86ad5f 1119 OCSP_NOSIGS = 4,
sPymbed 17:ff9d1e86ad5f 1120 OCSP_NOCHAIN = 8,
sPymbed 17:ff9d1e86ad5f 1121 OCSP_NOVERIFY = 16,
sPymbed 17:ff9d1e86ad5f 1122 OCSP_NOEXPLICIT = 32,
sPymbed 17:ff9d1e86ad5f 1123 OCSP_NOCASIGN = 64,
sPymbed 17:ff9d1e86ad5f 1124 OCSP_NODELEGATED = 128,
sPymbed 17:ff9d1e86ad5f 1125 OCSP_NOCHECKS = 256,
sPymbed 17:ff9d1e86ad5f 1126 OCSP_TRUSTOTHER = 512,
sPymbed 17:ff9d1e86ad5f 1127 OCSP_RESPID_KEY = 1024,
sPymbed 17:ff9d1e86ad5f 1128 OCSP_NOTIME = 2048,
sPymbed 17:ff9d1e86ad5f 1129
sPymbed 17:ff9d1e86ad5f 1130 /* OCSP Types */
sPymbed 17:ff9d1e86ad5f 1131 OCSP_CERTID = 2,
sPymbed 17:ff9d1e86ad5f 1132 OCSP_REQUEST = 4,
sPymbed 17:ff9d1e86ad5f 1133 OCSP_RESPONSE = 8,
sPymbed 17:ff9d1e86ad5f 1134 OCSP_BASICRESP = 16,
sPymbed 17:ff9d1e86ad5f 1135 #endif
sPymbed 17:ff9d1e86ad5f 1136
sPymbed 17:ff9d1e86ad5f 1137 ASN1_GENERALIZEDTIME = 4,
sPymbed 17:ff9d1e86ad5f 1138 SSL_MAX_SSL_SESSION_ID_LENGTH = 32,
sPymbed 17:ff9d1e86ad5f 1139
sPymbed 17:ff9d1e86ad5f 1140 EVP_R_BAD_DECRYPT = 2,
sPymbed 17:ff9d1e86ad5f 1141
sPymbed 17:ff9d1e86ad5f 1142 SSL_ST_CONNECT = 0x1000,
sPymbed 17:ff9d1e86ad5f 1143 SSL_ST_ACCEPT = 0x2000,
sPymbed 17:ff9d1e86ad5f 1144 SSL_ST_MASK = 0x0FFF,
sPymbed 17:ff9d1e86ad5f 1145
sPymbed 17:ff9d1e86ad5f 1146 SSL_CB_LOOP = 0x01,
sPymbed 17:ff9d1e86ad5f 1147 SSL_CB_EXIT = 0x02,
sPymbed 17:ff9d1e86ad5f 1148 SSL_CB_READ = 0x04,
sPymbed 17:ff9d1e86ad5f 1149 SSL_CB_WRITE = 0x08,
sPymbed 17:ff9d1e86ad5f 1150 SSL_CB_HANDSHAKE_START = 0x10,
sPymbed 17:ff9d1e86ad5f 1151 SSL_CB_HANDSHAKE_DONE = 0x20,
sPymbed 17:ff9d1e86ad5f 1152 SSL_CB_ALERT = 0x4000,
sPymbed 17:ff9d1e86ad5f 1153 SSL_CB_READ_ALERT = (SSL_CB_ALERT | SSL_CB_READ),
sPymbed 17:ff9d1e86ad5f 1154 SSL_CB_WRITE_ALERT = (SSL_CB_ALERT | SSL_CB_WRITE),
sPymbed 17:ff9d1e86ad5f 1155 SSL_CB_ACCEPT_LOOP = (SSL_ST_ACCEPT | SSL_CB_LOOP),
sPymbed 17:ff9d1e86ad5f 1156 SSL_CB_ACCEPT_EXIT = (SSL_ST_ACCEPT | SSL_CB_EXIT),
sPymbed 17:ff9d1e86ad5f 1157 SSL_CB_CONNECT_LOOP = (SSL_ST_CONNECT | SSL_CB_LOOP),
sPymbed 17:ff9d1e86ad5f 1158 SSL_CB_CONNECT_EXIT = (SSL_ST_CONNECT | SSL_CB_EXIT),
sPymbed 17:ff9d1e86ad5f 1159 SSL_CB_MODE_READ = 1,
sPymbed 17:ff9d1e86ad5f 1160 SSL_CB_MODE_WRITE = 2,
sPymbed 17:ff9d1e86ad5f 1161
sPymbed 17:ff9d1e86ad5f 1162 SSL_MODE_ENABLE_PARTIAL_WRITE = 2,
sPymbed 17:ff9d1e86ad5f 1163
sPymbed 17:ff9d1e86ad5f 1164 BIO_FLAGS_BASE64_NO_NL = 1,
sPymbed 17:ff9d1e86ad5f 1165 BIO_CLOSE = 1,
sPymbed 17:ff9d1e86ad5f 1166 BIO_NOCLOSE = 0,
sPymbed 17:ff9d1e86ad5f 1167
sPymbed 17:ff9d1e86ad5f 1168 NID_undef = 0,
sPymbed 17:ff9d1e86ad5f 1169
sPymbed 17:ff9d1e86ad5f 1170 X509_FILETYPE_PEM = 8,
sPymbed 17:ff9d1e86ad5f 1171 X509_LU_X509 = 9,
sPymbed 17:ff9d1e86ad5f 1172 X509_LU_CRL = 12,
sPymbed 17:ff9d1e86ad5f 1173
sPymbed 17:ff9d1e86ad5f 1174 X509_V_OK = 0,
sPymbed 17:ff9d1e86ad5f 1175 X509_V_ERR_CRL_SIGNATURE_FAILURE = 13,
sPymbed 17:ff9d1e86ad5f 1176 X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 14,
sPymbed 17:ff9d1e86ad5f 1177 X509_V_ERR_CRL_HAS_EXPIRED = 15,
sPymbed 17:ff9d1e86ad5f 1178 X509_V_ERR_CERT_REVOKED = 16,
sPymbed 17:ff9d1e86ad5f 1179 X509_V_ERR_CERT_CHAIN_TOO_LONG = 17,
sPymbed 17:ff9d1e86ad5f 1180 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 18,
sPymbed 17:ff9d1e86ad5f 1181 X509_V_ERR_CERT_NOT_YET_VALID = 19,
sPymbed 17:ff9d1e86ad5f 1182 X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 20,
sPymbed 17:ff9d1e86ad5f 1183 X509_V_ERR_CERT_HAS_EXPIRED = 21,
sPymbed 17:ff9d1e86ad5f 1184 X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 22,
sPymbed 17:ff9d1e86ad5f 1185 X509_V_ERR_CERT_REJECTED = 23,
sPymbed 17:ff9d1e86ad5f 1186 /* Required for Nginx */
sPymbed 17:ff9d1e86ad5f 1187 X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 24,
sPymbed 17:ff9d1e86ad5f 1188 X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 25,
sPymbed 17:ff9d1e86ad5f 1189 X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 26,
sPymbed 17:ff9d1e86ad5f 1190 X509_V_ERR_CERT_UNTRUSTED = 27,
sPymbed 17:ff9d1e86ad5f 1191 X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 28,
sPymbed 17:ff9d1e86ad5f 1192 X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29,
sPymbed 17:ff9d1e86ad5f 1193 /* additional X509_V_ERR_* enums not used in wolfSSL */
sPymbed 17:ff9d1e86ad5f 1194 X509_V_ERR_UNABLE_TO_GET_CRL,
sPymbed 17:ff9d1e86ad5f 1195 X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE,
sPymbed 17:ff9d1e86ad5f 1196 X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE,
sPymbed 17:ff9d1e86ad5f 1197 X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY,
sPymbed 17:ff9d1e86ad5f 1198 X509_V_ERR_CERT_SIGNATURE_FAILURE,
sPymbed 17:ff9d1e86ad5f 1199 X509_V_ERR_CRL_NOT_YET_VALID,
sPymbed 17:ff9d1e86ad5f 1200 X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD,
sPymbed 17:ff9d1e86ad5f 1201 X509_V_ERR_OUT_OF_MEM,
sPymbed 17:ff9d1e86ad5f 1202 X509_V_ERR_INVALID_CA,
sPymbed 17:ff9d1e86ad5f 1203 X509_V_ERR_PATH_LENGTH_EXCEEDED,
sPymbed 17:ff9d1e86ad5f 1204 X509_V_ERR_INVALID_PURPOSE,
sPymbed 17:ff9d1e86ad5f 1205 X509_V_ERR_AKID_SKID_MISMATCH,
sPymbed 17:ff9d1e86ad5f 1206 X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH,
sPymbed 17:ff9d1e86ad5f 1207 X509_V_ERR_KEYUSAGE_NO_CERTSIGN,
sPymbed 17:ff9d1e86ad5f 1208 X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER,
sPymbed 17:ff9d1e86ad5f 1209 X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION,
sPymbed 17:ff9d1e86ad5f 1210 X509_V_ERR_KEYUSAGE_NO_CRL_SIGN,
sPymbed 17:ff9d1e86ad5f 1211 X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION,
sPymbed 17:ff9d1e86ad5f 1212 X509_V_ERR_INVALID_NON_CA,
sPymbed 17:ff9d1e86ad5f 1213 X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED,
sPymbed 17:ff9d1e86ad5f 1214 X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE,
sPymbed 17:ff9d1e86ad5f 1215 X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED,
sPymbed 17:ff9d1e86ad5f 1216 X509_V_ERR_INVALID_EXTENSION,
sPymbed 17:ff9d1e86ad5f 1217 X509_V_ERR_INVALID_POLICY_EXTENSION,
sPymbed 17:ff9d1e86ad5f 1218 X509_V_ERR_NO_EXPLICIT_POLICY,
sPymbed 17:ff9d1e86ad5f 1219 X509_V_ERR_UNNESTED_RESOURCE,
sPymbed 17:ff9d1e86ad5f 1220
sPymbed 17:ff9d1e86ad5f 1221 X509_R_CERT_ALREADY_IN_HASH_TABLE,
sPymbed 17:ff9d1e86ad5f 1222
sPymbed 17:ff9d1e86ad5f 1223 XN_FLAG_SPC_EQ = (1 << 23),
sPymbed 17:ff9d1e86ad5f 1224 XN_FLAG_ONELINE = 0,
sPymbed 17:ff9d1e86ad5f 1225 XN_FLAG_RFC2253 = 1,
sPymbed 17:ff9d1e86ad5f 1226
sPymbed 17:ff9d1e86ad5f 1227 CRYPTO_LOCK = 1,
sPymbed 17:ff9d1e86ad5f 1228 CRYPTO_NUM_LOCKS = 10,
sPymbed 17:ff9d1e86ad5f 1229
sPymbed 17:ff9d1e86ad5f 1230 ASN1_STRFLGS_ESC_MSB = 4
sPymbed 17:ff9d1e86ad5f 1231 };
sPymbed 17:ff9d1e86ad5f 1232 #endif
sPymbed 17:ff9d1e86ad5f 1233
sPymbed 17:ff9d1e86ad5f 1234 /* extras end */
sPymbed 17:ff9d1e86ad5f 1235
sPymbed 17:ff9d1e86ad5f 1236 #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM)
sPymbed 17:ff9d1e86ad5f 1237 /* wolfSSL extension, provide last error from SSL_get_error
sPymbed 17:ff9d1e86ad5f 1238 since not using thread storage error queue */
sPymbed 17:ff9d1e86ad5f 1239 #include <stdio.h>
sPymbed 17:ff9d1e86ad5f 1240 WOLFSSL_API void wolfSSL_ERR_print_errors_fp(XFILE, int err);
sPymbed 17:ff9d1e86ad5f 1241 #if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE)
sPymbed 17:ff9d1e86ad5f 1242 WOLFSSL_API void wolfSSL_ERR_dump_errors_fp(XFILE fp);
sPymbed 17:ff9d1e86ad5f 1243 #endif
sPymbed 17:ff9d1e86ad5f 1244 #endif
sPymbed 17:ff9d1e86ad5f 1245
sPymbed 17:ff9d1e86ad5f 1246
sPymbed 17:ff9d1e86ad5f 1247 #ifndef NO_OLD_SSL_NAMES
sPymbed 17:ff9d1e86ad5f 1248 #define SSL_ERROR_NONE WOLFSSL_ERROR_NONE
sPymbed 17:ff9d1e86ad5f 1249 #define SSL_FAILURE WOLFSSL_FAILURE
sPymbed 17:ff9d1e86ad5f 1250 #define SSL_SUCCESS WOLFSSL_SUCCESS
sPymbed 17:ff9d1e86ad5f 1251 #define SSL_SHUTDOWN_NOT_DONE WOLFSSL_SHUTDOWN_NOT_DONE
sPymbed 17:ff9d1e86ad5f 1252
sPymbed 17:ff9d1e86ad5f 1253 #define SSL_ALPN_NOT_FOUND WOLFSSL_ALPN_NOT_FOUND
sPymbed 17:ff9d1e86ad5f 1254 #define SSL_BAD_CERTTYPE WOLFSSL_BAD_CERTTYPE
sPymbed 17:ff9d1e86ad5f 1255 #define SSL_BAD_STAT WOLFSSL_BAD_STAT
sPymbed 17:ff9d1e86ad5f 1256 #define SSL_BAD_PATH WOLFSSL_BAD_PATH
sPymbed 17:ff9d1e86ad5f 1257 #define SSL_BAD_FILETYPE WOLFSSL_BAD_FILETYPE
sPymbed 17:ff9d1e86ad5f 1258 #define SSL_BAD_FILE WOLFSSL_BAD_FILE
sPymbed 17:ff9d1e86ad5f 1259 #define SSL_NOT_IMPLEMENTED WOLFSSL_NOT_IMPLEMENTED
sPymbed 17:ff9d1e86ad5f 1260 #define SSL_UNKNOWN WOLFSSL_UNKNOWN
sPymbed 17:ff9d1e86ad5f 1261 #define SSL_FATAL_ERROR WOLFSSL_FATAL_ERROR
sPymbed 17:ff9d1e86ad5f 1262
sPymbed 17:ff9d1e86ad5f 1263 #define SSL_FILETYPE_ASN1 WOLFSSL_FILETYPE_ASN1
sPymbed 17:ff9d1e86ad5f 1264 #define SSL_FILETYPE_PEM WOLFSSL_FILETYPE_PEM
sPymbed 17:ff9d1e86ad5f 1265 #define SSL_FILETYPE_DEFAULT WOLFSSL_FILETYPE_DEFAULT
sPymbed 17:ff9d1e86ad5f 1266 #define SSL_FILETYPE_RAW WOLFSSL_FILETYPE_RAW
sPymbed 17:ff9d1e86ad5f 1267
sPymbed 17:ff9d1e86ad5f 1268 #define SSL_VERIFY_NONE WOLFSSL_VERIFY_NONE
sPymbed 17:ff9d1e86ad5f 1269 #define SSL_VERIFY_PEER WOLFSSL_VERIFY_PEER
sPymbed 17:ff9d1e86ad5f 1270 #define SSL_VERIFY_FAIL_IF_NO_PEER_CERT WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT
sPymbed 17:ff9d1e86ad5f 1271 #define SSL_VERIFY_CLIENT_ONCE WOLFSSL_VERIFY_CLIENT_ONCE
sPymbed 17:ff9d1e86ad5f 1272 #define SSL_VERIFY_FAIL_EXCEPT_PSK WOLFSSL_VERIFY_FAIL_EXCEPT_PSK
sPymbed 17:ff9d1e86ad5f 1273
sPymbed 17:ff9d1e86ad5f 1274 #define SSL_SESS_CACHE_OFF WOLFSSL_SESS_CACHE_OFF
sPymbed 17:ff9d1e86ad5f 1275 #define SSL_SESS_CACHE_CLIENT WOLFSSL_SESS_CACHE_CLIENT
sPymbed 17:ff9d1e86ad5f 1276 #define SSL_SESS_CACHE_SERVER WOLFSSL_SESS_CACHE_SERVER
sPymbed 17:ff9d1e86ad5f 1277 #define SSL_SESS_CACHE_BOTH WOLFSSL_SESS_CACHE_BOTH
sPymbed 17:ff9d1e86ad5f 1278 #define SSL_SESS_CACHE_NO_AUTO_CLEAR WOLFSSL_SESS_CACHE_NO_AUTO_CLEAR
sPymbed 17:ff9d1e86ad5f 1279 #define SSL_SESS_CACHE_NO_INTERNAL_LOOKUP WOLFSSL_SESS_CACHE_NO_INTERNAL_LOOKUP
sPymbed 17:ff9d1e86ad5f 1280 #define SSL_SESS_CACHE_NO_INTERNAL_STORE WOLFSSL_SESS_CACHE_NO_INTERNAL_STORE
sPymbed 17:ff9d1e86ad5f 1281 #define SSL_SESS_CACHE_NO_INTERNAL WOLFSSL_SESS_CACHE_NO_INTERNAL
sPymbed 17:ff9d1e86ad5f 1282
sPymbed 17:ff9d1e86ad5f 1283 #define SSL_ERROR_WANT_READ WOLFSSL_ERROR_WANT_READ
sPymbed 17:ff9d1e86ad5f 1284 #define SSL_ERROR_WANT_WRITE WOLFSSL_ERROR_WANT_WRITE
sPymbed 17:ff9d1e86ad5f 1285 #define SSL_ERROR_WANT_CONNECT WOLFSSL_ERROR_WANT_CONNECT
sPymbed 17:ff9d1e86ad5f 1286 #define SSL_ERROR_WANT_ACCEPT WOLFSSL_ERROR_WANT_ACCEPT
sPymbed 17:ff9d1e86ad5f 1287 #define SSL_ERROR_SYSCALL WOLFSSL_ERROR_SYSCALL
sPymbed 17:ff9d1e86ad5f 1288 #define SSL_ERROR_WANT_X509_LOOKUP WOLFSSL_ERROR_WANT_X509_LOOKUP
sPymbed 17:ff9d1e86ad5f 1289 #define SSL_ERROR_ZERO_RETURN WOLFSSL_ERROR_ZERO_RETURN
sPymbed 17:ff9d1e86ad5f 1290 #define SSL_ERROR_SSL WOLFSSL_ERROR_SSL
sPymbed 17:ff9d1e86ad5f 1291
sPymbed 17:ff9d1e86ad5f 1292 #define SSL_SENT_SHUTDOWN WOLFSSL_SENT_SHUTDOWN
sPymbed 17:ff9d1e86ad5f 1293 #define SSL_RECEIVED_SHUTDOWN WOLFSSL_RECEIVED_SHUTDOWN
sPymbed 17:ff9d1e86ad5f 1294 #define SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER WOLFSSL_MODE_ACCEPT_MOVING_WRITE_BUFFER
sPymbed 17:ff9d1e86ad5f 1295 #define SSL_OP_NO_SSLv2 WOLFSSL_OP_NO_SSLv2
sPymbed 17:ff9d1e86ad5f 1296
sPymbed 17:ff9d1e86ad5f 1297 #define SSL_R_SSL_HANDSHAKE_FAILURE WOLFSSL_R_SSL_HANDSHAKE_FAILURE
sPymbed 17:ff9d1e86ad5f 1298 #define SSL_R_TLSV1_ALERT_UNKNOWN_CA WOLFSSL_R_TLSV1_ALERT_UNKNOWN_CA
sPymbed 17:ff9d1e86ad5f 1299 #define SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN WOLFSSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN
sPymbed 17:ff9d1e86ad5f 1300 #define SSL_R_SSLV3_ALERT_BAD_CERTIFICATE WOLFSSL_R_SSLV3_ALERT_BAD_CERTIFICATE
sPymbed 17:ff9d1e86ad5f 1301
sPymbed 17:ff9d1e86ad5f 1302 #define PEM_BUFSIZE WOLF_PEM_BUFSIZE
sPymbed 17:ff9d1e86ad5f 1303 #endif
sPymbed 17:ff9d1e86ad5f 1304
sPymbed 17:ff9d1e86ad5f 1305 enum { /* ssl Constants */
sPymbed 17:ff9d1e86ad5f 1306 WOLFSSL_ERROR_NONE = 0, /* for most functions */
sPymbed 17:ff9d1e86ad5f 1307 WOLFSSL_FAILURE = 0, /* for some functions */
sPymbed 17:ff9d1e86ad5f 1308 WOLFSSL_SUCCESS = 1,
sPymbed 17:ff9d1e86ad5f 1309 WOLFSSL_SHUTDOWN_NOT_DONE = 2, /* call wolfSSL_shutdown again to complete */
sPymbed 17:ff9d1e86ad5f 1310
sPymbed 17:ff9d1e86ad5f 1311 WOLFSSL_ALPN_NOT_FOUND = -9,
sPymbed 17:ff9d1e86ad5f 1312 WOLFSSL_BAD_CERTTYPE = -8,
sPymbed 17:ff9d1e86ad5f 1313 WOLFSSL_BAD_STAT = -7,
sPymbed 17:ff9d1e86ad5f 1314 WOLFSSL_BAD_PATH = -6,
sPymbed 17:ff9d1e86ad5f 1315 WOLFSSL_BAD_FILETYPE = -5,
sPymbed 17:ff9d1e86ad5f 1316 WOLFSSL_BAD_FILE = -4,
sPymbed 17:ff9d1e86ad5f 1317 WOLFSSL_NOT_IMPLEMENTED = -3,
sPymbed 17:ff9d1e86ad5f 1318 WOLFSSL_UNKNOWN = -2,
sPymbed 17:ff9d1e86ad5f 1319 WOLFSSL_FATAL_ERROR = -1,
sPymbed 17:ff9d1e86ad5f 1320
sPymbed 17:ff9d1e86ad5f 1321 WOLFSSL_FILETYPE_ASN1 = 2,
sPymbed 17:ff9d1e86ad5f 1322 WOLFSSL_FILETYPE_PEM = 1,
sPymbed 17:ff9d1e86ad5f 1323 WOLFSSL_FILETYPE_DEFAULT = 2, /* ASN1 */
sPymbed 17:ff9d1e86ad5f 1324 WOLFSSL_FILETYPE_RAW = 3, /* NTRU raw key blob */
sPymbed 17:ff9d1e86ad5f 1325
sPymbed 17:ff9d1e86ad5f 1326 WOLFSSL_VERIFY_NONE = 0,
sPymbed 17:ff9d1e86ad5f 1327 WOLFSSL_VERIFY_PEER = 1,
sPymbed 17:ff9d1e86ad5f 1328 WOLFSSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2,
sPymbed 17:ff9d1e86ad5f 1329 WOLFSSL_VERIFY_CLIENT_ONCE = 4,
sPymbed 17:ff9d1e86ad5f 1330 WOLFSSL_VERIFY_FAIL_EXCEPT_PSK = 8,
sPymbed 17:ff9d1e86ad5f 1331
sPymbed 17:ff9d1e86ad5f 1332 WOLFSSL_SESS_CACHE_OFF = 0x0000,
sPymbed 17:ff9d1e86ad5f 1333 WOLFSSL_SESS_CACHE_CLIENT = 0x0001,
sPymbed 17:ff9d1e86ad5f 1334 WOLFSSL_SESS_CACHE_SERVER = 0x0002,
sPymbed 17:ff9d1e86ad5f 1335 WOLFSSL_SESS_CACHE_BOTH = 0x0003,
sPymbed 17:ff9d1e86ad5f 1336 WOLFSSL_SESS_CACHE_NO_AUTO_CLEAR = 0x0008,
sPymbed 17:ff9d1e86ad5f 1337 WOLFSSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 0x0100,
sPymbed 17:ff9d1e86ad5f 1338 WOLFSSL_SESS_CACHE_NO_INTERNAL_STORE = 0x0200,
sPymbed 17:ff9d1e86ad5f 1339 WOLFSSL_SESS_CACHE_NO_INTERNAL = 0x0300,
sPymbed 17:ff9d1e86ad5f 1340
sPymbed 17:ff9d1e86ad5f 1341 WOLFSSL_ERROR_WANT_READ = 2,
sPymbed 17:ff9d1e86ad5f 1342 WOLFSSL_ERROR_WANT_WRITE = 3,
sPymbed 17:ff9d1e86ad5f 1343 WOLFSSL_ERROR_WANT_CONNECT = 7,
sPymbed 17:ff9d1e86ad5f 1344 WOLFSSL_ERROR_WANT_ACCEPT = 8,
sPymbed 17:ff9d1e86ad5f 1345 WOLFSSL_ERROR_SYSCALL = 5,
sPymbed 17:ff9d1e86ad5f 1346 WOLFSSL_ERROR_WANT_X509_LOOKUP = 83,
sPymbed 17:ff9d1e86ad5f 1347 WOLFSSL_ERROR_ZERO_RETURN = 6,
sPymbed 17:ff9d1e86ad5f 1348 WOLFSSL_ERROR_SSL = 85,
sPymbed 17:ff9d1e86ad5f 1349
sPymbed 17:ff9d1e86ad5f 1350 WOLFSSL_SENT_SHUTDOWN = 1,
sPymbed 17:ff9d1e86ad5f 1351 WOLFSSL_RECEIVED_SHUTDOWN = 2,
sPymbed 17:ff9d1e86ad5f 1352 WOLFSSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 4,
sPymbed 17:ff9d1e86ad5f 1353 WOLFSSL_OP_NO_SSLv2 = 8,
sPymbed 17:ff9d1e86ad5f 1354
sPymbed 17:ff9d1e86ad5f 1355 WOLFSSL_R_SSL_HANDSHAKE_FAILURE = 101,
sPymbed 17:ff9d1e86ad5f 1356 WOLFSSL_R_TLSV1_ALERT_UNKNOWN_CA = 102,
sPymbed 17:ff9d1e86ad5f 1357 WOLFSSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 103,
sPymbed 17:ff9d1e86ad5f 1358 WOLFSSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 104,
sPymbed 17:ff9d1e86ad5f 1359
sPymbed 17:ff9d1e86ad5f 1360 WOLF_PEM_BUFSIZE = 1024
sPymbed 17:ff9d1e86ad5f 1361 };
sPymbed 17:ff9d1e86ad5f 1362
sPymbed 17:ff9d1e86ad5f 1363 #ifndef NO_PSK
sPymbed 17:ff9d1e86ad5f 1364 typedef unsigned int (*wc_psk_client_callback)(WOLFSSL*, const char*, char*,
sPymbed 17:ff9d1e86ad5f 1365 unsigned int, unsigned char*, unsigned int);
sPymbed 17:ff9d1e86ad5f 1366 WOLFSSL_API void wolfSSL_CTX_set_psk_client_callback(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1367 wc_psk_client_callback);
sPymbed 17:ff9d1e86ad5f 1368 WOLFSSL_API void wolfSSL_set_psk_client_callback(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 1369 wc_psk_client_callback);
sPymbed 17:ff9d1e86ad5f 1370
sPymbed 17:ff9d1e86ad5f 1371 WOLFSSL_API const char* wolfSSL_get_psk_identity_hint(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1372 WOLFSSL_API const char* wolfSSL_get_psk_identity(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1373
sPymbed 17:ff9d1e86ad5f 1374 WOLFSSL_API int wolfSSL_CTX_use_psk_identity_hint(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 1375 WOLFSSL_API int wolfSSL_use_psk_identity_hint(WOLFSSL*, const char*);
sPymbed 17:ff9d1e86ad5f 1376
sPymbed 17:ff9d1e86ad5f 1377 typedef unsigned int (*wc_psk_server_callback)(WOLFSSL*, const char*,
sPymbed 17:ff9d1e86ad5f 1378 unsigned char*, unsigned int);
sPymbed 17:ff9d1e86ad5f 1379 WOLFSSL_API void wolfSSL_CTX_set_psk_server_callback(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1380 wc_psk_server_callback);
sPymbed 17:ff9d1e86ad5f 1381 WOLFSSL_API void wolfSSL_set_psk_server_callback(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 1382 wc_psk_server_callback);
sPymbed 17:ff9d1e86ad5f 1383
sPymbed 17:ff9d1e86ad5f 1384 #define PSK_TYPES_DEFINED
sPymbed 17:ff9d1e86ad5f 1385 #endif /* NO_PSK */
sPymbed 17:ff9d1e86ad5f 1386
sPymbed 17:ff9d1e86ad5f 1387
sPymbed 17:ff9d1e86ad5f 1388 #ifdef HAVE_ANON
sPymbed 17:ff9d1e86ad5f 1389 WOLFSSL_API int wolfSSL_CTX_allow_anon_cipher(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1390 #endif /* HAVE_ANON */
sPymbed 17:ff9d1e86ad5f 1391
sPymbed 17:ff9d1e86ad5f 1392
sPymbed 17:ff9d1e86ad5f 1393 /* extra begins */
sPymbed 17:ff9d1e86ad5f 1394 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 1395 enum { /* ERR Constants */
sPymbed 17:ff9d1e86ad5f 1396 ERR_TXT_STRING = 1
sPymbed 17:ff9d1e86ad5f 1397 };
sPymbed 17:ff9d1e86ad5f 1398
sPymbed 17:ff9d1e86ad5f 1399 /* bio misc */
sPymbed 17:ff9d1e86ad5f 1400 enum {
sPymbed 17:ff9d1e86ad5f 1401 WOLFSSL_BIO_ERROR = -1,
sPymbed 17:ff9d1e86ad5f 1402 WOLFSSL_BIO_UNSET = -2,
sPymbed 17:ff9d1e86ad5f 1403 WOLFSSL_BIO_SIZE = 17000 /* default BIO write size if not set */
sPymbed 17:ff9d1e86ad5f 1404 };
sPymbed 17:ff9d1e86ad5f 1405 #endif
sPymbed 17:ff9d1e86ad5f 1406
sPymbed 17:ff9d1e86ad5f 1407 WOLFSSL_API void wolfSSL_ERR_put_error(int lib, int fun, int err,
sPymbed 17:ff9d1e86ad5f 1408 const char* file, int line);
sPymbed 17:ff9d1e86ad5f 1409 WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line(const char**, int*);
sPymbed 17:ff9d1e86ad5f 1410 WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line_data(const char**, int*,
sPymbed 17:ff9d1e86ad5f 1411 const char**, int *);
sPymbed 17:ff9d1e86ad5f 1412
sPymbed 17:ff9d1e86ad5f 1413 WOLFSSL_API unsigned long wolfSSL_ERR_get_error(void);
sPymbed 17:ff9d1e86ad5f 1414 WOLFSSL_API void wolfSSL_ERR_clear_error(void);
sPymbed 17:ff9d1e86ad5f 1415
sPymbed 17:ff9d1e86ad5f 1416
sPymbed 17:ff9d1e86ad5f 1417 WOLFSSL_API int wolfSSL_RAND_status(void);
sPymbed 17:ff9d1e86ad5f 1418 WOLFSSL_API int wolfSSL_RAND_pseudo_bytes(unsigned char* buf, int num);
sPymbed 17:ff9d1e86ad5f 1419 WOLFSSL_API int wolfSSL_RAND_bytes(unsigned char* buf, int num);
sPymbed 17:ff9d1e86ad5f 1420 WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method(void);
sPymbed 17:ff9d1e86ad5f 1421 WOLFSSL_API long wolfSSL_CTX_set_options(WOLFSSL_CTX*, long);
sPymbed 17:ff9d1e86ad5f 1422 WOLFSSL_API long wolfSSL_CTX_get_options(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 1423 WOLFSSL_API long wolfSSL_CTX_clear_options(WOLFSSL_CTX*, long);
sPymbed 17:ff9d1e86ad5f 1424
sPymbed 17:ff9d1e86ad5f 1425 #ifndef NO_CERTS
sPymbed 17:ff9d1e86ad5f 1426 WOLFSSL_API int wolfSSL_CTX_check_private_key(const WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1427 #endif /* !NO_CERTS */
sPymbed 17:ff9d1e86ad5f 1428
sPymbed 17:ff9d1e86ad5f 1429 WOLFSSL_API void wolfSSL_ERR_free_strings(void);
sPymbed 17:ff9d1e86ad5f 1430 WOLFSSL_API void wolfSSL_ERR_remove_state(unsigned long);
sPymbed 17:ff9d1e86ad5f 1431 WOLFSSL_API int wolfSSL_clear(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1432 WOLFSSL_API int wolfSSL_state(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1433
sPymbed 17:ff9d1e86ad5f 1434 WOLFSSL_API void wolfSSL_cleanup_all_ex_data(void);
sPymbed 17:ff9d1e86ad5f 1435 WOLFSSL_API long wolfSSL_CTX_set_mode(WOLFSSL_CTX* ctx, long mode);
sPymbed 17:ff9d1e86ad5f 1436 WOLFSSL_API long wolfSSL_CTX_get_mode(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 1437 WOLFSSL_API void wolfSSL_CTX_set_default_read_ahead(WOLFSSL_CTX* ctx, int m);
sPymbed 17:ff9d1e86ad5f 1438 WOLFSSL_API long wolfSSL_SSL_get_mode(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1439
sPymbed 17:ff9d1e86ad5f 1440
sPymbed 17:ff9d1e86ad5f 1441 WOLFSSL_API int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1442 WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1443 const unsigned char*, unsigned int);
sPymbed 17:ff9d1e86ad5f 1444 WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1445 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_get_peer_cert_chain(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1446
sPymbed 17:ff9d1e86ad5f 1447 WOLFSSL_API int wolfSSL_want_read(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1448 WOLFSSL_API int wolfSSL_want_write(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1449
sPymbed 17:ff9d1e86ad5f 1450 WOLFSSL_API int wolfSSL_BIO_printf(WOLFSSL_BIO*, const char*, ...);
sPymbed 17:ff9d1e86ad5f 1451 WOLFSSL_API int wolfSSL_ASN1_UTCTIME_print(WOLFSSL_BIO*,
sPymbed 17:ff9d1e86ad5f 1452 const WOLFSSL_ASN1_UTCTIME*);
sPymbed 17:ff9d1e86ad5f 1453 WOLFSSL_API int wolfSSL_ASN1_GENERALIZEDTIME_print(WOLFSSL_BIO*,
sPymbed 17:ff9d1e86ad5f 1454 const WOLFSSL_ASN1_GENERALIZEDTIME*);
sPymbed 17:ff9d1e86ad5f 1455 WOLFSSL_API void wolfSSL_ASN1_GENERALIZEDTIME_free(WOLFSSL_ASN1_GENERALIZEDTIME*);
sPymbed 17:ff9d1e86ad5f 1456 WOLFSSL_API int wolfSSL_sk_num(WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)*);
sPymbed 17:ff9d1e86ad5f 1457 WOLFSSL_API void* wolfSSL_sk_value(WOLF_STACK_OF(WOLFSSL_ASN1_OBJECT)*, int);
sPymbed 17:ff9d1e86ad5f 1458
sPymbed 17:ff9d1e86ad5f 1459 /* stunnel 4.28 needs */
sPymbed 17:ff9d1e86ad5f 1460 WOLFSSL_API void* wolfSSL_CTX_get_ex_data(const WOLFSSL_CTX*, int);
sPymbed 17:ff9d1e86ad5f 1461 WOLFSSL_API int wolfSSL_CTX_set_ex_data(WOLFSSL_CTX*, int, void*);
sPymbed 17:ff9d1e86ad5f 1462 WOLFSSL_API void wolfSSL_CTX_sess_set_get_cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1463 WOLFSSL_SESSION*(*f)(WOLFSSL*, unsigned char*, int, int*));
sPymbed 17:ff9d1e86ad5f 1464 WOLFSSL_API void wolfSSL_CTX_sess_set_new_cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1465 int (*f)(WOLFSSL*, WOLFSSL_SESSION*));
sPymbed 17:ff9d1e86ad5f 1466 WOLFSSL_API void wolfSSL_CTX_sess_set_remove_cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1467 void (*f)(WOLFSSL_CTX*, WOLFSSL_SESSION*));
sPymbed 17:ff9d1e86ad5f 1468
sPymbed 17:ff9d1e86ad5f 1469 WOLFSSL_API int wolfSSL_i2d_SSL_SESSION(WOLFSSL_SESSION*,unsigned char**);
sPymbed 17:ff9d1e86ad5f 1470 WOLFSSL_API WOLFSSL_SESSION* wolfSSL_d2i_SSL_SESSION(WOLFSSL_SESSION**,
sPymbed 17:ff9d1e86ad5f 1471 const unsigned char**, long);
sPymbed 17:ff9d1e86ad5f 1472
sPymbed 17:ff9d1e86ad5f 1473 WOLFSSL_API long wolfSSL_SESSION_get_timeout(const WOLFSSL_SESSION*);
sPymbed 17:ff9d1e86ad5f 1474 WOLFSSL_API long wolfSSL_SESSION_get_time(const WOLFSSL_SESSION*);
sPymbed 17:ff9d1e86ad5f 1475 WOLFSSL_API int wolfSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*);
sPymbed 17:ff9d1e86ad5f 1476
sPymbed 17:ff9d1e86ad5f 1477 /* extra ends */
sPymbed 17:ff9d1e86ad5f 1478
sPymbed 17:ff9d1e86ad5f 1479
sPymbed 17:ff9d1e86ad5f 1480 /* wolfSSL extensions */
sPymbed 17:ff9d1e86ad5f 1481
sPymbed 17:ff9d1e86ad5f 1482 /* call before SSL_connect, if verifying will add name check to
sPymbed 17:ff9d1e86ad5f 1483 date check and signature check */
sPymbed 17:ff9d1e86ad5f 1484 WOLFSSL_API int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn);
sPymbed 17:ff9d1e86ad5f 1485
sPymbed 17:ff9d1e86ad5f 1486 /* need to call once to load library (session cache) */
sPymbed 17:ff9d1e86ad5f 1487 WOLFSSL_API int wolfSSL_Init(void);
sPymbed 17:ff9d1e86ad5f 1488 /* call when done to cleanup/free session cache mutex / resources */
sPymbed 17:ff9d1e86ad5f 1489 WOLFSSL_API int wolfSSL_Cleanup(void);
sPymbed 17:ff9d1e86ad5f 1490
sPymbed 17:ff9d1e86ad5f 1491 /* which library version do we have */
sPymbed 17:ff9d1e86ad5f 1492 WOLFSSL_API const char* wolfSSL_lib_version(void);
sPymbed 17:ff9d1e86ad5f 1493 /* which library version do we have in hex */
sPymbed 17:ff9d1e86ad5f 1494 WOLFSSL_API unsigned int wolfSSL_lib_version_hex(void);
sPymbed 17:ff9d1e86ad5f 1495
sPymbed 17:ff9d1e86ad5f 1496 /* do accept or connect depedning on side */
sPymbed 17:ff9d1e86ad5f 1497 WOLFSSL_API int wolfSSL_negotiate(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1498 /* turn on wolfSSL data compression */
sPymbed 17:ff9d1e86ad5f 1499 WOLFSSL_API int wolfSSL_set_compression(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1500
sPymbed 17:ff9d1e86ad5f 1501 WOLFSSL_API int wolfSSL_set_timeout(WOLFSSL*, unsigned int);
sPymbed 17:ff9d1e86ad5f 1502 WOLFSSL_API int wolfSSL_CTX_set_timeout(WOLFSSL_CTX*, unsigned int);
sPymbed 17:ff9d1e86ad5f 1503
sPymbed 17:ff9d1e86ad5f 1504 /* get wolfSSL peer X509_CHAIN */
sPymbed 17:ff9d1e86ad5f 1505 WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_chain(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1506 #ifdef WOLFSSL_ALT_CERT_CHAINS
sPymbed 17:ff9d1e86ad5f 1507 WOLFSSL_API int wolfSSL_is_peer_alt_cert_chain(const WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1508 /* get wolfSSL alternate peer X509_CHAIN */
sPymbed 17:ff9d1e86ad5f 1509 WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_alt_chain(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1510 #endif
sPymbed 17:ff9d1e86ad5f 1511 /* peer chain count */
sPymbed 17:ff9d1e86ad5f 1512 WOLFSSL_API int wolfSSL_get_chain_count(WOLFSSL_X509_CHAIN* chain);
sPymbed 17:ff9d1e86ad5f 1513 /* index cert length */
sPymbed 17:ff9d1e86ad5f 1514 WOLFSSL_API int wolfSSL_get_chain_length(WOLFSSL_X509_CHAIN*, int idx);
sPymbed 17:ff9d1e86ad5f 1515 /* index cert */
sPymbed 17:ff9d1e86ad5f 1516 WOLFSSL_API unsigned char* wolfSSL_get_chain_cert(WOLFSSL_X509_CHAIN*, int idx);
sPymbed 17:ff9d1e86ad5f 1517 /* index cert in X509 */
sPymbed 17:ff9d1e86ad5f 1518 WOLFSSL_API WOLFSSL_X509* wolfSSL_get_chain_X509(WOLFSSL_X509_CHAIN*, int idx);
sPymbed 17:ff9d1e86ad5f 1519 /* free X509 */
sPymbed 17:ff9d1e86ad5f 1520 #define wolfSSL_FreeX509(x509) wolfSSL_X509_free((x509))
sPymbed 17:ff9d1e86ad5f 1521 WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1522 /* get index cert in PEM */
sPymbed 17:ff9d1e86ad5f 1523 WOLFSSL_API int wolfSSL_get_chain_cert_pem(WOLFSSL_X509_CHAIN*, int idx,
sPymbed 17:ff9d1e86ad5f 1524 unsigned char* buf, int inLen, int* outLen);
sPymbed 17:ff9d1e86ad5f 1525 WOLFSSL_API const unsigned char* wolfSSL_get_sessionID(const WOLFSSL_SESSION* s);
sPymbed 17:ff9d1e86ad5f 1526 WOLFSSL_API int wolfSSL_X509_get_serial_number(WOLFSSL_X509*,unsigned char*,int*);
sPymbed 17:ff9d1e86ad5f 1527 WOLFSSL_API char* wolfSSL_X509_get_subjectCN(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1528 WOLFSSL_API const unsigned char* wolfSSL_X509_get_der(WOLFSSL_X509*, int*);
sPymbed 17:ff9d1e86ad5f 1529 WOLFSSL_API const unsigned char* wolfSSL_X509_notBefore(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1530 WOLFSSL_API const unsigned char* wolfSSL_X509_notAfter(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1531 WOLFSSL_API int wolfSSL_X509_version(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1532
sPymbed 17:ff9d1e86ad5f 1533 WOLFSSL_API int wolfSSL_cmp_peer_cert_to_file(WOLFSSL*, const char*);
sPymbed 17:ff9d1e86ad5f 1534
sPymbed 17:ff9d1e86ad5f 1535 WOLFSSL_API char* wolfSSL_X509_get_next_altname(WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 1536
sPymbed 17:ff9d1e86ad5f 1537 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509(WOLFSSL_X509** x509,
sPymbed 17:ff9d1e86ad5f 1538 const unsigned char** in, int len);
sPymbed 17:ff9d1e86ad5f 1539 WOLFSSL_API WOLFSSL_X509*
sPymbed 17:ff9d1e86ad5f 1540 wolfSSL_X509_d2i(WOLFSSL_X509** x509, const unsigned char* in, int len);
sPymbed 17:ff9d1e86ad5f 1541 WOLFSSL_API int wolfSSL_i2d_X509(WOLFSSL_X509* x509, unsigned char** out);
sPymbed 17:ff9d1e86ad5f 1542 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_d2i_X509_CRL(WOLFSSL_X509_CRL **crl,
sPymbed 17:ff9d1e86ad5f 1543 const unsigned char *in, int len);
sPymbed 17:ff9d1e86ad5f 1544 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1545 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_d2i_X509_CRL_fp(XFILE file, WOLFSSL_X509_CRL **crl);
sPymbed 17:ff9d1e86ad5f 1546 #endif
sPymbed 17:ff9d1e86ad5f 1547 WOLFSSL_API void wolfSSL_X509_CRL_free(WOLFSSL_X509_CRL *crl);
sPymbed 17:ff9d1e86ad5f 1548
sPymbed 17:ff9d1e86ad5f 1549 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1550 #ifndef NO_STDIO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1551 WOLFSSL_API WOLFSSL_X509*
sPymbed 17:ff9d1e86ad5f 1552 wolfSSL_X509_d2i_fp(WOLFSSL_X509** x509, XFILE file);
sPymbed 17:ff9d1e86ad5f 1553 #endif
sPymbed 17:ff9d1e86ad5f 1554 WOLFSSL_API WOLFSSL_X509*
sPymbed 17:ff9d1e86ad5f 1555 wolfSSL_X509_load_certificate_file(const char* fname, int format);
sPymbed 17:ff9d1e86ad5f 1556 #endif
sPymbed 17:ff9d1e86ad5f 1557 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_load_certificate_buffer(
sPymbed 17:ff9d1e86ad5f 1558 const unsigned char* buf, int sz, int format);
sPymbed 17:ff9d1e86ad5f 1559
sPymbed 17:ff9d1e86ad5f 1560 #ifdef WOLFSSL_SEP
sPymbed 17:ff9d1e86ad5f 1561 WOLFSSL_API unsigned char*
sPymbed 17:ff9d1e86ad5f 1562 wolfSSL_X509_get_device_type(WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 1563 WOLFSSL_API unsigned char*
sPymbed 17:ff9d1e86ad5f 1564 wolfSSL_X509_get_hw_type(WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 1565 WOLFSSL_API unsigned char*
sPymbed 17:ff9d1e86ad5f 1566 wolfSSL_X509_get_hw_serial_number(WOLFSSL_X509*, unsigned char*, int*);
sPymbed 17:ff9d1e86ad5f 1567 #endif
sPymbed 17:ff9d1e86ad5f 1568
sPymbed 17:ff9d1e86ad5f 1569 /* connect enough to get peer cert */
sPymbed 17:ff9d1e86ad5f 1570 WOLFSSL_API int wolfSSL_connect_cert(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1571
sPymbed 17:ff9d1e86ad5f 1572
sPymbed 17:ff9d1e86ad5f 1573
sPymbed 17:ff9d1e86ad5f 1574 /* PKCS12 compatibility */
sPymbed 17:ff9d1e86ad5f 1575 typedef struct WC_PKCS12 WC_PKCS12;
sPymbed 17:ff9d1e86ad5f 1576 WOLFSSL_API WC_PKCS12* wolfSSL_d2i_PKCS12_bio(WOLFSSL_BIO* bio,
sPymbed 17:ff9d1e86ad5f 1577 WC_PKCS12** pkcs12);
sPymbed 17:ff9d1e86ad5f 1578 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1579 WOLFSSL_API WOLFSSL_X509_PKCS12* wolfSSL_d2i_PKCS12_fp(XFILE fp,
sPymbed 17:ff9d1e86ad5f 1580 WOLFSSL_X509_PKCS12** pkcs12);
sPymbed 17:ff9d1e86ad5f 1581 #endif
sPymbed 17:ff9d1e86ad5f 1582 WOLFSSL_API int wolfSSL_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw,
sPymbed 17:ff9d1e86ad5f 1583 WOLFSSL_EVP_PKEY** pkey, WOLFSSL_X509** cert,
sPymbed 17:ff9d1e86ad5f 1584 WOLF_STACK_OF(WOLFSSL_X509)** ca);
sPymbed 17:ff9d1e86ad5f 1585 WOLFSSL_API WC_PKCS12* wolfSSL_PKCS12_create(char* pass, char* name,
sPymbed 17:ff9d1e86ad5f 1586 WOLFSSL_EVP_PKEY* pkey, WOLFSSL_X509* cert,
sPymbed 17:ff9d1e86ad5f 1587 WOLF_STACK_OF(WOLFSSL_X509)* ca,
sPymbed 17:ff9d1e86ad5f 1588 int keyNID, int certNID, int itt, int macItt, int keytype);
sPymbed 17:ff9d1e86ad5f 1589 WOLFSSL_API void wolfSSL_PKCS12_PBE_add(void);
sPymbed 17:ff9d1e86ad5f 1590
sPymbed 17:ff9d1e86ad5f 1591
sPymbed 17:ff9d1e86ad5f 1592
sPymbed 17:ff9d1e86ad5f 1593 #ifndef NO_DH
sPymbed 17:ff9d1e86ad5f 1594 /* server Diffie-Hellman parameters */
sPymbed 17:ff9d1e86ad5f 1595 WOLFSSL_API int wolfSSL_SetTmpDH(WOLFSSL*, const unsigned char* p, int pSz,
sPymbed 17:ff9d1e86ad5f 1596 const unsigned char* g, int gSz);
sPymbed 17:ff9d1e86ad5f 1597 WOLFSSL_API int wolfSSL_SetTmpDH_buffer(WOLFSSL*, const unsigned char* b, long sz,
sPymbed 17:ff9d1e86ad5f 1598 int format);
sPymbed 17:ff9d1e86ad5f 1599 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1600 WOLFSSL_API int wolfSSL_SetTmpDH_file(WOLFSSL*, const char* f, int format);
sPymbed 17:ff9d1e86ad5f 1601 #endif
sPymbed 17:ff9d1e86ad5f 1602
sPymbed 17:ff9d1e86ad5f 1603 /* server ctx Diffie-Hellman parameters */
sPymbed 17:ff9d1e86ad5f 1604 WOLFSSL_API int wolfSSL_CTX_SetTmpDH(WOLFSSL_CTX*, const unsigned char* p,
sPymbed 17:ff9d1e86ad5f 1605 int pSz, const unsigned char* g, int gSz);
sPymbed 17:ff9d1e86ad5f 1606 WOLFSSL_API int wolfSSL_CTX_SetTmpDH_buffer(WOLFSSL_CTX*, const unsigned char* b,
sPymbed 17:ff9d1e86ad5f 1607 long sz, int format);
sPymbed 17:ff9d1e86ad5f 1608
sPymbed 17:ff9d1e86ad5f 1609 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 1610 WOLFSSL_API int wolfSSL_CTX_SetTmpDH_file(WOLFSSL_CTX*, const char* f,
sPymbed 17:ff9d1e86ad5f 1611 int format);
sPymbed 17:ff9d1e86ad5f 1612 #endif
sPymbed 17:ff9d1e86ad5f 1613
sPymbed 17:ff9d1e86ad5f 1614 WOLFSSL_API int wolfSSL_CTX_SetMinDhKey_Sz(WOLFSSL_CTX*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1615 WOLFSSL_API int wolfSSL_SetMinDhKey_Sz(WOLFSSL*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1616 WOLFSSL_API int wolfSSL_CTX_SetMaxDhKey_Sz(WOLFSSL_CTX*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1617 WOLFSSL_API int wolfSSL_SetMaxDhKey_Sz(WOLFSSL*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1618 WOLFSSL_API int wolfSSL_GetDhKey_Sz(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1619 #endif /* NO_DH */
sPymbed 17:ff9d1e86ad5f 1620
sPymbed 17:ff9d1e86ad5f 1621 #ifndef NO_RSA
sPymbed 17:ff9d1e86ad5f 1622 WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, short);
sPymbed 17:ff9d1e86ad5f 1623 WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, short);
sPymbed 17:ff9d1e86ad5f 1624 #endif /* NO_RSA */
sPymbed 17:ff9d1e86ad5f 1625
sPymbed 17:ff9d1e86ad5f 1626 #ifdef HAVE_ECC
sPymbed 17:ff9d1e86ad5f 1627 WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX*, short);
sPymbed 17:ff9d1e86ad5f 1628 WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL*, short);
sPymbed 17:ff9d1e86ad5f 1629 #endif /* NO_RSA */
sPymbed 17:ff9d1e86ad5f 1630
sPymbed 17:ff9d1e86ad5f 1631 WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1632 WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX*, unsigned short);
sPymbed 17:ff9d1e86ad5f 1633
sPymbed 17:ff9d1e86ad5f 1634 /* keyblock size in bytes or -1 */
sPymbed 17:ff9d1e86ad5f 1635 /* need to call wolfSSL_KeepArrays before handshake to save keys */
sPymbed 17:ff9d1e86ad5f 1636 WOLFSSL_API int wolfSSL_get_keyblock_size(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1637 WOLFSSL_API int wolfSSL_get_keys(WOLFSSL*,unsigned char** ms, unsigned int* msLen,
sPymbed 17:ff9d1e86ad5f 1638 unsigned char** sr, unsigned int* srLen,
sPymbed 17:ff9d1e86ad5f 1639 unsigned char** cr, unsigned int* crLen);
sPymbed 17:ff9d1e86ad5f 1640
sPymbed 17:ff9d1e86ad5f 1641 /* Computes EAP-TLS and EAP-TTLS keying material from the master_secret. */
sPymbed 17:ff9d1e86ad5f 1642 WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len,
sPymbed 17:ff9d1e86ad5f 1643 const char* label);
sPymbed 17:ff9d1e86ad5f 1644
sPymbed 17:ff9d1e86ad5f 1645
sPymbed 17:ff9d1e86ad5f 1646 #ifndef _WIN32
sPymbed 17:ff9d1e86ad5f 1647 #ifndef NO_WRITEV
sPymbed 17:ff9d1e86ad5f 1648 #ifdef __PPU
sPymbed 17:ff9d1e86ad5f 1649 #include <sys/types.h>
sPymbed 17:ff9d1e86ad5f 1650 #include <sys/socket.h>
sPymbed 17:ff9d1e86ad5f 1651 #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \
sPymbed 17:ff9d1e86ad5f 1652 !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \
sPymbed 17:ff9d1e86ad5f 1653 !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) && \
sPymbed 17:ff9d1e86ad5f 1654 !defined(WOLFSSL_CHIBIOS)
sPymbed 17:ff9d1e86ad5f 1655 #include <sys/uio.h>
sPymbed 17:ff9d1e86ad5f 1656 #endif
sPymbed 17:ff9d1e86ad5f 1657 /* allow writev style writing */
sPymbed 17:ff9d1e86ad5f 1658 WOLFSSL_API int wolfSSL_writev(WOLFSSL* ssl, const struct iovec* iov,
sPymbed 17:ff9d1e86ad5f 1659 int iovcnt);
sPymbed 17:ff9d1e86ad5f 1660 #endif
sPymbed 17:ff9d1e86ad5f 1661 #endif
sPymbed 17:ff9d1e86ad5f 1662
sPymbed 17:ff9d1e86ad5f 1663
sPymbed 17:ff9d1e86ad5f 1664 #ifndef NO_CERTS
sPymbed 17:ff9d1e86ad5f 1665 /* SSL_CTX versions */
sPymbed 17:ff9d1e86ad5f 1666 WOLFSSL_API int wolfSSL_CTX_UnloadCAs(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1667 #ifdef WOLFSSL_TRUST_PEER_CERT
sPymbed 17:ff9d1e86ad5f 1668 WOLFSSL_API int wolfSSL_CTX_Unload_trust_peers(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1669 WOLFSSL_API int wolfSSL_CTX_trust_peer_buffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1670 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1671 #endif
sPymbed 17:ff9d1e86ad5f 1672 WOLFSSL_API int wolfSSL_CTX_load_verify_buffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1673 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1674 WOLFSSL_API int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1675 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1676 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_buffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1677 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1678 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer_format(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1679 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1680 WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1681 const unsigned char*, long);
sPymbed 17:ff9d1e86ad5f 1682
sPymbed 17:ff9d1e86ad5f 1683 /* SSL versions */
sPymbed 17:ff9d1e86ad5f 1684 WOLFSSL_API int wolfSSL_use_certificate_buffer(WOLFSSL*, const unsigned char*,
sPymbed 17:ff9d1e86ad5f 1685 long, int);
sPymbed 17:ff9d1e86ad5f 1686 WOLFSSL_API int wolfSSL_use_PrivateKey_buffer(WOLFSSL*, const unsigned char*,
sPymbed 17:ff9d1e86ad5f 1687 long, int);
sPymbed 17:ff9d1e86ad5f 1688 WOLFSSL_API int wolfSSL_use_certificate_chain_buffer_format(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 1689 const unsigned char*, long, int);
sPymbed 17:ff9d1e86ad5f 1690 WOLFSSL_API int wolfSSL_use_certificate_chain_buffer(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 1691 const unsigned char*, long);
sPymbed 17:ff9d1e86ad5f 1692 WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1693
sPymbed 17:ff9d1e86ad5f 1694 #if defined(OPENSSL_EXTRA) && defined(KEEP_OUR_CERT)
sPymbed 17:ff9d1e86ad5f 1695 WOLFSSL_API WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1696 #endif
sPymbed 17:ff9d1e86ad5f 1697 #endif
sPymbed 17:ff9d1e86ad5f 1698
sPymbed 17:ff9d1e86ad5f 1699 WOLFSSL_API int wolfSSL_CTX_set_group_messages(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 1700 WOLFSSL_API int wolfSSL_set_group_messages(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1701
sPymbed 17:ff9d1e86ad5f 1702
sPymbed 17:ff9d1e86ad5f 1703 #ifdef HAVE_FUZZER
sPymbed 17:ff9d1e86ad5f 1704 enum fuzzer_type {
sPymbed 17:ff9d1e86ad5f 1705 FUZZ_HMAC = 0,
sPymbed 17:ff9d1e86ad5f 1706 FUZZ_ENCRYPT = 1,
sPymbed 17:ff9d1e86ad5f 1707 FUZZ_SIGNATURE = 2,
sPymbed 17:ff9d1e86ad5f 1708 FUZZ_HASH = 3,
sPymbed 17:ff9d1e86ad5f 1709 FUZZ_HEAD = 4
sPymbed 17:ff9d1e86ad5f 1710 };
sPymbed 17:ff9d1e86ad5f 1711
sPymbed 17:ff9d1e86ad5f 1712 typedef int (*CallbackFuzzer)(WOLFSSL* ssl, const unsigned char* buf, int sz,
sPymbed 17:ff9d1e86ad5f 1713 int type, void* fuzzCtx);
sPymbed 17:ff9d1e86ad5f 1714
sPymbed 17:ff9d1e86ad5f 1715 WOLFSSL_API void wolfSSL_SetFuzzerCb(WOLFSSL* ssl, CallbackFuzzer cbf, void* fCtx);
sPymbed 17:ff9d1e86ad5f 1716 #endif
sPymbed 17:ff9d1e86ad5f 1717
sPymbed 17:ff9d1e86ad5f 1718
sPymbed 17:ff9d1e86ad5f 1719 WOLFSSL_API int wolfSSL_DTLS_SetCookieSecret(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 1720 const unsigned char*,
sPymbed 17:ff9d1e86ad5f 1721 unsigned int);
sPymbed 17:ff9d1e86ad5f 1722
sPymbed 17:ff9d1e86ad5f 1723
sPymbed 17:ff9d1e86ad5f 1724 /* I/O Callback default errors */
sPymbed 17:ff9d1e86ad5f 1725 enum IOerrors {
sPymbed 17:ff9d1e86ad5f 1726 WOLFSSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */
sPymbed 17:ff9d1e86ad5f 1727 WOLFSSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */
sPymbed 17:ff9d1e86ad5f 1728 WOLFSSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */
sPymbed 17:ff9d1e86ad5f 1729 WOLFSSL_CBIO_ERR_CONN_RST = -3, /* connection reset */
sPymbed 17:ff9d1e86ad5f 1730 WOLFSSL_CBIO_ERR_ISR = -4, /* interrupt */
sPymbed 17:ff9d1e86ad5f 1731 WOLFSSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */
sPymbed 17:ff9d1e86ad5f 1732 WOLFSSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */
sPymbed 17:ff9d1e86ad5f 1733 };
sPymbed 17:ff9d1e86ad5f 1734
sPymbed 17:ff9d1e86ad5f 1735
sPymbed 17:ff9d1e86ad5f 1736 /* CA cache callbacks */
sPymbed 17:ff9d1e86ad5f 1737 enum {
sPymbed 17:ff9d1e86ad5f 1738 WOLFSSL_SSLV3 = 0,
sPymbed 17:ff9d1e86ad5f 1739 WOLFSSL_TLSV1 = 1,
sPymbed 17:ff9d1e86ad5f 1740 WOLFSSL_TLSV1_1 = 2,
sPymbed 17:ff9d1e86ad5f 1741 WOLFSSL_TLSV1_2 = 3,
sPymbed 17:ff9d1e86ad5f 1742 WOLFSSL_TLSV1_3 = 4,
sPymbed 17:ff9d1e86ad5f 1743 WOLFSSL_USER_CA = 1, /* user added as trusted */
sPymbed 17:ff9d1e86ad5f 1744 WOLFSSL_CHAIN_CA = 2 /* added to cache from trusted chain */
sPymbed 17:ff9d1e86ad5f 1745 };
sPymbed 17:ff9d1e86ad5f 1746
sPymbed 17:ff9d1e86ad5f 1747 WOLFSSL_API WC_RNG* wolfSSL_GetRNG(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1748
sPymbed 17:ff9d1e86ad5f 1749 WOLFSSL_API int wolfSSL_CTX_SetMinVersion(WOLFSSL_CTX* ctx, int version);
sPymbed 17:ff9d1e86ad5f 1750 WOLFSSL_API int wolfSSL_SetMinVersion(WOLFSSL* ssl, int version);
sPymbed 17:ff9d1e86ad5f 1751 WOLFSSL_API int wolfSSL_GetObjectSize(void); /* object size based on build */
sPymbed 17:ff9d1e86ad5f 1752 WOLFSSL_API int wolfSSL_CTX_GetObjectSize(void);
sPymbed 17:ff9d1e86ad5f 1753 WOLFSSL_API int wolfSSL_METHOD_GetObjectSize(void);
sPymbed 17:ff9d1e86ad5f 1754 WOLFSSL_API int wolfSSL_GetOutputSize(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 1755 WOLFSSL_API int wolfSSL_GetMaxOutputSize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1756 WOLFSSL_API int wolfSSL_GetVersion(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1757 WOLFSSL_API int wolfSSL_SetVersion(WOLFSSL* ssl, int version);
sPymbed 17:ff9d1e86ad5f 1758
sPymbed 17:ff9d1e86ad5f 1759 /* moved to asn.c, old names kept for backwards compatability */
sPymbed 17:ff9d1e86ad5f 1760 #define wolfSSL_KeyPemToDer wc_KeyPemToDer
sPymbed 17:ff9d1e86ad5f 1761 #define wolfSSL_CertPemToDer wc_CertPemToDer
sPymbed 17:ff9d1e86ad5f 1762 #define wolfSSL_PemPubKeyToDer wc_PemPubKeyToDer
sPymbed 17:ff9d1e86ad5f 1763 #define wolfSSL_PubKeyPemToDer wc_PubKeyPemToDer
sPymbed 17:ff9d1e86ad5f 1764 #define wolfSSL_PemCertToDer wc_PemCertToDer
sPymbed 17:ff9d1e86ad5f 1765
sPymbed 17:ff9d1e86ad5f 1766
sPymbed 17:ff9d1e86ad5f 1767 typedef void (*CallbackCACache)(unsigned char* der, int sz, int type);
sPymbed 17:ff9d1e86ad5f 1768 typedef void (*CbMissingCRL)(const char* url);
sPymbed 17:ff9d1e86ad5f 1769 typedef int (*CbOCSPIO)(void*, const char*, int,
sPymbed 17:ff9d1e86ad5f 1770 unsigned char*, int, unsigned char**);
sPymbed 17:ff9d1e86ad5f 1771 typedef void (*CbOCSPRespFree)(void*,unsigned char*);
sPymbed 17:ff9d1e86ad5f 1772
sPymbed 17:ff9d1e86ad5f 1773 #ifdef HAVE_CRL_IO
sPymbed 17:ff9d1e86ad5f 1774 typedef int (*CbCrlIO)(WOLFSSL_CRL* crl, const char* url, int urlSz);
sPymbed 17:ff9d1e86ad5f 1775 #endif
sPymbed 17:ff9d1e86ad5f 1776
sPymbed 17:ff9d1e86ad5f 1777 /* User Atomic Record Layer CallBacks */
sPymbed 17:ff9d1e86ad5f 1778 typedef int (*CallbackMacEncrypt)(WOLFSSL* ssl, unsigned char* macOut,
sPymbed 17:ff9d1e86ad5f 1779 const unsigned char* macIn, unsigned int macInSz, int macContent,
sPymbed 17:ff9d1e86ad5f 1780 int macVerify, unsigned char* encOut, const unsigned char* encIn,
sPymbed 17:ff9d1e86ad5f 1781 unsigned int encSz, void* ctx);
sPymbed 17:ff9d1e86ad5f 1782 WOLFSSL_API void wolfSSL_CTX_SetMacEncryptCb(WOLFSSL_CTX*, CallbackMacEncrypt);
sPymbed 17:ff9d1e86ad5f 1783 WOLFSSL_API void wolfSSL_SetMacEncryptCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1784 WOLFSSL_API void* wolfSSL_GetMacEncryptCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1785
sPymbed 17:ff9d1e86ad5f 1786 typedef int (*CallbackDecryptVerify)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1787 unsigned char* decOut, const unsigned char* decIn,
sPymbed 17:ff9d1e86ad5f 1788 unsigned int decSz, int content, int verify, unsigned int* padSz,
sPymbed 17:ff9d1e86ad5f 1789 void* ctx);
sPymbed 17:ff9d1e86ad5f 1790 WOLFSSL_API void wolfSSL_CTX_SetDecryptVerifyCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1791 CallbackDecryptVerify);
sPymbed 17:ff9d1e86ad5f 1792 WOLFSSL_API void wolfSSL_SetDecryptVerifyCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1793 WOLFSSL_API void* wolfSSL_GetDecryptVerifyCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1794
sPymbed 17:ff9d1e86ad5f 1795 WOLFSSL_API const unsigned char* wolfSSL_GetMacSecret(WOLFSSL*, int);
sPymbed 17:ff9d1e86ad5f 1796 WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteKey(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1797 WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteIV(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1798 WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteKey(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1799 WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteIV(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1800 WOLFSSL_API int wolfSSL_GetKeySize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1801 WOLFSSL_API int wolfSSL_GetIVSize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1802 WOLFSSL_API int wolfSSL_GetSide(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1803 WOLFSSL_API int wolfSSL_IsTLSv1_1(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1804 WOLFSSL_API int wolfSSL_GetBulkCipher(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1805 WOLFSSL_API int wolfSSL_GetCipherBlockSize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1806 WOLFSSL_API int wolfSSL_GetAeadMacSize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1807 WOLFSSL_API int wolfSSL_GetHmacSize(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1808 WOLFSSL_API int wolfSSL_GetHmacType(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1809 WOLFSSL_API int wolfSSL_GetCipherType(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 1810 WOLFSSL_API int wolfSSL_SetTlsHmacInner(WOLFSSL*, unsigned char*,
sPymbed 17:ff9d1e86ad5f 1811 unsigned int, int, int);
sPymbed 17:ff9d1e86ad5f 1812
sPymbed 17:ff9d1e86ad5f 1813 /* Atomic User Needs */
sPymbed 17:ff9d1e86ad5f 1814 enum {
sPymbed 17:ff9d1e86ad5f 1815 WOLFSSL_SERVER_END = 0,
sPymbed 17:ff9d1e86ad5f 1816 WOLFSSL_CLIENT_END = 1,
sPymbed 17:ff9d1e86ad5f 1817 WOLFSSL_NEITHER_END = 3,
sPymbed 17:ff9d1e86ad5f 1818 WOLFSSL_BLOCK_TYPE = 2,
sPymbed 17:ff9d1e86ad5f 1819 WOLFSSL_STREAM_TYPE = 3,
sPymbed 17:ff9d1e86ad5f 1820 WOLFSSL_AEAD_TYPE = 4,
sPymbed 17:ff9d1e86ad5f 1821 WOLFSSL_TLS_HMAC_INNER_SZ = 13 /* SEQ_SZ + ENUM + VERSION_SZ + LEN_SZ */
sPymbed 17:ff9d1e86ad5f 1822 };
sPymbed 17:ff9d1e86ad5f 1823
sPymbed 17:ff9d1e86ad5f 1824 /* for GetBulkCipher and internal use */
sPymbed 17:ff9d1e86ad5f 1825 enum BulkCipherAlgorithm {
sPymbed 17:ff9d1e86ad5f 1826 wolfssl_cipher_null,
sPymbed 17:ff9d1e86ad5f 1827 wolfssl_rc4,
sPymbed 17:ff9d1e86ad5f 1828 wolfssl_rc2,
sPymbed 17:ff9d1e86ad5f 1829 wolfssl_des,
sPymbed 17:ff9d1e86ad5f 1830 wolfssl_triple_des, /* leading 3 (3des) not valid identifier */
sPymbed 17:ff9d1e86ad5f 1831 wolfssl_des40,
sPymbed 17:ff9d1e86ad5f 1832 #ifdef HAVE_IDEA
sPymbed 17:ff9d1e86ad5f 1833 wolfssl_idea,
sPymbed 17:ff9d1e86ad5f 1834 #endif
sPymbed 17:ff9d1e86ad5f 1835 wolfssl_aes,
sPymbed 17:ff9d1e86ad5f 1836 wolfssl_aes_gcm,
sPymbed 17:ff9d1e86ad5f 1837 wolfssl_aes_ccm,
sPymbed 17:ff9d1e86ad5f 1838 wolfssl_chacha,
sPymbed 17:ff9d1e86ad5f 1839 wolfssl_camellia,
sPymbed 17:ff9d1e86ad5f 1840 wolfssl_hc128, /* wolfSSL extensions */
sPymbed 17:ff9d1e86ad5f 1841 wolfssl_rabbit
sPymbed 17:ff9d1e86ad5f 1842 };
sPymbed 17:ff9d1e86ad5f 1843
sPymbed 17:ff9d1e86ad5f 1844
sPymbed 17:ff9d1e86ad5f 1845 /* for KDF TLS 1.2 mac types */
sPymbed 17:ff9d1e86ad5f 1846 enum KDF_MacAlgorithm {
sPymbed 17:ff9d1e86ad5f 1847 wolfssl_sha256 = 4, /* needs to match internal MACAlgorithm */
sPymbed 17:ff9d1e86ad5f 1848 wolfssl_sha384,
sPymbed 17:ff9d1e86ad5f 1849 wolfssl_sha512
sPymbed 17:ff9d1e86ad5f 1850 };
sPymbed 17:ff9d1e86ad5f 1851
sPymbed 17:ff9d1e86ad5f 1852
sPymbed 17:ff9d1e86ad5f 1853 /* Public Key Callback support */
sPymbed 17:ff9d1e86ad5f 1854 #ifdef HAVE_PK_CALLBACKS
sPymbed 17:ff9d1e86ad5f 1855 #ifdef HAVE_ECC
sPymbed 17:ff9d1e86ad5f 1856
sPymbed 17:ff9d1e86ad5f 1857 struct ecc_key;
sPymbed 17:ff9d1e86ad5f 1858
sPymbed 17:ff9d1e86ad5f 1859 typedef int (*CallbackEccKeyGen)(WOLFSSL* ssl, struct ecc_key* key,
sPymbed 17:ff9d1e86ad5f 1860 unsigned int keySz, int ecc_curve, void* ctx);
sPymbed 17:ff9d1e86ad5f 1861 WOLFSSL_API void wolfSSL_CTX_SetEccKeyGenCb(WOLFSSL_CTX*, CallbackEccKeyGen);
sPymbed 17:ff9d1e86ad5f 1862 WOLFSSL_API void wolfSSL_SetEccKeyGenCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1863 WOLFSSL_API void* wolfSSL_GetEccKeyGenCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1864
sPymbed 17:ff9d1e86ad5f 1865 typedef int (*CallbackEccSign)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1866 const unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 1867 unsigned char* out, unsigned int* outSz,
sPymbed 17:ff9d1e86ad5f 1868 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1869 void* ctx);
sPymbed 17:ff9d1e86ad5f 1870 WOLFSSL_API void wolfSSL_CTX_SetEccSignCb(WOLFSSL_CTX*, CallbackEccSign);
sPymbed 17:ff9d1e86ad5f 1871 WOLFSSL_API void wolfSSL_SetEccSignCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1872 WOLFSSL_API void* wolfSSL_GetEccSignCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1873
sPymbed 17:ff9d1e86ad5f 1874 typedef int (*CallbackEccVerify)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1875 const unsigned char* sig, unsigned int sigSz,
sPymbed 17:ff9d1e86ad5f 1876 const unsigned char* hash, unsigned int hashSz,
sPymbed 17:ff9d1e86ad5f 1877 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1878 int* result, void* ctx);
sPymbed 17:ff9d1e86ad5f 1879 WOLFSSL_API void wolfSSL_CTX_SetEccVerifyCb(WOLFSSL_CTX*, CallbackEccVerify);
sPymbed 17:ff9d1e86ad5f 1880 WOLFSSL_API void wolfSSL_SetEccVerifyCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1881 WOLFSSL_API void* wolfSSL_GetEccVerifyCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1882
sPymbed 17:ff9d1e86ad5f 1883 typedef int (*CallbackEccSharedSecret)(WOLFSSL* ssl, struct ecc_key* otherKey,
sPymbed 17:ff9d1e86ad5f 1884 unsigned char* pubKeyDer, unsigned int* pubKeySz,
sPymbed 17:ff9d1e86ad5f 1885 unsigned char* out, unsigned int* outlen,
sPymbed 17:ff9d1e86ad5f 1886 int side, void* ctx); /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */
sPymbed 17:ff9d1e86ad5f 1887 WOLFSSL_API void wolfSSL_CTX_SetEccSharedSecretCb(WOLFSSL_CTX*, CallbackEccSharedSecret);
sPymbed 17:ff9d1e86ad5f 1888 WOLFSSL_API void wolfSSL_SetEccSharedSecretCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1889 WOLFSSL_API void* wolfSSL_GetEccSharedSecretCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1890 #endif
sPymbed 17:ff9d1e86ad5f 1891
sPymbed 17:ff9d1e86ad5f 1892 #ifndef NO_DH
sPymbed 17:ff9d1e86ad5f 1893 /* Public DH Key Callback support */
sPymbed 17:ff9d1e86ad5f 1894 struct DhKey;
sPymbed 17:ff9d1e86ad5f 1895 typedef int (*CallbackDhAgree)(WOLFSSL* ssl, struct DhKey* key,
sPymbed 17:ff9d1e86ad5f 1896 const unsigned char* priv, unsigned int privSz,
sPymbed 17:ff9d1e86ad5f 1897 const unsigned char* otherPubKeyDer, unsigned int otherPubKeySz,
sPymbed 17:ff9d1e86ad5f 1898 unsigned char* out, unsigned int* outlen,
sPymbed 17:ff9d1e86ad5f 1899 void* ctx);
sPymbed 17:ff9d1e86ad5f 1900 WOLFSSL_API void wolfSSL_CTX_SetDhAgreeCb(WOLFSSL_CTX*, CallbackDhAgree);
sPymbed 17:ff9d1e86ad5f 1901 WOLFSSL_API void wolfSSL_SetDhAgreeCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1902 WOLFSSL_API void* wolfSSL_GetDhAgreeCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1903 #endif /* !NO_DH */
sPymbed 17:ff9d1e86ad5f 1904
sPymbed 17:ff9d1e86ad5f 1905 #ifdef HAVE_ED25519
sPymbed 17:ff9d1e86ad5f 1906 struct ed25519_key;
sPymbed 17:ff9d1e86ad5f 1907 typedef int (*CallbackEd25519Sign)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1908 const unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 1909 unsigned char* out, unsigned int* outSz,
sPymbed 17:ff9d1e86ad5f 1910 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1911 void* ctx);
sPymbed 17:ff9d1e86ad5f 1912 WOLFSSL_API void wolfSSL_CTX_SetEd25519SignCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1913 CallbackEd25519Sign);
sPymbed 17:ff9d1e86ad5f 1914 WOLFSSL_API void wolfSSL_SetEd25519SignCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1915 WOLFSSL_API void* wolfSSL_GetEd25519SignCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1916
sPymbed 17:ff9d1e86ad5f 1917 typedef int (*CallbackEd25519Verify)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1918 const unsigned char* sig, unsigned int sigSz,
sPymbed 17:ff9d1e86ad5f 1919 const unsigned char* msg, unsigned int msgSz,
sPymbed 17:ff9d1e86ad5f 1920 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1921 int* result, void* ctx);
sPymbed 17:ff9d1e86ad5f 1922 WOLFSSL_API void wolfSSL_CTX_SetEd25519VerifyCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1923 CallbackEd25519Verify);
sPymbed 17:ff9d1e86ad5f 1924 WOLFSSL_API void wolfSSL_SetEd25519VerifyCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1925 WOLFSSL_API void* wolfSSL_GetEd25519VerifyCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1926 #endif
sPymbed 17:ff9d1e86ad5f 1927
sPymbed 17:ff9d1e86ad5f 1928 #ifdef HAVE_CURVE25519
sPymbed 17:ff9d1e86ad5f 1929 struct curve25519_key;
sPymbed 17:ff9d1e86ad5f 1930
sPymbed 17:ff9d1e86ad5f 1931 typedef int (*CallbackX25519KeyGen)(WOLFSSL* ssl, struct curve25519_key* key,
sPymbed 17:ff9d1e86ad5f 1932 unsigned int keySz, void* ctx);
sPymbed 17:ff9d1e86ad5f 1933 WOLFSSL_API void wolfSSL_CTX_SetX25519KeyGenCb(WOLFSSL_CTX*, CallbackX25519KeyGen);
sPymbed 17:ff9d1e86ad5f 1934 WOLFSSL_API void wolfSSL_SetX25519KeyGenCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1935 WOLFSSL_API void* wolfSSL_GetX25519KeyGenCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1936
sPymbed 17:ff9d1e86ad5f 1937 typedef int (*CallbackX25519SharedSecret)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1938 struct curve25519_key* otherKey,
sPymbed 17:ff9d1e86ad5f 1939 unsigned char* pubKeyDer, unsigned int* pubKeySz,
sPymbed 17:ff9d1e86ad5f 1940 unsigned char* out, unsigned int* outlen,
sPymbed 17:ff9d1e86ad5f 1941 int side, void* ctx);
sPymbed 17:ff9d1e86ad5f 1942 /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */
sPymbed 17:ff9d1e86ad5f 1943 WOLFSSL_API void wolfSSL_CTX_SetX25519SharedSecretCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1944 CallbackX25519SharedSecret);
sPymbed 17:ff9d1e86ad5f 1945 WOLFSSL_API void wolfSSL_SetX25519SharedSecretCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1946 WOLFSSL_API void* wolfSSL_GetX25519SharedSecretCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1947 #endif
sPymbed 17:ff9d1e86ad5f 1948
sPymbed 17:ff9d1e86ad5f 1949 #ifndef NO_RSA
sPymbed 17:ff9d1e86ad5f 1950 typedef int (*CallbackRsaSign)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1951 const unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 1952 unsigned char* out, unsigned int* outSz,
sPymbed 17:ff9d1e86ad5f 1953 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1954 void* ctx);
sPymbed 17:ff9d1e86ad5f 1955 WOLFSSL_API void wolfSSL_CTX_SetRsaSignCb(WOLFSSL_CTX*, CallbackRsaSign);
sPymbed 17:ff9d1e86ad5f 1956 WOLFSSL_API void wolfSSL_SetRsaSignCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1957 WOLFSSL_API void* wolfSSL_GetRsaSignCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1958
sPymbed 17:ff9d1e86ad5f 1959 typedef int (*CallbackRsaVerify)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1960 unsigned char* sig, unsigned int sigSz,
sPymbed 17:ff9d1e86ad5f 1961 unsigned char** out,
sPymbed 17:ff9d1e86ad5f 1962 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1963 void* ctx);
sPymbed 17:ff9d1e86ad5f 1964 WOLFSSL_API void wolfSSL_CTX_SetRsaVerifyCb(WOLFSSL_CTX*, CallbackRsaVerify);
sPymbed 17:ff9d1e86ad5f 1965 WOLFSSL_API void wolfSSL_CTX_SetRsaSignCheckCb(WOLFSSL_CTX*, CallbackRsaVerify);
sPymbed 17:ff9d1e86ad5f 1966 WOLFSSL_API void wolfSSL_SetRsaVerifyCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1967 WOLFSSL_API void* wolfSSL_GetRsaVerifyCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1968
sPymbed 17:ff9d1e86ad5f 1969 #ifdef WC_RSA_PSS
sPymbed 17:ff9d1e86ad5f 1970 typedef int (*CallbackRsaPssSign)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1971 const unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 1972 unsigned char* out, unsigned int* outSz,
sPymbed 17:ff9d1e86ad5f 1973 int hash, int mgf,
sPymbed 17:ff9d1e86ad5f 1974 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1975 void* ctx);
sPymbed 17:ff9d1e86ad5f 1976 WOLFSSL_API void wolfSSL_CTX_SetRsaPssSignCb(WOLFSSL_CTX*, CallbackRsaPssSign);
sPymbed 17:ff9d1e86ad5f 1977 WOLFSSL_API void wolfSSL_SetRsaPssSignCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1978 WOLFSSL_API void* wolfSSL_GetRsaPssSignCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1979
sPymbed 17:ff9d1e86ad5f 1980 typedef int (*CallbackRsaPssVerify)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1981 unsigned char* sig, unsigned int sigSz,
sPymbed 17:ff9d1e86ad5f 1982 unsigned char** out,
sPymbed 17:ff9d1e86ad5f 1983 int hash, int mgf,
sPymbed 17:ff9d1e86ad5f 1984 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1985 void* ctx);
sPymbed 17:ff9d1e86ad5f 1986 WOLFSSL_API void wolfSSL_CTX_SetRsaPssVerifyCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1987 CallbackRsaPssVerify);
sPymbed 17:ff9d1e86ad5f 1988 WOLFSSL_API void wolfSSL_CTX_SetRsaPssSignCheckCb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 1989 CallbackRsaPssVerify);
sPymbed 17:ff9d1e86ad5f 1990 WOLFSSL_API void wolfSSL_SetRsaPssVerifyCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 1991 WOLFSSL_API void* wolfSSL_GetRsaPssVerifyCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 1992 #endif
sPymbed 17:ff9d1e86ad5f 1993
sPymbed 17:ff9d1e86ad5f 1994 /* RSA Public Encrypt cb */
sPymbed 17:ff9d1e86ad5f 1995 typedef int (*CallbackRsaEnc)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 1996 const unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 1997 unsigned char* out, unsigned int* outSz,
sPymbed 17:ff9d1e86ad5f 1998 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 1999 void* ctx);
sPymbed 17:ff9d1e86ad5f 2000 WOLFSSL_API void wolfSSL_CTX_SetRsaEncCb(WOLFSSL_CTX*, CallbackRsaEnc);
sPymbed 17:ff9d1e86ad5f 2001 WOLFSSL_API void wolfSSL_SetRsaEncCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 2002 WOLFSSL_API void* wolfSSL_GetRsaEncCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2003
sPymbed 17:ff9d1e86ad5f 2004 /* RSA Private Decrypt cb */
sPymbed 17:ff9d1e86ad5f 2005 typedef int (*CallbackRsaDec)(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 2006 unsigned char* in, unsigned int inSz,
sPymbed 17:ff9d1e86ad5f 2007 unsigned char** out,
sPymbed 17:ff9d1e86ad5f 2008 const unsigned char* keyDer, unsigned int keySz,
sPymbed 17:ff9d1e86ad5f 2009 void* ctx);
sPymbed 17:ff9d1e86ad5f 2010 WOLFSSL_API void wolfSSL_CTX_SetRsaDecCb(WOLFSSL_CTX*, CallbackRsaDec);
sPymbed 17:ff9d1e86ad5f 2011 WOLFSSL_API void wolfSSL_SetRsaDecCtx(WOLFSSL* ssl, void *ctx);
sPymbed 17:ff9d1e86ad5f 2012 WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2013 #endif
sPymbed 17:ff9d1e86ad5f 2014 #endif /* HAVE_PK_CALLBACKS */
sPymbed 17:ff9d1e86ad5f 2015
sPymbed 17:ff9d1e86ad5f 2016 #ifndef NO_CERTS
sPymbed 17:ff9d1e86ad5f 2017 WOLFSSL_API void wolfSSL_CTX_SetCACb(WOLFSSL_CTX*, CallbackCACache);
sPymbed 17:ff9d1e86ad5f 2018
sPymbed 17:ff9d1e86ad5f 2019 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CTX_GetCertManager(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2020
sPymbed 17:ff9d1e86ad5f 2021 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew_ex(void* heap);
sPymbed 17:ff9d1e86ad5f 2022 WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void);
sPymbed 17:ff9d1e86ad5f 2023 WOLFSSL_API void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER*);
sPymbed 17:ff9d1e86ad5f 2024
sPymbed 17:ff9d1e86ad5f 2025 WOLFSSL_API int wolfSSL_CertManagerLoadCA(WOLFSSL_CERT_MANAGER*, const char* f,
sPymbed 17:ff9d1e86ad5f 2026 const char* d);
sPymbed 17:ff9d1e86ad5f 2027 WOLFSSL_API int wolfSSL_CertManagerLoadCABuffer(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2028 const unsigned char* in, long sz, int format);
sPymbed 17:ff9d1e86ad5f 2029 WOLFSSL_API int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm);
sPymbed 17:ff9d1e86ad5f 2030 #ifdef WOLFSSL_TRUST_PEER_CERT
sPymbed 17:ff9d1e86ad5f 2031 WOLFSSL_API int wolfSSL_CertManagerUnload_trust_peers(WOLFSSL_CERT_MANAGER* cm);
sPymbed 17:ff9d1e86ad5f 2032 #endif
sPymbed 17:ff9d1e86ad5f 2033 WOLFSSL_API int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER*, const char* f,
sPymbed 17:ff9d1e86ad5f 2034 int format);
sPymbed 17:ff9d1e86ad5f 2035 WOLFSSL_API int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm,
sPymbed 17:ff9d1e86ad5f 2036 const unsigned char* buff, long sz, int format);
sPymbed 17:ff9d1e86ad5f 2037 WOLFSSL_API int wolfSSL_CertManagerCheckCRL(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2038 unsigned char*, int sz);
sPymbed 17:ff9d1e86ad5f 2039 WOLFSSL_API int wolfSSL_CertManagerEnableCRL(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2040 int options);
sPymbed 17:ff9d1e86ad5f 2041 WOLFSSL_API int wolfSSL_CertManagerDisableCRL(WOLFSSL_CERT_MANAGER*);
sPymbed 17:ff9d1e86ad5f 2042 WOLFSSL_API int wolfSSL_CertManagerLoadCRL(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2043 const char*, int, int);
sPymbed 17:ff9d1e86ad5f 2044 WOLFSSL_API int wolfSSL_CertManagerLoadCRLBuffer(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2045 const unsigned char*, long sz, int);
sPymbed 17:ff9d1e86ad5f 2046 WOLFSSL_API int wolfSSL_CertManagerSetCRL_Cb(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2047 CbMissingCRL);
sPymbed 17:ff9d1e86ad5f 2048 #ifdef HAVE_CRL_IO
sPymbed 17:ff9d1e86ad5f 2049 WOLFSSL_API int wolfSSL_CertManagerSetCRL_IOCb(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2050 CbCrlIO);
sPymbed 17:ff9d1e86ad5f 2051 #endif
sPymbed 17:ff9d1e86ad5f 2052 WOLFSSL_API int wolfSSL_CertManagerCheckOCSP(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2053 unsigned char*, int sz);
sPymbed 17:ff9d1e86ad5f 2054 WOLFSSL_API int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2055 int options);
sPymbed 17:ff9d1e86ad5f 2056 WOLFSSL_API int wolfSSL_CertManagerDisableOCSP(WOLFSSL_CERT_MANAGER*);
sPymbed 17:ff9d1e86ad5f 2057 WOLFSSL_API int wolfSSL_CertManagerSetOCSPOverrideURL(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2058 const char*);
sPymbed 17:ff9d1e86ad5f 2059 WOLFSSL_API int wolfSSL_CertManagerSetOCSP_Cb(WOLFSSL_CERT_MANAGER*,
sPymbed 17:ff9d1e86ad5f 2060 CbOCSPIO, CbOCSPRespFree, void*);
sPymbed 17:ff9d1e86ad5f 2061
sPymbed 17:ff9d1e86ad5f 2062 WOLFSSL_API int wolfSSL_CertManagerEnableOCSPStapling(
sPymbed 17:ff9d1e86ad5f 2063 WOLFSSL_CERT_MANAGER* cm);
sPymbed 17:ff9d1e86ad5f 2064 WOLFSSL_API int wolfSSL_CertManagerDisableOCSPStapling(
sPymbed 17:ff9d1e86ad5f 2065 WOLFSSL_CERT_MANAGER* cm);
sPymbed 17:ff9d1e86ad5f 2066
sPymbed 17:ff9d1e86ad5f 2067 WOLFSSL_API int wolfSSL_EnableCRL(WOLFSSL* ssl, int options);
sPymbed 17:ff9d1e86ad5f 2068 WOLFSSL_API int wolfSSL_DisableCRL(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2069 WOLFSSL_API int wolfSSL_LoadCRL(WOLFSSL*, const char*, int, int);
sPymbed 17:ff9d1e86ad5f 2070 WOLFSSL_API int wolfSSL_LoadCRLBuffer(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 2071 const unsigned char*, long sz, int);
sPymbed 17:ff9d1e86ad5f 2072 WOLFSSL_API int wolfSSL_SetCRL_Cb(WOLFSSL*, CbMissingCRL);
sPymbed 17:ff9d1e86ad5f 2073 #ifdef HAVE_CRL_IO
sPymbed 17:ff9d1e86ad5f 2074 WOLFSSL_API int wolfSSL_SetCRL_IOCb(WOLFSSL* ssl, CbCrlIO cb);
sPymbed 17:ff9d1e86ad5f 2075 #endif
sPymbed 17:ff9d1e86ad5f 2076 WOLFSSL_API int wolfSSL_EnableOCSP(WOLFSSL*, int options);
sPymbed 17:ff9d1e86ad5f 2077 WOLFSSL_API int wolfSSL_DisableOCSP(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2078 WOLFSSL_API int wolfSSL_SetOCSP_OverrideURL(WOLFSSL*, const char*);
sPymbed 17:ff9d1e86ad5f 2079 WOLFSSL_API int wolfSSL_SetOCSP_Cb(WOLFSSL*, CbOCSPIO, CbOCSPRespFree, void*);
sPymbed 17:ff9d1e86ad5f 2080 WOLFSSL_API int wolfSSL_EnableOCSPStapling(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2081 WOLFSSL_API int wolfSSL_DisableOCSPStapling(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2082
sPymbed 17:ff9d1e86ad5f 2083 WOLFSSL_API int wolfSSL_CTX_EnableCRL(WOLFSSL_CTX* ctx, int options);
sPymbed 17:ff9d1e86ad5f 2084 WOLFSSL_API int wolfSSL_CTX_DisableCRL(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2085 WOLFSSL_API int wolfSSL_CTX_LoadCRL(WOLFSSL_CTX*, const char*, int, int);
sPymbed 17:ff9d1e86ad5f 2086 WOLFSSL_API int wolfSSL_CTX_LoadCRLBuffer(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 2087 const unsigned char*, long sz, int);
sPymbed 17:ff9d1e86ad5f 2088 WOLFSSL_API int wolfSSL_CTX_SetCRL_Cb(WOLFSSL_CTX*, CbMissingCRL);
sPymbed 17:ff9d1e86ad5f 2089 #ifdef HAVE_CRL_IO
sPymbed 17:ff9d1e86ad5f 2090 WOLFSSL_API int wolfSSL_CTX_SetCRL_IOCb(WOLFSSL_CTX*, CbCrlIO);
sPymbed 17:ff9d1e86ad5f 2091 #endif
sPymbed 17:ff9d1e86ad5f 2092
sPymbed 17:ff9d1e86ad5f 2093 WOLFSSL_API int wolfSSL_CTX_EnableOCSP(WOLFSSL_CTX*, int options);
sPymbed 17:ff9d1e86ad5f 2094 WOLFSSL_API int wolfSSL_CTX_DisableOCSP(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2095 WOLFSSL_API int wolfSSL_CTX_SetOCSP_OverrideURL(WOLFSSL_CTX*, const char*);
sPymbed 17:ff9d1e86ad5f 2096 WOLFSSL_API int wolfSSL_CTX_SetOCSP_Cb(WOLFSSL_CTX*,
sPymbed 17:ff9d1e86ad5f 2097 CbOCSPIO, CbOCSPRespFree, void*);
sPymbed 17:ff9d1e86ad5f 2098 WOLFSSL_API int wolfSSL_CTX_EnableOCSPStapling(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2099 WOLFSSL_API int wolfSSL_CTX_DisableOCSPStapling(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2100 #endif /* !NO_CERTS */
sPymbed 17:ff9d1e86ad5f 2101
sPymbed 17:ff9d1e86ad5f 2102
sPymbed 17:ff9d1e86ad5f 2103 #ifdef SINGLE_THREADED
sPymbed 17:ff9d1e86ad5f 2104 WOLFSSL_API int wolfSSL_CTX_new_rng(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2105 #endif
sPymbed 17:ff9d1e86ad5f 2106
sPymbed 17:ff9d1e86ad5f 2107 /* end of handshake frees temporary arrays, if user needs for get_keys or
sPymbed 17:ff9d1e86ad5f 2108 psk hints, call KeepArrays before handshake and then FreeArrays when done
sPymbed 17:ff9d1e86ad5f 2109 if don't want to wait for object free */
sPymbed 17:ff9d1e86ad5f 2110 WOLFSSL_API void wolfSSL_KeepArrays(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2111 WOLFSSL_API void wolfSSL_FreeArrays(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2112
sPymbed 17:ff9d1e86ad5f 2113 WOLFSSL_API int wolfSSL_KeepHandshakeResources(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2114 WOLFSSL_API int wolfSSL_FreeHandshakeResources(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2115
sPymbed 17:ff9d1e86ad5f 2116 WOLFSSL_API int wolfSSL_CTX_UseClientSuites(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2117 WOLFSSL_API int wolfSSL_UseClientSuites(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2118
sPymbed 17:ff9d1e86ad5f 2119 /* async additions */
sPymbed 17:ff9d1e86ad5f 2120 #define wolfSSL_UseAsync wolfSSL_SetDevId
sPymbed 17:ff9d1e86ad5f 2121 #define wolfSSL_CTX_UseAsync wolfSSL_CTX_SetDevId
sPymbed 17:ff9d1e86ad5f 2122 WOLFSSL_API int wolfSSL_SetDevId(WOLFSSL*, int devId);
sPymbed 17:ff9d1e86ad5f 2123 WOLFSSL_API int wolfSSL_CTX_SetDevId(WOLFSSL_CTX*, int devId);
sPymbed 17:ff9d1e86ad5f 2124
sPymbed 17:ff9d1e86ad5f 2125 /* helpers to get device id and heap */
sPymbed 17:ff9d1e86ad5f 2126 WOLFSSL_API int wolfSSL_CTX_GetDevId(WOLFSSL_CTX* ctx, WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2127 WOLFSSL_API void* wolfSSL_CTX_GetHeap(WOLFSSL_CTX* ctx, WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2128
sPymbed 17:ff9d1e86ad5f 2129 /* TLS Extensions */
sPymbed 17:ff9d1e86ad5f 2130
sPymbed 17:ff9d1e86ad5f 2131 /* Server Name Indication */
sPymbed 17:ff9d1e86ad5f 2132 #ifdef HAVE_SNI
sPymbed 17:ff9d1e86ad5f 2133
sPymbed 17:ff9d1e86ad5f 2134 /* SNI types */
sPymbed 17:ff9d1e86ad5f 2135 enum {
sPymbed 17:ff9d1e86ad5f 2136 WOLFSSL_SNI_HOST_NAME = 0
sPymbed 17:ff9d1e86ad5f 2137 };
sPymbed 17:ff9d1e86ad5f 2138
sPymbed 17:ff9d1e86ad5f 2139 WOLFSSL_API int wolfSSL_UseSNI(WOLFSSL* ssl, unsigned char type,
sPymbed 17:ff9d1e86ad5f 2140 const void* data, unsigned short size);
sPymbed 17:ff9d1e86ad5f 2141 WOLFSSL_API int wolfSSL_CTX_UseSNI(WOLFSSL_CTX* ctx, unsigned char type,
sPymbed 17:ff9d1e86ad5f 2142 const void* data, unsigned short size);
sPymbed 17:ff9d1e86ad5f 2143
sPymbed 17:ff9d1e86ad5f 2144 #ifndef NO_WOLFSSL_SERVER
sPymbed 17:ff9d1e86ad5f 2145
sPymbed 17:ff9d1e86ad5f 2146 /* SNI options */
sPymbed 17:ff9d1e86ad5f 2147 enum {
sPymbed 17:ff9d1e86ad5f 2148 /* Do not abort the handshake if the requested SNI didn't match. */
sPymbed 17:ff9d1e86ad5f 2149 WOLFSSL_SNI_CONTINUE_ON_MISMATCH = 0x01,
sPymbed 17:ff9d1e86ad5f 2150
sPymbed 17:ff9d1e86ad5f 2151 /* Behave as if the requested SNI matched in a case of mismatch. */
sPymbed 17:ff9d1e86ad5f 2152 /* In this case, the status will be set to WOLFSSL_SNI_FAKE_MATCH. */
sPymbed 17:ff9d1e86ad5f 2153 WOLFSSL_SNI_ANSWER_ON_MISMATCH = 0x02,
sPymbed 17:ff9d1e86ad5f 2154
sPymbed 17:ff9d1e86ad5f 2155 /* Abort the handshake if the client didn't send a SNI request. */
sPymbed 17:ff9d1e86ad5f 2156 WOLFSSL_SNI_ABORT_ON_ABSENCE = 0x04,
sPymbed 17:ff9d1e86ad5f 2157 };
sPymbed 17:ff9d1e86ad5f 2158
sPymbed 17:ff9d1e86ad5f 2159 WOLFSSL_API void wolfSSL_SNI_SetOptions(WOLFSSL* ssl, unsigned char type,
sPymbed 17:ff9d1e86ad5f 2160 unsigned char options);
sPymbed 17:ff9d1e86ad5f 2161 WOLFSSL_API void wolfSSL_CTX_SNI_SetOptions(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2162 unsigned char type, unsigned char options);
sPymbed 17:ff9d1e86ad5f 2163 WOLFSSL_API int wolfSSL_SNI_GetFromBuffer(
sPymbed 17:ff9d1e86ad5f 2164 const unsigned char* clientHello, unsigned int helloSz,
sPymbed 17:ff9d1e86ad5f 2165 unsigned char type, unsigned char* sni, unsigned int* inOutSz);
sPymbed 17:ff9d1e86ad5f 2166
sPymbed 17:ff9d1e86ad5f 2167 #endif /* NO_WOLFSSL_SERVER */
sPymbed 17:ff9d1e86ad5f 2168
sPymbed 17:ff9d1e86ad5f 2169 /* SNI status */
sPymbed 17:ff9d1e86ad5f 2170 enum {
sPymbed 17:ff9d1e86ad5f 2171 WOLFSSL_SNI_NO_MATCH = 0,
sPymbed 17:ff9d1e86ad5f 2172 WOLFSSL_SNI_FAKE_MATCH = 1, /**< @see WOLFSSL_SNI_ANSWER_ON_MISMATCH */
sPymbed 17:ff9d1e86ad5f 2173 WOLFSSL_SNI_REAL_MATCH = 2,
sPymbed 17:ff9d1e86ad5f 2174 WOLFSSL_SNI_FORCE_KEEP = 3 /** Used with -DWOLFSSL_ALWAYS_KEEP_SNI */
sPymbed 17:ff9d1e86ad5f 2175 };
sPymbed 17:ff9d1e86ad5f 2176
sPymbed 17:ff9d1e86ad5f 2177 WOLFSSL_API unsigned char wolfSSL_SNI_Status(WOLFSSL* ssl, unsigned char type);
sPymbed 17:ff9d1e86ad5f 2178
sPymbed 17:ff9d1e86ad5f 2179 WOLFSSL_API unsigned short wolfSSL_SNI_GetRequest(WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2180 unsigned char type, void** data);
sPymbed 17:ff9d1e86ad5f 2181
sPymbed 17:ff9d1e86ad5f 2182 #endif /* HAVE_SNI */
sPymbed 17:ff9d1e86ad5f 2183
sPymbed 17:ff9d1e86ad5f 2184 /* Application-Layer Protocol Negotiation */
sPymbed 17:ff9d1e86ad5f 2185 #ifdef HAVE_ALPN
sPymbed 17:ff9d1e86ad5f 2186
sPymbed 17:ff9d1e86ad5f 2187 /* ALPN status code */
sPymbed 17:ff9d1e86ad5f 2188 enum {
sPymbed 17:ff9d1e86ad5f 2189 WOLFSSL_ALPN_NO_MATCH = 0,
sPymbed 17:ff9d1e86ad5f 2190 WOLFSSL_ALPN_MATCH = 1,
sPymbed 17:ff9d1e86ad5f 2191 WOLFSSL_ALPN_CONTINUE_ON_MISMATCH = 2,
sPymbed 17:ff9d1e86ad5f 2192 WOLFSSL_ALPN_FAILED_ON_MISMATCH = 4,
sPymbed 17:ff9d1e86ad5f 2193 };
sPymbed 17:ff9d1e86ad5f 2194
sPymbed 17:ff9d1e86ad5f 2195 enum {
sPymbed 17:ff9d1e86ad5f 2196 WOLFSSL_MAX_ALPN_PROTO_NAME_LEN = 255,
sPymbed 17:ff9d1e86ad5f 2197 WOLFSSL_MAX_ALPN_NUMBER = 257
sPymbed 17:ff9d1e86ad5f 2198 };
sPymbed 17:ff9d1e86ad5f 2199
sPymbed 17:ff9d1e86ad5f 2200 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2201 typedef int (*CallbackALPNSelect)(WOLFSSL* ssl, const unsigned char** out,
sPymbed 17:ff9d1e86ad5f 2202 unsigned char* outLen, const unsigned char* in, unsigned int inLen,
sPymbed 17:ff9d1e86ad5f 2203 void *arg);
sPymbed 17:ff9d1e86ad5f 2204 #endif
sPymbed 17:ff9d1e86ad5f 2205
sPymbed 17:ff9d1e86ad5f 2206 WOLFSSL_API int wolfSSL_UseALPN(WOLFSSL* ssl, char *protocol_name_list,
sPymbed 17:ff9d1e86ad5f 2207 unsigned int protocol_name_listSz,
sPymbed 17:ff9d1e86ad5f 2208 unsigned char options);
sPymbed 17:ff9d1e86ad5f 2209
sPymbed 17:ff9d1e86ad5f 2210 WOLFSSL_API int wolfSSL_ALPN_GetProtocol(WOLFSSL* ssl, char **protocol_name,
sPymbed 17:ff9d1e86ad5f 2211 unsigned short *size);
sPymbed 17:ff9d1e86ad5f 2212
sPymbed 17:ff9d1e86ad5f 2213 WOLFSSL_API int wolfSSL_ALPN_GetPeerProtocol(WOLFSSL* ssl, char **list,
sPymbed 17:ff9d1e86ad5f 2214 unsigned short *listSz);
sPymbed 17:ff9d1e86ad5f 2215 WOLFSSL_API int wolfSSL_ALPN_FreePeerProtocol(WOLFSSL* ssl, char **list);
sPymbed 17:ff9d1e86ad5f 2216 #endif /* HAVE_ALPN */
sPymbed 17:ff9d1e86ad5f 2217
sPymbed 17:ff9d1e86ad5f 2218 /* Maximum Fragment Length */
sPymbed 17:ff9d1e86ad5f 2219 #ifdef HAVE_MAX_FRAGMENT
sPymbed 17:ff9d1e86ad5f 2220
sPymbed 17:ff9d1e86ad5f 2221 /* Fragment lengths */
sPymbed 17:ff9d1e86ad5f 2222 enum {
sPymbed 17:ff9d1e86ad5f 2223 WOLFSSL_MFL_2_9 = 1, /* 512 bytes */
sPymbed 17:ff9d1e86ad5f 2224 WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */
sPymbed 17:ff9d1e86ad5f 2225 WOLFSSL_MFL_2_11 = 3, /* 2048 bytes */
sPymbed 17:ff9d1e86ad5f 2226 WOLFSSL_MFL_2_12 = 4, /* 4096 bytes */
sPymbed 17:ff9d1e86ad5f 2227 WOLFSSL_MFL_2_13 = 5 /* 8192 bytes *//* wolfSSL ONLY!!! */
sPymbed 17:ff9d1e86ad5f 2228 };
sPymbed 17:ff9d1e86ad5f 2229
sPymbed 17:ff9d1e86ad5f 2230 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2231
sPymbed 17:ff9d1e86ad5f 2232 WOLFSSL_API int wolfSSL_UseMaxFragment(WOLFSSL* ssl, unsigned char mfl);
sPymbed 17:ff9d1e86ad5f 2233 WOLFSSL_API int wolfSSL_CTX_UseMaxFragment(WOLFSSL_CTX* ctx, unsigned char mfl);
sPymbed 17:ff9d1e86ad5f 2234
sPymbed 17:ff9d1e86ad5f 2235 #endif
sPymbed 17:ff9d1e86ad5f 2236 #endif
sPymbed 17:ff9d1e86ad5f 2237
sPymbed 17:ff9d1e86ad5f 2238 /* Truncated HMAC */
sPymbed 17:ff9d1e86ad5f 2239 #ifdef HAVE_TRUNCATED_HMAC
sPymbed 17:ff9d1e86ad5f 2240 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2241
sPymbed 17:ff9d1e86ad5f 2242 WOLFSSL_API int wolfSSL_UseTruncatedHMAC(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2243 WOLFSSL_API int wolfSSL_CTX_UseTruncatedHMAC(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2244
sPymbed 17:ff9d1e86ad5f 2245 #endif
sPymbed 17:ff9d1e86ad5f 2246 #endif
sPymbed 17:ff9d1e86ad5f 2247
sPymbed 17:ff9d1e86ad5f 2248 /* Certificate Status Request */
sPymbed 17:ff9d1e86ad5f 2249 /* Certificate Status Type */
sPymbed 17:ff9d1e86ad5f 2250 enum {
sPymbed 17:ff9d1e86ad5f 2251 WOLFSSL_CSR_OCSP = 1
sPymbed 17:ff9d1e86ad5f 2252 };
sPymbed 17:ff9d1e86ad5f 2253
sPymbed 17:ff9d1e86ad5f 2254 /* Certificate Status Options (flags) */
sPymbed 17:ff9d1e86ad5f 2255 enum {
sPymbed 17:ff9d1e86ad5f 2256 WOLFSSL_CSR_OCSP_USE_NONCE = 0x01
sPymbed 17:ff9d1e86ad5f 2257 };
sPymbed 17:ff9d1e86ad5f 2258
sPymbed 17:ff9d1e86ad5f 2259 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST
sPymbed 17:ff9d1e86ad5f 2260 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2261
sPymbed 17:ff9d1e86ad5f 2262 WOLFSSL_API int wolfSSL_UseOCSPStapling(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 2263 unsigned char status_type, unsigned char options);
sPymbed 17:ff9d1e86ad5f 2264
sPymbed 17:ff9d1e86ad5f 2265 WOLFSSL_API int wolfSSL_CTX_UseOCSPStapling(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2266 unsigned char status_type, unsigned char options);
sPymbed 17:ff9d1e86ad5f 2267
sPymbed 17:ff9d1e86ad5f 2268 #endif
sPymbed 17:ff9d1e86ad5f 2269 #endif
sPymbed 17:ff9d1e86ad5f 2270
sPymbed 17:ff9d1e86ad5f 2271 /* Certificate Status Request v2 */
sPymbed 17:ff9d1e86ad5f 2272 /* Certificate Status Type */
sPymbed 17:ff9d1e86ad5f 2273 enum {
sPymbed 17:ff9d1e86ad5f 2274 WOLFSSL_CSR2_OCSP = 1,
sPymbed 17:ff9d1e86ad5f 2275 WOLFSSL_CSR2_OCSP_MULTI = 2
sPymbed 17:ff9d1e86ad5f 2276 };
sPymbed 17:ff9d1e86ad5f 2277
sPymbed 17:ff9d1e86ad5f 2278 /* Certificate Status v2 Options (flags) */
sPymbed 17:ff9d1e86ad5f 2279 enum {
sPymbed 17:ff9d1e86ad5f 2280 WOLFSSL_CSR2_OCSP_USE_NONCE = 0x01
sPymbed 17:ff9d1e86ad5f 2281 };
sPymbed 17:ff9d1e86ad5f 2282
sPymbed 17:ff9d1e86ad5f 2283 #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2
sPymbed 17:ff9d1e86ad5f 2284 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2285
sPymbed 17:ff9d1e86ad5f 2286 WOLFSSL_API int wolfSSL_UseOCSPStaplingV2(WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 2287 unsigned char status_type, unsigned char options);
sPymbed 17:ff9d1e86ad5f 2288
sPymbed 17:ff9d1e86ad5f 2289 WOLFSSL_API int wolfSSL_CTX_UseOCSPStaplingV2(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2290 unsigned char status_type, unsigned char options);
sPymbed 17:ff9d1e86ad5f 2291
sPymbed 17:ff9d1e86ad5f 2292 #endif
sPymbed 17:ff9d1e86ad5f 2293 #endif
sPymbed 17:ff9d1e86ad5f 2294
sPymbed 17:ff9d1e86ad5f 2295 /* Named Groups */
sPymbed 17:ff9d1e86ad5f 2296 enum {
sPymbed 17:ff9d1e86ad5f 2297 #if 0 /* Not Supported */
sPymbed 17:ff9d1e86ad5f 2298 WOLFSSL_ECC_SECT163K1 = 1,
sPymbed 17:ff9d1e86ad5f 2299 WOLFSSL_ECC_SECT163R1 = 2,
sPymbed 17:ff9d1e86ad5f 2300 WOLFSSL_ECC_SECT163R2 = 3,
sPymbed 17:ff9d1e86ad5f 2301 WOLFSSL_ECC_SECT193R1 = 4,
sPymbed 17:ff9d1e86ad5f 2302 WOLFSSL_ECC_SECT193R2 = 5,
sPymbed 17:ff9d1e86ad5f 2303 WOLFSSL_ECC_SECT233K1 = 6,
sPymbed 17:ff9d1e86ad5f 2304 WOLFSSL_ECC_SECT233R1 = 7,
sPymbed 17:ff9d1e86ad5f 2305 WOLFSSL_ECC_SECT239K1 = 8,
sPymbed 17:ff9d1e86ad5f 2306 WOLFSSL_ECC_SECT283K1 = 9,
sPymbed 17:ff9d1e86ad5f 2307 WOLFSSL_ECC_SECT283R1 = 10,
sPymbed 17:ff9d1e86ad5f 2308 WOLFSSL_ECC_SECT409K1 = 11,
sPymbed 17:ff9d1e86ad5f 2309 WOLFSSL_ECC_SECT409R1 = 12,
sPymbed 17:ff9d1e86ad5f 2310 WOLFSSL_ECC_SECT571K1 = 13,
sPymbed 17:ff9d1e86ad5f 2311 WOLFSSL_ECC_SECT571R1 = 14,
sPymbed 17:ff9d1e86ad5f 2312 #endif
sPymbed 17:ff9d1e86ad5f 2313 WOLFSSL_ECC_SECP160K1 = 15,
sPymbed 17:ff9d1e86ad5f 2314 WOLFSSL_ECC_SECP160R1 = 16,
sPymbed 17:ff9d1e86ad5f 2315 WOLFSSL_ECC_SECP160R2 = 17,
sPymbed 17:ff9d1e86ad5f 2316 WOLFSSL_ECC_SECP192K1 = 18,
sPymbed 17:ff9d1e86ad5f 2317 WOLFSSL_ECC_SECP192R1 = 19,
sPymbed 17:ff9d1e86ad5f 2318 WOLFSSL_ECC_SECP224K1 = 20,
sPymbed 17:ff9d1e86ad5f 2319 WOLFSSL_ECC_SECP224R1 = 21,
sPymbed 17:ff9d1e86ad5f 2320 WOLFSSL_ECC_SECP256K1 = 22,
sPymbed 17:ff9d1e86ad5f 2321 WOLFSSL_ECC_SECP256R1 = 23,
sPymbed 17:ff9d1e86ad5f 2322 WOLFSSL_ECC_SECP384R1 = 24,
sPymbed 17:ff9d1e86ad5f 2323 WOLFSSL_ECC_SECP521R1 = 25,
sPymbed 17:ff9d1e86ad5f 2324 WOLFSSL_ECC_BRAINPOOLP256R1 = 26,
sPymbed 17:ff9d1e86ad5f 2325 WOLFSSL_ECC_BRAINPOOLP384R1 = 27,
sPymbed 17:ff9d1e86ad5f 2326 WOLFSSL_ECC_BRAINPOOLP512R1 = 28,
sPymbed 17:ff9d1e86ad5f 2327 WOLFSSL_ECC_X25519 = 29,
sPymbed 17:ff9d1e86ad5f 2328 #ifdef WOLFSSL_TLS13
sPymbed 17:ff9d1e86ad5f 2329 /* Not implemented. */
sPymbed 17:ff9d1e86ad5f 2330 WOLFSSL_ECC_X448 = 30,
sPymbed 17:ff9d1e86ad5f 2331
sPymbed 17:ff9d1e86ad5f 2332 WOLFSSL_FFDHE_2048 = 256,
sPymbed 17:ff9d1e86ad5f 2333 WOLFSSL_FFDHE_3072 = 257,
sPymbed 17:ff9d1e86ad5f 2334 WOLFSSL_FFDHE_4096 = 258,
sPymbed 17:ff9d1e86ad5f 2335 WOLFSSL_FFDHE_6144 = 259,
sPymbed 17:ff9d1e86ad5f 2336 WOLFSSL_FFDHE_8192 = 260,
sPymbed 17:ff9d1e86ad5f 2337 #endif
sPymbed 17:ff9d1e86ad5f 2338 };
sPymbed 17:ff9d1e86ad5f 2339
sPymbed 17:ff9d1e86ad5f 2340 enum {
sPymbed 17:ff9d1e86ad5f 2341 WOLFSSL_EC_PF_UNCOMPRESSED = 0,
sPymbed 17:ff9d1e86ad5f 2342 #if 0 /* Not Supported */
sPymbed 17:ff9d1e86ad5f 2343 WOLFSSL_EC_PF_X962_COMP_PRIME = 1,
sPymbed 17:ff9d1e86ad5f 2344 WOLFSSL_EC_PF_X962_COMP_CHAR2 = 2,
sPymbed 17:ff9d1e86ad5f 2345 #endif
sPymbed 17:ff9d1e86ad5f 2346 };
sPymbed 17:ff9d1e86ad5f 2347
sPymbed 17:ff9d1e86ad5f 2348 #ifdef HAVE_SUPPORTED_CURVES
sPymbed 17:ff9d1e86ad5f 2349 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2350
sPymbed 17:ff9d1e86ad5f 2351 WOLFSSL_API int wolfSSL_UseSupportedCurve(WOLFSSL* ssl, unsigned short name);
sPymbed 17:ff9d1e86ad5f 2352 WOLFSSL_API int wolfSSL_CTX_UseSupportedCurve(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2353 unsigned short name);
sPymbed 17:ff9d1e86ad5f 2354
sPymbed 17:ff9d1e86ad5f 2355 #endif
sPymbed 17:ff9d1e86ad5f 2356 #endif
sPymbed 17:ff9d1e86ad5f 2357
sPymbed 17:ff9d1e86ad5f 2358 #ifdef WOLFSSL_TLS13
sPymbed 17:ff9d1e86ad5f 2359 WOLFSSL_API int wolfSSL_UseKeyShare(WOLFSSL* ssl, unsigned short group);
sPymbed 17:ff9d1e86ad5f 2360 WOLFSSL_API int wolfSSL_NoKeyShares(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2361 #endif
sPymbed 17:ff9d1e86ad5f 2362
sPymbed 17:ff9d1e86ad5f 2363
sPymbed 17:ff9d1e86ad5f 2364 /* Secure Renegotiation */
sPymbed 17:ff9d1e86ad5f 2365 #ifdef HAVE_SECURE_RENEGOTIATION
sPymbed 17:ff9d1e86ad5f 2366
sPymbed 17:ff9d1e86ad5f 2367 WOLFSSL_API int wolfSSL_UseSecureRenegotiation(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2368 WOLFSSL_API int wolfSSL_Rehandshake(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2369
sPymbed 17:ff9d1e86ad5f 2370 #endif
sPymbed 17:ff9d1e86ad5f 2371
sPymbed 17:ff9d1e86ad5f 2372 /* Session Ticket */
sPymbed 17:ff9d1e86ad5f 2373 #ifdef HAVE_SESSION_TICKET
sPymbed 17:ff9d1e86ad5f 2374
sPymbed 17:ff9d1e86ad5f 2375 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2376 WOLFSSL_API int wolfSSL_UseSessionTicket(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2377 WOLFSSL_API int wolfSSL_CTX_UseSessionTicket(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2378 WOLFSSL_API int wolfSSL_get_SessionTicket(WOLFSSL*, unsigned char*, unsigned int*);
sPymbed 17:ff9d1e86ad5f 2379 WOLFSSL_API int wolfSSL_set_SessionTicket(WOLFSSL*, const unsigned char*, unsigned int);
sPymbed 17:ff9d1e86ad5f 2380 typedef int (*CallbackSessionTicket)(WOLFSSL*, const unsigned char*, int, void*);
sPymbed 17:ff9d1e86ad5f 2381 WOLFSSL_API int wolfSSL_set_SessionTicket_cb(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 2382 CallbackSessionTicket, void*);
sPymbed 17:ff9d1e86ad5f 2383 #endif /* NO_WOLFSSL_CLIENT */
sPymbed 17:ff9d1e86ad5f 2384
sPymbed 17:ff9d1e86ad5f 2385
sPymbed 17:ff9d1e86ad5f 2386 #define WOLFSSL_TICKET_NAME_SZ 16
sPymbed 17:ff9d1e86ad5f 2387 #define WOLFSSL_TICKET_IV_SZ 16
sPymbed 17:ff9d1e86ad5f 2388 #define WOLFSSL_TICKET_MAC_SZ 32
sPymbed 17:ff9d1e86ad5f 2389
sPymbed 17:ff9d1e86ad5f 2390 enum TicketEncRet {
sPymbed 17:ff9d1e86ad5f 2391 WOLFSSL_TICKET_RET_FATAL = -1, /* fatal error, don't use ticket */
sPymbed 17:ff9d1e86ad5f 2392 WOLFSSL_TICKET_RET_OK = 0, /* ok, use ticket */
sPymbed 17:ff9d1e86ad5f 2393 WOLFSSL_TICKET_RET_REJECT, /* don't use ticket, but not fatal */
sPymbed 17:ff9d1e86ad5f 2394 WOLFSSL_TICKET_RET_CREATE /* existing ticket ok and create new one */
sPymbed 17:ff9d1e86ad5f 2395 };
sPymbed 17:ff9d1e86ad5f 2396
sPymbed 17:ff9d1e86ad5f 2397 #ifndef NO_WOLFSSL_SERVER
sPymbed 17:ff9d1e86ad5f 2398
sPymbed 17:ff9d1e86ad5f 2399 typedef int (*SessionTicketEncCb)(WOLFSSL*,
sPymbed 17:ff9d1e86ad5f 2400 unsigned char key_name[WOLFSSL_TICKET_NAME_SZ],
sPymbed 17:ff9d1e86ad5f 2401 unsigned char iv[WOLFSSL_TICKET_IV_SZ],
sPymbed 17:ff9d1e86ad5f 2402 unsigned char mac[WOLFSSL_TICKET_MAC_SZ],
sPymbed 17:ff9d1e86ad5f 2403 int enc, unsigned char*, int, int*, void*);
sPymbed 17:ff9d1e86ad5f 2404 WOLFSSL_API int wolfSSL_CTX_set_TicketEncCb(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2405 SessionTicketEncCb);
sPymbed 17:ff9d1e86ad5f 2406 WOLFSSL_API int wolfSSL_CTX_set_TicketHint(WOLFSSL_CTX* ctx, int);
sPymbed 17:ff9d1e86ad5f 2407 WOLFSSL_API int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void*);
sPymbed 17:ff9d1e86ad5f 2408
sPymbed 17:ff9d1e86ad5f 2409 #endif /* NO_WOLFSSL_SERVER */
sPymbed 17:ff9d1e86ad5f 2410
sPymbed 17:ff9d1e86ad5f 2411 #endif /* HAVE_SESSION_TICKET */
sPymbed 17:ff9d1e86ad5f 2412
sPymbed 17:ff9d1e86ad5f 2413 #ifdef HAVE_QSH
sPymbed 17:ff9d1e86ad5f 2414 /* Quantum-safe Crypto Schemes */
sPymbed 17:ff9d1e86ad5f 2415 enum {
sPymbed 17:ff9d1e86ad5f 2416 WOLFSSL_NTRU_EESS439 = 0x0101, /* max plaintext length of 65 */
sPymbed 17:ff9d1e86ad5f 2417 WOLFSSL_NTRU_EESS593 = 0x0102, /* max plaintext length of 86 */
sPymbed 17:ff9d1e86ad5f 2418 WOLFSSL_NTRU_EESS743 = 0x0103, /* max plaintext length of 106 */
sPymbed 17:ff9d1e86ad5f 2419 WOLFSSL_LWE_XXX = 0x0201, /* Learning With Error encryption scheme */
sPymbed 17:ff9d1e86ad5f 2420 WOLFSSL_HFE_XXX = 0x0301, /* Hidden Field Equation scheme */
sPymbed 17:ff9d1e86ad5f 2421 WOLFSSL_NULL_QSH = 0xFFFF /* QSHScheme is not used */
sPymbed 17:ff9d1e86ad5f 2422 };
sPymbed 17:ff9d1e86ad5f 2423
sPymbed 17:ff9d1e86ad5f 2424
sPymbed 17:ff9d1e86ad5f 2425 /* test if the connection is using a QSH secure connection return 1 if so */
sPymbed 17:ff9d1e86ad5f 2426 WOLFSSL_API int wolfSSL_isQSH(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2427 WOLFSSL_API int wolfSSL_UseSupportedQSH(WOLFSSL* ssl, unsigned short name);
sPymbed 17:ff9d1e86ad5f 2428 #ifndef NO_WOLFSSL_CLIENT
sPymbed 17:ff9d1e86ad5f 2429 /* user control over sending client public key in hello
sPymbed 17:ff9d1e86ad5f 2430 when flag = 1 will send keys if flag is 0 or function is not called
sPymbed 17:ff9d1e86ad5f 2431 then will not send keys in the hello extension */
sPymbed 17:ff9d1e86ad5f 2432 WOLFSSL_API int wolfSSL_UseClientQSHKeys(WOLFSSL* ssl, unsigned char flag);
sPymbed 17:ff9d1e86ad5f 2433 #endif
sPymbed 17:ff9d1e86ad5f 2434
sPymbed 17:ff9d1e86ad5f 2435 #endif /* QSH */
sPymbed 17:ff9d1e86ad5f 2436
sPymbed 17:ff9d1e86ad5f 2437 /* TLS Extended Master Secret Extension */
sPymbed 17:ff9d1e86ad5f 2438 WOLFSSL_API int wolfSSL_DisableExtendedMasterSecret(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2439 WOLFSSL_API int wolfSSL_CTX_DisableExtendedMasterSecret(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2440
sPymbed 17:ff9d1e86ad5f 2441
sPymbed 17:ff9d1e86ad5f 2442 #define WOLFSSL_CRL_MONITOR 0x01 /* monitor this dir flag */
sPymbed 17:ff9d1e86ad5f 2443 #define WOLFSSL_CRL_START_MON 0x02 /* start monitoring flag */
sPymbed 17:ff9d1e86ad5f 2444
sPymbed 17:ff9d1e86ad5f 2445
sPymbed 17:ff9d1e86ad5f 2446 /* notify user the handshake is done */
sPymbed 17:ff9d1e86ad5f 2447 typedef int (*HandShakeDoneCb)(WOLFSSL*, void*);
sPymbed 17:ff9d1e86ad5f 2448 WOLFSSL_API int wolfSSL_SetHsDoneCb(WOLFSSL*, HandShakeDoneCb, void*);
sPymbed 17:ff9d1e86ad5f 2449
sPymbed 17:ff9d1e86ad5f 2450
sPymbed 17:ff9d1e86ad5f 2451 WOLFSSL_API int wolfSSL_PrintSessionStats(void);
sPymbed 17:ff9d1e86ad5f 2452 WOLFSSL_API int wolfSSL_get_session_stats(unsigned int* active,
sPymbed 17:ff9d1e86ad5f 2453 unsigned int* total,
sPymbed 17:ff9d1e86ad5f 2454 unsigned int* peak,
sPymbed 17:ff9d1e86ad5f 2455 unsigned int* maxSessions);
sPymbed 17:ff9d1e86ad5f 2456 /* External facing KDF */
sPymbed 17:ff9d1e86ad5f 2457 WOLFSSL_API
sPymbed 17:ff9d1e86ad5f 2458 int wolfSSL_MakeTlsMasterSecret(unsigned char* ms, unsigned int msLen,
sPymbed 17:ff9d1e86ad5f 2459 const unsigned char* pms, unsigned int pmsLen,
sPymbed 17:ff9d1e86ad5f 2460 const unsigned char* cr, const unsigned char* sr,
sPymbed 17:ff9d1e86ad5f 2461 int tls1_2, int hash_type);
sPymbed 17:ff9d1e86ad5f 2462
sPymbed 17:ff9d1e86ad5f 2463 WOLFSSL_API
sPymbed 17:ff9d1e86ad5f 2464 int wolfSSL_MakeTlsExtendedMasterSecret(unsigned char* ms, unsigned int msLen,
sPymbed 17:ff9d1e86ad5f 2465 const unsigned char* pms, unsigned int pmsLen,
sPymbed 17:ff9d1e86ad5f 2466 const unsigned char* sHash, unsigned int sHashLen,
sPymbed 17:ff9d1e86ad5f 2467 int tls1_2, int hash_type);
sPymbed 17:ff9d1e86ad5f 2468
sPymbed 17:ff9d1e86ad5f 2469 WOLFSSL_API
sPymbed 17:ff9d1e86ad5f 2470 int wolfSSL_DeriveTlsKeys(unsigned char* key_data, unsigned int keyLen,
sPymbed 17:ff9d1e86ad5f 2471 const unsigned char* ms, unsigned int msLen,
sPymbed 17:ff9d1e86ad5f 2472 const unsigned char* sr, const unsigned char* cr,
sPymbed 17:ff9d1e86ad5f 2473 int tls1_2, int hash_type);
sPymbed 17:ff9d1e86ad5f 2474
sPymbed 17:ff9d1e86ad5f 2475 #ifdef WOLFSSL_CALLBACKS
sPymbed 17:ff9d1e86ad5f 2476
sPymbed 17:ff9d1e86ad5f 2477 /* used internally by wolfSSL while OpenSSL types aren't */
sPymbed 17:ff9d1e86ad5f 2478 #include <wolfssl/callbacks.h>
sPymbed 17:ff9d1e86ad5f 2479
sPymbed 17:ff9d1e86ad5f 2480 typedef int (*HandShakeCallBack)(HandShakeInfo*);
sPymbed 17:ff9d1e86ad5f 2481 typedef int (*TimeoutCallBack)(TimeoutInfo*);
sPymbed 17:ff9d1e86ad5f 2482
sPymbed 17:ff9d1e86ad5f 2483 /* wolfSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack
sPymbed 17:ff9d1e86ad5f 2484 for diagnostics */
sPymbed 17:ff9d1e86ad5f 2485 WOLFSSL_API int wolfSSL_connect_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack,
sPymbed 17:ff9d1e86ad5f 2486 Timeval);
sPymbed 17:ff9d1e86ad5f 2487 WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack,
sPymbed 17:ff9d1e86ad5f 2488 Timeval);
sPymbed 17:ff9d1e86ad5f 2489
sPymbed 17:ff9d1e86ad5f 2490 #endif /* WOLFSSL_CALLBACKS */
sPymbed 17:ff9d1e86ad5f 2491
sPymbed 17:ff9d1e86ad5f 2492
sPymbed 17:ff9d1e86ad5f 2493 #ifdef WOLFSSL_HAVE_WOLFSCEP
sPymbed 17:ff9d1e86ad5f 2494 WOLFSSL_API void wolfSSL_wolfSCEP(void);
sPymbed 17:ff9d1e86ad5f 2495 #endif /* WOLFSSL_HAVE_WOLFSCEP */
sPymbed 17:ff9d1e86ad5f 2496
sPymbed 17:ff9d1e86ad5f 2497 #ifdef WOLFSSL_HAVE_CERT_SERVICE
sPymbed 17:ff9d1e86ad5f 2498 WOLFSSL_API void wolfSSL_cert_service(void);
sPymbed 17:ff9d1e86ad5f 2499 #endif
sPymbed 17:ff9d1e86ad5f 2500
sPymbed 17:ff9d1e86ad5f 2501 #if defined(OPENSSL_ALL) || defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL)
sPymbed 17:ff9d1e86ad5f 2502 /* Smaller subset of X509 compatibility functions. Avoid increasing the size of
sPymbed 17:ff9d1e86ad5f 2503 * this subset and its memory usage */
sPymbed 17:ff9d1e86ad5f 2504
sPymbed 17:ff9d1e86ad5f 2505 #include <wolfssl/openssl/asn1.h>
sPymbed 17:ff9d1e86ad5f 2506 struct WOLFSSL_X509_NAME_ENTRY {
sPymbed 17:ff9d1e86ad5f 2507 WOLFSSL_ASN1_OBJECT* object; /* not defined yet */
sPymbed 17:ff9d1e86ad5f 2508 WOLFSSL_ASN1_STRING data;
sPymbed 17:ff9d1e86ad5f 2509 WOLFSSL_ASN1_STRING* value; /* points to data, for lighttpd port */
sPymbed 17:ff9d1e86ad5f 2510 int nid; /* i.e. ASN_COMMON_NAME */
sPymbed 17:ff9d1e86ad5f 2511 int set;
sPymbed 17:ff9d1e86ad5f 2512 int size;
sPymbed 17:ff9d1e86ad5f 2513 };
sPymbed 17:ff9d1e86ad5f 2514 #endif /* OPENSSL_ALL || OPENSSL_EXTRA || OPENSSL_EXTRA_X509_SMALL */
sPymbed 17:ff9d1e86ad5f 2515
sPymbed 17:ff9d1e86ad5f 2516
sPymbed 17:ff9d1e86ad5f 2517 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL)
sPymbed 17:ff9d1e86ad5f 2518
sPymbed 17:ff9d1e86ad5f 2519 enum {
sPymbed 17:ff9d1e86ad5f 2520 WOLFSSL_SYS_ACCEPT = 0,
sPymbed 17:ff9d1e86ad5f 2521 WOLFSSL_SYS_BIND,
sPymbed 17:ff9d1e86ad5f 2522 WOLFSSL_SYS_CONNECT,
sPymbed 17:ff9d1e86ad5f 2523 WOLFSSL_SYS_FOPEN,
sPymbed 17:ff9d1e86ad5f 2524 WOLFSSL_SYS_FREAD,
sPymbed 17:ff9d1e86ad5f 2525 WOLFSSL_SYS_GETADDRINFO,
sPymbed 17:ff9d1e86ad5f 2526 WOLFSSL_SYS_GETSOCKOPT,
sPymbed 17:ff9d1e86ad5f 2527 WOLFSSL_SYS_GETSOCKNAME,
sPymbed 17:ff9d1e86ad5f 2528 WOLFSSL_SYS_GETHOSTBYNAME,
sPymbed 17:ff9d1e86ad5f 2529 WOLFSSL_SYS_GETNAMEINFO,
sPymbed 17:ff9d1e86ad5f 2530 WOLFSSL_SYS_GETSERVBYNAME,
sPymbed 17:ff9d1e86ad5f 2531 WOLFSSL_SYS_IOCTLSOCKET,
sPymbed 17:ff9d1e86ad5f 2532 WOLFSSL_SYS_LISTEN,
sPymbed 17:ff9d1e86ad5f 2533 WOLFSSL_SYS_OPENDIR,
sPymbed 17:ff9d1e86ad5f 2534 WOLFSSL_SYS_SETSOCKOPT,
sPymbed 17:ff9d1e86ad5f 2535 WOLFSSL_SYS_SOCKET
sPymbed 17:ff9d1e86ad5f 2536 };
sPymbed 17:ff9d1e86ad5f 2537
sPymbed 17:ff9d1e86ad5f 2538 /* Object functions */
sPymbed 17:ff9d1e86ad5f 2539 WOLFSSL_API const char * wolfSSL_OBJ_nid2sn(int n);
sPymbed 17:ff9d1e86ad5f 2540 WOLFSSL_API int wolfSSL_OBJ_obj2nid(const WOLFSSL_ASN1_OBJECT *o);
sPymbed 17:ff9d1e86ad5f 2541 WOLFSSL_API int wolfSSL_OBJ_sn2nid(const char *sn);
sPymbed 17:ff9d1e86ad5f 2542
sPymbed 17:ff9d1e86ad5f 2543 WOLFSSL_API char* wolfSSL_OBJ_nid2ln(int n);
sPymbed 17:ff9d1e86ad5f 2544 WOLFSSL_API int wolfSSL_OBJ_txt2nid(const char *sn);
sPymbed 17:ff9d1e86ad5f 2545
sPymbed 17:ff9d1e86ad5f 2546 WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_OBJ_nid2obj(int n);
sPymbed 17:ff9d1e86ad5f 2547 WOLFSSL_API int wolfSSL_OBJ_obj2txt(char *buf, int buf_len, WOLFSSL_ASN1_OBJECT *a, int no_name);
sPymbed 17:ff9d1e86ad5f 2548
sPymbed 17:ff9d1e86ad5f 2549 WOLFSSL_API void wolfSSL_OBJ_cleanup(void);
sPymbed 17:ff9d1e86ad5f 2550 /* end of object functions */
sPymbed 17:ff9d1e86ad5f 2551
sPymbed 17:ff9d1e86ad5f 2552 WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error_line(const char **file, int *line);
sPymbed 17:ff9d1e86ad5f 2553 WOLFSSL_API long wolfSSL_ctrl(WOLFSSL* ssl, int cmd, long opt, void* pt);
sPymbed 17:ff9d1e86ad5f 2554 WOLFSSL_API long wolfSSL_CTX_ctrl(WOLFSSL_CTX* ctx, int cmd, long opt,void* pt);
sPymbed 17:ff9d1e86ad5f 2555
sPymbed 17:ff9d1e86ad5f 2556 #ifndef NO_CERTS
sPymbed 17:ff9d1e86ad5f 2557 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY* wolfSSL_X509_NAME_ENTRY_create_by_NID(
sPymbed 17:ff9d1e86ad5f 2558 WOLFSSL_X509_NAME_ENTRY** out, int nid, int type,
sPymbed 17:ff9d1e86ad5f 2559 unsigned char* data, int dataSz);
sPymbed 17:ff9d1e86ad5f 2560 WOLFSSL_API int wolfSSL_X509_NAME_add_entry(WOLFSSL_X509_NAME* name,
sPymbed 17:ff9d1e86ad5f 2561 WOLFSSL_X509_NAME_ENTRY* entry, int idx, int set);
sPymbed 17:ff9d1e86ad5f 2562 WOLFSSL_API int wolfSSL_X509_NAME_cmp(const WOLFSSL_X509_NAME* x,
sPymbed 17:ff9d1e86ad5f 2563 const WOLFSSL_X509_NAME* y);
sPymbed 17:ff9d1e86ad5f 2564 WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_NAME_new(void);
sPymbed 17:ff9d1e86ad5f 2565 WOLFSSL_API int wolfSSL_check_private_key(const WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2566 WOLFSSL_API void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509,
sPymbed 17:ff9d1e86ad5f 2567 int nid, int* c, int* idx);
sPymbed 17:ff9d1e86ad5f 2568 WOLFSSL_API int wolfSSL_X509_digest(const WOLFSSL_X509* x509,
sPymbed 17:ff9d1e86ad5f 2569 const WOLFSSL_EVP_MD* digest, unsigned char* buf, unsigned int* len);
sPymbed 17:ff9d1e86ad5f 2570 WOLFSSL_API int wolfSSL_use_certificate(WOLFSSL* ssl, WOLFSSL_X509* x509);
sPymbed 17:ff9d1e86ad5f 2571 WOLFSSL_API int wolfSSL_use_certificate_ASN1(WOLFSSL* ssl, unsigned char* der,
sPymbed 17:ff9d1e86ad5f 2572 int derSz);
sPymbed 17:ff9d1e86ad5f 2573 WOLFSSL_API int wolfSSL_use_PrivateKey(WOLFSSL* ssl, WOLFSSL_EVP_PKEY* pkey);
sPymbed 17:ff9d1e86ad5f 2574 WOLFSSL_API int wolfSSL_use_PrivateKey_ASN1(int pri, WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 2575 unsigned char* der, long derSz);
sPymbed 17:ff9d1e86ad5f 2576 WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_get_privatekey(const WOLFSSL *ssl);
sPymbed 17:ff9d1e86ad5f 2577 #ifndef NO_RSA
sPymbed 17:ff9d1e86ad5f 2578 WOLFSSL_API int wolfSSL_use_RSAPrivateKey_ASN1(WOLFSSL* ssl, unsigned char* der,
sPymbed 17:ff9d1e86ad5f 2579 long derSz);
sPymbed 17:ff9d1e86ad5f 2580 #endif
sPymbed 17:ff9d1e86ad5f 2581 #endif /* NO_CERTS */
sPymbed 17:ff9d1e86ad5f 2582
sPymbed 17:ff9d1e86ad5f 2583 WOLFSSL_API WOLFSSL_DH *wolfSSL_DSA_dup_DH(const WOLFSSL_DSA *r);
sPymbed 17:ff9d1e86ad5f 2584
sPymbed 17:ff9d1e86ad5f 2585 WOLFSSL_API int wolfSSL_SESSION_get_master_key(const WOLFSSL_SESSION* ses,
sPymbed 17:ff9d1e86ad5f 2586 unsigned char* out, int outSz);
sPymbed 17:ff9d1e86ad5f 2587 WOLFSSL_API int wolfSSL_SESSION_get_master_key_length(const WOLFSSL_SESSION* ses);
sPymbed 17:ff9d1e86ad5f 2588
sPymbed 17:ff9d1e86ad5f 2589 WOLFSSL_API void wolfSSL_CTX_set_cert_store(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2590 WOLFSSL_X509_STORE* str);
sPymbed 17:ff9d1e86ad5f 2591 WOLFSSL_API int wolfSSL_i2d_X509_bio(WOLFSSL_BIO* bio, WOLFSSL_X509* x509);
sPymbed 17:ff9d1e86ad5f 2592 #if !defined(NO_FILESYSTEM)
sPymbed 17:ff9d1e86ad5f 2593 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509_fp(XFILE fp,
sPymbed 17:ff9d1e86ad5f 2594 WOLFSSL_X509** x509);
sPymbed 17:ff9d1e86ad5f 2595 #endif
sPymbed 17:ff9d1e86ad5f 2596 WOLFSSL_API WOLFSSL_X509* wolfSSL_d2i_X509_bio(WOLFSSL_BIO* bio,
sPymbed 17:ff9d1e86ad5f 2597 WOLFSSL_X509** x509);
sPymbed 17:ff9d1e86ad5f 2598 WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_CTX_get_cert_store(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2599
sPymbed 17:ff9d1e86ad5f 2600 WOLFSSL_API size_t wolfSSL_BIO_ctrl_pending(WOLFSSL_BIO *b);
sPymbed 17:ff9d1e86ad5f 2601 WOLFSSL_API size_t wolfSSL_get_server_random(const WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2602 unsigned char *out, size_t outlen);
sPymbed 17:ff9d1e86ad5f 2603 WOLFSSL_API size_t wolfSSL_get_client_random(const WOLFSSL* ssl,
sPymbed 17:ff9d1e86ad5f 2604 unsigned char* out, size_t outSz);
sPymbed 17:ff9d1e86ad5f 2605 WOLFSSL_API int wolfSSL_CTX_use_PrivateKey(WOLFSSL_CTX *ctx, WOLFSSL_EVP_PKEY *pkey);
sPymbed 17:ff9d1e86ad5f 2606 WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509(WOLFSSL_BIO *bp, WOLFSSL_X509 **x, pem_password_cb *cb, void *u);
sPymbed 17:ff9d1e86ad5f 2607 WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509_AUX
sPymbed 17:ff9d1e86ad5f 2608 (WOLFSSL_BIO *bp, WOLFSSL_X509 **x, pem_password_cb *cb, void *u);
sPymbed 17:ff9d1e86ad5f 2609 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 2610 WOLFSSL_API WOLFSSL_X509_CRL *wolfSSL_PEM_read_X509_CRL(XFILE fp, WOLFSSL_X509_CRL **x,
sPymbed 17:ff9d1e86ad5f 2611 pem_password_cb *cb, void *u);
sPymbed 17:ff9d1e86ad5f 2612 #endif
sPymbed 17:ff9d1e86ad5f 2613
sPymbed 17:ff9d1e86ad5f 2614 /*lighttp compatibility */
sPymbed 17:ff9d1e86ad5f 2615
sPymbed 17:ff9d1e86ad5f 2616 struct WOLFSSL_ASN1_BIT_STRING {
sPymbed 17:ff9d1e86ad5f 2617 int length;
sPymbed 17:ff9d1e86ad5f 2618 int type;
sPymbed 17:ff9d1e86ad5f 2619 char* data;
sPymbed 17:ff9d1e86ad5f 2620 long flags;
sPymbed 17:ff9d1e86ad5f 2621 };
sPymbed 17:ff9d1e86ad5f 2622
sPymbed 17:ff9d1e86ad5f 2623
sPymbed 17:ff9d1e86ad5f 2624 #if defined(OPENSSL_EXTRA) \
sPymbed 17:ff9d1e86ad5f 2625 || defined(OPENSSL_ALL) \
sPymbed 17:ff9d1e86ad5f 2626 || defined(HAVE_LIGHTY) \
sPymbed 17:ff9d1e86ad5f 2627 || defined(WOLFSSL_MYSQL_COMPATIBLE) \
sPymbed 17:ff9d1e86ad5f 2628 || defined(HAVE_STUNNEL) \
sPymbed 17:ff9d1e86ad5f 2629 || defined(WOLFSSL_NGINX) \
sPymbed 17:ff9d1e86ad5f 2630 || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2631 WOLFSSL_API void wolfSSL_X509_NAME_ENTRY_free(WOLFSSL_X509_NAME_ENTRY* ne);
sPymbed 17:ff9d1e86ad5f 2632 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY* wolfSSL_X509_NAME_ENTRY_new(void);
sPymbed 17:ff9d1e86ad5f 2633 WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME* name);
sPymbed 17:ff9d1e86ad5f 2634 WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX *ctx, WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2635 WOLFSSL_API int wolfSSL_BIO_read_filename(WOLFSSL_BIO *b, const char *name);
sPymbed 17:ff9d1e86ad5f 2636 /* These are to be merged shortly */
sPymbed 17:ff9d1e86ad5f 2637 WOLFSSL_API void wolfSSL_set_verify_depth(WOLFSSL *ssl,int depth);
sPymbed 17:ff9d1e86ad5f 2638 WOLFSSL_API void* wolfSSL_get_app_data( const WOLFSSL *ssl);
sPymbed 17:ff9d1e86ad5f 2639 WOLFSSL_API int wolfSSL_set_app_data(WOLFSSL *ssl, void *arg);
sPymbed 17:ff9d1e86ad5f 2640 WOLFSSL_API WOLFSSL_ASN1_OBJECT * wolfSSL_X509_NAME_ENTRY_get_object(WOLFSSL_X509_NAME_ENTRY *ne);
sPymbed 17:ff9d1e86ad5f 2641 WOLFSSL_API WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry(WOLFSSL_X509_NAME *name, int loc);
sPymbed 17:ff9d1e86ad5f 2642 WOLFSSL_API void wolfSSL_sk_X509_NAME_pop_free(WOLF_STACK_OF(WOLFSSL_X509_NAME)* sk, void f (WOLFSSL_X509_NAME*));
sPymbed 17:ff9d1e86ad5f 2643 WOLFSSL_API unsigned char *wolfSSL_SHA1(const unsigned char *d, size_t n, unsigned char *md);
sPymbed 17:ff9d1e86ad5f 2644 WOLFSSL_API unsigned char *wolfSSL_SHA256(const unsigned char *d, size_t n, unsigned char *md);
sPymbed 17:ff9d1e86ad5f 2645 WOLFSSL_API unsigned char *wolfSSL_SHA384(const unsigned char *d, size_t n, unsigned char *md);
sPymbed 17:ff9d1e86ad5f 2646 WOLFSSL_API unsigned char *wolfSSL_SHA512(const unsigned char *d, size_t n, unsigned char *md);
sPymbed 17:ff9d1e86ad5f 2647 WOLFSSL_API int wolfSSL_X509_check_private_key(WOLFSSL_X509*, WOLFSSL_EVP_PKEY*);
sPymbed 17:ff9d1e86ad5f 2648 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509_NAME) *wolfSSL_dup_CA_list( WOLF_STACK_OF(WOLFSSL_X509_NAME) *sk );
sPymbed 17:ff9d1e86ad5f 2649 WOLFSSL_API int wolfSSL_X509_check_ca(WOLFSSL_X509 *x509);
sPymbed 17:ff9d1e86ad5f 2650
sPymbed 17:ff9d1e86ad5f 2651 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 2652 WOLFSSL_API long wolfSSL_BIO_set_fp(WOLFSSL_BIO *bio, XFILE fp, int c);
sPymbed 17:ff9d1e86ad5f 2653 WOLFSSL_API long wolfSSL_BIO_get_fp(WOLFSSL_BIO *bio, XFILE* fp);
sPymbed 17:ff9d1e86ad5f 2654 #endif
sPymbed 17:ff9d1e86ad5f 2655
sPymbed 17:ff9d1e86ad5f 2656 #endif /* OPENSSL_EXTRA || OPENSSL_ALL || HAVE_LIGHTY || WOLFSSL_MYSQL_COMPATIBLE || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */
sPymbed 17:ff9d1e86ad5f 2657
sPymbed 17:ff9d1e86ad5f 2658 #endif /* OPENSSL_EXTRA || OPENSSL_ALL */
sPymbed 17:ff9d1e86ad5f 2659
sPymbed 17:ff9d1e86ad5f 2660
sPymbed 17:ff9d1e86ad5f 2661 #if defined(OPENSSL_ALL) \
sPymbed 17:ff9d1e86ad5f 2662 || defined(HAVE_STUNNEL) \
sPymbed 17:ff9d1e86ad5f 2663 || defined(HAVE_LIGHTY) \
sPymbed 17:ff9d1e86ad5f 2664 || defined(WOLFSSL_MYSQL_COMPATIBLE) \
sPymbed 17:ff9d1e86ad5f 2665 || defined(WOLFSSL_HAPROXY) \
sPymbed 17:ff9d1e86ad5f 2666 || defined(OPENSSL_EXTRA)
sPymbed 17:ff9d1e86ad5f 2667
sPymbed 17:ff9d1e86ad5f 2668 WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_file(const char *filename, const char *mode);
sPymbed 17:ff9d1e86ad5f 2669 WOLFSSL_API long wolfSSL_CTX_set_tmp_dh(WOLFSSL_CTX*, WOLFSSL_DH*);
sPymbed 17:ff9d1e86ad5f 2670 WOLFSSL_API WOLFSSL_DH *wolfSSL_PEM_read_bio_DHparams(WOLFSSL_BIO *bp,
sPymbed 17:ff9d1e86ad5f 2671 WOLFSSL_DH **x, pem_password_cb *cb, void *u);
sPymbed 17:ff9d1e86ad5f 2672 WOLFSSL_API WOLFSSL_DSA *wolfSSL_PEM_read_bio_DSAparams(WOLFSSL_BIO *bp,
sPymbed 17:ff9d1e86ad5f 2673 WOLFSSL_DSA **x, pem_password_cb *cb, void *u);
sPymbed 17:ff9d1e86ad5f 2674 WOLFSSL_API int wolfSSL_PEM_write_bio_X509_REQ(WOLFSSL_BIO *bp,WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2675 WOLFSSL_API int wolfSSL_PEM_write_bio_X509_AUX(WOLFSSL_BIO *bp,WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2676 WOLFSSL_API int wolfSSL_PEM_write_bio_X509(WOLFSSL_BIO *bp, WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2677
sPymbed 17:ff9d1e86ad5f 2678 #endif /* HAVE_STUNNEL || HAVE_LIGHTY */
sPymbed 17:ff9d1e86ad5f 2679
sPymbed 17:ff9d1e86ad5f 2680
sPymbed 17:ff9d1e86ad5f 2681 #if defined(OPENSSL_ALL) \
sPymbed 17:ff9d1e86ad5f 2682 || defined(HAVE_STUNNEL) \
sPymbed 17:ff9d1e86ad5f 2683 || defined(WOLFSSL_NGINX) \
sPymbed 17:ff9d1e86ad5f 2684 || defined(WOLFSSL_HAPROXY) \
sPymbed 17:ff9d1e86ad5f 2685 || defined(OPENSSL_EXTRA) \
sPymbed 17:ff9d1e86ad5f 2686 || defined(HAVE_LIGHTY)
sPymbed 17:ff9d1e86ad5f 2687
sPymbed 17:ff9d1e86ad5f 2688 #include <wolfssl/openssl/crypto.h>
sPymbed 17:ff9d1e86ad5f 2689
sPymbed 17:ff9d1e86ad5f 2690 /* SNI received callback type */
sPymbed 17:ff9d1e86ad5f 2691 typedef int (*CallbackSniRecv)(WOLFSSL *ssl, int *ret, void* exArg);
sPymbed 17:ff9d1e86ad5f 2692
sPymbed 17:ff9d1e86ad5f 2693 WOLFSSL_API int wolfSSL_CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int),
sPymbed 17:ff9d1e86ad5f 2694 void *(*r) (void *, size_t, const char *, int), void (*f) (void *));
sPymbed 17:ff9d1e86ad5f 2695
sPymbed 17:ff9d1e86ad5f 2696 WOLFSSL_API void wolfSSL_CRYPTO_cleanup_all_ex_data(void);
sPymbed 17:ff9d1e86ad5f 2697
sPymbed 17:ff9d1e86ad5f 2698 WOLFSSL_API WOLFSSL_BIGNUM* wolfSSL_DH_1536_prime(WOLFSSL_BIGNUM* bn);
sPymbed 17:ff9d1e86ad5f 2699 WOLFSSL_API WOLFSSL_DH *wolfSSL_DH_generate_parameters(int prime_len, int generator,
sPymbed 17:ff9d1e86ad5f 2700 void (*callback) (int, int, void *), void *cb_arg);
sPymbed 17:ff9d1e86ad5f 2701
sPymbed 17:ff9d1e86ad5f 2702 WOLFSSL_API int wolfSSL_DH_generate_parameters_ex(WOLFSSL_DH*, int, int,
sPymbed 17:ff9d1e86ad5f 2703 void (*callback) (int, int, void *));
sPymbed 17:ff9d1e86ad5f 2704
sPymbed 17:ff9d1e86ad5f 2705 WOLFSSL_API void wolfSSL_ERR_load_crypto_strings(void);
sPymbed 17:ff9d1e86ad5f 2706
sPymbed 17:ff9d1e86ad5f 2707 WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error(void);
sPymbed 17:ff9d1e86ad5f 2708
sPymbed 17:ff9d1e86ad5f 2709 WOLFSSL_API int wolfSSL_FIPS_mode(void);
sPymbed 17:ff9d1e86ad5f 2710
sPymbed 17:ff9d1e86ad5f 2711 WOLFSSL_API int wolfSSL_FIPS_mode_set(int r);
sPymbed 17:ff9d1e86ad5f 2712
sPymbed 17:ff9d1e86ad5f 2713 WOLFSSL_API int wolfSSL_RAND_set_rand_method(const void *meth);
sPymbed 17:ff9d1e86ad5f 2714
sPymbed 17:ff9d1e86ad5f 2715 WOLFSSL_API int wolfSSL_CIPHER_get_bits(const WOLFSSL_CIPHER *c, int *alg_bits);
sPymbed 17:ff9d1e86ad5f 2716
sPymbed 17:ff9d1e86ad5f 2717 WOLFSSL_API int wolfSSL_sk_X509_NAME_num(const WOLF_STACK_OF(WOLFSSL_X509_NAME) *s);
sPymbed 17:ff9d1e86ad5f 2718
sPymbed 17:ff9d1e86ad5f 2719 WOLFSSL_API int wolfSSL_sk_X509_num(const WOLF_STACK_OF(WOLFSSL_X509) *s);
sPymbed 17:ff9d1e86ad5f 2720
sPymbed 17:ff9d1e86ad5f 2721 WOLFSSL_API int wolfSSL_X509_NAME_print_ex(WOLFSSL_BIO*,WOLFSSL_X509_NAME*,int,
sPymbed 17:ff9d1e86ad5f 2722 unsigned long);
sPymbed 17:ff9d1e86ad5f 2723
sPymbed 17:ff9d1e86ad5f 2724 WOLFSSL_API WOLFSSL_ASN1_BIT_STRING* wolfSSL_X509_get0_pubkey_bitstr(
sPymbed 17:ff9d1e86ad5f 2725 const WOLFSSL_X509*);
sPymbed 17:ff9d1e86ad5f 2726
sPymbed 17:ff9d1e86ad5f 2727 WOLFSSL_API int wolfSSL_CTX_add_session(WOLFSSL_CTX*, WOLFSSL_SESSION*);
sPymbed 17:ff9d1e86ad5f 2728
sPymbed 17:ff9d1e86ad5f 2729 WOLFSSL_API WOLFSSL_CTX* wolfSSL_get_SSL_CTX(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2730
sPymbed 17:ff9d1e86ad5f 2731 WOLFSSL_API int wolfSSL_version(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2732
sPymbed 17:ff9d1e86ad5f 2733 WOLFSSL_API int wolfSSL_get_state(const WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2734
sPymbed 17:ff9d1e86ad5f 2735 WOLFSSL_API void* wolfSSL_sk_X509_NAME_value(const WOLF_STACK_OF(WOLFSSL_X509_NAME)*, int);
sPymbed 17:ff9d1e86ad5f 2736
sPymbed 17:ff9d1e86ad5f 2737 WOLFSSL_API void* wolfSSL_sk_X509_value(WOLF_STACK_OF(WOLFSSL_X509)*, int);
sPymbed 17:ff9d1e86ad5f 2738
sPymbed 17:ff9d1e86ad5f 2739 WOLFSSL_API void* wolfSSL_SESSION_get_ex_data(const WOLFSSL_SESSION*, int);
sPymbed 17:ff9d1e86ad5f 2740
sPymbed 17:ff9d1e86ad5f 2741 WOLFSSL_API int wolfSSL_SESSION_set_ex_data(WOLFSSL_SESSION*, int, void*);
sPymbed 17:ff9d1e86ad5f 2742
sPymbed 17:ff9d1e86ad5f 2743 WOLFSSL_API int wolfSSL_SESSION_get_ex_new_index(long,void*,void*,void*,
sPymbed 17:ff9d1e86ad5f 2744 CRYPTO_free_func*);
sPymbed 17:ff9d1e86ad5f 2745
sPymbed 17:ff9d1e86ad5f 2746 WOLFSSL_API int wolfSSL_X509_NAME_get_sz(WOLFSSL_X509_NAME*);
sPymbed 17:ff9d1e86ad5f 2747
sPymbed 17:ff9d1e86ad5f 2748
sPymbed 17:ff9d1e86ad5f 2749 WOLFSSL_API const unsigned char* wolfSSL_SESSION_get_id(WOLFSSL_SESSION*,
sPymbed 17:ff9d1e86ad5f 2750 unsigned int*);
sPymbed 17:ff9d1e86ad5f 2751
sPymbed 17:ff9d1e86ad5f 2752 WOLFSSL_API int wolfSSL_set_tlsext_host_name(WOLFSSL *, const char *);
sPymbed 17:ff9d1e86ad5f 2753
sPymbed 17:ff9d1e86ad5f 2754 WOLFSSL_API const char* wolfSSL_get_servername(WOLFSSL *, unsigned char);
sPymbed 17:ff9d1e86ad5f 2755
sPymbed 17:ff9d1e86ad5f 2756 WOLFSSL_API WOLFSSL_CTX* wolfSSL_set_SSL_CTX(WOLFSSL*,WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2757
sPymbed 17:ff9d1e86ad5f 2758 WOLFSSL_API VerifyCallback wolfSSL_CTX_get_verify_callback(WOLFSSL_CTX*);
sPymbed 17:ff9d1e86ad5f 2759
sPymbed 17:ff9d1e86ad5f 2760 WOLFSSL_API VerifyCallback wolfSSL_get_verify_callback(WOLFSSL*);
sPymbed 17:ff9d1e86ad5f 2761
sPymbed 17:ff9d1e86ad5f 2762 WOLFSSL_API void wolfSSL_CTX_set_servername_callback(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 2763 CallbackSniRecv);
sPymbed 17:ff9d1e86ad5f 2764 WOLFSSL_API int wolfSSL_CTX_set_tlsext_servername_callback(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 2765 CallbackSniRecv);
sPymbed 17:ff9d1e86ad5f 2766
sPymbed 17:ff9d1e86ad5f 2767 WOLFSSL_API void wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX *, void*);
sPymbed 17:ff9d1e86ad5f 2768
sPymbed 17:ff9d1e86ad5f 2769 WOLFSSL_API void wolfSSL_ERR_remove_thread_state(void*);
sPymbed 17:ff9d1e86ad5f 2770
sPymbed 17:ff9d1e86ad5f 2771 /* support for depricated old name */
sPymbed 17:ff9d1e86ad5f 2772 #define WOLFSSL_ERR_remove_thread_state wolfSSL_ERR_remove_thread_state
sPymbed 17:ff9d1e86ad5f 2773
sPymbed 17:ff9d1e86ad5f 2774 #ifndef NO_FILESYSTEM
sPymbed 17:ff9d1e86ad5f 2775 WOLFSSL_API void wolfSSL_print_all_errors_fp(XFILE *fp);
sPymbed 17:ff9d1e86ad5f 2776 #endif
sPymbed 17:ff9d1e86ad5f 2777
sPymbed 17:ff9d1e86ad5f 2778 WOLFSSL_API void wolfSSL_THREADID_set_callback(void (*threadid_func)(void*));
sPymbed 17:ff9d1e86ad5f 2779
sPymbed 17:ff9d1e86ad5f 2780 WOLFSSL_API void wolfSSL_THREADID_set_numeric(void* id, unsigned long val);
sPymbed 17:ff9d1e86ad5f 2781
sPymbed 17:ff9d1e86ad5f 2782 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_X509)* wolfSSL_X509_STORE_get1_certs(
sPymbed 17:ff9d1e86ad5f 2783 WOLFSSL_X509_STORE_CTX*, WOLFSSL_X509_NAME*);
sPymbed 17:ff9d1e86ad5f 2784
sPymbed 17:ff9d1e86ad5f 2785 WOLFSSL_API void wolfSSL_sk_X509_pop_free(WOLF_STACK_OF(WOLFSSL_X509)* sk, void f (WOLFSSL_X509*));
sPymbed 17:ff9d1e86ad5f 2786 #endif /* OPENSSL_ALL || HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY || HAVE_LIGHTY */
sPymbed 17:ff9d1e86ad5f 2787
sPymbed 17:ff9d1e86ad5f 2788 #if defined(OPENSSL_ALL) || \
sPymbed 17:ff9d1e86ad5f 2789 defined(HAVE_STUNNEL) || defined(WOLFSSL_MYSQL_COMPATIBLE) || \
sPymbed 17:ff9d1e86ad5f 2790 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2791
sPymbed 17:ff9d1e86ad5f 2792 WOLFSSL_API int wolfSSL_CTX_get_verify_mode(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2793
sPymbed 17:ff9d1e86ad5f 2794 #endif
sPymbed 17:ff9d1e86ad5f 2795
sPymbed 17:ff9d1e86ad5f 2796 #ifdef WOLFSSL_JNI
sPymbed 17:ff9d1e86ad5f 2797 WOLFSSL_API int wolfSSL_set_jobject(WOLFSSL* ssl, void* objPtr);
sPymbed 17:ff9d1e86ad5f 2798 WOLFSSL_API void* wolfSSL_get_jobject(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2799 #endif /* WOLFSSL_JNI */
sPymbed 17:ff9d1e86ad5f 2800
sPymbed 17:ff9d1e86ad5f 2801
sPymbed 17:ff9d1e86ad5f 2802 #ifdef WOLFSSL_ASYNC_CRYPT
sPymbed 17:ff9d1e86ad5f 2803 WOLFSSL_API int wolfSSL_AsyncPoll(WOLFSSL* ssl, WOLF_EVENT_FLAG flags);
sPymbed 17:ff9d1e86ad5f 2804 WOLFSSL_API int wolfSSL_CTX_AsyncPoll(WOLFSSL_CTX* ctx, WOLF_EVENT** events, int maxEvents,
sPymbed 17:ff9d1e86ad5f 2805 WOLF_EVENT_FLAG flags, int* eventCount);
sPymbed 17:ff9d1e86ad5f 2806 #endif /* WOLFSSL_ASYNC_CRYPT */
sPymbed 17:ff9d1e86ad5f 2807
sPymbed 17:ff9d1e86ad5f 2808 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 2809 WOLFSSL_API int wolfSSL_CTX_set1_curves_list(WOLFSSL_CTX* ctx, char* names);
sPymbed 17:ff9d1e86ad5f 2810
sPymbed 17:ff9d1e86ad5f 2811 typedef void (*SSL_Msg_Cb)(int write_p, int version, int content_type,
sPymbed 17:ff9d1e86ad5f 2812 const void *buf, size_t len, WOLFSSL *ssl, void *arg);
sPymbed 17:ff9d1e86ad5f 2813
sPymbed 17:ff9d1e86ad5f 2814 WOLFSSL_API int wolfSSL_CTX_set_msg_callback(WOLFSSL_CTX *ctx, SSL_Msg_Cb cb);
sPymbed 17:ff9d1e86ad5f 2815 WOLFSSL_API int wolfSSL_set_msg_callback(WOLFSSL *ssl, SSL_Msg_Cb cb);
sPymbed 17:ff9d1e86ad5f 2816 WOLFSSL_API int wolfSSL_CTX_set_msg_callback_arg(WOLFSSL_CTX *ctx, void* arg);
sPymbed 17:ff9d1e86ad5f 2817 WOLFSSL_API int wolfSSL_set_msg_callback_arg(WOLFSSL *ssl, void* arg);
sPymbed 17:ff9d1e86ad5f 2818 WOLFSSL_API unsigned long wolfSSL_ERR_peek_error_line_data(const char **file,
sPymbed 17:ff9d1e86ad5f 2819 int *line, const char **data, int *flags);
sPymbed 17:ff9d1e86ad5f 2820 WOLFSSL_API int wolfSSL_CTX_set_alpn_protos(WOLFSSL_CTX *ctx,
sPymbed 17:ff9d1e86ad5f 2821 const unsigned char *protos, unsigned int protos_len);
sPymbed 17:ff9d1e86ad5f 2822 WOLFSSL_API void *wolfSSL_OPENSSL_memdup(const void *data,
sPymbed 17:ff9d1e86ad5f 2823 size_t siz, const char* file, int line);
sPymbed 17:ff9d1e86ad5f 2824 WOLFSSL_API void wolfSSL_ERR_load_BIO_strings(void);
sPymbed 17:ff9d1e86ad5f 2825 #endif
sPymbed 17:ff9d1e86ad5f 2826
sPymbed 17:ff9d1e86ad5f 2827 #if defined(OPENSSL_ALL) \
sPymbed 17:ff9d1e86ad5f 2828 || defined(WOLFSSL_NGINX) \
sPymbed 17:ff9d1e86ad5f 2829 || defined(WOLFSSL_HAPROXY) \
sPymbed 17:ff9d1e86ad5f 2830 || defined(OPENSSL_EXTRA)
sPymbed 17:ff9d1e86ad5f 2831 WOLFSSL_API void wolfSSL_OPENSSL_config(char *config_name);
sPymbed 17:ff9d1e86ad5f 2832 #endif
sPymbed 17:ff9d1e86ad5f 2833
sPymbed 17:ff9d1e86ad5f 2834 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2835 /* Not an OpenSSL API. */
sPymbed 17:ff9d1e86ad5f 2836 WOLFSSL_LOCAL int wolfSSL_get_ocsp_response(WOLFSSL* ssl, byte** response);
sPymbed 17:ff9d1e86ad5f 2837 /* Not an OpenSSL API. */
sPymbed 17:ff9d1e86ad5f 2838 WOLFSSL_LOCAL char* wolfSSL_get_ocsp_url(WOLFSSL* ssl);
sPymbed 17:ff9d1e86ad5f 2839 /* Not an OpenSSL API. */
sPymbed 17:ff9d1e86ad5f 2840 WOLFSSL_API int wolfSSL_set_ocsp_url(WOLFSSL* ssl, char* url);
sPymbed 17:ff9d1e86ad5f 2841 #endif
sPymbed 17:ff9d1e86ad5f 2842
sPymbed 17:ff9d1e86ad5f 2843 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) \
sPymbed 17:ff9d1e86ad5f 2844 || defined(OPENSSL_EXTRA) || defined(HAVE_LIGHTY)
sPymbed 17:ff9d1e86ad5f 2845 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_CIPHER) *wolfSSL_get_ciphers_compat(const WOLFSSL *ssl);
sPymbed 17:ff9d1e86ad5f 2846 WOLFSSL_API int wolfSSL_X509_get_ex_new_index(int idx, void *arg, void *a,
sPymbed 17:ff9d1e86ad5f 2847 void *b, void *c);
sPymbed 17:ff9d1e86ad5f 2848 WOLFSSL_API void *wolfSSL_X509_get_ex_data(WOLFSSL_X509 *x509, int idx);
sPymbed 17:ff9d1e86ad5f 2849 WOLFSSL_API int wolfSSL_X509_set_ex_data(WOLFSSL_X509 *x509, int idx,
sPymbed 17:ff9d1e86ad5f 2850 void *data);
sPymbed 17:ff9d1e86ad5f 2851
sPymbed 17:ff9d1e86ad5f 2852 WOLFSSL_API int wolfSSL_X509_NAME_digest(const WOLFSSL_X509_NAME *data,
sPymbed 17:ff9d1e86ad5f 2853 const WOLFSSL_EVP_MD *type, unsigned char *md, unsigned int *len);
sPymbed 17:ff9d1e86ad5f 2854
sPymbed 17:ff9d1e86ad5f 2855 WOLFSSL_API long wolfSSL_SSL_CTX_get_timeout(const WOLFSSL_CTX *ctx);
sPymbed 17:ff9d1e86ad5f 2856 WOLFSSL_API int wolfSSL_SSL_CTX_set_tmp_ecdh(WOLFSSL_CTX *ctx,
sPymbed 17:ff9d1e86ad5f 2857 WOLFSSL_EC_KEY *ecdh);
sPymbed 17:ff9d1e86ad5f 2858 WOLFSSL_API int wolfSSL_SSL_CTX_remove_session(WOLFSSL_CTX *,
sPymbed 17:ff9d1e86ad5f 2859 WOLFSSL_SESSION *c);
sPymbed 17:ff9d1e86ad5f 2860
sPymbed 17:ff9d1e86ad5f 2861 WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_rbio(const WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 2862 WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_wbio(const WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 2863 WOLFSSL_API int wolfSSL_SSL_do_handshake(WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 2864 WOLFSSL_API int wolfSSL_SSL_in_init(WOLFSSL *a); /* #define in OpenSSL */
sPymbed 17:ff9d1e86ad5f 2865 #ifndef NO_SESSION_CACHE
sPymbed 17:ff9d1e86ad5f 2866 WOLFSSL_API WOLFSSL_SESSION *wolfSSL_SSL_get0_session(const WOLFSSL *s);
sPymbed 17:ff9d1e86ad5f 2867 #endif
sPymbed 17:ff9d1e86ad5f 2868 WOLFSSL_API int wolfSSL_X509_check_host(WOLFSSL_X509 *x, const char *chk,
sPymbed 17:ff9d1e86ad5f 2869 size_t chklen, unsigned int flags, char **peername);
sPymbed 17:ff9d1e86ad5f 2870
sPymbed 17:ff9d1e86ad5f 2871 WOLFSSL_API int wolfSSL_i2a_ASN1_INTEGER(WOLFSSL_BIO *bp,
sPymbed 17:ff9d1e86ad5f 2872 const WOLFSSL_ASN1_INTEGER *a);
sPymbed 17:ff9d1e86ad5f 2873
sPymbed 17:ff9d1e86ad5f 2874 #ifdef HAVE_SESSION_TICKET
sPymbed 17:ff9d1e86ad5f 2875 WOLFSSL_API int wolfSSL_CTX_set_tlsext_ticket_key_cb(WOLFSSL_CTX *, int (*)(
sPymbed 17:ff9d1e86ad5f 2876 WOLFSSL *ssl, unsigned char *name, unsigned char *iv,
sPymbed 17:ff9d1e86ad5f 2877 WOLFSSL_EVP_CIPHER_CTX *ectx, WOLFSSL_HMAC_CTX *hctx, int enc));
sPymbed 17:ff9d1e86ad5f 2878 #endif
sPymbed 17:ff9d1e86ad5f 2879
sPymbed 17:ff9d1e86ad5f 2880 #if defined(HAVE_OCSP) || defined(OPENSSL_EXTRA) || defined(OPENSSL_ALL) || \
sPymbed 17:ff9d1e86ad5f 2881 defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2882 WOLFSSL_API int wolfSSL_CTX_get_extra_chain_certs(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2883 WOLF_STACK_OF(X509)** chain);
sPymbed 17:ff9d1e86ad5f 2884 WOLFSSL_API int wolfSSL_CTX_set_tlsext_status_cb(WOLFSSL_CTX* ctx,
sPymbed 17:ff9d1e86ad5f 2885 int(*)(WOLFSSL*, void*));
sPymbed 17:ff9d1e86ad5f 2886
sPymbed 17:ff9d1e86ad5f 2887 WOLFSSL_API int wolfSSL_X509_STORE_CTX_get1_issuer(WOLFSSL_X509 **issuer,
sPymbed 17:ff9d1e86ad5f 2888 WOLFSSL_X509_STORE_CTX *ctx, WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2889
sPymbed 17:ff9d1e86ad5f 2890 WOLFSSL_API void wolfSSL_X509_email_free(WOLF_STACK_OF(WOLFSSL_STRING) *sk);
sPymbed 17:ff9d1e86ad5f 2891 WOLFSSL_API WOLF_STACK_OF(WOLFSSL_STRING) *wolfSSL_X509_get1_ocsp(WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2892
sPymbed 17:ff9d1e86ad5f 2893 WOLFSSL_API int wolfSSL_X509_check_issued(WOLFSSL_X509 *issuer,
sPymbed 17:ff9d1e86ad5f 2894 WOLFSSL_X509 *subject);
sPymbed 17:ff9d1e86ad5f 2895
sPymbed 17:ff9d1e86ad5f 2896 WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_dup(WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2897
sPymbed 17:ff9d1e86ad5f 2898 WOLFSSL_API char* wolfSSL_sk_WOLFSSL_STRING_value(
sPymbed 17:ff9d1e86ad5f 2899 WOLF_STACK_OF(WOLFSSL_STRING)* strings, int idx);
sPymbed 17:ff9d1e86ad5f 2900 #endif /* HAVE_OCSP */
sPymbed 17:ff9d1e86ad5f 2901
sPymbed 17:ff9d1e86ad5f 2902 WOLFSSL_API int PEM_write_bio_WOLFSSL_X509(WOLFSSL_BIO *bio,
sPymbed 17:ff9d1e86ad5f 2903 WOLFSSL_X509 *cert);
sPymbed 17:ff9d1e86ad5f 2904
sPymbed 17:ff9d1e86ad5f 2905 #endif /* OPENSSL_ALL || WOLFSSL_NGINX || WOLFSSL_HAPROXY ||
sPymbed 17:ff9d1e86ad5f 2906 OPENSSL_EXTRA || HAVE_LIGHTY*/
sPymbed 17:ff9d1e86ad5f 2907
sPymbed 17:ff9d1e86ad5f 2908 WOLFSSL_API void wolfSSL_get0_alpn_selected(const WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2909 const unsigned char **data, unsigned int *len);
sPymbed 17:ff9d1e86ad5f 2910 WOLFSSL_API int wolfSSL_select_next_proto(unsigned char **out,
sPymbed 17:ff9d1e86ad5f 2911 unsigned char *outlen,
sPymbed 17:ff9d1e86ad5f 2912 const unsigned char *in, unsigned int inlen,
sPymbed 17:ff9d1e86ad5f 2913 const unsigned char *client,
sPymbed 17:ff9d1e86ad5f 2914 unsigned int client_len);
sPymbed 17:ff9d1e86ad5f 2915 WOLFSSL_API void wolfSSL_CTX_set_alpn_select_cb(WOLFSSL_CTX *ctx,
sPymbed 17:ff9d1e86ad5f 2916 int (*cb) (WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2917 const unsigned char **out,
sPymbed 17:ff9d1e86ad5f 2918 unsigned char *outlen,
sPymbed 17:ff9d1e86ad5f 2919 const unsigned char *in,
sPymbed 17:ff9d1e86ad5f 2920 unsigned int inlen,
sPymbed 17:ff9d1e86ad5f 2921 void *arg), void *arg);
sPymbed 17:ff9d1e86ad5f 2922 WOLFSSL_API void wolfSSL_CTX_set_next_protos_advertised_cb(WOLFSSL_CTX *s,
sPymbed 17:ff9d1e86ad5f 2923 int (*cb) (WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2924 const unsigned char **out,
sPymbed 17:ff9d1e86ad5f 2925 unsigned int *outlen,
sPymbed 17:ff9d1e86ad5f 2926 void *arg), void *arg);
sPymbed 17:ff9d1e86ad5f 2927 WOLFSSL_API void wolfSSL_CTX_set_next_proto_select_cb(WOLFSSL_CTX *s,
sPymbed 17:ff9d1e86ad5f 2928 int (*cb) (WOLFSSL *ssl,
sPymbed 17:ff9d1e86ad5f 2929 unsigned char **out,
sPymbed 17:ff9d1e86ad5f 2930 unsigned char *outlen,
sPymbed 17:ff9d1e86ad5f 2931 const unsigned char *in,
sPymbed 17:ff9d1e86ad5f 2932 unsigned int inlen,
sPymbed 17:ff9d1e86ad5f 2933 void *arg), void *arg);
sPymbed 17:ff9d1e86ad5f 2934 WOLFSSL_API void wolfSSL_get0_next_proto_negotiated(const WOLFSSL *s, const unsigned char **data,
sPymbed 17:ff9d1e86ad5f 2935 unsigned *len);
sPymbed 17:ff9d1e86ad5f 2936
sPymbed 17:ff9d1e86ad5f 2937
sPymbed 17:ff9d1e86ad5f 2938 #ifdef OPENSSL_EXTRA
sPymbed 17:ff9d1e86ad5f 2939 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
sPymbed 17:ff9d1e86ad5f 2940 WOLFSSL_API const unsigned char *SSL_SESSION_get0_id_context(
sPymbed 17:ff9d1e86ad5f 2941 const WOLFSSL_SESSION *sess, unsigned int *sid_ctx_length);
sPymbed 17:ff9d1e86ad5f 2942 WOLFSSL_API size_t SSL_get_finished(const WOLFSSL *s, void *buf, size_t count);
sPymbed 17:ff9d1e86ad5f 2943 WOLFSSL_API size_t SSL_get_peer_finished(const WOLFSSL *s, void *buf, size_t count);
sPymbed 17:ff9d1e86ad5f 2944 #endif
sPymbed 17:ff9d1e86ad5f 2945
sPymbed 17:ff9d1e86ad5f 2946 WOLFSSL_API int SSL_SESSION_set1_id(WOLFSSL_SESSION *s, const unsigned char *sid, unsigned int sid_len);
sPymbed 17:ff9d1e86ad5f 2947 WOLFSSL_API int SSL_SESSION_set1_id_context(WOLFSSL_SESSION *s, const unsigned char *sid_ctx, unsigned int sid_ctx_len);
sPymbed 17:ff9d1e86ad5f 2948 WOLFSSL_API void *X509_get0_tbs_sigalg(const WOLFSSL_X509 *x);
sPymbed 17:ff9d1e86ad5f 2949 WOLFSSL_API void X509_ALGOR_get0(WOLFSSL_ASN1_OBJECT **paobj, int *pptype, const void **ppval, const void *algor);
sPymbed 17:ff9d1e86ad5f 2950 WOLFSSL_API void *X509_get_X509_PUBKEY(void * x);
sPymbed 17:ff9d1e86ad5f 2951 WOLFSSL_API int X509_PUBKEY_get0_param(WOLFSSL_ASN1_OBJECT **ppkalg, const unsigned char **pk, int *ppklen, void **pa, WOLFSSL_EVP_PKEY *pub);
sPymbed 17:ff9d1e86ad5f 2952 WOLFSSL_API int i2t_ASN1_OBJECT(char *buf, int buf_len, WOLFSSL_ASN1_OBJECT *a);
sPymbed 17:ff9d1e86ad5f 2953 WOLFSSL_API void SSL_CTX_set_tmp_dh_callback(WOLFSSL_CTX *ctx, WOLFSSL_DH *(*dh) (WOLFSSL *ssl, int is_export, int keylength));
sPymbed 17:ff9d1e86ad5f 2954 WOLFSSL_API WOLF_STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void);
sPymbed 17:ff9d1e86ad5f 2955 WOLFSSL_API int X509_STORE_load_locations(WOLFSSL_X509_STORE *ctx, const char *file, const char *dir);
sPymbed 17:ff9d1e86ad5f 2956 WOLFSSL_API int wolfSSL_X509_STORE_add_crl(WOLFSSL_X509_STORE *ctx, WOLFSSL_X509_CRL *x);
sPymbed 17:ff9d1e86ad5f 2957 WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_num(const void * p);
sPymbed 17:ff9d1e86ad5f 2958 WOLFSSL_API int wolfSSL_sk_SSL_COMP_zero(WOLFSSL_STACK* st);
sPymbed 17:ff9d1e86ad5f 2959 WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_sk_SSL_CIPHER_value(void *ciphers, int idx);
sPymbed 17:ff9d1e86ad5f 2960 WOLFSSL_API void ERR_load_SSL_strings(void);
sPymbed 17:ff9d1e86ad5f 2961 WOLFSSL_API void wolfSSL_EC_POINT_dump(const char *msg, const WOLFSSL_EC_POINT *p);
sPymbed 17:ff9d1e86ad5f 2962
sPymbed 17:ff9d1e86ad5f 2963 WOLFSSL_API const char *wolfSSL_ASN1_tag2str(int tag);
sPymbed 17:ff9d1e86ad5f 2964 WOLFSSL_API int wolfSSL_ASN1_STRING_print_ex(WOLFSSL_BIO *out, WOLFSSL_ASN1_STRING *str, unsigned long flags);
sPymbed 17:ff9d1e86ad5f 2965 WOLFSSL_API WOLFSSL_ASN1_TIME *wolfSSL_ASN1_TIME_to_generalizedtime(WOLFSSL_ASN1_TIME *t,
sPymbed 17:ff9d1e86ad5f 2966 WOLFSSL_ASN1_TIME **out);
sPymbed 17:ff9d1e86ad5f 2967 WOLFSSL_API int wolfSSL_i2c_ASN1_INTEGER(WOLFSSL_ASN1_INTEGER *a, unsigned char **pp);
sPymbed 17:ff9d1e86ad5f 2968 #endif /* OPENSSL_EXTRA */
sPymbed 17:ff9d1e86ad5f 2969
sPymbed 17:ff9d1e86ad5f 2970 #ifdef HAVE_PK_CALLBACKS
sPymbed 17:ff9d1e86ad5f 2971 WOLFSSL_API int wolfSSL_CTX_IsPrivatePkSet(WOLFSSL_CTX* ctx);
sPymbed 17:ff9d1e86ad5f 2972 #endif
sPymbed 17:ff9d1e86ad5f 2973
sPymbed 17:ff9d1e86ad5f 2974 #ifdef __cplusplus
sPymbed 17:ff9d1e86ad5f 2975 } /* extern "C" */
sPymbed 17:ff9d1e86ad5f 2976 #endif
sPymbed 17:ff9d1e86ad5f 2977
sPymbed 17:ff9d1e86ad5f 2978
sPymbed 17:ff9d1e86ad5f 2979 #endif /* WOLFSSL_SSL_H */
sPymbed 17:ff9d1e86ad5f 2980