wolfSSL 3.11.1 for TLS1.3 beta
Fork of wolfSSL by
wolfssl/ssl.h@11:cee25a834751, 2017-05-30 (annotated)
- Committer:
- wolfSSL
- Date:
- Tue May 30 01:44:10 2017 +0000
- Revision:
- 11:cee25a834751
wolfSSL 3.11.0
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
wolfSSL | 11:cee25a834751 | 1 | /* ssl.h |
wolfSSL | 11:cee25a834751 | 2 | * |
wolfSSL | 11:cee25a834751 | 3 | * Copyright (C) 2006-2016 wolfSSL Inc. |
wolfSSL | 11:cee25a834751 | 4 | * |
wolfSSL | 11:cee25a834751 | 5 | * This file is part of wolfSSL. |
wolfSSL | 11:cee25a834751 | 6 | * |
wolfSSL | 11:cee25a834751 | 7 | * wolfSSL is free software; you can redistribute it and/or modify |
wolfSSL | 11:cee25a834751 | 8 | * it under the terms of the GNU General Public License as published by |
wolfSSL | 11:cee25a834751 | 9 | * the Free Software Foundation; either version 2 of the License, or |
wolfSSL | 11:cee25a834751 | 10 | * (at your option) any later version. |
wolfSSL | 11:cee25a834751 | 11 | * |
wolfSSL | 11:cee25a834751 | 12 | * wolfSSL is distributed in the hope that it will be useful, |
wolfSSL | 11:cee25a834751 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
wolfSSL | 11:cee25a834751 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
wolfSSL | 11:cee25a834751 | 15 | * GNU General Public License for more details. |
wolfSSL | 11:cee25a834751 | 16 | * |
wolfSSL | 11:cee25a834751 | 17 | * You should have received a copy of the GNU General Public License |
wolfSSL | 11:cee25a834751 | 18 | * along with this program; if not, write to the Free Software |
wolfSSL | 11:cee25a834751 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA |
wolfSSL | 11:cee25a834751 | 20 | */ |
wolfSSL | 11:cee25a834751 | 21 | |
wolfSSL | 11:cee25a834751 | 22 | |
wolfSSL | 11:cee25a834751 | 23 | |
wolfSSL | 11:cee25a834751 | 24 | /* wolfSSL API */ |
wolfSSL | 11:cee25a834751 | 25 | |
wolfSSL | 11:cee25a834751 | 26 | #ifndef WOLFSSL_SSL_H |
wolfSSL | 11:cee25a834751 | 27 | #define WOLFSSL_SSL_H |
wolfSSL | 11:cee25a834751 | 28 | |
wolfSSL | 11:cee25a834751 | 29 | |
wolfSSL | 11:cee25a834751 | 30 | /* for users not using preprocessor flags*/ |
wolfSSL | 11:cee25a834751 | 31 | #include <wolfssl/wolfcrypt/settings.h> |
wolfSSL | 11:cee25a834751 | 32 | #include <wolfssl/version.h> |
wolfSSL | 11:cee25a834751 | 33 | |
wolfSSL | 11:cee25a834751 | 34 | #ifdef HAVE_WOLF_EVENT |
wolfSSL | 11:cee25a834751 | 35 | #include <wolfssl/wolfcrypt/wolfevent.h> |
wolfSSL | 11:cee25a834751 | 36 | #endif |
wolfSSL | 11:cee25a834751 | 37 | |
wolfSSL | 11:cee25a834751 | 38 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 39 | #if defined(FREESCALE_MQX) || defined(FREESCALE_KSDK_MQX) |
wolfSSL | 11:cee25a834751 | 40 | #if MQX_USE_IO_OLD |
wolfSSL | 11:cee25a834751 | 41 | #include <fio.h> |
wolfSSL | 11:cee25a834751 | 42 | #else |
wolfSSL | 11:cee25a834751 | 43 | #include <nio.h> |
wolfSSL | 11:cee25a834751 | 44 | #endif |
wolfSSL | 11:cee25a834751 | 45 | #endif |
wolfSSL | 11:cee25a834751 | 46 | #endif |
wolfSSL | 11:cee25a834751 | 47 | |
wolfSSL | 11:cee25a834751 | 48 | #ifdef WOLFSSL_PREFIX |
wolfSSL | 11:cee25a834751 | 49 | #include "prefix_ssl.h" |
wolfSSL | 11:cee25a834751 | 50 | #endif |
wolfSSL | 11:cee25a834751 | 51 | |
wolfSSL | 11:cee25a834751 | 52 | #ifdef LIBWOLFSSL_VERSION_STRING |
wolfSSL | 11:cee25a834751 | 53 | #define WOLFSSL_VERSION LIBWOLFSSL_VERSION_STRING |
wolfSSL | 11:cee25a834751 | 54 | #endif |
wolfSSL | 11:cee25a834751 | 55 | |
wolfSSL | 11:cee25a834751 | 56 | #ifdef _WIN32 |
wolfSSL | 11:cee25a834751 | 57 | /* wincrypt.h clashes */ |
wolfSSL | 11:cee25a834751 | 58 | #undef OCSP_REQUEST |
wolfSSL | 11:cee25a834751 | 59 | #undef OCSP_RESPONSE |
wolfSSL | 11:cee25a834751 | 60 | #endif |
wolfSSL | 11:cee25a834751 | 61 | |
wolfSSL | 11:cee25a834751 | 62 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 63 | #include <wolfssl/openssl/bn.h> |
wolfSSL | 11:cee25a834751 | 64 | #include <wolfssl/openssl/hmac.h> |
wolfSSL | 11:cee25a834751 | 65 | #endif |
wolfSSL | 11:cee25a834751 | 66 | |
wolfSSL | 11:cee25a834751 | 67 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 68 | extern "C" { |
wolfSSL | 11:cee25a834751 | 69 | #endif |
wolfSSL | 11:cee25a834751 | 70 | |
wolfSSL | 11:cee25a834751 | 71 | typedef struct WOLFSSL WOLFSSL; |
wolfSSL | 11:cee25a834751 | 72 | typedef struct WOLFSSL_SESSION WOLFSSL_SESSION; |
wolfSSL | 11:cee25a834751 | 73 | typedef struct WOLFSSL_METHOD WOLFSSL_METHOD; |
wolfSSL | 11:cee25a834751 | 74 | typedef struct WOLFSSL_CTX WOLFSSL_CTX; |
wolfSSL | 11:cee25a834751 | 75 | |
wolfSSL | 11:cee25a834751 | 76 | typedef struct WOLFSSL_STACK WOLFSSL_STACK; |
wolfSSL | 11:cee25a834751 | 77 | typedef struct WOLFSSL_X509 WOLFSSL_X509; |
wolfSSL | 11:cee25a834751 | 78 | typedef struct WOLFSSL_X509_NAME WOLFSSL_X509_NAME; |
wolfSSL | 11:cee25a834751 | 79 | typedef struct WOLFSSL_X509_NAME_ENTRY WOLFSSL_X509_NAME_ENTRY; |
wolfSSL | 11:cee25a834751 | 80 | typedef struct WOLFSSL_X509_CHAIN WOLFSSL_X509_CHAIN; |
wolfSSL | 11:cee25a834751 | 81 | |
wolfSSL | 11:cee25a834751 | 82 | typedef struct WOLFSSL_CERT_MANAGER WOLFSSL_CERT_MANAGER; |
wolfSSL | 11:cee25a834751 | 83 | typedef struct WOLFSSL_SOCKADDR WOLFSSL_SOCKADDR; |
wolfSSL | 11:cee25a834751 | 84 | typedef struct WOLFSSL_CRL WOLFSSL_CRL; |
wolfSSL | 11:cee25a834751 | 85 | |
wolfSSL | 11:cee25a834751 | 86 | /* redeclare guard */ |
wolfSSL | 11:cee25a834751 | 87 | #define WOLFSSL_TYPES_DEFINED |
wolfSSL | 11:cee25a834751 | 88 | |
wolfSSL | 11:cee25a834751 | 89 | #include <wolfssl/io.h> |
wolfSSL | 11:cee25a834751 | 90 | |
wolfSSL | 11:cee25a834751 | 91 | |
wolfSSL | 11:cee25a834751 | 92 | #ifndef WOLFSSL_RSA_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 93 | typedef struct WOLFSSL_RSA WOLFSSL_RSA; |
wolfSSL | 11:cee25a834751 | 94 | #define WOLFSSL_RSA_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 95 | #endif |
wolfSSL | 11:cee25a834751 | 96 | |
wolfSSL | 11:cee25a834751 | 97 | #ifndef WC_RNG_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 98 | typedef struct WC_RNG WC_RNG; |
wolfSSL | 11:cee25a834751 | 99 | #define WC_RNG_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 100 | #endif |
wolfSSL | 11:cee25a834751 | 101 | |
wolfSSL | 11:cee25a834751 | 102 | #ifndef WOLFSSL_DSA_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 103 | typedef struct WOLFSSL_DSA WOLFSSL_DSA; |
wolfSSL | 11:cee25a834751 | 104 | #define WOLFSSL_DSA_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 105 | #endif |
wolfSSL | 11:cee25a834751 | 106 | |
wolfSSL | 11:cee25a834751 | 107 | #ifndef WOLFSSL_EC_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 108 | typedef struct WOLFSSL_EC_KEY WOLFSSL_EC_KEY; |
wolfSSL | 11:cee25a834751 | 109 | typedef struct WOLFSSL_EC_POINT WOLFSSL_EC_POINT; |
wolfSSL | 11:cee25a834751 | 110 | typedef struct WOLFSSL_EC_GROUP WOLFSSL_EC_GROUP; |
wolfSSL | 11:cee25a834751 | 111 | #define WOLFSSL_EC_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 112 | #endif |
wolfSSL | 11:cee25a834751 | 113 | |
wolfSSL | 11:cee25a834751 | 114 | #ifndef WOLFSSL_ECDSA_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 115 | typedef struct WOLFSSL_ECDSA_SIG WOLFSSL_ECDSA_SIG; |
wolfSSL | 11:cee25a834751 | 116 | #define WOLFSSL_ECDSA_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 117 | #endif |
wolfSSL | 11:cee25a834751 | 118 | |
wolfSSL | 11:cee25a834751 | 119 | typedef struct WOLFSSL_CIPHER WOLFSSL_CIPHER; |
wolfSSL | 11:cee25a834751 | 120 | typedef struct WOLFSSL_X509_LOOKUP WOLFSSL_X509_LOOKUP; |
wolfSSL | 11:cee25a834751 | 121 | typedef struct WOLFSSL_X509_LOOKUP_METHOD WOLFSSL_X509_LOOKUP_METHOD; |
wolfSSL | 11:cee25a834751 | 122 | typedef struct WOLFSSL_X509_CRL WOLFSSL_X509_CRL; |
wolfSSL | 11:cee25a834751 | 123 | typedef struct WOLFSSL_X509_STORE WOLFSSL_X509_STORE; |
wolfSSL | 11:cee25a834751 | 124 | typedef struct WOLFSSL_BIO WOLFSSL_BIO; |
wolfSSL | 11:cee25a834751 | 125 | typedef struct WOLFSSL_BIO_METHOD WOLFSSL_BIO_METHOD; |
wolfSSL | 11:cee25a834751 | 126 | typedef struct WOLFSSL_X509_EXTENSION WOLFSSL_X509_EXTENSION; |
wolfSSL | 11:cee25a834751 | 127 | typedef struct WOLFSSL_ASN1_TIME WOLFSSL_ASN1_TIME; |
wolfSSL | 11:cee25a834751 | 128 | typedef struct WOLFSSL_ASN1_INTEGER WOLFSSL_ASN1_INTEGER; |
wolfSSL | 11:cee25a834751 | 129 | typedef struct WOLFSSL_ASN1_OBJECT WOLFSSL_ASN1_OBJECT; |
wolfSSL | 11:cee25a834751 | 130 | |
wolfSSL | 11:cee25a834751 | 131 | typedef struct WOLFSSL_ASN1_STRING WOLFSSL_ASN1_STRING; |
wolfSSL | 11:cee25a834751 | 132 | typedef struct WOLFSSL_dynlock_value WOLFSSL_dynlock_value; |
wolfSSL | 11:cee25a834751 | 133 | typedef struct WOLFSSL_DH WOLFSSL_DH; |
wolfSSL | 11:cee25a834751 | 134 | typedef struct WOLFSSL_ASN1_BIT_STRING WOLFSSL_ASN1_BIT_STRING; |
wolfSSL | 11:cee25a834751 | 135 | typedef unsigned char* WOLFSSL_BUF_MEM; |
wolfSSL | 11:cee25a834751 | 136 | |
wolfSSL | 11:cee25a834751 | 137 | #define WOLFSSL_ASN1_UTCTIME WOLFSSL_ASN1_TIME |
wolfSSL | 11:cee25a834751 | 138 | #define WOLFSSL_ASN1_GENERALIZEDTIME WOLFSSL_ASN1_TIME |
wolfSSL | 11:cee25a834751 | 139 | |
wolfSSL | 11:cee25a834751 | 140 | struct WOLFSSL_ASN1_INTEGER { |
wolfSSL | 11:cee25a834751 | 141 | /* size can be increased set at 20 for tag, length then to hold at least 16 |
wolfSSL | 11:cee25a834751 | 142 | * byte type */ |
wolfSSL | 11:cee25a834751 | 143 | unsigned char data[20]; |
wolfSSL | 11:cee25a834751 | 144 | /* ASN_INTEGER | LENGTH | hex of number */ |
wolfSSL | 11:cee25a834751 | 145 | }; |
wolfSSL | 11:cee25a834751 | 146 | |
wolfSSL | 11:cee25a834751 | 147 | struct WOLFSSL_ASN1_TIME { |
wolfSSL | 11:cee25a834751 | 148 | /* MAX_DATA_SIZE is 32 */ |
wolfSSL | 11:cee25a834751 | 149 | unsigned char data[32 + 2]; |
wolfSSL | 11:cee25a834751 | 150 | /* ASN_TIME | LENGTH | date bytes */ |
wolfSSL | 11:cee25a834751 | 151 | }; |
wolfSSL | 11:cee25a834751 | 152 | |
wolfSSL | 11:cee25a834751 | 153 | #ifndef WOLFSSL_EVP_PKEY_TYPE_DEFINED /* guard on redeclaration */ |
wolfSSL | 11:cee25a834751 | 154 | typedef struct WOLFSSL_EVP_PKEY WOLFSSL_EVP_PKEY; |
wolfSSL | 11:cee25a834751 | 155 | #define WOLFSSL_EVP_PKEY_TYPE_DEFINED |
wolfSSL | 11:cee25a834751 | 156 | #endif |
wolfSSL | 11:cee25a834751 | 157 | |
wolfSSL | 11:cee25a834751 | 158 | typedef struct WOLFSSL_MD4_CTX { |
wolfSSL | 11:cee25a834751 | 159 | int buffer[32]; /* big enough to hold, check size in Init */ |
wolfSSL | 11:cee25a834751 | 160 | } WOLFSSL_MD4_CTX; |
wolfSSL | 11:cee25a834751 | 161 | |
wolfSSL | 11:cee25a834751 | 162 | |
wolfSSL | 11:cee25a834751 | 163 | typedef struct WOLFSSL_COMP_METHOD { |
wolfSSL | 11:cee25a834751 | 164 | int type; /* stunnel dereference */ |
wolfSSL | 11:cee25a834751 | 165 | } WOLFSSL_COMP_METHOD; |
wolfSSL | 11:cee25a834751 | 166 | |
wolfSSL | 11:cee25a834751 | 167 | struct WOLFSSL_X509_LOOKUP_METHOD { |
wolfSSL | 11:cee25a834751 | 168 | int type; |
wolfSSL | 11:cee25a834751 | 169 | }; |
wolfSSL | 11:cee25a834751 | 170 | |
wolfSSL | 11:cee25a834751 | 171 | struct WOLFSSL_X509_LOOKUP { |
wolfSSL | 11:cee25a834751 | 172 | WOLFSSL_X509_STORE *store; |
wolfSSL | 11:cee25a834751 | 173 | }; |
wolfSSL | 11:cee25a834751 | 174 | |
wolfSSL | 11:cee25a834751 | 175 | struct WOLFSSL_X509_STORE { |
wolfSSL | 11:cee25a834751 | 176 | int cache; /* stunnel dereference */ |
wolfSSL | 11:cee25a834751 | 177 | WOLFSSL_CERT_MANAGER* cm; |
wolfSSL | 11:cee25a834751 | 178 | WOLFSSL_X509_LOOKUP lookup; |
wolfSSL | 11:cee25a834751 | 179 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 180 | int isDynamic; |
wolfSSL | 11:cee25a834751 | 181 | #endif |
wolfSSL | 11:cee25a834751 | 182 | }; |
wolfSSL | 11:cee25a834751 | 183 | |
wolfSSL | 11:cee25a834751 | 184 | typedef struct WOLFSSL_ALERT { |
wolfSSL | 11:cee25a834751 | 185 | int code; |
wolfSSL | 11:cee25a834751 | 186 | int level; |
wolfSSL | 11:cee25a834751 | 187 | } WOLFSSL_ALERT; |
wolfSSL | 11:cee25a834751 | 188 | |
wolfSSL | 11:cee25a834751 | 189 | typedef struct WOLFSSL_ALERT_HISTORY { |
wolfSSL | 11:cee25a834751 | 190 | WOLFSSL_ALERT last_rx; |
wolfSSL | 11:cee25a834751 | 191 | WOLFSSL_ALERT last_tx; |
wolfSSL | 11:cee25a834751 | 192 | } WOLFSSL_ALERT_HISTORY; |
wolfSSL | 11:cee25a834751 | 193 | |
wolfSSL | 11:cee25a834751 | 194 | typedef struct WOLFSSL_X509_REVOKED { |
wolfSSL | 11:cee25a834751 | 195 | WOLFSSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */ |
wolfSSL | 11:cee25a834751 | 196 | } WOLFSSL_X509_REVOKED; |
wolfSSL | 11:cee25a834751 | 197 | |
wolfSSL | 11:cee25a834751 | 198 | |
wolfSSL | 11:cee25a834751 | 199 | typedef struct WOLFSSL_X509_OBJECT { |
wolfSSL | 11:cee25a834751 | 200 | union { |
wolfSSL | 11:cee25a834751 | 201 | char* ptr; |
wolfSSL | 11:cee25a834751 | 202 | WOLFSSL_X509 *x509; |
wolfSSL | 11:cee25a834751 | 203 | WOLFSSL_X509_CRL* crl; /* stunnel dereference */ |
wolfSSL | 11:cee25a834751 | 204 | } data; |
wolfSSL | 11:cee25a834751 | 205 | } WOLFSSL_X509_OBJECT; |
wolfSSL | 11:cee25a834751 | 206 | |
wolfSSL | 11:cee25a834751 | 207 | typedef struct WOLFSSL_BUFFER_INFO { |
wolfSSL | 11:cee25a834751 | 208 | unsigned char* buffer; |
wolfSSL | 11:cee25a834751 | 209 | unsigned int length; |
wolfSSL | 11:cee25a834751 | 210 | } WOLFSSL_BUFFER_INFO; |
wolfSSL | 11:cee25a834751 | 211 | |
wolfSSL | 11:cee25a834751 | 212 | typedef struct WOLFSSL_X509_STORE_CTX { |
wolfSSL | 11:cee25a834751 | 213 | WOLFSSL_X509_STORE* store; /* Store full of a CA cert chain */ |
wolfSSL | 11:cee25a834751 | 214 | WOLFSSL_X509* current_cert; /* stunnel dereference */ |
wolfSSL | 11:cee25a834751 | 215 | WOLFSSL_STACK* chain; |
wolfSSL | 11:cee25a834751 | 216 | char* domain; /* subject CN domain name */ |
wolfSSL | 11:cee25a834751 | 217 | void* ex_data; /* external data, for fortress build */ |
wolfSSL | 11:cee25a834751 | 218 | void* userCtx; /* user ctx */ |
wolfSSL | 11:cee25a834751 | 219 | int error; /* current error */ |
wolfSSL | 11:cee25a834751 | 220 | int error_depth; /* cert depth for this error */ |
wolfSSL | 11:cee25a834751 | 221 | int discardSessionCerts; /* so verify callback can flag for discard */ |
wolfSSL | 11:cee25a834751 | 222 | int totalCerts; /* number of peer cert buffers */ |
wolfSSL | 11:cee25a834751 | 223 | WOLFSSL_BUFFER_INFO* certs; /* peer certs */ |
wolfSSL | 11:cee25a834751 | 224 | } WOLFSSL_X509_STORE_CTX; |
wolfSSL | 11:cee25a834751 | 225 | |
wolfSSL | 11:cee25a834751 | 226 | typedef char* WOLFSSL_STRING; |
wolfSSL | 11:cee25a834751 | 227 | |
wolfSSL | 11:cee25a834751 | 228 | /* Valid Alert types from page 16/17 */ |
wolfSSL | 11:cee25a834751 | 229 | enum AlertDescription { |
wolfSSL | 11:cee25a834751 | 230 | close_notify = 0, |
wolfSSL | 11:cee25a834751 | 231 | unexpected_message = 10, |
wolfSSL | 11:cee25a834751 | 232 | bad_record_mac = 20, |
wolfSSL | 11:cee25a834751 | 233 | record_overflow = 22, |
wolfSSL | 11:cee25a834751 | 234 | decompression_failure = 30, |
wolfSSL | 11:cee25a834751 | 235 | handshake_failure = 40, |
wolfSSL | 11:cee25a834751 | 236 | no_certificate = 41, |
wolfSSL | 11:cee25a834751 | 237 | bad_certificate = 42, |
wolfSSL | 11:cee25a834751 | 238 | unsupported_certificate = 43, |
wolfSSL | 11:cee25a834751 | 239 | certificate_revoked = 44, |
wolfSSL | 11:cee25a834751 | 240 | certificate_expired = 45, |
wolfSSL | 11:cee25a834751 | 241 | certificate_unknown = 46, |
wolfSSL | 11:cee25a834751 | 242 | illegal_parameter = 47, |
wolfSSL | 11:cee25a834751 | 243 | decode_error = 50, |
wolfSSL | 11:cee25a834751 | 244 | decrypt_error = 51, |
wolfSSL | 11:cee25a834751 | 245 | #ifdef WOLFSSL_MYSQL_COMPATIBLE |
wolfSSL | 11:cee25a834751 | 246 | /* catch name conflict for enum protocol with MYSQL build */ |
wolfSSL | 11:cee25a834751 | 247 | wc_protocol_version = 70, |
wolfSSL | 11:cee25a834751 | 248 | #else |
wolfSSL | 11:cee25a834751 | 249 | protocol_version = 70, |
wolfSSL | 11:cee25a834751 | 250 | #endif |
wolfSSL | 11:cee25a834751 | 251 | no_renegotiation = 100, |
wolfSSL | 11:cee25a834751 | 252 | unrecognized_name = 112, /**< RFC 6066, section 3 */ |
wolfSSL | 11:cee25a834751 | 253 | bad_certificate_status_response = 113, /**< RFC 6066, section 8 */ |
wolfSSL | 11:cee25a834751 | 254 | no_application_protocol = 120 |
wolfSSL | 11:cee25a834751 | 255 | }; |
wolfSSL | 11:cee25a834751 | 256 | |
wolfSSL | 11:cee25a834751 | 257 | |
wolfSSL | 11:cee25a834751 | 258 | enum AlertLevel { |
wolfSSL | 11:cee25a834751 | 259 | alert_warning = 1, |
wolfSSL | 11:cee25a834751 | 260 | alert_fatal = 2 |
wolfSSL | 11:cee25a834751 | 261 | }; |
wolfSSL | 11:cee25a834751 | 262 | |
wolfSSL | 11:cee25a834751 | 263 | |
wolfSSL | 11:cee25a834751 | 264 | typedef WOLFSSL_METHOD* (*wolfSSL_method_func)(void* heap); |
wolfSSL | 11:cee25a834751 | 265 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 266 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 267 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 268 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 269 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 270 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 271 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 272 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 273 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 274 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 275 | |
wolfSSL | 11:cee25a834751 | 276 | #ifdef WOLFSSL_DTLS |
wolfSSL | 11:cee25a834751 | 277 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 278 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 279 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 280 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 281 | #endif |
wolfSSL | 11:cee25a834751 | 282 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_method(void); |
wolfSSL | 11:cee25a834751 | 283 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_server_method(void); |
wolfSSL | 11:cee25a834751 | 284 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv3_client_method(void); |
wolfSSL | 11:cee25a834751 | 285 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_server_method(void); |
wolfSSL | 11:cee25a834751 | 286 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_client_method(void); |
wolfSSL | 11:cee25a834751 | 287 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_server_method(void); |
wolfSSL | 11:cee25a834751 | 288 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_1_client_method(void); |
wolfSSL | 11:cee25a834751 | 289 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_server_method(void); |
wolfSSL | 11:cee25a834751 | 290 | WOLFSSL_API WOLFSSL_METHOD *wolfTLSv1_2_client_method(void); |
wolfSSL | 11:cee25a834751 | 291 | |
wolfSSL | 11:cee25a834751 | 292 | #ifdef WOLFSSL_DTLS |
wolfSSL | 11:cee25a834751 | 293 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_client_method(void); |
wolfSSL | 11:cee25a834751 | 294 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_server_method(void); |
wolfSSL | 11:cee25a834751 | 295 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_client_method(void); |
wolfSSL | 11:cee25a834751 | 296 | WOLFSSL_API WOLFSSL_METHOD *wolfDTLSv1_2_server_method(void); |
wolfSSL | 11:cee25a834751 | 297 | #endif |
wolfSSL | 11:cee25a834751 | 298 | |
wolfSSL | 11:cee25a834751 | 299 | #ifdef HAVE_POLY1305 |
wolfSSL | 11:cee25a834751 | 300 | WOLFSSL_API int wolfSSL_use_old_poly(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 301 | #endif |
wolfSSL | 11:cee25a834751 | 302 | |
wolfSSL | 11:cee25a834751 | 303 | #ifdef WOLFSSL_SESSION_EXPORT |
wolfSSL | 11:cee25a834751 | 304 | #ifdef WOLFSSL_DTLS |
wolfSSL | 11:cee25a834751 | 305 | typedef int (*wc_dtls_export)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 306 | unsigned char* exportBuffer, unsigned int sz, void* userCtx); |
wolfSSL | 11:cee25a834751 | 307 | WOLFSSL_API int wolfSSL_dtls_import(WOLFSSL* ssl, unsigned char* buf, |
wolfSSL | 11:cee25a834751 | 308 | unsigned int sz); |
wolfSSL | 11:cee25a834751 | 309 | WOLFSSL_API int wolfSSL_CTX_dtls_set_export(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 310 | wc_dtls_export func); |
wolfSSL | 11:cee25a834751 | 311 | WOLFSSL_API int wolfSSL_dtls_set_export(WOLFSSL* ssl, wc_dtls_export func); |
wolfSSL | 11:cee25a834751 | 312 | WOLFSSL_API int wolfSSL_dtls_export(WOLFSSL* ssl, unsigned char* buf, |
wolfSSL | 11:cee25a834751 | 313 | unsigned int* sz); |
wolfSSL | 11:cee25a834751 | 314 | #endif /* WOLFSSL_DTLS */ |
wolfSSL | 11:cee25a834751 | 315 | #endif /* WOLFSSL_SESSION_EXPORT */ |
wolfSSL | 11:cee25a834751 | 316 | |
wolfSSL | 11:cee25a834751 | 317 | #ifdef WOLFSSL_STATIC_MEMORY |
wolfSSL | 11:cee25a834751 | 318 | #ifndef WOLFSSL_MEM_GUARD |
wolfSSL | 11:cee25a834751 | 319 | #define WOLFSSL_MEM_GUARD |
wolfSSL | 11:cee25a834751 | 320 | typedef struct WOLFSSL_MEM_STATS WOLFSSL_MEM_STATS; |
wolfSSL | 11:cee25a834751 | 321 | typedef struct WOLFSSL_MEM_CONN_STATS WOLFSSL_MEM_CONN_STATS; |
wolfSSL | 11:cee25a834751 | 322 | #endif |
wolfSSL | 11:cee25a834751 | 323 | WOLFSSL_API int wolfSSL_CTX_load_static_memory(WOLFSSL_CTX** ctx, |
wolfSSL | 11:cee25a834751 | 324 | wolfSSL_method_func method, |
wolfSSL | 11:cee25a834751 | 325 | unsigned char* buf, unsigned int sz, |
wolfSSL | 11:cee25a834751 | 326 | int flag, int max); |
wolfSSL | 11:cee25a834751 | 327 | WOLFSSL_API int wolfSSL_CTX_is_static_memory(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 328 | WOLFSSL_MEM_STATS* mem_stats); |
wolfSSL | 11:cee25a834751 | 329 | WOLFSSL_API int wolfSSL_is_static_memory(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 330 | WOLFSSL_MEM_CONN_STATS* mem_stats); |
wolfSSL | 11:cee25a834751 | 331 | #endif |
wolfSSL | 11:cee25a834751 | 332 | |
wolfSSL | 11:cee25a834751 | 333 | #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) |
wolfSSL | 11:cee25a834751 | 334 | |
wolfSSL | 11:cee25a834751 | 335 | WOLFSSL_API int wolfSSL_CTX_use_certificate_file(WOLFSSL_CTX*, const char*, int); |
wolfSSL | 11:cee25a834751 | 336 | WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_file(WOLFSSL_CTX*, const char*, int); |
wolfSSL | 11:cee25a834751 | 337 | WOLFSSL_API int wolfSSL_CTX_load_verify_locations(WOLFSSL_CTX*, const char*, |
wolfSSL | 11:cee25a834751 | 338 | const char*); |
wolfSSL | 11:cee25a834751 | 339 | #ifdef WOLFSSL_TRUST_PEER_CERT |
wolfSSL | 11:cee25a834751 | 340 | WOLFSSL_API int wolfSSL_CTX_trust_peer_cert(WOLFSSL_CTX*, const char*, int); |
wolfSSL | 11:cee25a834751 | 341 | #endif |
wolfSSL | 11:cee25a834751 | 342 | WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_file(WOLFSSL_CTX *, |
wolfSSL | 11:cee25a834751 | 343 | const char *file); |
wolfSSL | 11:cee25a834751 | 344 | WOLFSSL_API int wolfSSL_CTX_use_RSAPrivateKey_file(WOLFSSL_CTX*, const char*, int); |
wolfSSL | 11:cee25a834751 | 345 | |
wolfSSL | 11:cee25a834751 | 346 | WOLFSSL_API long wolfSSL_get_verify_depth(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 347 | WOLFSSL_API long wolfSSL_CTX_get_verify_depth(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 348 | WOLFSSL_API int wolfSSL_use_certificate_file(WOLFSSL*, const char*, int); |
wolfSSL | 11:cee25a834751 | 349 | WOLFSSL_API int wolfSSL_use_PrivateKey_file(WOLFSSL*, const char*, int); |
wolfSSL | 11:cee25a834751 | 350 | WOLFSSL_API int wolfSSL_use_certificate_chain_file(WOLFSSL*, const char *file); |
wolfSSL | 11:cee25a834751 | 351 | WOLFSSL_API int wolfSSL_use_RSAPrivateKey_file(WOLFSSL*, const char*, int); |
wolfSSL | 11:cee25a834751 | 352 | |
wolfSSL | 11:cee25a834751 | 353 | #ifdef WOLFSSL_DER_LOAD |
wolfSSL | 11:cee25a834751 | 354 | WOLFSSL_API int wolfSSL_CTX_der_load_verify_locations(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 355 | const char*, int); |
wolfSSL | 11:cee25a834751 | 356 | #endif |
wolfSSL | 11:cee25a834751 | 357 | |
wolfSSL | 11:cee25a834751 | 358 | #ifdef HAVE_NTRU |
wolfSSL | 11:cee25a834751 | 359 | WOLFSSL_API int wolfSSL_CTX_use_NTRUPrivateKey_file(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 360 | /* load NTRU private key blob */ |
wolfSSL | 11:cee25a834751 | 361 | #endif |
wolfSSL | 11:cee25a834751 | 362 | |
wolfSSL | 11:cee25a834751 | 363 | #ifndef WOLFSSL_PEMCERT_TODER_DEFINED |
wolfSSL | 11:cee25a834751 | 364 | WOLFSSL_API int wolfSSL_PemCertToDer(const char*, unsigned char*, int); |
wolfSSL | 11:cee25a834751 | 365 | #define WOLFSSL_PEMCERT_TODER_DEFINED |
wolfSSL | 11:cee25a834751 | 366 | #endif |
wolfSSL | 11:cee25a834751 | 367 | |
wolfSSL | 11:cee25a834751 | 368 | #endif /* !NO_FILESYSTEM && !NO_CERTS */ |
wolfSSL | 11:cee25a834751 | 369 | |
wolfSSL | 11:cee25a834751 | 370 | WOLFSSL_API WOLFSSL_CTX* wolfSSL_CTX_new(WOLFSSL_METHOD*); |
wolfSSL | 11:cee25a834751 | 371 | WOLFSSL_API WOLFSSL* wolfSSL_new(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 372 | WOLFSSL_API WOLFSSL* wolfSSL_write_dup(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 373 | WOLFSSL_API int wolfSSL_set_fd (WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 374 | WOLFSSL_API int wolfSSL_set_write_fd (WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 375 | WOLFSSL_API int wolfSSL_set_read_fd (WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 376 | WOLFSSL_API char* wolfSSL_get_cipher_list(int priority); |
wolfSSL | 11:cee25a834751 | 377 | WOLFSSL_API int wolfSSL_get_ciphers(char*, int); |
wolfSSL | 11:cee25a834751 | 378 | WOLFSSL_API const char* wolfSSL_get_cipher_name(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 379 | WOLFSSL_API const char* wolfSSL_get_shared_ciphers(WOLFSSL* ssl, char* buf, |
wolfSSL | 11:cee25a834751 | 380 | int len); |
wolfSSL | 11:cee25a834751 | 381 | WOLFSSL_API const char* wolfSSL_get_curve_name(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 382 | WOLFSSL_API int wolfSSL_get_fd(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 383 | WOLFSSL_API void wolfSSL_set_using_nonblock(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 384 | WOLFSSL_API int wolfSSL_get_using_nonblock(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 385 | WOLFSSL_API int wolfSSL_connect(WOLFSSL*); /* please see note at top of README |
wolfSSL | 11:cee25a834751 | 386 | if you get an error from connect */ |
wolfSSL | 11:cee25a834751 | 387 | WOLFSSL_API int wolfSSL_write(WOLFSSL*, const void*, int); |
wolfSSL | 11:cee25a834751 | 388 | WOLFSSL_API int wolfSSL_read(WOLFSSL*, void*, int); |
wolfSSL | 11:cee25a834751 | 389 | WOLFSSL_API int wolfSSL_peek(WOLFSSL*, void*, int); |
wolfSSL | 11:cee25a834751 | 390 | WOLFSSL_API int wolfSSL_accept(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 391 | WOLFSSL_API void wolfSSL_CTX_free(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 392 | WOLFSSL_API void wolfSSL_free(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 393 | WOLFSSL_API int wolfSSL_shutdown(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 394 | WOLFSSL_API int wolfSSL_send(WOLFSSL*, const void*, int sz, int flags); |
wolfSSL | 11:cee25a834751 | 395 | WOLFSSL_API int wolfSSL_recv(WOLFSSL*, void*, int sz, int flags); |
wolfSSL | 11:cee25a834751 | 396 | |
wolfSSL | 11:cee25a834751 | 397 | WOLFSSL_API void wolfSSL_CTX_set_quiet_shutdown(WOLFSSL_CTX*, int); |
wolfSSL | 11:cee25a834751 | 398 | WOLFSSL_API void wolfSSL_set_quiet_shutdown(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 399 | |
wolfSSL | 11:cee25a834751 | 400 | WOLFSSL_API int wolfSSL_get_error(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 401 | WOLFSSL_API int wolfSSL_get_alert_history(WOLFSSL*, WOLFSSL_ALERT_HISTORY *); |
wolfSSL | 11:cee25a834751 | 402 | |
wolfSSL | 11:cee25a834751 | 403 | WOLFSSL_API int wolfSSL_set_session(WOLFSSL* ssl,WOLFSSL_SESSION* session); |
wolfSSL | 11:cee25a834751 | 404 | WOLFSSL_API long wolfSSL_SSL_SESSION_set_timeout(WOLFSSL_SESSION* session, long t); |
wolfSSL | 11:cee25a834751 | 405 | WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get_session(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 406 | WOLFSSL_API void wolfSSL_flush_sessions(WOLFSSL_CTX *ctx, long tm); |
wolfSSL | 11:cee25a834751 | 407 | WOLFSSL_API int wolfSSL_SetServerID(WOLFSSL* ssl, const unsigned char*, |
wolfSSL | 11:cee25a834751 | 408 | int, int); |
wolfSSL | 11:cee25a834751 | 409 | |
wolfSSL | 11:cee25a834751 | 410 | #ifdef SESSION_INDEX |
wolfSSL | 11:cee25a834751 | 411 | WOLFSSL_API int wolfSSL_GetSessionIndex(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 412 | WOLFSSL_API int wolfSSL_GetSessionAtIndex(int index, WOLFSSL_SESSION* session); |
wolfSSL | 11:cee25a834751 | 413 | #endif /* SESSION_INDEX */ |
wolfSSL | 11:cee25a834751 | 414 | |
wolfSSL | 11:cee25a834751 | 415 | #if defined(SESSION_INDEX) && defined(SESSION_CERTS) |
wolfSSL | 11:cee25a834751 | 416 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 417 | WOLFSSL_X509_CHAIN* wolfSSL_SESSION_get_peer_chain(WOLFSSL_SESSION* session); |
wolfSSL | 11:cee25a834751 | 418 | #endif /* SESSION_INDEX && SESSION_CERTS */ |
wolfSSL | 11:cee25a834751 | 419 | |
wolfSSL | 11:cee25a834751 | 420 | typedef int (*VerifyCallback)(int, WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 421 | typedef int (pem_password_cb)(char*, int, int, void*); |
wolfSSL | 11:cee25a834751 | 422 | |
wolfSSL | 11:cee25a834751 | 423 | WOLFSSL_API void wolfSSL_CTX_set_verify(WOLFSSL_CTX*, int, |
wolfSSL | 11:cee25a834751 | 424 | VerifyCallback verify_callback); |
wolfSSL | 11:cee25a834751 | 425 | WOLFSSL_API void wolfSSL_set_verify(WOLFSSL*, int, VerifyCallback verify_callback); |
wolfSSL | 11:cee25a834751 | 426 | WOLFSSL_API void wolfSSL_SetCertCbCtx(WOLFSSL*, void*); |
wolfSSL | 11:cee25a834751 | 427 | |
wolfSSL | 11:cee25a834751 | 428 | WOLFSSL_API int wolfSSL_pending(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 429 | |
wolfSSL | 11:cee25a834751 | 430 | WOLFSSL_API void wolfSSL_load_error_strings(void); |
wolfSSL | 11:cee25a834751 | 431 | WOLFSSL_API int wolfSSL_library_init(void); |
wolfSSL | 11:cee25a834751 | 432 | WOLFSSL_API long wolfSSL_CTX_set_session_cache_mode(WOLFSSL_CTX*, long); |
wolfSSL | 11:cee25a834751 | 433 | |
wolfSSL | 11:cee25a834751 | 434 | #ifdef HAVE_SECRET_CALLBACK |
wolfSSL | 11:cee25a834751 | 435 | typedef int (*SessionSecretCb)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 436 | void* secret, int* secretSz, void* ctx); |
wolfSSL | 11:cee25a834751 | 437 | WOLFSSL_API int wolfSSL_set_session_secret_cb(WOLFSSL*, SessionSecretCb, void*); |
wolfSSL | 11:cee25a834751 | 438 | #endif /* HAVE_SECRET_CALLBACK */ |
wolfSSL | 11:cee25a834751 | 439 | |
wolfSSL | 11:cee25a834751 | 440 | /* session cache persistence */ |
wolfSSL | 11:cee25a834751 | 441 | WOLFSSL_API int wolfSSL_save_session_cache(const char*); |
wolfSSL | 11:cee25a834751 | 442 | WOLFSSL_API int wolfSSL_restore_session_cache(const char*); |
wolfSSL | 11:cee25a834751 | 443 | WOLFSSL_API int wolfSSL_memsave_session_cache(void*, int); |
wolfSSL | 11:cee25a834751 | 444 | WOLFSSL_API int wolfSSL_memrestore_session_cache(const void*, int); |
wolfSSL | 11:cee25a834751 | 445 | WOLFSSL_API int wolfSSL_get_session_cache_memsize(void); |
wolfSSL | 11:cee25a834751 | 446 | |
wolfSSL | 11:cee25a834751 | 447 | /* certificate cache persistence, uses ctx since certs are per ctx */ |
wolfSSL | 11:cee25a834751 | 448 | WOLFSSL_API int wolfSSL_CTX_save_cert_cache(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 449 | WOLFSSL_API int wolfSSL_CTX_restore_cert_cache(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 450 | WOLFSSL_API int wolfSSL_CTX_memsave_cert_cache(WOLFSSL_CTX*, void*, int, int*); |
wolfSSL | 11:cee25a834751 | 451 | WOLFSSL_API int wolfSSL_CTX_memrestore_cert_cache(WOLFSSL_CTX*, const void*, int); |
wolfSSL | 11:cee25a834751 | 452 | WOLFSSL_API int wolfSSL_CTX_get_cert_cache_memsize(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 453 | |
wolfSSL | 11:cee25a834751 | 454 | /* only supports full name from cipher_name[] delimited by : */ |
wolfSSL | 11:cee25a834751 | 455 | WOLFSSL_API int wolfSSL_CTX_set_cipher_list(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 456 | WOLFSSL_API int wolfSSL_set_cipher_list(WOLFSSL*, const char*); |
wolfSSL | 11:cee25a834751 | 457 | |
wolfSSL | 11:cee25a834751 | 458 | /* Nonblocking DTLS helper functions */ |
wolfSSL | 11:cee25a834751 | 459 | WOLFSSL_API int wolfSSL_dtls_get_current_timeout(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 460 | WOLFSSL_API int wolfSSL_dtls_set_timeout_init(WOLFSSL* ssl, int); |
wolfSSL | 11:cee25a834751 | 461 | WOLFSSL_API int wolfSSL_dtls_set_timeout_max(WOLFSSL* ssl, int); |
wolfSSL | 11:cee25a834751 | 462 | WOLFSSL_API int wolfSSL_dtls_got_timeout(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 463 | WOLFSSL_API int wolfSSL_dtls(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 464 | |
wolfSSL | 11:cee25a834751 | 465 | WOLFSSL_API int wolfSSL_dtls_set_peer(WOLFSSL*, void*, unsigned int); |
wolfSSL | 11:cee25a834751 | 466 | WOLFSSL_API int wolfSSL_dtls_get_peer(WOLFSSL*, void*, unsigned int*); |
wolfSSL | 11:cee25a834751 | 467 | |
wolfSSL | 11:cee25a834751 | 468 | WOLFSSL_API int wolfSSL_CTX_dtls_set_sctp(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 469 | WOLFSSL_API int wolfSSL_dtls_set_sctp(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 470 | WOLFSSL_API int wolfSSL_CTX_dtls_set_mtu(WOLFSSL_CTX*, unsigned short); |
wolfSSL | 11:cee25a834751 | 471 | WOLFSSL_API int wolfSSL_dtls_set_mtu(WOLFSSL*, unsigned short); |
wolfSSL | 11:cee25a834751 | 472 | |
wolfSSL | 11:cee25a834751 | 473 | WOLFSSL_API int wolfSSL_ERR_GET_REASON(unsigned long err); |
wolfSSL | 11:cee25a834751 | 474 | WOLFSSL_API char* wolfSSL_ERR_error_string(unsigned long,char*); |
wolfSSL | 11:cee25a834751 | 475 | WOLFSSL_API void wolfSSL_ERR_error_string_n(unsigned long e, char* buf, |
wolfSSL | 11:cee25a834751 | 476 | unsigned long sz); |
wolfSSL | 11:cee25a834751 | 477 | WOLFSSL_API const char* wolfSSL_ERR_reason_error_string(unsigned long); |
wolfSSL | 11:cee25a834751 | 478 | |
wolfSSL | 11:cee25a834751 | 479 | /* extras */ |
wolfSSL | 11:cee25a834751 | 480 | |
wolfSSL | 11:cee25a834751 | 481 | #define STACK_OF(x) WOLFSSL_STACK |
wolfSSL | 11:cee25a834751 | 482 | WOLFSSL_API int wolfSSL_sk_X509_push(STACK_OF(WOLFSSL_X509_NAME)* sk, |
wolfSSL | 11:cee25a834751 | 483 | WOLFSSL_X509* x509); |
wolfSSL | 11:cee25a834751 | 484 | WOLFSSL_API WOLFSSL_X509* wolfSSL_sk_X509_pop(STACK_OF(WOLFSSL_X509_NAME)* sk); |
wolfSSL | 11:cee25a834751 | 485 | WOLFSSL_API void wolfSSL_sk_X509_free(STACK_OF(WOLFSSL_X509_NAME)* sk); |
wolfSSL | 11:cee25a834751 | 486 | WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_ASN1_OBJECT_new(void); |
wolfSSL | 11:cee25a834751 | 487 | WOLFSSL_API void wolfSSL_ASN1_OBJECT_free(WOLFSSL_ASN1_OBJECT* obj); |
wolfSSL | 11:cee25a834751 | 488 | WOLFSSL_API int wolfSSL_sk_ASN1_OBJECT_push(STACK_OF(WOLFSSL_ASN1_OBJEXT)* sk, |
wolfSSL | 11:cee25a834751 | 489 | WOLFSSL_ASN1_OBJECT* obj); |
wolfSSL | 11:cee25a834751 | 490 | WOLFSSL_API WOLFSSL_ASN1_OBJECT* wolfSSL_sk_ASN1_OBJCET_pop( |
wolfSSL | 11:cee25a834751 | 491 | STACK_OF(WOLFSSL_ASN1_OBJECT)* sk); |
wolfSSL | 11:cee25a834751 | 492 | WOLFSSL_API void wolfSSL_sk_ASN1_OBJECT_free(STACK_OF(WOLFSSL_ASN1_OBJECT)* sk); |
wolfSSL | 11:cee25a834751 | 493 | WOLFSSL_API int wolfSSL_ASN1_STRING_to_UTF8(unsigned char **out, WOLFSSL_ASN1_STRING *in); |
wolfSSL | 11:cee25a834751 | 494 | |
wolfSSL | 11:cee25a834751 | 495 | WOLFSSL_API int wolfSSL_set_ex_data(WOLFSSL*, int, void*); |
wolfSSL | 11:cee25a834751 | 496 | WOLFSSL_API int wolfSSL_get_shutdown(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 497 | WOLFSSL_API int wolfSSL_set_rfd(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 498 | WOLFSSL_API int wolfSSL_set_wfd(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 499 | WOLFSSL_API void wolfSSL_set_shutdown(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 500 | WOLFSSL_API int wolfSSL_set_session_id_context(WOLFSSL*, const unsigned char*, |
wolfSSL | 11:cee25a834751 | 501 | unsigned int); |
wolfSSL | 11:cee25a834751 | 502 | WOLFSSL_API void wolfSSL_set_connect_state(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 503 | WOLFSSL_API void wolfSSL_set_accept_state(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 504 | WOLFSSL_API int wolfSSL_session_reused(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 505 | WOLFSSL_API void wolfSSL_SESSION_free(WOLFSSL_SESSION* session); |
wolfSSL | 11:cee25a834751 | 506 | WOLFSSL_API int wolfSSL_is_init_finished(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 507 | |
wolfSSL | 11:cee25a834751 | 508 | WOLFSSL_API const char* wolfSSL_get_version(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 509 | WOLFSSL_API int wolfSSL_get_current_cipher_suite(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 510 | WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_get_current_cipher(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 511 | WOLFSSL_API char* wolfSSL_CIPHER_description(const WOLFSSL_CIPHER*, char*, int); |
wolfSSL | 11:cee25a834751 | 512 | WOLFSSL_API const char* wolfSSL_CIPHER_get_name(const WOLFSSL_CIPHER* cipher); |
wolfSSL | 11:cee25a834751 | 513 | WOLFSSL_API const char* wolfSSL_SESSION_CIPHER_get_name(WOLFSSL_SESSION* session); |
wolfSSL | 11:cee25a834751 | 514 | WOLFSSL_API const char* wolfSSL_get_cipher(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 515 | WOLFSSL_API WOLFSSL_SESSION* wolfSSL_get1_session(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 516 | /* what's ref count */ |
wolfSSL | 11:cee25a834751 | 517 | |
wolfSSL | 11:cee25a834751 | 518 | WOLFSSL_API void wolfSSL_X509_free(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 519 | WOLFSSL_API void wolfSSL_OPENSSL_free(void*); |
wolfSSL | 11:cee25a834751 | 520 | |
wolfSSL | 11:cee25a834751 | 521 | WOLFSSL_API int wolfSSL_OCSP_parse_url(char* url, char** host, char** port, |
wolfSSL | 11:cee25a834751 | 522 | char** path, int* ssl); |
wolfSSL | 11:cee25a834751 | 523 | |
wolfSSL | 11:cee25a834751 | 524 | WOLFSSL_API WOLFSSL_METHOD* wolfSSLv23_client_method(void); |
wolfSSL | 11:cee25a834751 | 525 | WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_client_method(void); |
wolfSSL | 11:cee25a834751 | 526 | WOLFSSL_API WOLFSSL_METHOD* wolfSSLv2_server_method(void); |
wolfSSL | 11:cee25a834751 | 527 | |
wolfSSL | 11:cee25a834751 | 528 | WOLFSSL_API void wolfSSL_MD4_Init(WOLFSSL_MD4_CTX*); |
wolfSSL | 11:cee25a834751 | 529 | WOLFSSL_API void wolfSSL_MD4_Update(WOLFSSL_MD4_CTX*, const void*, unsigned long); |
wolfSSL | 11:cee25a834751 | 530 | WOLFSSL_API void wolfSSL_MD4_Final(unsigned char*, WOLFSSL_MD4_CTX*); |
wolfSSL | 11:cee25a834751 | 531 | |
wolfSSL | 11:cee25a834751 | 532 | |
wolfSSL | 11:cee25a834751 | 533 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new(WOLFSSL_BIO_METHOD*); |
wolfSSL | 11:cee25a834751 | 534 | WOLFSSL_API int wolfSSL_BIO_free(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 535 | WOLFSSL_API int wolfSSL_BIO_free_all(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 536 | WOLFSSL_API int wolfSSL_BIO_read(WOLFSSL_BIO*, void*, int); |
wolfSSL | 11:cee25a834751 | 537 | WOLFSSL_API int wolfSSL_BIO_write(WOLFSSL_BIO*, const void*, int); |
wolfSSL | 11:cee25a834751 | 538 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_push(WOLFSSL_BIO*, WOLFSSL_BIO* append); |
wolfSSL | 11:cee25a834751 | 539 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_pop(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 540 | WOLFSSL_API int wolfSSL_BIO_flush(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 541 | WOLFSSL_API int wolfSSL_BIO_pending(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 542 | |
wolfSSL | 11:cee25a834751 | 543 | WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_buffer(void); |
wolfSSL | 11:cee25a834751 | 544 | WOLFSSL_API long wolfSSL_BIO_set_write_buffer_size(WOLFSSL_BIO*, long size); |
wolfSSL | 11:cee25a834751 | 545 | WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_ssl(void); |
wolfSSL | 11:cee25a834751 | 546 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_socket(int sfd, int flag); |
wolfSSL | 11:cee25a834751 | 547 | WOLFSSL_API int wolfSSL_BIO_eof(WOLFSSL_BIO*); |
wolfSSL | 11:cee25a834751 | 548 | |
wolfSSL | 11:cee25a834751 | 549 | WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_s_mem(void); |
wolfSSL | 11:cee25a834751 | 550 | WOLFSSL_API WOLFSSL_BIO_METHOD* wolfSSL_BIO_f_base64(void); |
wolfSSL | 11:cee25a834751 | 551 | WOLFSSL_API void wolfSSL_BIO_set_flags(WOLFSSL_BIO*, int); |
wolfSSL | 11:cee25a834751 | 552 | |
wolfSSL | 11:cee25a834751 | 553 | WOLFSSL_API int wolfSSL_BIO_get_mem_data(WOLFSSL_BIO* bio,void* p); |
wolfSSL | 11:cee25a834751 | 554 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_mem_buf(void* buf, int len); |
wolfSSL | 11:cee25a834751 | 555 | |
wolfSSL | 11:cee25a834751 | 556 | |
wolfSSL | 11:cee25a834751 | 557 | WOLFSSL_API long wolfSSL_BIO_set_ssl(WOLFSSL_BIO*, WOLFSSL*, int flag); |
wolfSSL | 11:cee25a834751 | 558 | WOLFSSL_API long wolfSSL_BIO_set_fd(WOLFSSL_BIO* b, int fd, int flag); |
wolfSSL | 11:cee25a834751 | 559 | WOLFSSL_API void wolfSSL_set_bio(WOLFSSL*, WOLFSSL_BIO* rd, WOLFSSL_BIO* wr); |
wolfSSL | 11:cee25a834751 | 560 | WOLFSSL_API int wolfSSL_add_all_algorithms(void); |
wolfSSL | 11:cee25a834751 | 561 | |
wolfSSL | 11:cee25a834751 | 562 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 563 | WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_file(void); |
wolfSSL | 11:cee25a834751 | 564 | #endif |
wolfSSL | 11:cee25a834751 | 565 | |
wolfSSL | 11:cee25a834751 | 566 | WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_bio(void); |
wolfSSL | 11:cee25a834751 | 567 | WOLFSSL_API WOLFSSL_BIO_METHOD *wolfSSL_BIO_s_socket(void); |
wolfSSL | 11:cee25a834751 | 568 | |
wolfSSL | 11:cee25a834751 | 569 | WOLFSSL_API long wolfSSL_BIO_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, void *parg); |
wolfSSL | 11:cee25a834751 | 570 | WOLFSSL_API long wolfSSL_BIO_int_ctrl(WOLFSSL_BIO *bp, int cmd, long larg, int iarg); |
wolfSSL | 11:cee25a834751 | 571 | |
wolfSSL | 11:cee25a834751 | 572 | WOLFSSL_API int wolfSSL_BIO_set_write_buf_size(WOLFSSL_BIO *b, long size); |
wolfSSL | 11:cee25a834751 | 573 | WOLFSSL_API int wolfSSL_BIO_make_bio_pair(WOLFSSL_BIO *b1, WOLFSSL_BIO *b2); |
wolfSSL | 11:cee25a834751 | 574 | WOLFSSL_API int wolfSSL_BIO_ctrl_reset_read_request(WOLFSSL_BIO *b); |
wolfSSL | 11:cee25a834751 | 575 | WOLFSSL_API int wolfSSL_BIO_nread0(WOLFSSL_BIO *bio, char **buf); |
wolfSSL | 11:cee25a834751 | 576 | WOLFSSL_API int wolfSSL_BIO_nread(WOLFSSL_BIO *bio, char **buf, int num); |
wolfSSL | 11:cee25a834751 | 577 | WOLFSSL_API int wolfSSL_BIO_nwrite(WOLFSSL_BIO *bio, char **buf, int num); |
wolfSSL | 11:cee25a834751 | 578 | WOLFSSL_API int wolfSSL_BIO_reset(WOLFSSL_BIO *bio); |
wolfSSL | 11:cee25a834751 | 579 | |
wolfSSL | 11:cee25a834751 | 580 | WOLFSSL_API int wolfSSL_BIO_seek(WOLFSSL_BIO *bio, int ofs); |
wolfSSL | 11:cee25a834751 | 581 | WOLFSSL_API int wolfSSL_BIO_write_filename(WOLFSSL_BIO *bio, char *name); |
wolfSSL | 11:cee25a834751 | 582 | WOLFSSL_API long wolfSSL_BIO_set_mem_eof_return(WOLFSSL_BIO *bio, int v); |
wolfSSL | 11:cee25a834751 | 583 | WOLFSSL_API long wolfSSL_BIO_get_mem_ptr(WOLFSSL_BIO *bio, WOLFSSL_BUF_MEM **m); |
wolfSSL | 11:cee25a834751 | 584 | |
wolfSSL | 11:cee25a834751 | 585 | WOLFSSL_API void wolfSSL_RAND_screen(void); |
wolfSSL | 11:cee25a834751 | 586 | WOLFSSL_API const char* wolfSSL_RAND_file_name(char*, unsigned long); |
wolfSSL | 11:cee25a834751 | 587 | WOLFSSL_API int wolfSSL_RAND_write_file(const char*); |
wolfSSL | 11:cee25a834751 | 588 | WOLFSSL_API int wolfSSL_RAND_load_file(const char*, long); |
wolfSSL | 11:cee25a834751 | 589 | WOLFSSL_API int wolfSSL_RAND_egd(const char*); |
wolfSSL | 11:cee25a834751 | 590 | WOLFSSL_API int wolfSSL_RAND_seed(const void*, int); |
wolfSSL | 11:cee25a834751 | 591 | WOLFSSL_API void wolfSSL_RAND_add(const void*, int, double); |
wolfSSL | 11:cee25a834751 | 592 | |
wolfSSL | 11:cee25a834751 | 593 | WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_zlib(void); |
wolfSSL | 11:cee25a834751 | 594 | WOLFSSL_API WOLFSSL_COMP_METHOD* wolfSSL_COMP_rle(void); |
wolfSSL | 11:cee25a834751 | 595 | WOLFSSL_API int wolfSSL_COMP_add_compression_method(int, void*); |
wolfSSL | 11:cee25a834751 | 596 | |
wolfSSL | 11:cee25a834751 | 597 | WOLFSSL_API int wolfSSL_get_ex_new_index(long, void*, void*, void*, void*); |
wolfSSL | 11:cee25a834751 | 598 | |
wolfSSL | 11:cee25a834751 | 599 | WOLFSSL_API void wolfSSL_set_id_callback(unsigned long (*f)(void)); |
wolfSSL | 11:cee25a834751 | 600 | WOLFSSL_API void wolfSSL_set_locking_callback(void (*f)(int, int, const char*, |
wolfSSL | 11:cee25a834751 | 601 | int)); |
wolfSSL | 11:cee25a834751 | 602 | WOLFSSL_API void wolfSSL_set_dynlock_create_callback(WOLFSSL_dynlock_value* (*f) |
wolfSSL | 11:cee25a834751 | 603 | (const char*, int)); |
wolfSSL | 11:cee25a834751 | 604 | WOLFSSL_API void wolfSSL_set_dynlock_lock_callback(void (*f)(int, |
wolfSSL | 11:cee25a834751 | 605 | WOLFSSL_dynlock_value*, const char*, int)); |
wolfSSL | 11:cee25a834751 | 606 | WOLFSSL_API void wolfSSL_set_dynlock_destroy_callback(void (*f) |
wolfSSL | 11:cee25a834751 | 607 | (WOLFSSL_dynlock_value*, const char*, int)); |
wolfSSL | 11:cee25a834751 | 608 | WOLFSSL_API int wolfSSL_num_locks(void); |
wolfSSL | 11:cee25a834751 | 609 | |
wolfSSL | 11:cee25a834751 | 610 | WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_STORE_CTX_get_current_cert( |
wolfSSL | 11:cee25a834751 | 611 | WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 612 | WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error(WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 613 | WOLFSSL_API int wolfSSL_X509_STORE_CTX_get_error_depth(WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 614 | |
wolfSSL | 11:cee25a834751 | 615 | WOLFSSL_API char* wolfSSL_X509_NAME_oneline(WOLFSSL_X509_NAME*, char*, int); |
wolfSSL | 11:cee25a834751 | 616 | WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_issuer_name(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 617 | WOLFSSL_API WOLFSSL_X509_NAME* wolfSSL_X509_get_subject_name(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 618 | WOLFSSL_API int wolfSSL_X509_ext_isSet_by_NID(WOLFSSL_X509*, int); |
wolfSSL | 11:cee25a834751 | 619 | WOLFSSL_API int wolfSSL_X509_ext_get_critical_by_NID(WOLFSSL_X509*, int); |
wolfSSL | 11:cee25a834751 | 620 | WOLFSSL_API int wolfSSL_X509_get_isCA(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 621 | WOLFSSL_API int wolfSSL_X509_get_isSet_pathLength(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 622 | WOLFSSL_API unsigned int wolfSSL_X509_get_pathLength(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 623 | WOLFSSL_API unsigned int wolfSSL_X509_get_keyUsage(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 624 | WOLFSSL_API unsigned char* wolfSSL_X509_get_authorityKeyID( |
wolfSSL | 11:cee25a834751 | 625 | WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 626 | WOLFSSL_API unsigned char* wolfSSL_X509_get_subjectKeyID( |
wolfSSL | 11:cee25a834751 | 627 | WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 628 | WOLFSSL_API int wolfSSL_X509_NAME_entry_count(WOLFSSL_X509_NAME*); |
wolfSSL | 11:cee25a834751 | 629 | WOLFSSL_API int wolfSSL_X509_NAME_get_text_by_NID( |
wolfSSL | 11:cee25a834751 | 630 | WOLFSSL_X509_NAME*, int, char*, int); |
wolfSSL | 11:cee25a834751 | 631 | WOLFSSL_API int wolfSSL_X509_NAME_get_index_by_NID( |
wolfSSL | 11:cee25a834751 | 632 | WOLFSSL_X509_NAME*, int, int); |
wolfSSL | 11:cee25a834751 | 633 | WOLFSSL_API WOLFSSL_ASN1_STRING* wolfSSL_X509_NAME_ENTRY_get_data(WOLFSSL_X509_NAME_ENTRY*); |
wolfSSL | 11:cee25a834751 | 634 | WOLFSSL_API char* wolfSSL_ASN1_STRING_data(WOLFSSL_ASN1_STRING*); |
wolfSSL | 11:cee25a834751 | 635 | WOLFSSL_API int wolfSSL_ASN1_STRING_length(WOLFSSL_ASN1_STRING*); |
wolfSSL | 11:cee25a834751 | 636 | WOLFSSL_API int wolfSSL_X509_verify_cert(WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 637 | WOLFSSL_API const char* wolfSSL_X509_verify_cert_error_string(long); |
wolfSSL | 11:cee25a834751 | 638 | WOLFSSL_API int wolfSSL_X509_get_signature_type(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 639 | WOLFSSL_API int wolfSSL_X509_get_signature(WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 640 | |
wolfSSL | 11:cee25a834751 | 641 | WOLFSSL_API int wolfSSL_X509_LOOKUP_add_dir(WOLFSSL_X509_LOOKUP*,const char*,long); |
wolfSSL | 11:cee25a834751 | 642 | WOLFSSL_API int wolfSSL_X509_LOOKUP_load_file(WOLFSSL_X509_LOOKUP*, const char*, |
wolfSSL | 11:cee25a834751 | 643 | long); |
wolfSSL | 11:cee25a834751 | 644 | WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_hash_dir(void); |
wolfSSL | 11:cee25a834751 | 645 | WOLFSSL_API WOLFSSL_X509_LOOKUP_METHOD* wolfSSL_X509_LOOKUP_file(void); |
wolfSSL | 11:cee25a834751 | 646 | |
wolfSSL | 11:cee25a834751 | 647 | WOLFSSL_API WOLFSSL_X509_LOOKUP* wolfSSL_X509_STORE_add_lookup(WOLFSSL_X509_STORE*, |
wolfSSL | 11:cee25a834751 | 648 | WOLFSSL_X509_LOOKUP_METHOD*); |
wolfSSL | 11:cee25a834751 | 649 | WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_X509_STORE_new(void); |
wolfSSL | 11:cee25a834751 | 650 | WOLFSSL_API void wolfSSL_X509_STORE_free(WOLFSSL_X509_STORE*); |
wolfSSL | 11:cee25a834751 | 651 | WOLFSSL_API int wolfSSL_X509_STORE_add_cert( |
wolfSSL | 11:cee25a834751 | 652 | WOLFSSL_X509_STORE*, WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 653 | WOLFSSL_API WOLFSSL_STACK* wolfSSL_X509_STORE_CTX_get_chain( |
wolfSSL | 11:cee25a834751 | 654 | WOLFSSL_X509_STORE_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 655 | WOLFSSL_API int wolfSSL_X509_STORE_set_flags(WOLFSSL_X509_STORE* store, |
wolfSSL | 11:cee25a834751 | 656 | unsigned long flag); |
wolfSSL | 11:cee25a834751 | 657 | WOLFSSL_API int wolfSSL_X509_STORE_set_default_paths(WOLFSSL_X509_STORE*); |
wolfSSL | 11:cee25a834751 | 658 | WOLFSSL_API int wolfSSL_X509_STORE_get_by_subject(WOLFSSL_X509_STORE_CTX*, |
wolfSSL | 11:cee25a834751 | 659 | int, WOLFSSL_X509_NAME*, WOLFSSL_X509_OBJECT*); |
wolfSSL | 11:cee25a834751 | 660 | WOLFSSL_API WOLFSSL_X509_STORE_CTX* wolfSSL_X509_STORE_CTX_new(void); |
wolfSSL | 11:cee25a834751 | 661 | WOLFSSL_API int wolfSSL_X509_STORE_CTX_init(WOLFSSL_X509_STORE_CTX*, |
wolfSSL | 11:cee25a834751 | 662 | WOLFSSL_X509_STORE*, WOLFSSL_X509*, STACK_OF(WOLFSSL_X509)*); |
wolfSSL | 11:cee25a834751 | 663 | WOLFSSL_API void wolfSSL_X509_STORE_CTX_free(WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 664 | WOLFSSL_API void wolfSSL_X509_STORE_CTX_cleanup(WOLFSSL_X509_STORE_CTX*); |
wolfSSL | 11:cee25a834751 | 665 | |
wolfSSL | 11:cee25a834751 | 666 | WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_lastUpdate(WOLFSSL_X509_CRL*); |
wolfSSL | 11:cee25a834751 | 667 | WOLFSSL_API WOLFSSL_ASN1_TIME* wolfSSL_X509_CRL_get_nextUpdate(WOLFSSL_X509_CRL*); |
wolfSSL | 11:cee25a834751 | 668 | |
wolfSSL | 11:cee25a834751 | 669 | WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_X509_get_pubkey(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 670 | WOLFSSL_API int wolfSSL_X509_CRL_verify(WOLFSSL_X509_CRL*, WOLFSSL_EVP_PKEY*); |
wolfSSL | 11:cee25a834751 | 671 | WOLFSSL_API void wolfSSL_X509_STORE_CTX_set_error(WOLFSSL_X509_STORE_CTX*, |
wolfSSL | 11:cee25a834751 | 672 | int); |
wolfSSL | 11:cee25a834751 | 673 | WOLFSSL_API void wolfSSL_X509_OBJECT_free_contents(WOLFSSL_X509_OBJECT*); |
wolfSSL | 11:cee25a834751 | 674 | WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_d2i_PrivateKey(int type, |
wolfSSL | 11:cee25a834751 | 675 | WOLFSSL_EVP_PKEY** out, const unsigned char **in, long inSz); |
wolfSSL | 11:cee25a834751 | 676 | WOLFSSL_API WOLFSSL_EVP_PKEY* wolfSSL_PKEY_new(void); |
wolfSSL | 11:cee25a834751 | 677 | WOLFSSL_API void wolfSSL_EVP_PKEY_free(WOLFSSL_EVP_PKEY*); |
wolfSSL | 11:cee25a834751 | 678 | WOLFSSL_API int wolfSSL_X509_cmp_current_time(const WOLFSSL_ASN1_TIME*); |
wolfSSL | 11:cee25a834751 | 679 | WOLFSSL_API int wolfSSL_sk_X509_REVOKED_num(WOLFSSL_X509_REVOKED*); |
wolfSSL | 11:cee25a834751 | 680 | |
wolfSSL | 11:cee25a834751 | 681 | WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_X509_CRL_get_REVOKED(WOLFSSL_X509_CRL*); |
wolfSSL | 11:cee25a834751 | 682 | WOLFSSL_API WOLFSSL_X509_REVOKED* wolfSSL_sk_X509_REVOKED_value( |
wolfSSL | 11:cee25a834751 | 683 | WOLFSSL_X509_REVOKED*,int); |
wolfSSL | 11:cee25a834751 | 684 | WOLFSSL_API WOLFSSL_ASN1_INTEGER* wolfSSL_X509_get_serialNumber(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 685 | |
wolfSSL | 11:cee25a834751 | 686 | WOLFSSL_API int wolfSSL_ASN1_TIME_print(WOLFSSL_BIO*, const WOLFSSL_ASN1_TIME*); |
wolfSSL | 11:cee25a834751 | 687 | |
wolfSSL | 11:cee25a834751 | 688 | WOLFSSL_API int wolfSSL_ASN1_INTEGER_cmp(const WOLFSSL_ASN1_INTEGER*, |
wolfSSL | 11:cee25a834751 | 689 | const WOLFSSL_ASN1_INTEGER*); |
wolfSSL | 11:cee25a834751 | 690 | WOLFSSL_API long wolfSSL_ASN1_INTEGER_get(const WOLFSSL_ASN1_INTEGER*); |
wolfSSL | 11:cee25a834751 | 691 | |
wolfSSL | 11:cee25a834751 | 692 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 693 | WOLFSSL_API WOLFSSL_BIGNUM *wolfSSL_ASN1_INTEGER_to_BN(const WOLFSSL_ASN1_INTEGER *ai, |
wolfSSL | 11:cee25a834751 | 694 | WOLFSSL_BIGNUM *bn); |
wolfSSL | 11:cee25a834751 | 695 | WOLFSSL_API STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_load_client_CA_file(const char*); |
wolfSSL | 11:cee25a834751 | 696 | #endif |
wolfSSL | 11:cee25a834751 | 697 | |
wolfSSL | 11:cee25a834751 | 698 | WOLFSSL_API STACK_OF(WOLFSSL_X509_NAME)* wolfSSL_SSL_CTX_get_client_CA_list( |
wolfSSL | 11:cee25a834751 | 699 | const WOLFSSL_CTX *s); |
wolfSSL | 11:cee25a834751 | 700 | WOLFSSL_API void wolfSSL_CTX_set_client_CA_list(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 701 | STACK_OF(WOLFSSL_X509_NAME)*); |
wolfSSL | 11:cee25a834751 | 702 | WOLFSSL_API void* wolfSSL_X509_STORE_CTX_get_ex_data(WOLFSSL_X509_STORE_CTX*, int); |
wolfSSL | 11:cee25a834751 | 703 | WOLFSSL_API int wolfSSL_get_ex_data_X509_STORE_CTX_idx(void); |
wolfSSL | 11:cee25a834751 | 704 | WOLFSSL_API void* wolfSSL_get_ex_data(const WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 705 | |
wolfSSL | 11:cee25a834751 | 706 | WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb_userdata(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 707 | void* userdata); |
wolfSSL | 11:cee25a834751 | 708 | WOLFSSL_API void wolfSSL_CTX_set_default_passwd_cb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 709 | pem_password_cb*); |
wolfSSL | 11:cee25a834751 | 710 | |
wolfSSL | 11:cee25a834751 | 711 | |
wolfSSL | 11:cee25a834751 | 712 | WOLFSSL_API void wolfSSL_CTX_set_info_callback(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 713 | void (*)(const WOLFSSL* ssl, int type, int val)); |
wolfSSL | 11:cee25a834751 | 714 | |
wolfSSL | 11:cee25a834751 | 715 | WOLFSSL_API unsigned long wolfSSL_ERR_peek_error(void); |
wolfSSL | 11:cee25a834751 | 716 | WOLFSSL_API int wolfSSL_GET_REASON(int); |
wolfSSL | 11:cee25a834751 | 717 | |
wolfSSL | 11:cee25a834751 | 718 | WOLFSSL_API char* wolfSSL_alert_type_string_long(int); |
wolfSSL | 11:cee25a834751 | 719 | WOLFSSL_API char* wolfSSL_alert_desc_string_long(int); |
wolfSSL | 11:cee25a834751 | 720 | WOLFSSL_API char* wolfSSL_state_string_long(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 721 | |
wolfSSL | 11:cee25a834751 | 722 | WOLFSSL_API WOLFSSL_RSA* wolfSSL_RSA_generate_key(int, unsigned long, |
wolfSSL | 11:cee25a834751 | 723 | void(*)(int, int, void*), void*); |
wolfSSL | 11:cee25a834751 | 724 | WOLFSSL_API void wolfSSL_CTX_set_tmp_rsa_callback(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 725 | WOLFSSL_RSA*(*)(WOLFSSL*, int, int)); |
wolfSSL | 11:cee25a834751 | 726 | |
wolfSSL | 11:cee25a834751 | 727 | WOLFSSL_API int wolfSSL_PEM_def_callback(char*, int num, int w, void* key); |
wolfSSL | 11:cee25a834751 | 728 | |
wolfSSL | 11:cee25a834751 | 729 | WOLFSSL_API long wolfSSL_CTX_sess_accept(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 730 | WOLFSSL_API long wolfSSL_CTX_sess_connect(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 731 | WOLFSSL_API long wolfSSL_CTX_sess_accept_good(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 732 | WOLFSSL_API long wolfSSL_CTX_sess_connect_good(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 733 | WOLFSSL_API long wolfSSL_CTX_sess_accept_renegotiate(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 734 | WOLFSSL_API long wolfSSL_CTX_sess_connect_renegotiate(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 735 | WOLFSSL_API long wolfSSL_CTX_sess_hits(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 736 | WOLFSSL_API long wolfSSL_CTX_sess_cb_hits(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 737 | WOLFSSL_API long wolfSSL_CTX_sess_cache_full(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 738 | WOLFSSL_API long wolfSSL_CTX_sess_misses(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 739 | WOLFSSL_API long wolfSSL_CTX_sess_timeouts(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 740 | WOLFSSL_API long wolfSSL_CTX_sess_number(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 741 | |
wolfSSL | 11:cee25a834751 | 742 | WOLFSSL_API long wolfSSL_CTX_add_extra_chain_cert(WOLFSSL_CTX*, WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 743 | WOLFSSL_API long wolfSSL_CTX_sess_set_cache_size(WOLFSSL_CTX*, long); |
wolfSSL | 11:cee25a834751 | 744 | WOLFSSL_API long wolfSSL_CTX_sess_get_cache_size(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 745 | |
wolfSSL | 11:cee25a834751 | 746 | WOLFSSL_API long wolfSSL_CTX_get_session_cache_mode(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 747 | WOLFSSL_API int wolfSSL_CTX_get_read_ahead(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 748 | WOLFSSL_API int wolfSSL_CTX_set_read_ahead(WOLFSSL_CTX*, int v); |
wolfSSL | 11:cee25a834751 | 749 | WOLFSSL_API long wolfSSL_CTX_set_tlsext_status_arg(WOLFSSL_CTX*, void* arg); |
wolfSSL | 11:cee25a834751 | 750 | WOLFSSL_API long wolfSSL_CTX_set_tlsext_opaque_prf_input_callback_arg( |
wolfSSL | 11:cee25a834751 | 751 | WOLFSSL_CTX*, void* arg); |
wolfSSL | 11:cee25a834751 | 752 | |
wolfSSL | 11:cee25a834751 | 753 | WOLFSSL_API unsigned long wolfSSL_set_options(WOLFSSL *s, unsigned long op); |
wolfSSL | 11:cee25a834751 | 754 | WOLFSSL_API unsigned long wolfSSL_get_options(const WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 755 | WOLFSSL_API long wolfSSL_clear_num_renegotiations(WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 756 | WOLFSSL_API long wolfSSL_total_renegotiations(WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 757 | WOLFSSL_API long wolfSSL_set_tmp_dh(WOLFSSL *s, WOLFSSL_DH *dh); |
wolfSSL | 11:cee25a834751 | 758 | WOLFSSL_API long wolfSSL_set_tlsext_debug_arg(WOLFSSL *s, void *arg); |
wolfSSL | 11:cee25a834751 | 759 | WOLFSSL_API long wolfSSL_set_tlsext_status_type(WOLFSSL *s, int type); |
wolfSSL | 11:cee25a834751 | 760 | WOLFSSL_API long wolfSSL_set_tlsext_status_exts(WOLFSSL *s, void *arg); |
wolfSSL | 11:cee25a834751 | 761 | WOLFSSL_API long wolfSSL_get_tlsext_status_ids(WOLFSSL *s, void *arg); |
wolfSSL | 11:cee25a834751 | 762 | WOLFSSL_API long wolfSSL_set_tlsext_status_ids(WOLFSSL *s, void *arg); |
wolfSSL | 11:cee25a834751 | 763 | WOLFSSL_API long wolfSSL_get_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char **resp); |
wolfSSL | 11:cee25a834751 | 764 | WOLFSSL_API long wolfSSL_set_tlsext_status_ocsp_resp(WOLFSSL *s, unsigned char *resp, int len); |
wolfSSL | 11:cee25a834751 | 765 | |
wolfSSL | 11:cee25a834751 | 766 | WOLFSSL_API void wolfSSL_CONF_modules_unload(int all); |
wolfSSL | 11:cee25a834751 | 767 | WOLFSSL_API long wolfSSL_get_tlsext_status_exts(WOLFSSL *s, void *arg); |
wolfSSL | 11:cee25a834751 | 768 | WOLFSSL_API long wolfSSL_get_verify_result(const WOLFSSL *ssl); |
wolfSSL | 11:cee25a834751 | 769 | |
wolfSSL | 11:cee25a834751 | 770 | #define WOLFSSL_DEFAULT_CIPHER_LIST "" /* default all */ |
wolfSSL | 11:cee25a834751 | 771 | #define WOLFSSL_RSA_F4 0x10001L |
wolfSSL | 11:cee25a834751 | 772 | |
wolfSSL | 11:cee25a834751 | 773 | /* seperated out from other enums because of size */ |
wolfSSL | 11:cee25a834751 | 774 | enum { |
wolfSSL | 11:cee25a834751 | 775 | SSL_OP_MICROSOFT_SESS_ID_BUG = 0x00000001, |
wolfSSL | 11:cee25a834751 | 776 | SSL_OP_NETSCAPE_CHALLENGE_BUG = 0x00000002, |
wolfSSL | 11:cee25a834751 | 777 | SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 0x00000004, |
wolfSSL | 11:cee25a834751 | 778 | SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 0x00000008, |
wolfSSL | 11:cee25a834751 | 779 | SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 0x00000010, |
wolfSSL | 11:cee25a834751 | 780 | SSL_OP_MSIE_SSLV2_RSA_PADDING = 0x00000020, |
wolfSSL | 11:cee25a834751 | 781 | SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 0x00000040, |
wolfSSL | 11:cee25a834751 | 782 | SSL_OP_TLS_D5_BUG = 0x00000080, |
wolfSSL | 11:cee25a834751 | 783 | SSL_OP_TLS_BLOCK_PADDING_BUG = 0x00000100, |
wolfSSL | 11:cee25a834751 | 784 | SSL_OP_TLS_ROLLBACK_BUG = 0x00000200, |
wolfSSL | 11:cee25a834751 | 785 | SSL_OP_ALL = 0x00000400, |
wolfSSL | 11:cee25a834751 | 786 | SSL_OP_EPHEMERAL_RSA = 0x00000800, |
wolfSSL | 11:cee25a834751 | 787 | SSL_OP_NO_SSLv3 = 0x00001000, |
wolfSSL | 11:cee25a834751 | 788 | SSL_OP_NO_TLSv1 = 0x00002000, |
wolfSSL | 11:cee25a834751 | 789 | SSL_OP_PKCS1_CHECK_1 = 0x00004000, |
wolfSSL | 11:cee25a834751 | 790 | SSL_OP_PKCS1_CHECK_2 = 0x00008000, |
wolfSSL | 11:cee25a834751 | 791 | SSL_OP_NETSCAPE_CA_DN_BUG = 0x00010000, |
wolfSSL | 11:cee25a834751 | 792 | SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 0x00020000, |
wolfSSL | 11:cee25a834751 | 793 | SSL_OP_SINGLE_DH_USE = 0x00040000, |
wolfSSL | 11:cee25a834751 | 794 | SSL_OP_NO_TICKET = 0x00080000, |
wolfSSL | 11:cee25a834751 | 795 | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 0x00100000, |
wolfSSL | 11:cee25a834751 | 796 | SSL_OP_NO_QUERY_MTU = 0x00200000, |
wolfSSL | 11:cee25a834751 | 797 | SSL_OP_COOKIE_EXCHANGE = 0x00400000, |
wolfSSL | 11:cee25a834751 | 798 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 0x00800000, |
wolfSSL | 11:cee25a834751 | 799 | SSL_OP_SINGLE_ECDH_USE = 0x01000000, |
wolfSSL | 11:cee25a834751 | 800 | SSL_OP_CIPHER_SERVER_PREFERENCE = 0x02000000, |
wolfSSL | 11:cee25a834751 | 801 | SSL_OP_NO_TLSv1_1 = 0x04000000, |
wolfSSL | 11:cee25a834751 | 802 | SSL_OP_NO_TLSv1_2 = 0x08000000, |
wolfSSL | 11:cee25a834751 | 803 | SSL_OP_NO_COMPRESSION = 0x10000000, |
wolfSSL | 11:cee25a834751 | 804 | }; |
wolfSSL | 11:cee25a834751 | 805 | |
wolfSSL | 11:cee25a834751 | 806 | |
wolfSSL | 11:cee25a834751 | 807 | enum { |
wolfSSL | 11:cee25a834751 | 808 | OCSP_NOCERTS = 1, |
wolfSSL | 11:cee25a834751 | 809 | OCSP_NOINTERN = 2, |
wolfSSL | 11:cee25a834751 | 810 | OCSP_NOSIGS = 4, |
wolfSSL | 11:cee25a834751 | 811 | OCSP_NOCHAIN = 8, |
wolfSSL | 11:cee25a834751 | 812 | OCSP_NOVERIFY = 16, |
wolfSSL | 11:cee25a834751 | 813 | OCSP_NOEXPLICIT = 32, |
wolfSSL | 11:cee25a834751 | 814 | OCSP_NOCASIGN = 64, |
wolfSSL | 11:cee25a834751 | 815 | OCSP_NODELEGATED = 128, |
wolfSSL | 11:cee25a834751 | 816 | OCSP_NOCHECKS = 256, |
wolfSSL | 11:cee25a834751 | 817 | OCSP_TRUSTOTHER = 512, |
wolfSSL | 11:cee25a834751 | 818 | OCSP_RESPID_KEY = 1024, |
wolfSSL | 11:cee25a834751 | 819 | OCSP_NOTIME = 2048, |
wolfSSL | 11:cee25a834751 | 820 | |
wolfSSL | 11:cee25a834751 | 821 | OCSP_CERTID = 2, |
wolfSSL | 11:cee25a834751 | 822 | OCSP_REQUEST = 4, |
wolfSSL | 11:cee25a834751 | 823 | OCSP_RESPONSE = 8, |
wolfSSL | 11:cee25a834751 | 824 | OCSP_BASICRESP = 16, |
wolfSSL | 11:cee25a834751 | 825 | |
wolfSSL | 11:cee25a834751 | 826 | WOLFSSL_OCSP_URL_OVERRIDE = 1, |
wolfSSL | 11:cee25a834751 | 827 | WOLFSSL_OCSP_NO_NONCE = 2, |
wolfSSL | 11:cee25a834751 | 828 | WOLFSSL_OCSP_CHECKALL = 4, |
wolfSSL | 11:cee25a834751 | 829 | |
wolfSSL | 11:cee25a834751 | 830 | WOLFSSL_CRL_CHECKALL = 1, |
wolfSSL | 11:cee25a834751 | 831 | WOLFSSL_CRL_CHECK = 27, |
wolfSSL | 11:cee25a834751 | 832 | |
wolfSSL | 11:cee25a834751 | 833 | ASN1_GENERALIZEDTIME = 4, |
wolfSSL | 11:cee25a834751 | 834 | SSL_MAX_SSL_SESSION_ID_LENGTH = 32, |
wolfSSL | 11:cee25a834751 | 835 | |
wolfSSL | 11:cee25a834751 | 836 | EVP_R_BAD_DECRYPT = 2, |
wolfSSL | 11:cee25a834751 | 837 | |
wolfSSL | 11:cee25a834751 | 838 | SSL_ST_CONNECT = 0x1000, |
wolfSSL | 11:cee25a834751 | 839 | SSL_ST_ACCEPT = 0x2000, |
wolfSSL | 11:cee25a834751 | 840 | |
wolfSSL | 11:cee25a834751 | 841 | SSL_CB_LOOP = 0x01, |
wolfSSL | 11:cee25a834751 | 842 | SSL_CB_EXIT = 0x02, |
wolfSSL | 11:cee25a834751 | 843 | SSL_CB_READ = 0x04, |
wolfSSL | 11:cee25a834751 | 844 | SSL_CB_WRITE = 0x08, |
wolfSSL | 11:cee25a834751 | 845 | SSL_CB_HANDSHAKE_START = 0x10, |
wolfSSL | 11:cee25a834751 | 846 | SSL_CB_HANDSHAKE_DONE = 0x20, |
wolfSSL | 11:cee25a834751 | 847 | SSL_CB_ALERT = 0x4000, |
wolfSSL | 11:cee25a834751 | 848 | SSL_CB_READ_ALERT = (SSL_CB_ALERT | SSL_CB_READ), |
wolfSSL | 11:cee25a834751 | 849 | SSL_CB_WRITE_ALERT = (SSL_CB_ALERT | SSL_CB_WRITE), |
wolfSSL | 11:cee25a834751 | 850 | SSL_CB_ACCEPT_LOOP = (SSL_ST_ACCEPT | SSL_CB_LOOP), |
wolfSSL | 11:cee25a834751 | 851 | SSL_CB_ACCEPT_EXIT = (SSL_ST_ACCEPT | SSL_CB_EXIT), |
wolfSSL | 11:cee25a834751 | 852 | SSL_CB_CONNECT_LOOP = (SSL_ST_CONNECT | SSL_CB_LOOP), |
wolfSSL | 11:cee25a834751 | 853 | SSL_CB_CONNECT_EXIT = (SSL_ST_CONNECT | SSL_CB_EXIT), |
wolfSSL | 11:cee25a834751 | 854 | |
wolfSSL | 11:cee25a834751 | 855 | SSL_MODE_ENABLE_PARTIAL_WRITE = 2, |
wolfSSL | 11:cee25a834751 | 856 | |
wolfSSL | 11:cee25a834751 | 857 | BIO_FLAGS_BASE64_NO_NL = 1, |
wolfSSL | 11:cee25a834751 | 858 | BIO_CLOSE = 1, |
wolfSSL | 11:cee25a834751 | 859 | BIO_NOCLOSE = 0, |
wolfSSL | 11:cee25a834751 | 860 | |
wolfSSL | 11:cee25a834751 | 861 | NID_undef = 0, |
wolfSSL | 11:cee25a834751 | 862 | |
wolfSSL | 11:cee25a834751 | 863 | X509_FILETYPE_PEM = 8, |
wolfSSL | 11:cee25a834751 | 864 | X509_LU_X509 = 9, |
wolfSSL | 11:cee25a834751 | 865 | X509_LU_CRL = 12, |
wolfSSL | 11:cee25a834751 | 866 | |
wolfSSL | 11:cee25a834751 | 867 | X509_V_OK = 0, |
wolfSSL | 11:cee25a834751 | 868 | X509_V_ERR_CRL_SIGNATURE_FAILURE = 13, |
wolfSSL | 11:cee25a834751 | 869 | X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 14, |
wolfSSL | 11:cee25a834751 | 870 | X509_V_ERR_CRL_HAS_EXPIRED = 15, |
wolfSSL | 11:cee25a834751 | 871 | X509_V_ERR_CERT_REVOKED = 16, |
wolfSSL | 11:cee25a834751 | 872 | X509_V_ERR_CERT_CHAIN_TOO_LONG = 17, |
wolfSSL | 11:cee25a834751 | 873 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 18, |
wolfSSL | 11:cee25a834751 | 874 | X509_V_ERR_CERT_NOT_YET_VALID = 19, |
wolfSSL | 11:cee25a834751 | 875 | X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 20, |
wolfSSL | 11:cee25a834751 | 876 | X509_V_ERR_CERT_HAS_EXPIRED = 21, |
wolfSSL | 11:cee25a834751 | 877 | X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 22, |
wolfSSL | 11:cee25a834751 | 878 | X509_V_ERR_CERT_REJECTED = 23, |
wolfSSL | 11:cee25a834751 | 879 | /* Required for Nginx */ |
wolfSSL | 11:cee25a834751 | 880 | X509_V_ERR_DEPTH_ZERO_SELF_SIGNED_CERT = 24, |
wolfSSL | 11:cee25a834751 | 881 | X509_V_ERR_SELF_SIGNED_CERT_IN_CHAIN = 25, |
wolfSSL | 11:cee25a834751 | 882 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY = 26, |
wolfSSL | 11:cee25a834751 | 883 | X509_V_ERR_CERT_UNTRUSTED = 27, |
wolfSSL | 11:cee25a834751 | 884 | X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE = 28, |
wolfSSL | 11:cee25a834751 | 885 | X509_V_ERR_SUBJECT_ISSUER_MISMATCH = 29, |
wolfSSL | 11:cee25a834751 | 886 | /* additional X509_V_ERR_* enums not used in wolfSSL */ |
wolfSSL | 11:cee25a834751 | 887 | X509_V_ERR_UNABLE_TO_GET_CRL, |
wolfSSL | 11:cee25a834751 | 888 | X509_V_ERR_UNABLE_TO_DECRYPT_CERT_SIGNATURE, |
wolfSSL | 11:cee25a834751 | 889 | X509_V_ERR_UNABLE_TO_DECRYPT_CRL_SIGNATURE, |
wolfSSL | 11:cee25a834751 | 890 | X509_V_ERR_UNABLE_TO_DECODE_ISSUER_PUBLIC_KEY, |
wolfSSL | 11:cee25a834751 | 891 | X509_V_ERR_CERT_SIGNATURE_FAILURE, |
wolfSSL | 11:cee25a834751 | 892 | X509_V_ERR_CRL_NOT_YET_VALID, |
wolfSSL | 11:cee25a834751 | 893 | X509_V_ERR_ERROR_IN_CRL_LAST_UPDATE_FIELD, |
wolfSSL | 11:cee25a834751 | 894 | X509_V_ERR_OUT_OF_MEM, |
wolfSSL | 11:cee25a834751 | 895 | X509_V_ERR_INVALID_CA, |
wolfSSL | 11:cee25a834751 | 896 | X509_V_ERR_PATH_LENGTH_EXCEEDED, |
wolfSSL | 11:cee25a834751 | 897 | X509_V_ERR_INVALID_PURPOSE, |
wolfSSL | 11:cee25a834751 | 898 | X509_V_ERR_AKID_SKID_MISMATCH, |
wolfSSL | 11:cee25a834751 | 899 | X509_V_ERR_AKID_ISSUER_SERIAL_MISMATCH, |
wolfSSL | 11:cee25a834751 | 900 | X509_V_ERR_KEYUSAGE_NO_CERTSIGN, |
wolfSSL | 11:cee25a834751 | 901 | X509_V_ERR_UNABLE_TO_GET_CRL_ISSUER, |
wolfSSL | 11:cee25a834751 | 902 | X509_V_ERR_UNHANDLED_CRITICAL_EXTENSION, |
wolfSSL | 11:cee25a834751 | 903 | X509_V_ERR_KEYUSAGE_NO_CRL_SIGN, |
wolfSSL | 11:cee25a834751 | 904 | X509_V_ERR_UNHANDLED_CRITICAL_CRL_EXTENSION, |
wolfSSL | 11:cee25a834751 | 905 | X509_V_ERR_INVALID_NON_CA, |
wolfSSL | 11:cee25a834751 | 906 | X509_V_ERR_PROXY_PATH_LENGTH_EXCEEDED, |
wolfSSL | 11:cee25a834751 | 907 | X509_V_ERR_KEYUSAGE_NO_DIGITAL_SIGNATURE, |
wolfSSL | 11:cee25a834751 | 908 | X509_V_ERR_PROXY_CERTIFICATES_NOT_ALLOWED, |
wolfSSL | 11:cee25a834751 | 909 | X509_V_ERR_INVALID_EXTENSION, |
wolfSSL | 11:cee25a834751 | 910 | X509_V_ERR_INVALID_POLICY_EXTENSION, |
wolfSSL | 11:cee25a834751 | 911 | X509_V_ERR_NO_EXPLICIT_POLICY, |
wolfSSL | 11:cee25a834751 | 912 | X509_V_ERR_UNNESTED_RESOURCE, |
wolfSSL | 11:cee25a834751 | 913 | |
wolfSSL | 11:cee25a834751 | 914 | XN_FLAG_SPC_EQ = (1 << 23), |
wolfSSL | 11:cee25a834751 | 915 | XN_FLAG_ONELINE = 0, |
wolfSSL | 11:cee25a834751 | 916 | XN_FLAG_RFC2253 = 1, |
wolfSSL | 11:cee25a834751 | 917 | |
wolfSSL | 11:cee25a834751 | 918 | CRYPTO_LOCK = 1, |
wolfSSL | 11:cee25a834751 | 919 | CRYPTO_NUM_LOCKS = 10, |
wolfSSL | 11:cee25a834751 | 920 | |
wolfSSL | 11:cee25a834751 | 921 | ASN1_STRFLGS_ESC_MSB = 4 |
wolfSSL | 11:cee25a834751 | 922 | }; |
wolfSSL | 11:cee25a834751 | 923 | |
wolfSSL | 11:cee25a834751 | 924 | /* extras end */ |
wolfSSL | 11:cee25a834751 | 925 | |
wolfSSL | 11:cee25a834751 | 926 | #if !defined(NO_FILESYSTEM) && !defined(NO_STDIO_FILESYSTEM) |
wolfSSL | 11:cee25a834751 | 927 | /* wolfSSL extension, provide last error from SSL_get_error |
wolfSSL | 11:cee25a834751 | 928 | since not using thread storage error queue */ |
wolfSSL | 11:cee25a834751 | 929 | #include <stdio.h> |
wolfSSL | 11:cee25a834751 | 930 | WOLFSSL_API void wolfSSL_ERR_print_errors_fp(FILE*, int err); |
wolfSSL | 11:cee25a834751 | 931 | #if defined(OPENSSL_EXTRA) || defined(DEBUG_WOLFSSL_VERBOSE) |
wolfSSL | 11:cee25a834751 | 932 | WOLFSSL_API void wolfSSL_ERR_dump_errors_fp(FILE* fp); |
wolfSSL | 11:cee25a834751 | 933 | #endif |
wolfSSL | 11:cee25a834751 | 934 | #endif |
wolfSSL | 11:cee25a834751 | 935 | |
wolfSSL | 11:cee25a834751 | 936 | enum { /* ssl Constants */ |
wolfSSL | 11:cee25a834751 | 937 | SSL_ERROR_NONE = 0, /* for most functions */ |
wolfSSL | 11:cee25a834751 | 938 | SSL_FAILURE = 0, /* for some functions */ |
wolfSSL | 11:cee25a834751 | 939 | SSL_SUCCESS = 1, |
wolfSSL | 11:cee25a834751 | 940 | SSL_SHUTDOWN_NOT_DONE = 2, /* call wolfSSL_shutdown again to complete */ |
wolfSSL | 11:cee25a834751 | 941 | |
wolfSSL | 11:cee25a834751 | 942 | SSL_ALPN_NOT_FOUND = -9, |
wolfSSL | 11:cee25a834751 | 943 | SSL_BAD_CERTTYPE = -8, |
wolfSSL | 11:cee25a834751 | 944 | SSL_BAD_STAT = -7, |
wolfSSL | 11:cee25a834751 | 945 | SSL_BAD_PATH = -6, |
wolfSSL | 11:cee25a834751 | 946 | SSL_BAD_FILETYPE = -5, |
wolfSSL | 11:cee25a834751 | 947 | SSL_BAD_FILE = -4, |
wolfSSL | 11:cee25a834751 | 948 | SSL_NOT_IMPLEMENTED = -3, |
wolfSSL | 11:cee25a834751 | 949 | SSL_UNKNOWN = -2, |
wolfSSL | 11:cee25a834751 | 950 | SSL_FATAL_ERROR = -1, |
wolfSSL | 11:cee25a834751 | 951 | |
wolfSSL | 11:cee25a834751 | 952 | SSL_FILETYPE_ASN1 = 2, |
wolfSSL | 11:cee25a834751 | 953 | SSL_FILETYPE_PEM = 1, |
wolfSSL | 11:cee25a834751 | 954 | SSL_FILETYPE_DEFAULT = 2, /* ASN1 */ |
wolfSSL | 11:cee25a834751 | 955 | SSL_FILETYPE_RAW = 3, /* NTRU raw key blob */ |
wolfSSL | 11:cee25a834751 | 956 | |
wolfSSL | 11:cee25a834751 | 957 | SSL_VERIFY_NONE = 0, |
wolfSSL | 11:cee25a834751 | 958 | SSL_VERIFY_PEER = 1, |
wolfSSL | 11:cee25a834751 | 959 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2, |
wolfSSL | 11:cee25a834751 | 960 | SSL_VERIFY_CLIENT_ONCE = 4, |
wolfSSL | 11:cee25a834751 | 961 | SSL_VERIFY_FAIL_EXCEPT_PSK = 8, |
wolfSSL | 11:cee25a834751 | 962 | |
wolfSSL | 11:cee25a834751 | 963 | SSL_SESS_CACHE_OFF = 0x0000, |
wolfSSL | 11:cee25a834751 | 964 | SSL_SESS_CACHE_CLIENT = 0x0001, |
wolfSSL | 11:cee25a834751 | 965 | SSL_SESS_CACHE_SERVER = 0x0002, |
wolfSSL | 11:cee25a834751 | 966 | SSL_SESS_CACHE_BOTH = 0x0003, |
wolfSSL | 11:cee25a834751 | 967 | SSL_SESS_CACHE_NO_AUTO_CLEAR = 0x0008, |
wolfSSL | 11:cee25a834751 | 968 | SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 0x0100, |
wolfSSL | 11:cee25a834751 | 969 | SSL_SESS_CACHE_NO_INTERNAL_STORE = 0x0200, |
wolfSSL | 11:cee25a834751 | 970 | SSL_SESS_CACHE_NO_INTERNAL = 0x0300, |
wolfSSL | 11:cee25a834751 | 971 | |
wolfSSL | 11:cee25a834751 | 972 | SSL_ERROR_WANT_READ = 2, |
wolfSSL | 11:cee25a834751 | 973 | SSL_ERROR_WANT_WRITE = 3, |
wolfSSL | 11:cee25a834751 | 974 | SSL_ERROR_WANT_CONNECT = 7, |
wolfSSL | 11:cee25a834751 | 975 | SSL_ERROR_WANT_ACCEPT = 8, |
wolfSSL | 11:cee25a834751 | 976 | SSL_ERROR_SYSCALL = 5, |
wolfSSL | 11:cee25a834751 | 977 | SSL_ERROR_WANT_X509_LOOKUP = 83, |
wolfSSL | 11:cee25a834751 | 978 | SSL_ERROR_ZERO_RETURN = 6, |
wolfSSL | 11:cee25a834751 | 979 | SSL_ERROR_SSL = 85, |
wolfSSL | 11:cee25a834751 | 980 | |
wolfSSL | 11:cee25a834751 | 981 | SSL_SENT_SHUTDOWN = 1, |
wolfSSL | 11:cee25a834751 | 982 | SSL_RECEIVED_SHUTDOWN = 2, |
wolfSSL | 11:cee25a834751 | 983 | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 4, |
wolfSSL | 11:cee25a834751 | 984 | SSL_OP_NO_SSLv2 = 8, |
wolfSSL | 11:cee25a834751 | 985 | |
wolfSSL | 11:cee25a834751 | 986 | SSL_R_SSL_HANDSHAKE_FAILURE = 101, |
wolfSSL | 11:cee25a834751 | 987 | SSL_R_TLSV1_ALERT_UNKNOWN_CA = 102, |
wolfSSL | 11:cee25a834751 | 988 | SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 103, |
wolfSSL | 11:cee25a834751 | 989 | SSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 104, |
wolfSSL | 11:cee25a834751 | 990 | |
wolfSSL | 11:cee25a834751 | 991 | PEM_BUFSIZE = 1024 |
wolfSSL | 11:cee25a834751 | 992 | }; |
wolfSSL | 11:cee25a834751 | 993 | |
wolfSSL | 11:cee25a834751 | 994 | |
wolfSSL | 11:cee25a834751 | 995 | #ifndef NO_PSK |
wolfSSL | 11:cee25a834751 | 996 | typedef unsigned int (*wc_psk_client_callback)(WOLFSSL*, const char*, char*, |
wolfSSL | 11:cee25a834751 | 997 | unsigned int, unsigned char*, unsigned int); |
wolfSSL | 11:cee25a834751 | 998 | WOLFSSL_API void wolfSSL_CTX_set_psk_client_callback(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 999 | wc_psk_client_callback); |
wolfSSL | 11:cee25a834751 | 1000 | WOLFSSL_API void wolfSSL_set_psk_client_callback(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1001 | wc_psk_client_callback); |
wolfSSL | 11:cee25a834751 | 1002 | |
wolfSSL | 11:cee25a834751 | 1003 | WOLFSSL_API const char* wolfSSL_get_psk_identity_hint(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1004 | WOLFSSL_API const char* wolfSSL_get_psk_identity(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1005 | |
wolfSSL | 11:cee25a834751 | 1006 | WOLFSSL_API int wolfSSL_CTX_use_psk_identity_hint(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 1007 | WOLFSSL_API int wolfSSL_use_psk_identity_hint(WOLFSSL*, const char*); |
wolfSSL | 11:cee25a834751 | 1008 | |
wolfSSL | 11:cee25a834751 | 1009 | typedef unsigned int (*wc_psk_server_callback)(WOLFSSL*, const char*, |
wolfSSL | 11:cee25a834751 | 1010 | unsigned char*, unsigned int); |
wolfSSL | 11:cee25a834751 | 1011 | WOLFSSL_API void wolfSSL_CTX_set_psk_server_callback(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1012 | wc_psk_server_callback); |
wolfSSL | 11:cee25a834751 | 1013 | WOLFSSL_API void wolfSSL_set_psk_server_callback(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1014 | wc_psk_server_callback); |
wolfSSL | 11:cee25a834751 | 1015 | |
wolfSSL | 11:cee25a834751 | 1016 | #define PSK_TYPES_DEFINED |
wolfSSL | 11:cee25a834751 | 1017 | #endif /* NO_PSK */ |
wolfSSL | 11:cee25a834751 | 1018 | |
wolfSSL | 11:cee25a834751 | 1019 | |
wolfSSL | 11:cee25a834751 | 1020 | #ifdef HAVE_ANON |
wolfSSL | 11:cee25a834751 | 1021 | WOLFSSL_API int wolfSSL_CTX_allow_anon_cipher(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1022 | #endif /* HAVE_ANON */ |
wolfSSL | 11:cee25a834751 | 1023 | |
wolfSSL | 11:cee25a834751 | 1024 | |
wolfSSL | 11:cee25a834751 | 1025 | /* extra begins */ |
wolfSSL | 11:cee25a834751 | 1026 | |
wolfSSL | 11:cee25a834751 | 1027 | enum { /* ERR Constants */ |
wolfSSL | 11:cee25a834751 | 1028 | ERR_TXT_STRING = 1 |
wolfSSL | 11:cee25a834751 | 1029 | }; |
wolfSSL | 11:cee25a834751 | 1030 | |
wolfSSL | 11:cee25a834751 | 1031 | /* bio misc */ |
wolfSSL | 11:cee25a834751 | 1032 | enum { |
wolfSSL | 11:cee25a834751 | 1033 | WOLFSSL_BIO_ERROR = -1, |
wolfSSL | 11:cee25a834751 | 1034 | WOLFSSL_BIO_UNSET = -2, |
wolfSSL | 11:cee25a834751 | 1035 | WOLFSSL_BIO_SIZE = 17000 /* default BIO write size if not set */ |
wolfSSL | 11:cee25a834751 | 1036 | }; |
wolfSSL | 11:cee25a834751 | 1037 | |
wolfSSL | 11:cee25a834751 | 1038 | |
wolfSSL | 11:cee25a834751 | 1039 | WOLFSSL_API unsigned long wolfSSL_ERR_get_error_line_data(const char**, int*, |
wolfSSL | 11:cee25a834751 | 1040 | const char**, int *); |
wolfSSL | 11:cee25a834751 | 1041 | |
wolfSSL | 11:cee25a834751 | 1042 | WOLFSSL_API unsigned long wolfSSL_ERR_get_error(void); |
wolfSSL | 11:cee25a834751 | 1043 | WOLFSSL_API void wolfSSL_ERR_clear_error(void); |
wolfSSL | 11:cee25a834751 | 1044 | |
wolfSSL | 11:cee25a834751 | 1045 | |
wolfSSL | 11:cee25a834751 | 1046 | WOLFSSL_API int wolfSSL_RAND_status(void); |
wolfSSL | 11:cee25a834751 | 1047 | WOLFSSL_API int wolfSSL_RAND_bytes(unsigned char* buf, int num); |
wolfSSL | 11:cee25a834751 | 1048 | WOLFSSL_API WOLFSSL_METHOD *wolfSSLv23_server_method(void); |
wolfSSL | 11:cee25a834751 | 1049 | WOLFSSL_API long wolfSSL_CTX_set_options(WOLFSSL_CTX*, long); |
wolfSSL | 11:cee25a834751 | 1050 | #ifndef NO_CERTS |
wolfSSL | 11:cee25a834751 | 1051 | WOLFSSL_API int wolfSSL_CTX_check_private_key(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1052 | #endif /* !NO_CERTS */ |
wolfSSL | 11:cee25a834751 | 1053 | |
wolfSSL | 11:cee25a834751 | 1054 | WOLFSSL_API void wolfSSL_ERR_free_strings(void); |
wolfSSL | 11:cee25a834751 | 1055 | WOLFSSL_API void wolfSSL_ERR_remove_state(unsigned long); |
wolfSSL | 11:cee25a834751 | 1056 | WOLFSSL_API void wolfSSL_EVP_cleanup(void); |
wolfSSL | 11:cee25a834751 | 1057 | WOLFSSL_API int wolfSSL_clear(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1058 | WOLFSSL_API int wolfSSL_state(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1059 | |
wolfSSL | 11:cee25a834751 | 1060 | WOLFSSL_API void wolfSSL_cleanup_all_ex_data(void); |
wolfSSL | 11:cee25a834751 | 1061 | WOLFSSL_API long wolfSSL_CTX_set_mode(WOLFSSL_CTX* ctx, long mode); |
wolfSSL | 11:cee25a834751 | 1062 | WOLFSSL_API long wolfSSL_CTX_get_mode(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1063 | WOLFSSL_API void wolfSSL_CTX_set_default_read_ahead(WOLFSSL_CTX* ctx, int m); |
wolfSSL | 11:cee25a834751 | 1064 | WOLFSSL_API long wolfSSL_SSL_get_mode(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1065 | |
wolfSSL | 11:cee25a834751 | 1066 | |
wolfSSL | 11:cee25a834751 | 1067 | WOLFSSL_API int wolfSSL_CTX_set_default_verify_paths(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1068 | WOLFSSL_API int wolfSSL_CTX_set_session_id_context(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1069 | const unsigned char*, unsigned int); |
wolfSSL | 11:cee25a834751 | 1070 | WOLFSSL_API WOLFSSL_X509* wolfSSL_get_peer_certificate(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1071 | |
wolfSSL | 11:cee25a834751 | 1072 | WOLFSSL_API int wolfSSL_want_read(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1073 | WOLFSSL_API int wolfSSL_want_write(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1074 | |
wolfSSL | 11:cee25a834751 | 1075 | WOLFSSL_API int wolfSSL_BIO_printf(WOLFSSL_BIO*, const char*, ...); |
wolfSSL | 11:cee25a834751 | 1076 | WOLFSSL_API int wolfSSL_ASN1_UTCTIME_print(WOLFSSL_BIO*, |
wolfSSL | 11:cee25a834751 | 1077 | const WOLFSSL_ASN1_UTCTIME*); |
wolfSSL | 11:cee25a834751 | 1078 | WOLFSSL_API int wolfSSL_ASN1_GENERALIZEDTIME_print(WOLFSSL_BIO*, |
wolfSSL | 11:cee25a834751 | 1079 | const WOLFSSL_ASN1_GENERALIZEDTIME*); |
wolfSSL | 11:cee25a834751 | 1080 | WOLFSSL_API int wolfSSL_sk_num(WOLFSSL_X509_REVOKED*); |
wolfSSL | 11:cee25a834751 | 1081 | WOLFSSL_API void* wolfSSL_sk_value(WOLFSSL_X509_REVOKED*, int); |
wolfSSL | 11:cee25a834751 | 1082 | |
wolfSSL | 11:cee25a834751 | 1083 | /* stunnel 4.28 needs */ |
wolfSSL | 11:cee25a834751 | 1084 | WOLFSSL_API void* wolfSSL_CTX_get_ex_data(const WOLFSSL_CTX*, int); |
wolfSSL | 11:cee25a834751 | 1085 | WOLFSSL_API int wolfSSL_CTX_set_ex_data(WOLFSSL_CTX*, int, void*); |
wolfSSL | 11:cee25a834751 | 1086 | WOLFSSL_API void wolfSSL_CTX_sess_set_get_cb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1087 | WOLFSSL_SESSION*(*f)(WOLFSSL*, unsigned char*, int, int*)); |
wolfSSL | 11:cee25a834751 | 1088 | WOLFSSL_API void wolfSSL_CTX_sess_set_new_cb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1089 | int (*f)(WOLFSSL*, WOLFSSL_SESSION*)); |
wolfSSL | 11:cee25a834751 | 1090 | WOLFSSL_API void wolfSSL_CTX_sess_set_remove_cb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1091 | void (*f)(WOLFSSL_CTX*, WOLFSSL_SESSION*)); |
wolfSSL | 11:cee25a834751 | 1092 | |
wolfSSL | 11:cee25a834751 | 1093 | WOLFSSL_API int wolfSSL_i2d_SSL_SESSION(WOLFSSL_SESSION*,unsigned char**); |
wolfSSL | 11:cee25a834751 | 1094 | WOLFSSL_API WOLFSSL_SESSION* wolfSSL_d2i_SSL_SESSION(WOLFSSL_SESSION**, |
wolfSSL | 11:cee25a834751 | 1095 | const unsigned char**, long); |
wolfSSL | 11:cee25a834751 | 1096 | |
wolfSSL | 11:cee25a834751 | 1097 | WOLFSSL_API long wolfSSL_SESSION_get_timeout(const WOLFSSL_SESSION*); |
wolfSSL | 11:cee25a834751 | 1098 | WOLFSSL_API long wolfSSL_SESSION_get_time(const WOLFSSL_SESSION*); |
wolfSSL | 11:cee25a834751 | 1099 | WOLFSSL_API int wolfSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*); |
wolfSSL | 11:cee25a834751 | 1100 | |
wolfSSL | 11:cee25a834751 | 1101 | /* extra ends */ |
wolfSSL | 11:cee25a834751 | 1102 | |
wolfSSL | 11:cee25a834751 | 1103 | |
wolfSSL | 11:cee25a834751 | 1104 | /* wolfSSL extensions */ |
wolfSSL | 11:cee25a834751 | 1105 | |
wolfSSL | 11:cee25a834751 | 1106 | /* call before SSL_connect, if verifying will add name check to |
wolfSSL | 11:cee25a834751 | 1107 | date check and signature check */ |
wolfSSL | 11:cee25a834751 | 1108 | WOLFSSL_API int wolfSSL_check_domain_name(WOLFSSL* ssl, const char* dn); |
wolfSSL | 11:cee25a834751 | 1109 | |
wolfSSL | 11:cee25a834751 | 1110 | /* need to call once to load library (session cache) */ |
wolfSSL | 11:cee25a834751 | 1111 | WOLFSSL_API int wolfSSL_Init(void); |
wolfSSL | 11:cee25a834751 | 1112 | /* call when done to cleanup/free session cache mutex / resources */ |
wolfSSL | 11:cee25a834751 | 1113 | WOLFSSL_API int wolfSSL_Cleanup(void); |
wolfSSL | 11:cee25a834751 | 1114 | |
wolfSSL | 11:cee25a834751 | 1115 | /* which library version do we have */ |
wolfSSL | 11:cee25a834751 | 1116 | WOLFSSL_API const char* wolfSSL_lib_version(void); |
wolfSSL | 11:cee25a834751 | 1117 | /* which library version do we have in hex */ |
wolfSSL | 11:cee25a834751 | 1118 | WOLFSSL_API unsigned int wolfSSL_lib_version_hex(void); |
wolfSSL | 11:cee25a834751 | 1119 | |
wolfSSL | 11:cee25a834751 | 1120 | /* turn logging on, only if compiled in */ |
wolfSSL | 11:cee25a834751 | 1121 | WOLFSSL_API int wolfSSL_Debugging_ON(void); |
wolfSSL | 11:cee25a834751 | 1122 | /* turn logging off */ |
wolfSSL | 11:cee25a834751 | 1123 | WOLFSSL_API void wolfSSL_Debugging_OFF(void); |
wolfSSL | 11:cee25a834751 | 1124 | |
wolfSSL | 11:cee25a834751 | 1125 | /* do accept or connect depedning on side */ |
wolfSSL | 11:cee25a834751 | 1126 | WOLFSSL_API int wolfSSL_negotiate(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1127 | /* turn on wolfSSL data compression */ |
wolfSSL | 11:cee25a834751 | 1128 | WOLFSSL_API int wolfSSL_set_compression(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1129 | |
wolfSSL | 11:cee25a834751 | 1130 | WOLFSSL_API int wolfSSL_set_timeout(WOLFSSL*, unsigned int); |
wolfSSL | 11:cee25a834751 | 1131 | WOLFSSL_API int wolfSSL_CTX_set_timeout(WOLFSSL_CTX*, unsigned int); |
wolfSSL | 11:cee25a834751 | 1132 | |
wolfSSL | 11:cee25a834751 | 1133 | /* get wolfSSL peer X509_CHAIN */ |
wolfSSL | 11:cee25a834751 | 1134 | WOLFSSL_API WOLFSSL_X509_CHAIN* wolfSSL_get_peer_chain(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1135 | /* peer chain count */ |
wolfSSL | 11:cee25a834751 | 1136 | WOLFSSL_API int wolfSSL_get_chain_count(WOLFSSL_X509_CHAIN* chain); |
wolfSSL | 11:cee25a834751 | 1137 | /* index cert length */ |
wolfSSL | 11:cee25a834751 | 1138 | WOLFSSL_API int wolfSSL_get_chain_length(WOLFSSL_X509_CHAIN*, int idx); |
wolfSSL | 11:cee25a834751 | 1139 | /* index cert */ |
wolfSSL | 11:cee25a834751 | 1140 | WOLFSSL_API unsigned char* wolfSSL_get_chain_cert(WOLFSSL_X509_CHAIN*, int idx); |
wolfSSL | 11:cee25a834751 | 1141 | /* index cert in X509 */ |
wolfSSL | 11:cee25a834751 | 1142 | WOLFSSL_API WOLFSSL_X509* wolfSSL_get_chain_X509(WOLFSSL_X509_CHAIN*, int idx); |
wolfSSL | 11:cee25a834751 | 1143 | /* free X509 */ |
wolfSSL | 11:cee25a834751 | 1144 | WOLFSSL_API void wolfSSL_FreeX509(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1145 | /* get index cert in PEM */ |
wolfSSL | 11:cee25a834751 | 1146 | WOLFSSL_API int wolfSSL_get_chain_cert_pem(WOLFSSL_X509_CHAIN*, int idx, |
wolfSSL | 11:cee25a834751 | 1147 | unsigned char* buf, int inLen, int* outLen); |
wolfSSL | 11:cee25a834751 | 1148 | WOLFSSL_API const unsigned char* wolfSSL_get_sessionID(const WOLFSSL_SESSION* s); |
wolfSSL | 11:cee25a834751 | 1149 | WOLFSSL_API int wolfSSL_X509_get_serial_number(WOLFSSL_X509*,unsigned char*,int*); |
wolfSSL | 11:cee25a834751 | 1150 | WOLFSSL_API char* wolfSSL_X509_get_subjectCN(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1151 | WOLFSSL_API const unsigned char* wolfSSL_X509_get_der(WOLFSSL_X509*, int*); |
wolfSSL | 11:cee25a834751 | 1152 | WOLFSSL_API const unsigned char* wolfSSL_X509_notBefore(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1153 | WOLFSSL_API const unsigned char* wolfSSL_X509_notAfter(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1154 | WOLFSSL_API int wolfSSL_X509_version(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1155 | |
wolfSSL | 11:cee25a834751 | 1156 | WOLFSSL_API int wolfSSL_cmp_peer_cert_to_file(WOLFSSL*, const char*); |
wolfSSL | 11:cee25a834751 | 1157 | |
wolfSSL | 11:cee25a834751 | 1158 | WOLFSSL_API char* wolfSSL_X509_get_next_altname(WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 1159 | |
wolfSSL | 11:cee25a834751 | 1160 | WOLFSSL_API WOLFSSL_X509* |
wolfSSL | 11:cee25a834751 | 1161 | wolfSSL_X509_d2i(WOLFSSL_X509** x509, const unsigned char* in, int len); |
wolfSSL | 11:cee25a834751 | 1162 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1163 | #ifndef NO_STDIO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1164 | WOLFSSL_API WOLFSSL_X509* |
wolfSSL | 11:cee25a834751 | 1165 | wolfSSL_X509_d2i_fp(WOLFSSL_X509** x509, FILE* file); |
wolfSSL | 11:cee25a834751 | 1166 | #endif |
wolfSSL | 11:cee25a834751 | 1167 | WOLFSSL_API WOLFSSL_X509* |
wolfSSL | 11:cee25a834751 | 1168 | wolfSSL_X509_load_certificate_file(const char* fname, int format); |
wolfSSL | 11:cee25a834751 | 1169 | #endif |
wolfSSL | 11:cee25a834751 | 1170 | WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_load_certificate_buffer( |
wolfSSL | 11:cee25a834751 | 1171 | const unsigned char* buf, int sz, int format); |
wolfSSL | 11:cee25a834751 | 1172 | |
wolfSSL | 11:cee25a834751 | 1173 | #ifdef WOLFSSL_SEP |
wolfSSL | 11:cee25a834751 | 1174 | WOLFSSL_API unsigned char* |
wolfSSL | 11:cee25a834751 | 1175 | wolfSSL_X509_get_device_type(WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 1176 | WOLFSSL_API unsigned char* |
wolfSSL | 11:cee25a834751 | 1177 | wolfSSL_X509_get_hw_type(WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 1178 | WOLFSSL_API unsigned char* |
wolfSSL | 11:cee25a834751 | 1179 | wolfSSL_X509_get_hw_serial_number(WOLFSSL_X509*, unsigned char*, int*); |
wolfSSL | 11:cee25a834751 | 1180 | #endif |
wolfSSL | 11:cee25a834751 | 1181 | |
wolfSSL | 11:cee25a834751 | 1182 | /* connect enough to get peer cert */ |
wolfSSL | 11:cee25a834751 | 1183 | WOLFSSL_API int wolfSSL_connect_cert(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1184 | |
wolfSSL | 11:cee25a834751 | 1185 | |
wolfSSL | 11:cee25a834751 | 1186 | |
wolfSSL | 11:cee25a834751 | 1187 | /* PKCS12 compatibility */ |
wolfSSL | 11:cee25a834751 | 1188 | typedef struct WC_PKCS12 WC_PKCS12; |
wolfSSL | 11:cee25a834751 | 1189 | WOLFSSL_API WC_PKCS12* wolfSSL_d2i_PKCS12_bio(WOLFSSL_BIO* bio, |
wolfSSL | 11:cee25a834751 | 1190 | WC_PKCS12** pkcs12); |
wolfSSL | 11:cee25a834751 | 1191 | WOLFSSL_API int wolfSSL_PKCS12_parse(WC_PKCS12* pkcs12, const char* psw, |
wolfSSL | 11:cee25a834751 | 1192 | WOLFSSL_EVP_PKEY** pkey, WOLFSSL_X509** cert, STACK_OF(WOLFSSL_X509)** ca); |
wolfSSL | 11:cee25a834751 | 1193 | WOLFSSL_API void wolfSSL_PKCS12_PBE_add(void); |
wolfSSL | 11:cee25a834751 | 1194 | |
wolfSSL | 11:cee25a834751 | 1195 | |
wolfSSL | 11:cee25a834751 | 1196 | |
wolfSSL | 11:cee25a834751 | 1197 | #ifndef NO_DH |
wolfSSL | 11:cee25a834751 | 1198 | /* server Diffie-Hellman parameters */ |
wolfSSL | 11:cee25a834751 | 1199 | WOLFSSL_API int wolfSSL_SetTmpDH(WOLFSSL*, const unsigned char* p, int pSz, |
wolfSSL | 11:cee25a834751 | 1200 | const unsigned char* g, int gSz); |
wolfSSL | 11:cee25a834751 | 1201 | WOLFSSL_API int wolfSSL_SetTmpDH_buffer(WOLFSSL*, const unsigned char* b, long sz, |
wolfSSL | 11:cee25a834751 | 1202 | int format); |
wolfSSL | 11:cee25a834751 | 1203 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1204 | WOLFSSL_API int wolfSSL_SetTmpDH_file(WOLFSSL*, const char* f, int format); |
wolfSSL | 11:cee25a834751 | 1205 | #endif |
wolfSSL | 11:cee25a834751 | 1206 | |
wolfSSL | 11:cee25a834751 | 1207 | /* server ctx Diffie-Hellman parameters */ |
wolfSSL | 11:cee25a834751 | 1208 | WOLFSSL_API int wolfSSL_CTX_SetTmpDH(WOLFSSL_CTX*, const unsigned char* p, |
wolfSSL | 11:cee25a834751 | 1209 | int pSz, const unsigned char* g, int gSz); |
wolfSSL | 11:cee25a834751 | 1210 | WOLFSSL_API int wolfSSL_CTX_SetTmpDH_buffer(WOLFSSL_CTX*, const unsigned char* b, |
wolfSSL | 11:cee25a834751 | 1211 | long sz, int format); |
wolfSSL | 11:cee25a834751 | 1212 | |
wolfSSL | 11:cee25a834751 | 1213 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1214 | WOLFSSL_API int wolfSSL_CTX_SetTmpDH_file(WOLFSSL_CTX*, const char* f, |
wolfSSL | 11:cee25a834751 | 1215 | int format); |
wolfSSL | 11:cee25a834751 | 1216 | #endif |
wolfSSL | 11:cee25a834751 | 1217 | |
wolfSSL | 11:cee25a834751 | 1218 | WOLFSSL_API int wolfSSL_CTX_SetMinDhKey_Sz(WOLFSSL_CTX*, unsigned short); |
wolfSSL | 11:cee25a834751 | 1219 | WOLFSSL_API int wolfSSL_SetMinDhKey_Sz(WOLFSSL*, unsigned short); |
wolfSSL | 11:cee25a834751 | 1220 | WOLFSSL_API int wolfSSL_GetDhKey_Sz(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1221 | #endif /* NO_DH */ |
wolfSSL | 11:cee25a834751 | 1222 | |
wolfSSL | 11:cee25a834751 | 1223 | #ifndef NO_RSA |
wolfSSL | 11:cee25a834751 | 1224 | WOLFSSL_API int wolfSSL_CTX_SetMinRsaKey_Sz(WOLFSSL_CTX*, short); |
wolfSSL | 11:cee25a834751 | 1225 | WOLFSSL_API int wolfSSL_SetMinRsaKey_Sz(WOLFSSL*, short); |
wolfSSL | 11:cee25a834751 | 1226 | #endif /* NO_RSA */ |
wolfSSL | 11:cee25a834751 | 1227 | |
wolfSSL | 11:cee25a834751 | 1228 | #ifdef HAVE_ECC |
wolfSSL | 11:cee25a834751 | 1229 | WOLFSSL_API int wolfSSL_CTX_SetMinEccKey_Sz(WOLFSSL_CTX*, short); |
wolfSSL | 11:cee25a834751 | 1230 | WOLFSSL_API int wolfSSL_SetMinEccKey_Sz(WOLFSSL*, short); |
wolfSSL | 11:cee25a834751 | 1231 | #endif /* NO_RSA */ |
wolfSSL | 11:cee25a834751 | 1232 | |
wolfSSL | 11:cee25a834751 | 1233 | WOLFSSL_API int wolfSSL_SetTmpEC_DHE_Sz(WOLFSSL*, unsigned short); |
wolfSSL | 11:cee25a834751 | 1234 | WOLFSSL_API int wolfSSL_CTX_SetTmpEC_DHE_Sz(WOLFSSL_CTX*, unsigned short); |
wolfSSL | 11:cee25a834751 | 1235 | |
wolfSSL | 11:cee25a834751 | 1236 | /* keyblock size in bytes or -1 */ |
wolfSSL | 11:cee25a834751 | 1237 | /* need to call wolfSSL_KeepArrays before handshake to save keys */ |
wolfSSL | 11:cee25a834751 | 1238 | WOLFSSL_API int wolfSSL_get_keyblock_size(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1239 | WOLFSSL_API int wolfSSL_get_keys(WOLFSSL*,unsigned char** ms, unsigned int* msLen, |
wolfSSL | 11:cee25a834751 | 1240 | unsigned char** sr, unsigned int* srLen, |
wolfSSL | 11:cee25a834751 | 1241 | unsigned char** cr, unsigned int* crLen); |
wolfSSL | 11:cee25a834751 | 1242 | |
wolfSSL | 11:cee25a834751 | 1243 | /* Computes EAP-TLS and EAP-TTLS keying material from the master_secret. */ |
wolfSSL | 11:cee25a834751 | 1244 | WOLFSSL_API int wolfSSL_make_eap_keys(WOLFSSL*, void* key, unsigned int len, |
wolfSSL | 11:cee25a834751 | 1245 | const char* label); |
wolfSSL | 11:cee25a834751 | 1246 | |
wolfSSL | 11:cee25a834751 | 1247 | |
wolfSSL | 11:cee25a834751 | 1248 | #ifndef _WIN32 |
wolfSSL | 11:cee25a834751 | 1249 | #ifndef NO_WRITEV |
wolfSSL | 11:cee25a834751 | 1250 | #ifdef __PPU |
wolfSSL | 11:cee25a834751 | 1251 | #include <sys/types.h> |
wolfSSL | 11:cee25a834751 | 1252 | #include <sys/socket.h> |
wolfSSL | 11:cee25a834751 | 1253 | #elif !defined(WOLFSSL_MDK_ARM) && !defined(WOLFSSL_IAR_ARM) && \ |
wolfSSL | 11:cee25a834751 | 1254 | !defined(WOLFSSL_PICOTCP) && !defined(WOLFSSL_ROWLEY_ARM) && \ |
wolfSSL | 11:cee25a834751 | 1255 | !defined(WOLFSSL_EMBOS) && !defined(WOLFSSL_FROSTED) |
wolfSSL | 11:cee25a834751 | 1256 | #include <sys/uio.h> |
wolfSSL | 11:cee25a834751 | 1257 | #endif |
wolfSSL | 11:cee25a834751 | 1258 | /* allow writev style writing */ |
wolfSSL | 11:cee25a834751 | 1259 | WOLFSSL_API int wolfSSL_writev(WOLFSSL* ssl, const struct iovec* iov, |
wolfSSL | 11:cee25a834751 | 1260 | int iovcnt); |
wolfSSL | 11:cee25a834751 | 1261 | #endif |
wolfSSL | 11:cee25a834751 | 1262 | #endif |
wolfSSL | 11:cee25a834751 | 1263 | |
wolfSSL | 11:cee25a834751 | 1264 | |
wolfSSL | 11:cee25a834751 | 1265 | #ifndef NO_CERTS |
wolfSSL | 11:cee25a834751 | 1266 | /* SSL_CTX versions */ |
wolfSSL | 11:cee25a834751 | 1267 | WOLFSSL_API int wolfSSL_CTX_UnloadCAs(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1268 | #ifdef WOLFSSL_TRUST_PEER_CERT |
wolfSSL | 11:cee25a834751 | 1269 | WOLFSSL_API int wolfSSL_CTX_Unload_trust_peers(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1270 | WOLFSSL_API int wolfSSL_CTX_trust_peer_buffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1271 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1272 | #endif |
wolfSSL | 11:cee25a834751 | 1273 | WOLFSSL_API int wolfSSL_CTX_load_verify_buffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1274 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1275 | WOLFSSL_API int wolfSSL_CTX_use_certificate_buffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1276 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1277 | WOLFSSL_API int wolfSSL_CTX_use_PrivateKey_buffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1278 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1279 | WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer_format(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1280 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1281 | WOLFSSL_API int wolfSSL_CTX_use_certificate_chain_buffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1282 | const unsigned char*, long); |
wolfSSL | 11:cee25a834751 | 1283 | |
wolfSSL | 11:cee25a834751 | 1284 | /* SSL versions */ |
wolfSSL | 11:cee25a834751 | 1285 | WOLFSSL_API int wolfSSL_use_certificate_buffer(WOLFSSL*, const unsigned char*, |
wolfSSL | 11:cee25a834751 | 1286 | long, int); |
wolfSSL | 11:cee25a834751 | 1287 | WOLFSSL_API int wolfSSL_use_PrivateKey_buffer(WOLFSSL*, const unsigned char*, |
wolfSSL | 11:cee25a834751 | 1288 | long, int); |
wolfSSL | 11:cee25a834751 | 1289 | WOLFSSL_API int wolfSSL_use_certificate_chain_buffer_format(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1290 | const unsigned char*, long, int); |
wolfSSL | 11:cee25a834751 | 1291 | WOLFSSL_API int wolfSSL_use_certificate_chain_buffer(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1292 | const unsigned char*, long); |
wolfSSL | 11:cee25a834751 | 1293 | WOLFSSL_API int wolfSSL_UnloadCertsKeys(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1294 | |
wolfSSL | 11:cee25a834751 | 1295 | #if defined(OPENSSL_EXTRA) && defined(KEEP_OUR_CERT) |
wolfSSL | 11:cee25a834751 | 1296 | WOLFSSL_API WOLFSSL_X509* wolfSSL_get_certificate(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1297 | #endif |
wolfSSL | 11:cee25a834751 | 1298 | #endif |
wolfSSL | 11:cee25a834751 | 1299 | |
wolfSSL | 11:cee25a834751 | 1300 | WOLFSSL_API int wolfSSL_CTX_set_group_messages(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1301 | WOLFSSL_API int wolfSSL_set_group_messages(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1302 | |
wolfSSL | 11:cee25a834751 | 1303 | |
wolfSSL | 11:cee25a834751 | 1304 | #ifdef HAVE_FUZZER |
wolfSSL | 11:cee25a834751 | 1305 | enum fuzzer_type { |
wolfSSL | 11:cee25a834751 | 1306 | FUZZ_HMAC = 0, |
wolfSSL | 11:cee25a834751 | 1307 | FUZZ_ENCRYPT = 1, |
wolfSSL | 11:cee25a834751 | 1308 | FUZZ_SIGNATURE = 2, |
wolfSSL | 11:cee25a834751 | 1309 | FUZZ_HASH = 3, |
wolfSSL | 11:cee25a834751 | 1310 | FUZZ_HEAD = 4 |
wolfSSL | 11:cee25a834751 | 1311 | }; |
wolfSSL | 11:cee25a834751 | 1312 | |
wolfSSL | 11:cee25a834751 | 1313 | typedef int (*CallbackFuzzer)(WOLFSSL* ssl, const unsigned char* buf, int sz, |
wolfSSL | 11:cee25a834751 | 1314 | int type, void* fuzzCtx); |
wolfSSL | 11:cee25a834751 | 1315 | |
wolfSSL | 11:cee25a834751 | 1316 | WOLFSSL_API void wolfSSL_SetFuzzerCb(WOLFSSL* ssl, CallbackFuzzer cbf, void* fCtx); |
wolfSSL | 11:cee25a834751 | 1317 | #endif |
wolfSSL | 11:cee25a834751 | 1318 | |
wolfSSL | 11:cee25a834751 | 1319 | |
wolfSSL | 11:cee25a834751 | 1320 | WOLFSSL_API int wolfSSL_DTLS_SetCookieSecret(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1321 | const unsigned char*, |
wolfSSL | 11:cee25a834751 | 1322 | unsigned int); |
wolfSSL | 11:cee25a834751 | 1323 | |
wolfSSL | 11:cee25a834751 | 1324 | |
wolfSSL | 11:cee25a834751 | 1325 | /* I/O Callback default errors */ |
wolfSSL | 11:cee25a834751 | 1326 | enum IOerrors { |
wolfSSL | 11:cee25a834751 | 1327 | WOLFSSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */ |
wolfSSL | 11:cee25a834751 | 1328 | WOLFSSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */ |
wolfSSL | 11:cee25a834751 | 1329 | WOLFSSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */ |
wolfSSL | 11:cee25a834751 | 1330 | WOLFSSL_CBIO_ERR_CONN_RST = -3, /* connection reset */ |
wolfSSL | 11:cee25a834751 | 1331 | WOLFSSL_CBIO_ERR_ISR = -4, /* interrupt */ |
wolfSSL | 11:cee25a834751 | 1332 | WOLFSSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */ |
wolfSSL | 11:cee25a834751 | 1333 | WOLFSSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */ |
wolfSSL | 11:cee25a834751 | 1334 | }; |
wolfSSL | 11:cee25a834751 | 1335 | |
wolfSSL | 11:cee25a834751 | 1336 | |
wolfSSL | 11:cee25a834751 | 1337 | /* CA cache callbacks */ |
wolfSSL | 11:cee25a834751 | 1338 | enum { |
wolfSSL | 11:cee25a834751 | 1339 | WOLFSSL_SSLV3 = 0, |
wolfSSL | 11:cee25a834751 | 1340 | WOLFSSL_TLSV1 = 1, |
wolfSSL | 11:cee25a834751 | 1341 | WOLFSSL_TLSV1_1 = 2, |
wolfSSL | 11:cee25a834751 | 1342 | WOLFSSL_TLSV1_2 = 3, |
wolfSSL | 11:cee25a834751 | 1343 | WOLFSSL_USER_CA = 1, /* user added as trusted */ |
wolfSSL | 11:cee25a834751 | 1344 | WOLFSSL_CHAIN_CA = 2 /* added to cache from trusted chain */ |
wolfSSL | 11:cee25a834751 | 1345 | }; |
wolfSSL | 11:cee25a834751 | 1346 | |
wolfSSL | 11:cee25a834751 | 1347 | WOLFSSL_API WC_RNG* wolfSSL_GetRNG(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1348 | |
wolfSSL | 11:cee25a834751 | 1349 | WOLFSSL_API int wolfSSL_CTX_SetMinVersion(WOLFSSL_CTX* ctx, int version); |
wolfSSL | 11:cee25a834751 | 1350 | WOLFSSL_API int wolfSSL_SetMinVersion(WOLFSSL* ssl, int version); |
wolfSSL | 11:cee25a834751 | 1351 | WOLFSSL_API int wolfSSL_GetObjectSize(void); /* object size based on build */ |
wolfSSL | 11:cee25a834751 | 1352 | WOLFSSL_API int wolfSSL_GetOutputSize(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 1353 | WOLFSSL_API int wolfSSL_GetMaxOutputSize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1354 | WOLFSSL_API int wolfSSL_SetVersion(WOLFSSL* ssl, int version); |
wolfSSL | 11:cee25a834751 | 1355 | WOLFSSL_API int wolfSSL_KeyPemToDer(const unsigned char*, int, |
wolfSSL | 11:cee25a834751 | 1356 | unsigned char*, int, const char*); |
wolfSSL | 11:cee25a834751 | 1357 | WOLFSSL_API int wolfSSL_CertPemToDer(const unsigned char*, int, |
wolfSSL | 11:cee25a834751 | 1358 | unsigned char*, int, int); |
wolfSSL | 11:cee25a834751 | 1359 | #if defined(WOLFSSL_CERT_EXT) || defined(WOLFSSL_PUB_PEM_TO_DER) |
wolfSSL | 11:cee25a834751 | 1360 | #ifndef WOLFSSL_PEMPUBKEY_TODER_DEFINED |
wolfSSL | 11:cee25a834751 | 1361 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1362 | WOLFSSL_API int wolfSSL_PemPubKeyToDer(const char* fileName, |
wolfSSL | 11:cee25a834751 | 1363 | unsigned char* derBuf, int derSz); |
wolfSSL | 11:cee25a834751 | 1364 | #endif |
wolfSSL | 11:cee25a834751 | 1365 | WOLFSSL_API int wolfSSL_PubKeyPemToDer(const unsigned char*, int, |
wolfSSL | 11:cee25a834751 | 1366 | unsigned char*, int); |
wolfSSL | 11:cee25a834751 | 1367 | #define WOLFSSL_PEMPUBKEY_TODER_DEFINED |
wolfSSL | 11:cee25a834751 | 1368 | #endif /* WOLFSSL_PEMPUBKEY_TODER_DEFINED */ |
wolfSSL | 11:cee25a834751 | 1369 | #endif /* WOLFSSL_CERT_EXT || WOLFSSL_PUB_PEM_TO_DER*/ |
wolfSSL | 11:cee25a834751 | 1370 | |
wolfSSL | 11:cee25a834751 | 1371 | typedef void (*CallbackCACache)(unsigned char* der, int sz, int type); |
wolfSSL | 11:cee25a834751 | 1372 | typedef void (*CbMissingCRL)(const char* url); |
wolfSSL | 11:cee25a834751 | 1373 | typedef int (*CbOCSPIO)(void*, const char*, int, |
wolfSSL | 11:cee25a834751 | 1374 | unsigned char*, int, unsigned char**); |
wolfSSL | 11:cee25a834751 | 1375 | typedef void (*CbOCSPRespFree)(void*,unsigned char*); |
wolfSSL | 11:cee25a834751 | 1376 | |
wolfSSL | 11:cee25a834751 | 1377 | #ifdef HAVE_CRL_IO |
wolfSSL | 11:cee25a834751 | 1378 | typedef int (*CbCrlIO)(WOLFSSL_CRL* crl, const char* url, int urlSz); |
wolfSSL | 11:cee25a834751 | 1379 | #endif |
wolfSSL | 11:cee25a834751 | 1380 | |
wolfSSL | 11:cee25a834751 | 1381 | /* User Atomic Record Layer CallBacks */ |
wolfSSL | 11:cee25a834751 | 1382 | typedef int (*CallbackMacEncrypt)(WOLFSSL* ssl, unsigned char* macOut, |
wolfSSL | 11:cee25a834751 | 1383 | const unsigned char* macIn, unsigned int macInSz, int macContent, |
wolfSSL | 11:cee25a834751 | 1384 | int macVerify, unsigned char* encOut, const unsigned char* encIn, |
wolfSSL | 11:cee25a834751 | 1385 | unsigned int encSz, void* ctx); |
wolfSSL | 11:cee25a834751 | 1386 | WOLFSSL_API void wolfSSL_CTX_SetMacEncryptCb(WOLFSSL_CTX*, CallbackMacEncrypt); |
wolfSSL | 11:cee25a834751 | 1387 | WOLFSSL_API void wolfSSL_SetMacEncryptCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1388 | WOLFSSL_API void* wolfSSL_GetMacEncryptCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1389 | |
wolfSSL | 11:cee25a834751 | 1390 | typedef int (*CallbackDecryptVerify)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1391 | unsigned char* decOut, const unsigned char* decIn, |
wolfSSL | 11:cee25a834751 | 1392 | unsigned int decSz, int content, int verify, unsigned int* padSz, |
wolfSSL | 11:cee25a834751 | 1393 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1394 | WOLFSSL_API void wolfSSL_CTX_SetDecryptVerifyCb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1395 | CallbackDecryptVerify); |
wolfSSL | 11:cee25a834751 | 1396 | WOLFSSL_API void wolfSSL_SetDecryptVerifyCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1397 | WOLFSSL_API void* wolfSSL_GetDecryptVerifyCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1398 | |
wolfSSL | 11:cee25a834751 | 1399 | WOLFSSL_API const unsigned char* wolfSSL_GetMacSecret(WOLFSSL*, int); |
wolfSSL | 11:cee25a834751 | 1400 | WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteKey(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1401 | WOLFSSL_API const unsigned char* wolfSSL_GetClientWriteIV(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1402 | WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteKey(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1403 | WOLFSSL_API const unsigned char* wolfSSL_GetServerWriteIV(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1404 | WOLFSSL_API int wolfSSL_GetKeySize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1405 | WOLFSSL_API int wolfSSL_GetIVSize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1406 | WOLFSSL_API int wolfSSL_GetSide(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1407 | WOLFSSL_API int wolfSSL_IsTLSv1_1(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1408 | WOLFSSL_API int wolfSSL_GetBulkCipher(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1409 | WOLFSSL_API int wolfSSL_GetCipherBlockSize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1410 | WOLFSSL_API int wolfSSL_GetAeadMacSize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1411 | WOLFSSL_API int wolfSSL_GetHmacSize(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1412 | WOLFSSL_API int wolfSSL_GetHmacType(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1413 | WOLFSSL_API int wolfSSL_GetCipherType(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1414 | WOLFSSL_API int wolfSSL_SetTlsHmacInner(WOLFSSL*, unsigned char*, |
wolfSSL | 11:cee25a834751 | 1415 | unsigned int, int, int); |
wolfSSL | 11:cee25a834751 | 1416 | |
wolfSSL | 11:cee25a834751 | 1417 | /* Atomic User Needs */ |
wolfSSL | 11:cee25a834751 | 1418 | enum { |
wolfSSL | 11:cee25a834751 | 1419 | WOLFSSL_SERVER_END = 0, |
wolfSSL | 11:cee25a834751 | 1420 | WOLFSSL_CLIENT_END = 1, |
wolfSSL | 11:cee25a834751 | 1421 | WOLFSSL_NEITHER_END = 3, |
wolfSSL | 11:cee25a834751 | 1422 | WOLFSSL_BLOCK_TYPE = 2, |
wolfSSL | 11:cee25a834751 | 1423 | WOLFSSL_STREAM_TYPE = 3, |
wolfSSL | 11:cee25a834751 | 1424 | WOLFSSL_AEAD_TYPE = 4, |
wolfSSL | 11:cee25a834751 | 1425 | WOLFSSL_TLS_HMAC_INNER_SZ = 13 /* SEQ_SZ + ENUM + VERSION_SZ + LEN_SZ */ |
wolfSSL | 11:cee25a834751 | 1426 | }; |
wolfSSL | 11:cee25a834751 | 1427 | |
wolfSSL | 11:cee25a834751 | 1428 | /* for GetBulkCipher and internal use */ |
wolfSSL | 11:cee25a834751 | 1429 | enum BulkCipherAlgorithm { |
wolfSSL | 11:cee25a834751 | 1430 | wolfssl_cipher_null, |
wolfSSL | 11:cee25a834751 | 1431 | wolfssl_rc4, |
wolfSSL | 11:cee25a834751 | 1432 | wolfssl_rc2, |
wolfSSL | 11:cee25a834751 | 1433 | wolfssl_des, |
wolfSSL | 11:cee25a834751 | 1434 | wolfssl_triple_des, /* leading 3 (3des) not valid identifier */ |
wolfSSL | 11:cee25a834751 | 1435 | wolfssl_des40, |
wolfSSL | 11:cee25a834751 | 1436 | wolfssl_idea, |
wolfSSL | 11:cee25a834751 | 1437 | wolfssl_aes, |
wolfSSL | 11:cee25a834751 | 1438 | wolfssl_aes_gcm, |
wolfSSL | 11:cee25a834751 | 1439 | wolfssl_aes_ccm, |
wolfSSL | 11:cee25a834751 | 1440 | wolfssl_chacha, |
wolfSSL | 11:cee25a834751 | 1441 | wolfssl_camellia, |
wolfSSL | 11:cee25a834751 | 1442 | wolfssl_hc128, /* wolfSSL extensions */ |
wolfSSL | 11:cee25a834751 | 1443 | wolfssl_rabbit |
wolfSSL | 11:cee25a834751 | 1444 | }; |
wolfSSL | 11:cee25a834751 | 1445 | |
wolfSSL | 11:cee25a834751 | 1446 | |
wolfSSL | 11:cee25a834751 | 1447 | /* for KDF TLS 1.2 mac types */ |
wolfSSL | 11:cee25a834751 | 1448 | enum KDF_MacAlgorithm { |
wolfSSL | 11:cee25a834751 | 1449 | wolfssl_sha256 = 4, /* needs to match internal MACAlgorithm */ |
wolfSSL | 11:cee25a834751 | 1450 | wolfssl_sha384, |
wolfSSL | 11:cee25a834751 | 1451 | wolfssl_sha512 |
wolfSSL | 11:cee25a834751 | 1452 | }; |
wolfSSL | 11:cee25a834751 | 1453 | |
wolfSSL | 11:cee25a834751 | 1454 | |
wolfSSL | 11:cee25a834751 | 1455 | /* Public Key Callback support */ |
wolfSSL | 11:cee25a834751 | 1456 | typedef int (*CallbackEccSign)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1457 | const unsigned char* in, unsigned int inSz, |
wolfSSL | 11:cee25a834751 | 1458 | unsigned char* out, unsigned int* outSz, |
wolfSSL | 11:cee25a834751 | 1459 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1460 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1461 | WOLFSSL_API void wolfSSL_CTX_SetEccSignCb(WOLFSSL_CTX*, CallbackEccSign); |
wolfSSL | 11:cee25a834751 | 1462 | WOLFSSL_API void wolfSSL_SetEccSignCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1463 | WOLFSSL_API void* wolfSSL_GetEccSignCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1464 | |
wolfSSL | 11:cee25a834751 | 1465 | typedef int (*CallbackEccVerify)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1466 | const unsigned char* sig, unsigned int sigSz, |
wolfSSL | 11:cee25a834751 | 1467 | const unsigned char* hash, unsigned int hashSz, |
wolfSSL | 11:cee25a834751 | 1468 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1469 | int* result, void* ctx); |
wolfSSL | 11:cee25a834751 | 1470 | WOLFSSL_API void wolfSSL_CTX_SetEccVerifyCb(WOLFSSL_CTX*, CallbackEccVerify); |
wolfSSL | 11:cee25a834751 | 1471 | WOLFSSL_API void wolfSSL_SetEccVerifyCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1472 | WOLFSSL_API void* wolfSSL_GetEccVerifyCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1473 | |
wolfSSL | 11:cee25a834751 | 1474 | struct ecc_key; |
wolfSSL | 11:cee25a834751 | 1475 | typedef int (*CallbackEccSharedSecret)(WOLFSSL* ssl, struct ecc_key* otherKey, |
wolfSSL | 11:cee25a834751 | 1476 | unsigned char* pubKeyDer, unsigned int* pubKeySz, |
wolfSSL | 11:cee25a834751 | 1477 | unsigned char* out, unsigned int* outlen, |
wolfSSL | 11:cee25a834751 | 1478 | int side, void* ctx); /* side is WOLFSSL_CLIENT_END or WOLFSSL_SERVER_END */ |
wolfSSL | 11:cee25a834751 | 1479 | WOLFSSL_API void wolfSSL_CTX_SetEccSharedSecretCb(WOLFSSL_CTX*, CallbackEccSharedSecret); |
wolfSSL | 11:cee25a834751 | 1480 | WOLFSSL_API void wolfSSL_SetEccSharedSecretCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1481 | WOLFSSL_API void* wolfSSL_GetEccSharedSecretCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1482 | |
wolfSSL | 11:cee25a834751 | 1483 | typedef int (*CallbackRsaSign)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1484 | const unsigned char* in, unsigned int inSz, |
wolfSSL | 11:cee25a834751 | 1485 | unsigned char* out, unsigned int* outSz, |
wolfSSL | 11:cee25a834751 | 1486 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1487 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1488 | WOLFSSL_API void wolfSSL_CTX_SetRsaSignCb(WOLFSSL_CTX*, CallbackRsaSign); |
wolfSSL | 11:cee25a834751 | 1489 | WOLFSSL_API void wolfSSL_SetRsaSignCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1490 | WOLFSSL_API void* wolfSSL_GetRsaSignCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1491 | |
wolfSSL | 11:cee25a834751 | 1492 | typedef int (*CallbackRsaVerify)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1493 | unsigned char* sig, unsigned int sigSz, |
wolfSSL | 11:cee25a834751 | 1494 | unsigned char** out, |
wolfSSL | 11:cee25a834751 | 1495 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1496 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1497 | WOLFSSL_API void wolfSSL_CTX_SetRsaVerifyCb(WOLFSSL_CTX*, CallbackRsaVerify); |
wolfSSL | 11:cee25a834751 | 1498 | WOLFSSL_API void wolfSSL_SetRsaVerifyCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1499 | WOLFSSL_API void* wolfSSL_GetRsaVerifyCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1500 | |
wolfSSL | 11:cee25a834751 | 1501 | /* RSA Public Encrypt cb */ |
wolfSSL | 11:cee25a834751 | 1502 | typedef int (*CallbackRsaEnc)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1503 | const unsigned char* in, unsigned int inSz, |
wolfSSL | 11:cee25a834751 | 1504 | unsigned char* out, unsigned int* outSz, |
wolfSSL | 11:cee25a834751 | 1505 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1506 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1507 | WOLFSSL_API void wolfSSL_CTX_SetRsaEncCb(WOLFSSL_CTX*, CallbackRsaEnc); |
wolfSSL | 11:cee25a834751 | 1508 | WOLFSSL_API void wolfSSL_SetRsaEncCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1509 | WOLFSSL_API void* wolfSSL_GetRsaEncCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1510 | |
wolfSSL | 11:cee25a834751 | 1511 | /* RSA Private Decrypt cb */ |
wolfSSL | 11:cee25a834751 | 1512 | typedef int (*CallbackRsaDec)(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1513 | unsigned char* in, unsigned int inSz, |
wolfSSL | 11:cee25a834751 | 1514 | unsigned char** out, |
wolfSSL | 11:cee25a834751 | 1515 | const unsigned char* keyDer, unsigned int keySz, |
wolfSSL | 11:cee25a834751 | 1516 | void* ctx); |
wolfSSL | 11:cee25a834751 | 1517 | WOLFSSL_API void wolfSSL_CTX_SetRsaDecCb(WOLFSSL_CTX*, CallbackRsaDec); |
wolfSSL | 11:cee25a834751 | 1518 | WOLFSSL_API void wolfSSL_SetRsaDecCtx(WOLFSSL* ssl, void *ctx); |
wolfSSL | 11:cee25a834751 | 1519 | WOLFSSL_API void* wolfSSL_GetRsaDecCtx(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1520 | |
wolfSSL | 11:cee25a834751 | 1521 | |
wolfSSL | 11:cee25a834751 | 1522 | #ifndef NO_CERTS |
wolfSSL | 11:cee25a834751 | 1523 | WOLFSSL_API void wolfSSL_CTX_SetCACb(WOLFSSL_CTX*, CallbackCACache); |
wolfSSL | 11:cee25a834751 | 1524 | |
wolfSSL | 11:cee25a834751 | 1525 | WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew_ex(void* heap); |
wolfSSL | 11:cee25a834751 | 1526 | WOLFSSL_API WOLFSSL_CERT_MANAGER* wolfSSL_CertManagerNew(void); |
wolfSSL | 11:cee25a834751 | 1527 | WOLFSSL_API void wolfSSL_CertManagerFree(WOLFSSL_CERT_MANAGER*); |
wolfSSL | 11:cee25a834751 | 1528 | |
wolfSSL | 11:cee25a834751 | 1529 | WOLFSSL_API int wolfSSL_CertManagerLoadCA(WOLFSSL_CERT_MANAGER*, const char* f, |
wolfSSL | 11:cee25a834751 | 1530 | const char* d); |
wolfSSL | 11:cee25a834751 | 1531 | WOLFSSL_API int wolfSSL_CertManagerLoadCABuffer(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1532 | const unsigned char* in, long sz, int format); |
wolfSSL | 11:cee25a834751 | 1533 | WOLFSSL_API int wolfSSL_CertManagerUnloadCAs(WOLFSSL_CERT_MANAGER* cm); |
wolfSSL | 11:cee25a834751 | 1534 | #ifdef WOLFSSL_TRUST_PEER_CERT |
wolfSSL | 11:cee25a834751 | 1535 | WOLFSSL_API int wolfSSL_CertManagerUnload_trust_peers(WOLFSSL_CERT_MANAGER* cm); |
wolfSSL | 11:cee25a834751 | 1536 | #endif |
wolfSSL | 11:cee25a834751 | 1537 | WOLFSSL_API int wolfSSL_CertManagerVerify(WOLFSSL_CERT_MANAGER*, const char* f, |
wolfSSL | 11:cee25a834751 | 1538 | int format); |
wolfSSL | 11:cee25a834751 | 1539 | WOLFSSL_API int wolfSSL_CertManagerVerifyBuffer(WOLFSSL_CERT_MANAGER* cm, |
wolfSSL | 11:cee25a834751 | 1540 | const unsigned char* buff, long sz, int format); |
wolfSSL | 11:cee25a834751 | 1541 | WOLFSSL_API int wolfSSL_CertManagerCheckCRL(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1542 | unsigned char*, int sz); |
wolfSSL | 11:cee25a834751 | 1543 | WOLFSSL_API int wolfSSL_CertManagerEnableCRL(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1544 | int options); |
wolfSSL | 11:cee25a834751 | 1545 | WOLFSSL_API int wolfSSL_CertManagerDisableCRL(WOLFSSL_CERT_MANAGER*); |
wolfSSL | 11:cee25a834751 | 1546 | WOLFSSL_API int wolfSSL_CertManagerLoadCRL(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1547 | const char*, int, int); |
wolfSSL | 11:cee25a834751 | 1548 | WOLFSSL_API int wolfSSL_CertManagerLoadCRLBuffer(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1549 | const unsigned char*, long sz, int); |
wolfSSL | 11:cee25a834751 | 1550 | WOLFSSL_API int wolfSSL_CertManagerSetCRL_Cb(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1551 | CbMissingCRL); |
wolfSSL | 11:cee25a834751 | 1552 | #ifdef HAVE_CRL_IO |
wolfSSL | 11:cee25a834751 | 1553 | WOLFSSL_API int wolfSSL_CertManagerSetCRL_IOCb(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1554 | CbCrlIO); |
wolfSSL | 11:cee25a834751 | 1555 | #endif |
wolfSSL | 11:cee25a834751 | 1556 | WOLFSSL_API int wolfSSL_CertManagerCheckOCSP(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1557 | unsigned char*, int sz); |
wolfSSL | 11:cee25a834751 | 1558 | WOLFSSL_API int wolfSSL_CertManagerEnableOCSP(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1559 | int options); |
wolfSSL | 11:cee25a834751 | 1560 | WOLFSSL_API int wolfSSL_CertManagerDisableOCSP(WOLFSSL_CERT_MANAGER*); |
wolfSSL | 11:cee25a834751 | 1561 | WOLFSSL_API int wolfSSL_CertManagerSetOCSPOverrideURL(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1562 | const char*); |
wolfSSL | 11:cee25a834751 | 1563 | WOLFSSL_API int wolfSSL_CertManagerSetOCSP_Cb(WOLFSSL_CERT_MANAGER*, |
wolfSSL | 11:cee25a834751 | 1564 | CbOCSPIO, CbOCSPRespFree, void*); |
wolfSSL | 11:cee25a834751 | 1565 | |
wolfSSL | 11:cee25a834751 | 1566 | WOLFSSL_API int wolfSSL_CertManagerEnableOCSPStapling( |
wolfSSL | 11:cee25a834751 | 1567 | WOLFSSL_CERT_MANAGER* cm); |
wolfSSL | 11:cee25a834751 | 1568 | |
wolfSSL | 11:cee25a834751 | 1569 | WOLFSSL_API int wolfSSL_EnableCRL(WOLFSSL* ssl, int options); |
wolfSSL | 11:cee25a834751 | 1570 | WOLFSSL_API int wolfSSL_DisableCRL(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1571 | WOLFSSL_API int wolfSSL_LoadCRL(WOLFSSL*, const char*, int, int); |
wolfSSL | 11:cee25a834751 | 1572 | WOLFSSL_API int wolfSSL_LoadCRLBuffer(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1573 | const unsigned char*, long sz, int); |
wolfSSL | 11:cee25a834751 | 1574 | WOLFSSL_API int wolfSSL_SetCRL_Cb(WOLFSSL*, CbMissingCRL); |
wolfSSL | 11:cee25a834751 | 1575 | #ifdef HAVE_CRL_IO |
wolfSSL | 11:cee25a834751 | 1576 | WOLFSSL_API int wolfSSL_SetCRL_IOCb(WOLFSSL* ssl, CbCrlIO cb); |
wolfSSL | 11:cee25a834751 | 1577 | #endif |
wolfSSL | 11:cee25a834751 | 1578 | WOLFSSL_API int wolfSSL_EnableOCSP(WOLFSSL*, int options); |
wolfSSL | 11:cee25a834751 | 1579 | WOLFSSL_API int wolfSSL_DisableOCSP(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1580 | WOLFSSL_API int wolfSSL_SetOCSP_OverrideURL(WOLFSSL*, const char*); |
wolfSSL | 11:cee25a834751 | 1581 | WOLFSSL_API int wolfSSL_SetOCSP_Cb(WOLFSSL*, CbOCSPIO, CbOCSPRespFree, void*); |
wolfSSL | 11:cee25a834751 | 1582 | |
wolfSSL | 11:cee25a834751 | 1583 | WOLFSSL_API int wolfSSL_CTX_EnableCRL(WOLFSSL_CTX* ctx, int options); |
wolfSSL | 11:cee25a834751 | 1584 | WOLFSSL_API int wolfSSL_CTX_DisableCRL(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1585 | WOLFSSL_API int wolfSSL_CTX_LoadCRL(WOLFSSL_CTX*, const char*, int, int); |
wolfSSL | 11:cee25a834751 | 1586 | WOLFSSL_API int wolfSSL_CTX_LoadCRLBuffer(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1587 | const unsigned char*, long sz, int); |
wolfSSL | 11:cee25a834751 | 1588 | WOLFSSL_API int wolfSSL_CTX_SetCRL_Cb(WOLFSSL_CTX*, CbMissingCRL); |
wolfSSL | 11:cee25a834751 | 1589 | #ifdef HAVE_CRL_IO |
wolfSSL | 11:cee25a834751 | 1590 | WOLFSSL_API int wolfSSL_CTX_SetCRL_IOCb(WOLFSSL_CTX*, CbCrlIO); |
wolfSSL | 11:cee25a834751 | 1591 | #endif |
wolfSSL | 11:cee25a834751 | 1592 | WOLFSSL_API int wolfSSL_CTX_EnableOCSP(WOLFSSL_CTX*, int options); |
wolfSSL | 11:cee25a834751 | 1593 | WOLFSSL_API int wolfSSL_CTX_DisableOCSP(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1594 | WOLFSSL_API int wolfSSL_CTX_SetOCSP_OverrideURL(WOLFSSL_CTX*, const char*); |
wolfSSL | 11:cee25a834751 | 1595 | WOLFSSL_API int wolfSSL_CTX_SetOCSP_Cb(WOLFSSL_CTX*, |
wolfSSL | 11:cee25a834751 | 1596 | CbOCSPIO, CbOCSPRespFree, void*); |
wolfSSL | 11:cee25a834751 | 1597 | |
wolfSSL | 11:cee25a834751 | 1598 | WOLFSSL_API int wolfSSL_CTX_EnableOCSPStapling(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1599 | #endif /* !NO_CERTS */ |
wolfSSL | 11:cee25a834751 | 1600 | |
wolfSSL | 11:cee25a834751 | 1601 | |
wolfSSL | 11:cee25a834751 | 1602 | #ifdef SINGLE_THREADED |
wolfSSL | 11:cee25a834751 | 1603 | WOLFSSL_API int wolfSSL_CTX_new_rng(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 1604 | #endif |
wolfSSL | 11:cee25a834751 | 1605 | |
wolfSSL | 11:cee25a834751 | 1606 | /* end of handshake frees temporary arrays, if user needs for get_keys or |
wolfSSL | 11:cee25a834751 | 1607 | psk hints, call KeepArrays before handshake and then FreeArrays when done |
wolfSSL | 11:cee25a834751 | 1608 | if don't want to wait for object free */ |
wolfSSL | 11:cee25a834751 | 1609 | WOLFSSL_API void wolfSSL_KeepArrays(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1610 | WOLFSSL_API void wolfSSL_FreeArrays(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 1611 | |
wolfSSL | 11:cee25a834751 | 1612 | WOLFSSL_API int wolfSSL_KeepHandshakeResources(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1613 | WOLFSSL_API int wolfSSL_FreeHandshakeResources(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1614 | |
wolfSSL | 11:cee25a834751 | 1615 | WOLFSSL_API int wolfSSL_CTX_UseClientSuites(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1616 | WOLFSSL_API int wolfSSL_UseClientSuites(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1617 | |
wolfSSL | 11:cee25a834751 | 1618 | /* async additions */ |
wolfSSL | 11:cee25a834751 | 1619 | WOLFSSL_API int wolfSSL_UseAsync(WOLFSSL*, int devId); |
wolfSSL | 11:cee25a834751 | 1620 | WOLFSSL_API int wolfSSL_CTX_UseAsync(WOLFSSL_CTX*, int devId); |
wolfSSL | 11:cee25a834751 | 1621 | |
wolfSSL | 11:cee25a834751 | 1622 | /* TLS Extensions */ |
wolfSSL | 11:cee25a834751 | 1623 | |
wolfSSL | 11:cee25a834751 | 1624 | /* Server Name Indication */ |
wolfSSL | 11:cee25a834751 | 1625 | #ifdef HAVE_SNI |
wolfSSL | 11:cee25a834751 | 1626 | |
wolfSSL | 11:cee25a834751 | 1627 | /* SNI types */ |
wolfSSL | 11:cee25a834751 | 1628 | enum { |
wolfSSL | 11:cee25a834751 | 1629 | WOLFSSL_SNI_HOST_NAME = 0 |
wolfSSL | 11:cee25a834751 | 1630 | }; |
wolfSSL | 11:cee25a834751 | 1631 | |
wolfSSL | 11:cee25a834751 | 1632 | WOLFSSL_API int wolfSSL_UseSNI(WOLFSSL* ssl, unsigned char type, |
wolfSSL | 11:cee25a834751 | 1633 | const void* data, unsigned short size); |
wolfSSL | 11:cee25a834751 | 1634 | WOLFSSL_API int wolfSSL_CTX_UseSNI(WOLFSSL_CTX* ctx, unsigned char type, |
wolfSSL | 11:cee25a834751 | 1635 | const void* data, unsigned short size); |
wolfSSL | 11:cee25a834751 | 1636 | |
wolfSSL | 11:cee25a834751 | 1637 | #ifndef NO_WOLFSSL_SERVER |
wolfSSL | 11:cee25a834751 | 1638 | |
wolfSSL | 11:cee25a834751 | 1639 | /* SNI options */ |
wolfSSL | 11:cee25a834751 | 1640 | enum { |
wolfSSL | 11:cee25a834751 | 1641 | /* Do not abort the handshake if the requested SNI didn't match. */ |
wolfSSL | 11:cee25a834751 | 1642 | WOLFSSL_SNI_CONTINUE_ON_MISMATCH = 0x01, |
wolfSSL | 11:cee25a834751 | 1643 | |
wolfSSL | 11:cee25a834751 | 1644 | /* Behave as if the requested SNI matched in a case of mismatch. */ |
wolfSSL | 11:cee25a834751 | 1645 | /* In this case, the status will be set to WOLFSSL_SNI_FAKE_MATCH. */ |
wolfSSL | 11:cee25a834751 | 1646 | WOLFSSL_SNI_ANSWER_ON_MISMATCH = 0x02, |
wolfSSL | 11:cee25a834751 | 1647 | |
wolfSSL | 11:cee25a834751 | 1648 | /* Abort the handshake if the client didn't send a SNI request. */ |
wolfSSL | 11:cee25a834751 | 1649 | WOLFSSL_SNI_ABORT_ON_ABSENCE = 0x04, |
wolfSSL | 11:cee25a834751 | 1650 | }; |
wolfSSL | 11:cee25a834751 | 1651 | |
wolfSSL | 11:cee25a834751 | 1652 | WOLFSSL_API void wolfSSL_SNI_SetOptions(WOLFSSL* ssl, unsigned char type, |
wolfSSL | 11:cee25a834751 | 1653 | unsigned char options); |
wolfSSL | 11:cee25a834751 | 1654 | WOLFSSL_API void wolfSSL_CTX_SNI_SetOptions(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 1655 | unsigned char type, unsigned char options); |
wolfSSL | 11:cee25a834751 | 1656 | |
wolfSSL | 11:cee25a834751 | 1657 | /* SNI status */ |
wolfSSL | 11:cee25a834751 | 1658 | enum { |
wolfSSL | 11:cee25a834751 | 1659 | WOLFSSL_SNI_NO_MATCH = 0, |
wolfSSL | 11:cee25a834751 | 1660 | WOLFSSL_SNI_FAKE_MATCH = 1, /**< @see WOLFSSL_SNI_ANSWER_ON_MISMATCH */ |
wolfSSL | 11:cee25a834751 | 1661 | WOLFSSL_SNI_REAL_MATCH = 2, |
wolfSSL | 11:cee25a834751 | 1662 | WOLFSSL_SNI_FORCE_KEEP = 3 /** Used with -DWOLFSSL_ALWAYS_KEEP_SNI */ |
wolfSSL | 11:cee25a834751 | 1663 | }; |
wolfSSL | 11:cee25a834751 | 1664 | |
wolfSSL | 11:cee25a834751 | 1665 | WOLFSSL_API unsigned char wolfSSL_SNI_Status(WOLFSSL* ssl, unsigned char type); |
wolfSSL | 11:cee25a834751 | 1666 | |
wolfSSL | 11:cee25a834751 | 1667 | WOLFSSL_API unsigned short wolfSSL_SNI_GetRequest(WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 1668 | unsigned char type, void** data); |
wolfSSL | 11:cee25a834751 | 1669 | WOLFSSL_API int wolfSSL_SNI_GetFromBuffer( |
wolfSSL | 11:cee25a834751 | 1670 | const unsigned char* clientHello, unsigned int helloSz, |
wolfSSL | 11:cee25a834751 | 1671 | unsigned char type, unsigned char* sni, unsigned int* inOutSz); |
wolfSSL | 11:cee25a834751 | 1672 | |
wolfSSL | 11:cee25a834751 | 1673 | #endif |
wolfSSL | 11:cee25a834751 | 1674 | #endif |
wolfSSL | 11:cee25a834751 | 1675 | |
wolfSSL | 11:cee25a834751 | 1676 | /* Application-Layer Protocol Negotiation */ |
wolfSSL | 11:cee25a834751 | 1677 | #ifdef HAVE_ALPN |
wolfSSL | 11:cee25a834751 | 1678 | |
wolfSSL | 11:cee25a834751 | 1679 | /* ALPN status code */ |
wolfSSL | 11:cee25a834751 | 1680 | enum { |
wolfSSL | 11:cee25a834751 | 1681 | WOLFSSL_ALPN_NO_MATCH = 0, |
wolfSSL | 11:cee25a834751 | 1682 | WOLFSSL_ALPN_MATCH = 1, |
wolfSSL | 11:cee25a834751 | 1683 | WOLFSSL_ALPN_CONTINUE_ON_MISMATCH = 2, |
wolfSSL | 11:cee25a834751 | 1684 | WOLFSSL_ALPN_FAILED_ON_MISMATCH = 4, |
wolfSSL | 11:cee25a834751 | 1685 | }; |
wolfSSL | 11:cee25a834751 | 1686 | |
wolfSSL | 11:cee25a834751 | 1687 | enum { |
wolfSSL | 11:cee25a834751 | 1688 | WOLFSSL_MAX_ALPN_PROTO_NAME_LEN = 255, |
wolfSSL | 11:cee25a834751 | 1689 | WOLFSSL_MAX_ALPN_NUMBER = 257 |
wolfSSL | 11:cee25a834751 | 1690 | }; |
wolfSSL | 11:cee25a834751 | 1691 | |
wolfSSL | 11:cee25a834751 | 1692 | #if defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) |
wolfSSL | 11:cee25a834751 | 1693 | typedef int (*CallbackALPNSelect)(WOLFSSL* ssl, const unsigned char** out, |
wolfSSL | 11:cee25a834751 | 1694 | unsigned char* outLen, const unsigned char* in, unsigned int inLen, |
wolfSSL | 11:cee25a834751 | 1695 | void *arg); |
wolfSSL | 11:cee25a834751 | 1696 | #endif |
wolfSSL | 11:cee25a834751 | 1697 | |
wolfSSL | 11:cee25a834751 | 1698 | WOLFSSL_API int wolfSSL_UseALPN(WOLFSSL* ssl, char *protocol_name_list, |
wolfSSL | 11:cee25a834751 | 1699 | unsigned int protocol_name_listSz, |
wolfSSL | 11:cee25a834751 | 1700 | unsigned char options); |
wolfSSL | 11:cee25a834751 | 1701 | |
wolfSSL | 11:cee25a834751 | 1702 | WOLFSSL_API int wolfSSL_ALPN_GetProtocol(WOLFSSL* ssl, char **protocol_name, |
wolfSSL | 11:cee25a834751 | 1703 | unsigned short *size); |
wolfSSL | 11:cee25a834751 | 1704 | |
wolfSSL | 11:cee25a834751 | 1705 | WOLFSSL_API int wolfSSL_ALPN_GetPeerProtocol(WOLFSSL* ssl, char **list, |
wolfSSL | 11:cee25a834751 | 1706 | unsigned short *listSz); |
wolfSSL | 11:cee25a834751 | 1707 | WOLFSSL_API int wolfSSL_ALPN_FreePeerProtocol(WOLFSSL* ssl, char **list); |
wolfSSL | 11:cee25a834751 | 1708 | #endif /* HAVE_ALPN */ |
wolfSSL | 11:cee25a834751 | 1709 | |
wolfSSL | 11:cee25a834751 | 1710 | /* Maximum Fragment Length */ |
wolfSSL | 11:cee25a834751 | 1711 | #ifdef HAVE_MAX_FRAGMENT |
wolfSSL | 11:cee25a834751 | 1712 | |
wolfSSL | 11:cee25a834751 | 1713 | /* Fragment lengths */ |
wolfSSL | 11:cee25a834751 | 1714 | enum { |
wolfSSL | 11:cee25a834751 | 1715 | WOLFSSL_MFL_2_9 = 1, /* 512 bytes */ |
wolfSSL | 11:cee25a834751 | 1716 | WOLFSSL_MFL_2_10 = 2, /* 1024 bytes */ |
wolfSSL | 11:cee25a834751 | 1717 | WOLFSSL_MFL_2_11 = 3, /* 2048 bytes */ |
wolfSSL | 11:cee25a834751 | 1718 | WOLFSSL_MFL_2_12 = 4, /* 4096 bytes */ |
wolfSSL | 11:cee25a834751 | 1719 | WOLFSSL_MFL_2_13 = 5 /* 8192 bytes *//* wolfSSL ONLY!!! */ |
wolfSSL | 11:cee25a834751 | 1720 | }; |
wolfSSL | 11:cee25a834751 | 1721 | |
wolfSSL | 11:cee25a834751 | 1722 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1723 | |
wolfSSL | 11:cee25a834751 | 1724 | WOLFSSL_API int wolfSSL_UseMaxFragment(WOLFSSL* ssl, unsigned char mfl); |
wolfSSL | 11:cee25a834751 | 1725 | WOLFSSL_API int wolfSSL_CTX_UseMaxFragment(WOLFSSL_CTX* ctx, unsigned char mfl); |
wolfSSL | 11:cee25a834751 | 1726 | |
wolfSSL | 11:cee25a834751 | 1727 | #endif |
wolfSSL | 11:cee25a834751 | 1728 | #endif |
wolfSSL | 11:cee25a834751 | 1729 | |
wolfSSL | 11:cee25a834751 | 1730 | /* Truncated HMAC */ |
wolfSSL | 11:cee25a834751 | 1731 | #ifdef HAVE_TRUNCATED_HMAC |
wolfSSL | 11:cee25a834751 | 1732 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1733 | |
wolfSSL | 11:cee25a834751 | 1734 | WOLFSSL_API int wolfSSL_UseTruncatedHMAC(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1735 | WOLFSSL_API int wolfSSL_CTX_UseTruncatedHMAC(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1736 | |
wolfSSL | 11:cee25a834751 | 1737 | #endif |
wolfSSL | 11:cee25a834751 | 1738 | #endif |
wolfSSL | 11:cee25a834751 | 1739 | |
wolfSSL | 11:cee25a834751 | 1740 | /* Certificate Status Request */ |
wolfSSL | 11:cee25a834751 | 1741 | /* Certificate Status Type */ |
wolfSSL | 11:cee25a834751 | 1742 | enum { |
wolfSSL | 11:cee25a834751 | 1743 | WOLFSSL_CSR_OCSP = 1 |
wolfSSL | 11:cee25a834751 | 1744 | }; |
wolfSSL | 11:cee25a834751 | 1745 | |
wolfSSL | 11:cee25a834751 | 1746 | /* Certificate Status Options (flags) */ |
wolfSSL | 11:cee25a834751 | 1747 | enum { |
wolfSSL | 11:cee25a834751 | 1748 | WOLFSSL_CSR_OCSP_USE_NONCE = 0x01 |
wolfSSL | 11:cee25a834751 | 1749 | }; |
wolfSSL | 11:cee25a834751 | 1750 | |
wolfSSL | 11:cee25a834751 | 1751 | #ifdef HAVE_CERTIFICATE_STATUS_REQUEST |
wolfSSL | 11:cee25a834751 | 1752 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1753 | |
wolfSSL | 11:cee25a834751 | 1754 | WOLFSSL_API int wolfSSL_UseOCSPStapling(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1755 | unsigned char status_type, unsigned char options); |
wolfSSL | 11:cee25a834751 | 1756 | |
wolfSSL | 11:cee25a834751 | 1757 | WOLFSSL_API int wolfSSL_CTX_UseOCSPStapling(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 1758 | unsigned char status_type, unsigned char options); |
wolfSSL | 11:cee25a834751 | 1759 | |
wolfSSL | 11:cee25a834751 | 1760 | #endif |
wolfSSL | 11:cee25a834751 | 1761 | #endif |
wolfSSL | 11:cee25a834751 | 1762 | |
wolfSSL | 11:cee25a834751 | 1763 | /* Certificate Status Request v2 */ |
wolfSSL | 11:cee25a834751 | 1764 | /* Certificate Status Type */ |
wolfSSL | 11:cee25a834751 | 1765 | enum { |
wolfSSL | 11:cee25a834751 | 1766 | WOLFSSL_CSR2_OCSP = 1, |
wolfSSL | 11:cee25a834751 | 1767 | WOLFSSL_CSR2_OCSP_MULTI = 2 |
wolfSSL | 11:cee25a834751 | 1768 | }; |
wolfSSL | 11:cee25a834751 | 1769 | |
wolfSSL | 11:cee25a834751 | 1770 | /* Certificate Status v2 Options (flags) */ |
wolfSSL | 11:cee25a834751 | 1771 | enum { |
wolfSSL | 11:cee25a834751 | 1772 | WOLFSSL_CSR2_OCSP_USE_NONCE = 0x01 |
wolfSSL | 11:cee25a834751 | 1773 | }; |
wolfSSL | 11:cee25a834751 | 1774 | |
wolfSSL | 11:cee25a834751 | 1775 | #ifdef HAVE_CERTIFICATE_STATUS_REQUEST_V2 |
wolfSSL | 11:cee25a834751 | 1776 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1777 | |
wolfSSL | 11:cee25a834751 | 1778 | WOLFSSL_API int wolfSSL_UseOCSPStaplingV2(WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1779 | unsigned char status_type, unsigned char options); |
wolfSSL | 11:cee25a834751 | 1780 | |
wolfSSL | 11:cee25a834751 | 1781 | WOLFSSL_API int wolfSSL_CTX_UseOCSPStaplingV2(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 1782 | unsigned char status_type, unsigned char options); |
wolfSSL | 11:cee25a834751 | 1783 | |
wolfSSL | 11:cee25a834751 | 1784 | #endif |
wolfSSL | 11:cee25a834751 | 1785 | #endif |
wolfSSL | 11:cee25a834751 | 1786 | |
wolfSSL | 11:cee25a834751 | 1787 | /* Elliptic Curves */ |
wolfSSL | 11:cee25a834751 | 1788 | enum { |
wolfSSL | 11:cee25a834751 | 1789 | #if 0 /* Not Supported */ |
wolfSSL | 11:cee25a834751 | 1790 | WOLFSSL_ECC_SECT163K1 = 1, |
wolfSSL | 11:cee25a834751 | 1791 | WOLFSSL_ECC_SECT163R1 = 2, |
wolfSSL | 11:cee25a834751 | 1792 | WOLFSSL_ECC_SECT163R2 = 3, |
wolfSSL | 11:cee25a834751 | 1793 | WOLFSSL_ECC_SECT193R1 = 4, |
wolfSSL | 11:cee25a834751 | 1794 | WOLFSSL_ECC_SECT193R2 = 5, |
wolfSSL | 11:cee25a834751 | 1795 | WOLFSSL_ECC_SECT233K1 = 6, |
wolfSSL | 11:cee25a834751 | 1796 | WOLFSSL_ECC_SECT233R1 = 7, |
wolfSSL | 11:cee25a834751 | 1797 | WOLFSSL_ECC_SECT239K1 = 8, |
wolfSSL | 11:cee25a834751 | 1798 | WOLFSSL_ECC_SECT283K1 = 9, |
wolfSSL | 11:cee25a834751 | 1799 | WOLFSSL_ECC_SECT283R1 = 10, |
wolfSSL | 11:cee25a834751 | 1800 | WOLFSSL_ECC_SECT409K1 = 11, |
wolfSSL | 11:cee25a834751 | 1801 | WOLFSSL_ECC_SECT409R1 = 12, |
wolfSSL | 11:cee25a834751 | 1802 | WOLFSSL_ECC_SECT571K1 = 13, |
wolfSSL | 11:cee25a834751 | 1803 | WOLFSSL_ECC_SECT571R1 = 14, |
wolfSSL | 11:cee25a834751 | 1804 | #endif |
wolfSSL | 11:cee25a834751 | 1805 | WOLFSSL_ECC_SECP160K1 = 15, |
wolfSSL | 11:cee25a834751 | 1806 | WOLFSSL_ECC_SECP160R1 = 16, |
wolfSSL | 11:cee25a834751 | 1807 | WOLFSSL_ECC_SECP160R2 = 17, |
wolfSSL | 11:cee25a834751 | 1808 | WOLFSSL_ECC_SECP192K1 = 18, |
wolfSSL | 11:cee25a834751 | 1809 | WOLFSSL_ECC_SECP192R1 = 19, |
wolfSSL | 11:cee25a834751 | 1810 | WOLFSSL_ECC_SECP224K1 = 20, |
wolfSSL | 11:cee25a834751 | 1811 | WOLFSSL_ECC_SECP224R1 = 21, |
wolfSSL | 11:cee25a834751 | 1812 | WOLFSSL_ECC_SECP256K1 = 22, |
wolfSSL | 11:cee25a834751 | 1813 | WOLFSSL_ECC_SECP256R1 = 23, |
wolfSSL | 11:cee25a834751 | 1814 | WOLFSSL_ECC_SECP384R1 = 24, |
wolfSSL | 11:cee25a834751 | 1815 | WOLFSSL_ECC_SECP521R1 = 25, |
wolfSSL | 11:cee25a834751 | 1816 | WOLFSSL_ECC_BRAINPOOLP256R1 = 26, |
wolfSSL | 11:cee25a834751 | 1817 | WOLFSSL_ECC_BRAINPOOLP384R1 = 27, |
wolfSSL | 11:cee25a834751 | 1818 | WOLFSSL_ECC_BRAINPOOLP512R1 = 28, |
wolfSSL | 11:cee25a834751 | 1819 | }; |
wolfSSL | 11:cee25a834751 | 1820 | |
wolfSSL | 11:cee25a834751 | 1821 | #ifdef HAVE_SUPPORTED_CURVES |
wolfSSL | 11:cee25a834751 | 1822 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1823 | |
wolfSSL | 11:cee25a834751 | 1824 | WOLFSSL_API int wolfSSL_UseSupportedCurve(WOLFSSL* ssl, unsigned short name); |
wolfSSL | 11:cee25a834751 | 1825 | WOLFSSL_API int wolfSSL_CTX_UseSupportedCurve(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 1826 | unsigned short name); |
wolfSSL | 11:cee25a834751 | 1827 | |
wolfSSL | 11:cee25a834751 | 1828 | #endif |
wolfSSL | 11:cee25a834751 | 1829 | #endif |
wolfSSL | 11:cee25a834751 | 1830 | |
wolfSSL | 11:cee25a834751 | 1831 | |
wolfSSL | 11:cee25a834751 | 1832 | /* Secure Renegotiation */ |
wolfSSL | 11:cee25a834751 | 1833 | #ifdef HAVE_SECURE_RENEGOTIATION |
wolfSSL | 11:cee25a834751 | 1834 | |
wolfSSL | 11:cee25a834751 | 1835 | WOLFSSL_API int wolfSSL_UseSecureRenegotiation(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1836 | WOLFSSL_API int wolfSSL_Rehandshake(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1837 | |
wolfSSL | 11:cee25a834751 | 1838 | #endif |
wolfSSL | 11:cee25a834751 | 1839 | |
wolfSSL | 11:cee25a834751 | 1840 | /* Session Ticket */ |
wolfSSL | 11:cee25a834751 | 1841 | #ifdef HAVE_SESSION_TICKET |
wolfSSL | 11:cee25a834751 | 1842 | |
wolfSSL | 11:cee25a834751 | 1843 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1844 | WOLFSSL_API int wolfSSL_UseSessionTicket(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1845 | WOLFSSL_API int wolfSSL_CTX_UseSessionTicket(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1846 | WOLFSSL_API int wolfSSL_get_SessionTicket(WOLFSSL*, unsigned char*, unsigned int*); |
wolfSSL | 11:cee25a834751 | 1847 | WOLFSSL_API int wolfSSL_set_SessionTicket(WOLFSSL*, const unsigned char*, unsigned int); |
wolfSSL | 11:cee25a834751 | 1848 | typedef int (*CallbackSessionTicket)(WOLFSSL*, const unsigned char*, int, void*); |
wolfSSL | 11:cee25a834751 | 1849 | WOLFSSL_API int wolfSSL_set_SessionTicket_cb(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1850 | CallbackSessionTicket, void*); |
wolfSSL | 11:cee25a834751 | 1851 | #endif /* NO_WOLFSSL_CLIENT */ |
wolfSSL | 11:cee25a834751 | 1852 | |
wolfSSL | 11:cee25a834751 | 1853 | #ifndef NO_WOLFSSL_SERVER |
wolfSSL | 11:cee25a834751 | 1854 | |
wolfSSL | 11:cee25a834751 | 1855 | #define WOLFSSL_TICKET_NAME_SZ 16 |
wolfSSL | 11:cee25a834751 | 1856 | #define WOLFSSL_TICKET_IV_SZ 16 |
wolfSSL | 11:cee25a834751 | 1857 | #define WOLFSSL_TICKET_MAC_SZ 32 |
wolfSSL | 11:cee25a834751 | 1858 | |
wolfSSL | 11:cee25a834751 | 1859 | enum TicketEncRet { |
wolfSSL | 11:cee25a834751 | 1860 | WOLFSSL_TICKET_RET_FATAL = -1, /* fatal error, don't use ticket */ |
wolfSSL | 11:cee25a834751 | 1861 | WOLFSSL_TICKET_RET_OK = 0, /* ok, use ticket */ |
wolfSSL | 11:cee25a834751 | 1862 | WOLFSSL_TICKET_RET_REJECT, /* don't use ticket, but not fatal */ |
wolfSSL | 11:cee25a834751 | 1863 | WOLFSSL_TICKET_RET_CREATE /* existing ticket ok and create new one */ |
wolfSSL | 11:cee25a834751 | 1864 | }; |
wolfSSL | 11:cee25a834751 | 1865 | |
wolfSSL | 11:cee25a834751 | 1866 | typedef int (*SessionTicketEncCb)(WOLFSSL*, |
wolfSSL | 11:cee25a834751 | 1867 | unsigned char key_name[WOLFSSL_TICKET_NAME_SZ], |
wolfSSL | 11:cee25a834751 | 1868 | unsigned char iv[WOLFSSL_TICKET_IV_SZ], |
wolfSSL | 11:cee25a834751 | 1869 | unsigned char mac[WOLFSSL_TICKET_MAC_SZ], |
wolfSSL | 11:cee25a834751 | 1870 | int enc, unsigned char*, int, int*, void*); |
wolfSSL | 11:cee25a834751 | 1871 | WOLFSSL_API int wolfSSL_CTX_set_TicketEncCb(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 1872 | SessionTicketEncCb); |
wolfSSL | 11:cee25a834751 | 1873 | WOLFSSL_API int wolfSSL_CTX_set_TicketHint(WOLFSSL_CTX* ctx, int); |
wolfSSL | 11:cee25a834751 | 1874 | WOLFSSL_API int wolfSSL_CTX_set_TicketEncCtx(WOLFSSL_CTX* ctx, void*); |
wolfSSL | 11:cee25a834751 | 1875 | |
wolfSSL | 11:cee25a834751 | 1876 | #endif /* NO_WOLFSSL_SERVER */ |
wolfSSL | 11:cee25a834751 | 1877 | |
wolfSSL | 11:cee25a834751 | 1878 | #endif /* HAVE_SESSION_TICKET */ |
wolfSSL | 11:cee25a834751 | 1879 | |
wolfSSL | 11:cee25a834751 | 1880 | #ifdef HAVE_QSH |
wolfSSL | 11:cee25a834751 | 1881 | /* Quantum-safe Crypto Schemes */ |
wolfSSL | 11:cee25a834751 | 1882 | enum { |
wolfSSL | 11:cee25a834751 | 1883 | WOLFSSL_NTRU_EESS439 = 0x0101, /* max plaintext length of 65 */ |
wolfSSL | 11:cee25a834751 | 1884 | WOLFSSL_NTRU_EESS593 = 0x0102, /* max plaintext length of 86 */ |
wolfSSL | 11:cee25a834751 | 1885 | WOLFSSL_NTRU_EESS743 = 0x0103, /* max plaintext length of 106 */ |
wolfSSL | 11:cee25a834751 | 1886 | WOLFSSL_LWE_XXX = 0x0201, /* Learning With Error encryption scheme */ |
wolfSSL | 11:cee25a834751 | 1887 | WOLFSSL_HFE_XXX = 0x0301, /* Hidden Field Equation scheme */ |
wolfSSL | 11:cee25a834751 | 1888 | WOLFSSL_NULL_QSH = 0xFFFF /* QSHScheme is not used */ |
wolfSSL | 11:cee25a834751 | 1889 | }; |
wolfSSL | 11:cee25a834751 | 1890 | |
wolfSSL | 11:cee25a834751 | 1891 | |
wolfSSL | 11:cee25a834751 | 1892 | /* test if the connection is using a QSH secure connection return 1 if so */ |
wolfSSL | 11:cee25a834751 | 1893 | WOLFSSL_API int wolfSSL_isQSH(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1894 | WOLFSSL_API int wolfSSL_UseSupportedQSH(WOLFSSL* ssl, unsigned short name); |
wolfSSL | 11:cee25a834751 | 1895 | #ifndef NO_WOLFSSL_CLIENT |
wolfSSL | 11:cee25a834751 | 1896 | /* user control over sending client public key in hello |
wolfSSL | 11:cee25a834751 | 1897 | when flag = 1 will send keys if flag is 0 or function is not called |
wolfSSL | 11:cee25a834751 | 1898 | then will not send keys in the hello extension */ |
wolfSSL | 11:cee25a834751 | 1899 | WOLFSSL_API int wolfSSL_UseClientQSHKeys(WOLFSSL* ssl, unsigned char flag); |
wolfSSL | 11:cee25a834751 | 1900 | #endif |
wolfSSL | 11:cee25a834751 | 1901 | |
wolfSSL | 11:cee25a834751 | 1902 | #endif /* QSH */ |
wolfSSL | 11:cee25a834751 | 1903 | |
wolfSSL | 11:cee25a834751 | 1904 | /* TLS Extended Master Secret Extension */ |
wolfSSL | 11:cee25a834751 | 1905 | WOLFSSL_API int wolfSSL_DisableExtendedMasterSecret(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1906 | WOLFSSL_API int wolfSSL_CTX_DisableExtendedMasterSecret(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 1907 | |
wolfSSL | 11:cee25a834751 | 1908 | |
wolfSSL | 11:cee25a834751 | 1909 | #define WOLFSSL_CRL_MONITOR 0x01 /* monitor this dir flag */ |
wolfSSL | 11:cee25a834751 | 1910 | #define WOLFSSL_CRL_START_MON 0x02 /* start monitoring flag */ |
wolfSSL | 11:cee25a834751 | 1911 | |
wolfSSL | 11:cee25a834751 | 1912 | |
wolfSSL | 11:cee25a834751 | 1913 | /* notify user the handshake is done */ |
wolfSSL | 11:cee25a834751 | 1914 | typedef int (*HandShakeDoneCb)(WOLFSSL*, void*); |
wolfSSL | 11:cee25a834751 | 1915 | WOLFSSL_API int wolfSSL_SetHsDoneCb(WOLFSSL*, HandShakeDoneCb, void*); |
wolfSSL | 11:cee25a834751 | 1916 | |
wolfSSL | 11:cee25a834751 | 1917 | |
wolfSSL | 11:cee25a834751 | 1918 | WOLFSSL_API int wolfSSL_PrintSessionStats(void); |
wolfSSL | 11:cee25a834751 | 1919 | WOLFSSL_API int wolfSSL_get_session_stats(unsigned int* active, |
wolfSSL | 11:cee25a834751 | 1920 | unsigned int* total, |
wolfSSL | 11:cee25a834751 | 1921 | unsigned int* peak, |
wolfSSL | 11:cee25a834751 | 1922 | unsigned int* maxSessions); |
wolfSSL | 11:cee25a834751 | 1923 | /* External facing KDF */ |
wolfSSL | 11:cee25a834751 | 1924 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 1925 | int wolfSSL_MakeTlsMasterSecret(unsigned char* ms, unsigned int msLen, |
wolfSSL | 11:cee25a834751 | 1926 | const unsigned char* pms, unsigned int pmsLen, |
wolfSSL | 11:cee25a834751 | 1927 | const unsigned char* cr, const unsigned char* sr, |
wolfSSL | 11:cee25a834751 | 1928 | int tls1_2, int hash_type); |
wolfSSL | 11:cee25a834751 | 1929 | |
wolfSSL | 11:cee25a834751 | 1930 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 1931 | int wolfSSL_MakeTlsExtendedMasterSecret(unsigned char* ms, unsigned int msLen, |
wolfSSL | 11:cee25a834751 | 1932 | const unsigned char* pms, unsigned int pmsLen, |
wolfSSL | 11:cee25a834751 | 1933 | const unsigned char* sHash, unsigned int sHashLen, |
wolfSSL | 11:cee25a834751 | 1934 | int tls1_2, int hash_type); |
wolfSSL | 11:cee25a834751 | 1935 | |
wolfSSL | 11:cee25a834751 | 1936 | WOLFSSL_API |
wolfSSL | 11:cee25a834751 | 1937 | int wolfSSL_DeriveTlsKeys(unsigned char* key_data, unsigned int keyLen, |
wolfSSL | 11:cee25a834751 | 1938 | const unsigned char* ms, unsigned int msLen, |
wolfSSL | 11:cee25a834751 | 1939 | const unsigned char* sr, const unsigned char* cr, |
wolfSSL | 11:cee25a834751 | 1940 | int tls1_2, int hash_type); |
wolfSSL | 11:cee25a834751 | 1941 | |
wolfSSL | 11:cee25a834751 | 1942 | #ifdef WOLFSSL_CALLBACKS |
wolfSSL | 11:cee25a834751 | 1943 | |
wolfSSL | 11:cee25a834751 | 1944 | /* used internally by wolfSSL while OpenSSL types aren't */ |
wolfSSL | 11:cee25a834751 | 1945 | #include <wolfssl/callbacks.h> |
wolfSSL | 11:cee25a834751 | 1946 | |
wolfSSL | 11:cee25a834751 | 1947 | typedef int (*HandShakeCallBack)(HandShakeInfo*); |
wolfSSL | 11:cee25a834751 | 1948 | typedef int (*TimeoutCallBack)(TimeoutInfo*); |
wolfSSL | 11:cee25a834751 | 1949 | |
wolfSSL | 11:cee25a834751 | 1950 | /* wolfSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack |
wolfSSL | 11:cee25a834751 | 1951 | for diagnostics */ |
wolfSSL | 11:cee25a834751 | 1952 | WOLFSSL_API int wolfSSL_connect_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, |
wolfSSL | 11:cee25a834751 | 1953 | Timeval); |
wolfSSL | 11:cee25a834751 | 1954 | WOLFSSL_API int wolfSSL_accept_ex(WOLFSSL*, HandShakeCallBack, TimeoutCallBack, |
wolfSSL | 11:cee25a834751 | 1955 | Timeval); |
wolfSSL | 11:cee25a834751 | 1956 | |
wolfSSL | 11:cee25a834751 | 1957 | #endif /* WOLFSSL_CALLBACKS */ |
wolfSSL | 11:cee25a834751 | 1958 | |
wolfSSL | 11:cee25a834751 | 1959 | |
wolfSSL | 11:cee25a834751 | 1960 | #ifdef WOLFSSL_HAVE_WOLFSCEP |
wolfSSL | 11:cee25a834751 | 1961 | WOLFSSL_API void wolfSSL_wolfSCEP(void); |
wolfSSL | 11:cee25a834751 | 1962 | #endif /* WOLFSSL_HAVE_WOLFSCEP */ |
wolfSSL | 11:cee25a834751 | 1963 | |
wolfSSL | 11:cee25a834751 | 1964 | #ifdef WOLFSSL_HAVE_CERT_SERVICE |
wolfSSL | 11:cee25a834751 | 1965 | WOLFSSL_API void wolfSSL_cert_service(void); |
wolfSSL | 11:cee25a834751 | 1966 | #endif |
wolfSSL | 11:cee25a834751 | 1967 | |
wolfSSL | 11:cee25a834751 | 1968 | #if defined(WOLFSSL_MYSQL_COMPATIBLE) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) |
wolfSSL | 11:cee25a834751 | 1969 | WOLFSSL_API char* wolfSSL_ASN1_TIME_to_string(WOLFSSL_ASN1_TIME* time, |
wolfSSL | 11:cee25a834751 | 1970 | char* buf, int len); |
wolfSSL | 11:cee25a834751 | 1971 | #endif /* WOLFSSL_MYSQL_COMPATIBLE */ |
wolfSSL | 11:cee25a834751 | 1972 | |
wolfSSL | 11:cee25a834751 | 1973 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 1974 | |
wolfSSL | 11:cee25a834751 | 1975 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 1976 | WOLFSSL_API long wolfSSL_BIO_set_fp(WOLFSSL_BIO *bio, XFILE fp, int c); |
wolfSSL | 11:cee25a834751 | 1977 | WOLFSSL_API long wolfSSL_BIO_get_fp(WOLFSSL_BIO *bio, XFILE* fp); |
wolfSSL | 11:cee25a834751 | 1978 | #endif |
wolfSSL | 11:cee25a834751 | 1979 | |
wolfSSL | 11:cee25a834751 | 1980 | WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error_line(const char **file, int *line); |
wolfSSL | 11:cee25a834751 | 1981 | WOLFSSL_API long wolfSSL_ctrl(WOLFSSL* ssl, int cmd, long opt, void* pt); |
wolfSSL | 11:cee25a834751 | 1982 | WOLFSSL_API long wolfSSL_CTX_ctrl(WOLFSSL_CTX* ctx, int cmd, long opt,void* pt); |
wolfSSL | 11:cee25a834751 | 1983 | |
wolfSSL | 11:cee25a834751 | 1984 | #ifndef NO_CERTS |
wolfSSL | 11:cee25a834751 | 1985 | WOLFSSL_API int wolfSSL_check_private_key(const WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 1986 | WOLFSSL_API void* wolfSSL_X509_get_ext_d2i(const WOLFSSL_X509* x509, |
wolfSSL | 11:cee25a834751 | 1987 | int nid, int* c, int* idx); |
wolfSSL | 11:cee25a834751 | 1988 | WOLFSSL_API int wolfSSL_X509_digest(const WOLFSSL_X509* x509, |
wolfSSL | 11:cee25a834751 | 1989 | const WOLFSSL_EVP_MD* digest, unsigned char* buf, unsigned int* len); |
wolfSSL | 11:cee25a834751 | 1990 | WOLFSSL_API int wolfSSL_use_certificate(WOLFSSL* ssl, WOLFSSL_X509* x509); |
wolfSSL | 11:cee25a834751 | 1991 | WOLFSSL_API int wolfSSL_use_certificate_ASN1(WOLFSSL* ssl, unsigned char* der, |
wolfSSL | 11:cee25a834751 | 1992 | int derSz); |
wolfSSL | 11:cee25a834751 | 1993 | WOLFSSL_API int wolfSSL_use_PrivateKey(WOLFSSL* ssl, WOLFSSL_EVP_PKEY* pkey); |
wolfSSL | 11:cee25a834751 | 1994 | WOLFSSL_API int wolfSSL_use_PrivateKey_ASN1(int pri, WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 1995 | unsigned char* der, long derSz); |
wolfSSL | 11:cee25a834751 | 1996 | WOLFSSL_API WOLFSSL_EVP_PKEY *wolfSSL_get_privatekey(const WOLFSSL *ssl); |
wolfSSL | 11:cee25a834751 | 1997 | #ifndef NO_RSA |
wolfSSL | 11:cee25a834751 | 1998 | WOLFSSL_API int wolfSSL_use_RSAPrivateKey_ASN1(WOLFSSL* ssl, unsigned char* der, |
wolfSSL | 11:cee25a834751 | 1999 | long derSz); |
wolfSSL | 11:cee25a834751 | 2000 | #endif |
wolfSSL | 11:cee25a834751 | 2001 | #endif /* NO_CERTS */ |
wolfSSL | 11:cee25a834751 | 2002 | |
wolfSSL | 11:cee25a834751 | 2003 | WOLFSSL_API WOLFSSL_DH *wolfSSL_DSA_dup_DH(const WOLFSSL_DSA *r); |
wolfSSL | 11:cee25a834751 | 2004 | |
wolfSSL | 11:cee25a834751 | 2005 | WOLFSSL_API int wolfSSL_SESSION_get_master_key(const WOLFSSL_SESSION* ses, |
wolfSSL | 11:cee25a834751 | 2006 | unsigned char* out, int outSz); |
wolfSSL | 11:cee25a834751 | 2007 | WOLFSSL_API int wolfSSL_SESSION_get_master_key_length(const WOLFSSL_SESSION* ses); |
wolfSSL | 11:cee25a834751 | 2008 | |
wolfSSL | 11:cee25a834751 | 2009 | WOLFSSL_API void wolfSSL_CTX_set_cert_store(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 2010 | WOLFSSL_X509_STORE* str); |
wolfSSL | 11:cee25a834751 | 2011 | WOLFSSL_X509* wolfSSL_d2i_X509_bio(WOLFSSL_BIO* bio, WOLFSSL_X509** x509); |
wolfSSL | 11:cee25a834751 | 2012 | WOLFSSL_API WOLFSSL_X509_STORE* wolfSSL_CTX_get_cert_store(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 2013 | |
wolfSSL | 11:cee25a834751 | 2014 | WOLFSSL_API size_t wolfSSL_BIO_ctrl_pending(WOLFSSL_BIO *b); |
wolfSSL | 11:cee25a834751 | 2015 | WOLFSSL_API size_t wolfSSL_get_server_random(const WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 2016 | unsigned char *out, size_t outlen); |
wolfSSL | 11:cee25a834751 | 2017 | WOLFSSL_API size_t wolfSSL_get_client_random(const WOLFSSL* ssl, |
wolfSSL | 11:cee25a834751 | 2018 | unsigned char* out, size_t outSz); |
wolfSSL | 11:cee25a834751 | 2019 | WOLFSSL_API pem_password_cb* wolfSSL_CTX_get_default_passwd_cb(WOLFSSL_CTX *ctx); |
wolfSSL | 11:cee25a834751 | 2020 | WOLFSSL_API void *wolfSSL_CTX_get_default_passwd_cb_userdata(WOLFSSL_CTX *ctx); |
wolfSSL | 11:cee25a834751 | 2021 | WOLFSSL_API int wolfSSL_CTX_use_PrivateKey(WOLFSSL_CTX *ctx, WOLFSSL_EVP_PKEY *pkey); |
wolfSSL | 11:cee25a834751 | 2022 | WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509(WOLFSSL_BIO *bp, WOLFSSL_X509 **x, pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 2023 | WOLFSSL_API WOLFSSL_X509 *wolfSSL_PEM_read_bio_X509_AUX |
wolfSSL | 11:cee25a834751 | 2024 | (WOLFSSL_BIO *bp, WOLFSSL_X509 **x, pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 2025 | |
wolfSSL | 11:cee25a834751 | 2026 | /*lighttp compatibility */ |
wolfSSL | 11:cee25a834751 | 2027 | |
wolfSSL | 11:cee25a834751 | 2028 | #include <wolfssl/openssl/asn1.h> |
wolfSSL | 11:cee25a834751 | 2029 | struct WOLFSSL_X509_NAME_ENTRY { |
wolfSSL | 11:cee25a834751 | 2030 | WOLFSSL_ASN1_OBJECT* object; /* not defined yet */ |
wolfSSL | 11:cee25a834751 | 2031 | WOLFSSL_ASN1_STRING data; |
wolfSSL | 11:cee25a834751 | 2032 | WOLFSSL_ASN1_STRING* value; /* points to data, for lighttpd port */ |
wolfSSL | 11:cee25a834751 | 2033 | int set; |
wolfSSL | 11:cee25a834751 | 2034 | int size; |
wolfSSL | 11:cee25a834751 | 2035 | }; |
wolfSSL | 11:cee25a834751 | 2036 | |
wolfSSL | 11:cee25a834751 | 2037 | #if defined(HAVE_LIGHTY) || defined(WOLFSSL_MYSQL_COMPATIBLE) \ |
wolfSSL | 11:cee25a834751 | 2038 | || defined(HAVE_STUNNEL) \ |
wolfSSL | 11:cee25a834751 | 2039 | || defined(WOLFSSL_NGINX) \ |
wolfSSL | 11:cee25a834751 | 2040 | || defined(WOLFSSL_HAPROXY) \ |
wolfSSL | 11:cee25a834751 | 2041 | || defined(OPENSSL_EXTRA) |
wolfSSL | 11:cee25a834751 | 2042 | WOLFSSL_API void wolfSSL_X509_NAME_free(WOLFSSL_X509_NAME *name); |
wolfSSL | 11:cee25a834751 | 2043 | WOLFSSL_API char wolfSSL_CTX_use_certificate(WOLFSSL_CTX *ctx, WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2044 | WOLFSSL_API int wolfSSL_BIO_read_filename(WOLFSSL_BIO *b, const char *name); |
wolfSSL | 11:cee25a834751 | 2045 | /* These are to be merged shortly */ |
wolfSSL | 11:cee25a834751 | 2046 | WOLFSSL_API const char * wolfSSL_OBJ_nid2sn(int n); |
wolfSSL | 11:cee25a834751 | 2047 | WOLFSSL_API int wolfSSL_OBJ_obj2nid(const WOLFSSL_ASN1_OBJECT *o); |
wolfSSL | 11:cee25a834751 | 2048 | WOLFSSL_API int wolfSSL_OBJ_sn2nid(const char *sn); |
wolfSSL | 11:cee25a834751 | 2049 | WOLFSSL_API void wolfSSL_CTX_set_verify_depth(WOLFSSL_CTX *ctx,int depth); |
wolfSSL | 11:cee25a834751 | 2050 | WOLFSSL_API void wolfSSL_set_verify_depth(WOLFSSL *ssl,int depth); |
wolfSSL | 11:cee25a834751 | 2051 | WOLFSSL_API void* wolfSSL_get_app_data( const WOLFSSL *ssl); |
wolfSSL | 11:cee25a834751 | 2052 | WOLFSSL_API int wolfSSL_set_app_data(WOLFSSL *ssl, void *arg); |
wolfSSL | 11:cee25a834751 | 2053 | WOLFSSL_API WOLFSSL_ASN1_OBJECT * wolfSSL_X509_NAME_ENTRY_get_object(WOLFSSL_X509_NAME_ENTRY *ne); |
wolfSSL | 11:cee25a834751 | 2054 | WOLFSSL_API WOLFSSL_X509_NAME_ENTRY *wolfSSL_X509_NAME_get_entry(WOLFSSL_X509_NAME *name, int loc); |
wolfSSL | 11:cee25a834751 | 2055 | WOLFSSL_API void wolfSSL_sk_X509_NAME_pop_free(STACK_OF(WOLFSSL_X509_NAME)* sk, void f (WOLFSSL_X509_NAME*)); |
wolfSSL | 11:cee25a834751 | 2056 | WOLFSSL_API unsigned char *wolfSSL_SHA1(const unsigned char *d, size_t n, unsigned char *md); |
wolfSSL | 11:cee25a834751 | 2057 | WOLFSSL_API int wolfSSL_X509_check_private_key(WOLFSSL_X509*, WOLFSSL_EVP_PKEY*); |
wolfSSL | 11:cee25a834751 | 2058 | WOLFSSL_API STACK_OF(WOLFSSL_X509_NAME) *wolfSSL_dup_CA_list( STACK_OF(WOLFSSL_X509_NAME) *sk ); |
wolfSSL | 11:cee25a834751 | 2059 | |
wolfSSL | 11:cee25a834751 | 2060 | /* end lighttpd*/ |
wolfSSL | 11:cee25a834751 | 2061 | #endif |
wolfSSL | 11:cee25a834751 | 2062 | #endif |
wolfSSL | 11:cee25a834751 | 2063 | |
wolfSSL | 11:cee25a834751 | 2064 | #if defined(HAVE_STUNNEL) || defined(HAVE_LIGHTY) \ |
wolfSSL | 11:cee25a834751 | 2065 | || defined(WOLFSSL_MYSQL_COMPATIBLE) \ |
wolfSSL | 11:cee25a834751 | 2066 | || defined(WOLFSSL_HAPROXY) \ |
wolfSSL | 11:cee25a834751 | 2067 | || defined(OPENSSL_EXTRA) |
wolfSSL | 11:cee25a834751 | 2068 | |
wolfSSL | 11:cee25a834751 | 2069 | WOLFSSL_API char* wolfSSL_OBJ_nid2ln(int n); |
wolfSSL | 11:cee25a834751 | 2070 | WOLFSSL_API int wolfSSL_OBJ_txt2nid(const char *sn); |
wolfSSL | 11:cee25a834751 | 2071 | WOLFSSL_API WOLFSSL_BIO* wolfSSL_BIO_new_file(const char *filename, const char *mode); |
wolfSSL | 11:cee25a834751 | 2072 | WOLFSSL_API long wolfSSL_CTX_set_tmp_dh(WOLFSSL_CTX*, WOLFSSL_DH*); |
wolfSSL | 11:cee25a834751 | 2073 | WOLFSSL_API WOLFSSL_DH *wolfSSL_PEM_read_bio_DHparams(WOLFSSL_BIO *bp, |
wolfSSL | 11:cee25a834751 | 2074 | WOLFSSL_DH **x, pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 2075 | WOLFSSL_API WOLFSSL_DSA *wolfSSL_PEM_read_bio_DSAparams(WOLFSSL_BIO *bp, |
wolfSSL | 11:cee25a834751 | 2076 | WOLFSSL_DSA **x, pem_password_cb *cb, void *u); |
wolfSSL | 11:cee25a834751 | 2077 | WOLFSSL_API int wolfSSL_PEM_write_bio_X509(WOLFSSL_BIO *bp, WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2078 | WOLFSSL_API long wolfSSL_CTX_get_options(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 2079 | |
wolfSSL | 11:cee25a834751 | 2080 | |
wolfSSL | 11:cee25a834751 | 2081 | |
wolfSSL | 11:cee25a834751 | 2082 | #endif /* HAVE_STUNNEL || HAVE_LIGHTY */ |
wolfSSL | 11:cee25a834751 | 2083 | |
wolfSSL | 11:cee25a834751 | 2084 | |
wolfSSL | 11:cee25a834751 | 2085 | #if defined(HAVE_STUNNEL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) |
wolfSSL | 11:cee25a834751 | 2086 | |
wolfSSL | 11:cee25a834751 | 2087 | #include <wolfssl/openssl/crypto.h> |
wolfSSL | 11:cee25a834751 | 2088 | |
wolfSSL | 11:cee25a834751 | 2089 | /* SNI received callback type */ |
wolfSSL | 11:cee25a834751 | 2090 | typedef int (*CallbackSniRecv)(WOLFSSL *ssl, int *ret, void* exArg); |
wolfSSL | 11:cee25a834751 | 2091 | |
wolfSSL | 11:cee25a834751 | 2092 | WOLFSSL_API int wolfSSL_CRYPTO_set_mem_ex_functions(void *(*m) (size_t, const char *, int), |
wolfSSL | 11:cee25a834751 | 2093 | void *(*r) (void *, size_t, const char *, int), void (*f) (void *)); |
wolfSSL | 11:cee25a834751 | 2094 | |
wolfSSL | 11:cee25a834751 | 2095 | WOLFSSL_API WOLFSSL_DH *wolfSSL_DH_generate_parameters(int prime_len, int generator, |
wolfSSL | 11:cee25a834751 | 2096 | void (*callback) (int, int, void *), void *cb_arg); |
wolfSSL | 11:cee25a834751 | 2097 | |
wolfSSL | 11:cee25a834751 | 2098 | WOLFSSL_API int wolfSSL_DH_generate_parameters_ex(WOLFSSL_DH*, int, int, |
wolfSSL | 11:cee25a834751 | 2099 | void (*callback) (int, int, void *)); |
wolfSSL | 11:cee25a834751 | 2100 | |
wolfSSL | 11:cee25a834751 | 2101 | WOLFSSL_API void wolfSSL_ERR_load_crypto_strings(void); |
wolfSSL | 11:cee25a834751 | 2102 | |
wolfSSL | 11:cee25a834751 | 2103 | WOLFSSL_API unsigned long wolfSSL_ERR_peek_last_error(void); |
wolfSSL | 11:cee25a834751 | 2104 | |
wolfSSL | 11:cee25a834751 | 2105 | WOLFSSL_API int wolfSSL_FIPS_mode(void); |
wolfSSL | 11:cee25a834751 | 2106 | |
wolfSSL | 11:cee25a834751 | 2107 | WOLFSSL_API int wolfSSL_FIPS_mode_set(int r); |
wolfSSL | 11:cee25a834751 | 2108 | |
wolfSSL | 11:cee25a834751 | 2109 | WOLFSSL_API int wolfSSL_RAND_set_rand_method(const void *meth); |
wolfSSL | 11:cee25a834751 | 2110 | |
wolfSSL | 11:cee25a834751 | 2111 | WOLFSSL_API int wolfSSL_CIPHER_get_bits(const WOLFSSL_CIPHER *c, int *alg_bits); |
wolfSSL | 11:cee25a834751 | 2112 | |
wolfSSL | 11:cee25a834751 | 2113 | WOLFSSL_API int wolfSSL_sk_X509_NAME_num(const STACK_OF(WOLFSSL_X509_NAME) *s); |
wolfSSL | 11:cee25a834751 | 2114 | |
wolfSSL | 11:cee25a834751 | 2115 | WOLFSSL_API int wolfSSL_sk_X509_num(const STACK_OF(WOLFSSL_X509) *s); |
wolfSSL | 11:cee25a834751 | 2116 | |
wolfSSL | 11:cee25a834751 | 2117 | WOLFSSL_API int wolfSSL_X509_NAME_print_ex(WOLFSSL_BIO*,WOLFSSL_X509_NAME*,int, |
wolfSSL | 11:cee25a834751 | 2118 | unsigned long); |
wolfSSL | 11:cee25a834751 | 2119 | |
wolfSSL | 11:cee25a834751 | 2120 | WOLFSSL_API WOLFSSL_ASN1_BIT_STRING* wolfSSL_X509_get0_pubkey_bitstr( |
wolfSSL | 11:cee25a834751 | 2121 | const WOLFSSL_X509*); |
wolfSSL | 11:cee25a834751 | 2122 | |
wolfSSL | 11:cee25a834751 | 2123 | WOLFSSL_API int wolfSSL_CTX_add_session(WOLFSSL_CTX*, WOLFSSL_SESSION*); |
wolfSSL | 11:cee25a834751 | 2124 | |
wolfSSL | 11:cee25a834751 | 2125 | WOLFSSL_API WOLFSSL_CTX* wolfSSL_get_SSL_CTX(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 2126 | |
wolfSSL | 11:cee25a834751 | 2127 | WOLFSSL_API int wolfSSL_version(WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 2128 | |
wolfSSL | 11:cee25a834751 | 2129 | WOLFSSL_API int wolfSSL_get_state(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 2130 | |
wolfSSL | 11:cee25a834751 | 2131 | WOLFSSL_API void* wolfSSL_sk_X509_NAME_value(const STACK_OF(WOLFSSL_X509_NAME)*, int); |
wolfSSL | 11:cee25a834751 | 2132 | |
wolfSSL | 11:cee25a834751 | 2133 | WOLFSSL_API void* wolfSSL_sk_X509_value(STACK_OF(WOLFSSL_X509)*, int); |
wolfSSL | 11:cee25a834751 | 2134 | |
wolfSSL | 11:cee25a834751 | 2135 | WOLFSSL_API STACK_OF(WOLFSSL_X509)* wolfSSL_get_peer_cert_chain(const WOLFSSL*); |
wolfSSL | 11:cee25a834751 | 2136 | |
wolfSSL | 11:cee25a834751 | 2137 | WOLFSSL_API void* wolfSSL_SESSION_get_ex_data(const WOLFSSL_SESSION*, int); |
wolfSSL | 11:cee25a834751 | 2138 | |
wolfSSL | 11:cee25a834751 | 2139 | WOLFSSL_API int wolfSSL_SESSION_set_ex_data(WOLFSSL_SESSION*, int, void*); |
wolfSSL | 11:cee25a834751 | 2140 | |
wolfSSL | 11:cee25a834751 | 2141 | WOLFSSL_API int wolfSSL_SESSION_get_ex_new_index(long,void*,void*,void*, |
wolfSSL | 11:cee25a834751 | 2142 | CRYPTO_free_func*); |
wolfSSL | 11:cee25a834751 | 2143 | |
wolfSSL | 11:cee25a834751 | 2144 | WOLFSSL_API int wolfSSL_X509_NAME_get_sz(WOLFSSL_X509_NAME*); |
wolfSSL | 11:cee25a834751 | 2145 | |
wolfSSL | 11:cee25a834751 | 2146 | |
wolfSSL | 11:cee25a834751 | 2147 | WOLFSSL_API const unsigned char* wolfSSL_SESSION_get_id(WOLFSSL_SESSION*, |
wolfSSL | 11:cee25a834751 | 2148 | unsigned int*); |
wolfSSL | 11:cee25a834751 | 2149 | |
wolfSSL | 11:cee25a834751 | 2150 | WOLFSSL_API int wolfSSL_set_tlsext_host_name(WOLFSSL *, const char *); |
wolfSSL | 11:cee25a834751 | 2151 | |
wolfSSL | 11:cee25a834751 | 2152 | WOLFSSL_API const char* wolfSSL_get_servername(WOLFSSL *, unsigned char); |
wolfSSL | 11:cee25a834751 | 2153 | |
wolfSSL | 11:cee25a834751 | 2154 | WOLFSSL_API WOLFSSL_CTX* wolfSSL_set_SSL_CTX(WOLFSSL*,WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 2155 | |
wolfSSL | 11:cee25a834751 | 2156 | WOLFSSL_API VerifyCallback wolfSSL_CTX_get_verify_callback(WOLFSSL_CTX*); |
wolfSSL | 11:cee25a834751 | 2157 | |
wolfSSL | 11:cee25a834751 | 2158 | WOLFSSL_API void wolfSSL_CTX_set_servername_callback(WOLFSSL_CTX *, |
wolfSSL | 11:cee25a834751 | 2159 | CallbackSniRecv); |
wolfSSL | 11:cee25a834751 | 2160 | WOLFSSL_API int wolfSSL_CTX_set_tlsext_servername_callback(WOLFSSL_CTX *, |
wolfSSL | 11:cee25a834751 | 2161 | CallbackSniRecv); |
wolfSSL | 11:cee25a834751 | 2162 | |
wolfSSL | 11:cee25a834751 | 2163 | WOLFSSL_API void wolfSSL_CTX_set_servername_arg(WOLFSSL_CTX *, void*); |
wolfSSL | 11:cee25a834751 | 2164 | |
wolfSSL | 11:cee25a834751 | 2165 | WOLFSSL_API void WOLFSSL_ERR_remove_thread_state(void*); |
wolfSSL | 11:cee25a834751 | 2166 | |
wolfSSL | 11:cee25a834751 | 2167 | #ifndef NO_FILESYSTEM |
wolfSSL | 11:cee25a834751 | 2168 | WOLFSSL_API void wolfSSL_print_all_errors_fp(XFILE *fp); |
wolfSSL | 11:cee25a834751 | 2169 | #endif |
wolfSSL | 11:cee25a834751 | 2170 | |
wolfSSL | 11:cee25a834751 | 2171 | WOLFSSL_API long wolfSSL_CTX_clear_options(WOLFSSL_CTX*, long); |
wolfSSL | 11:cee25a834751 | 2172 | |
wolfSSL | 11:cee25a834751 | 2173 | WOLFSSL_API void wolfSSL_THREADID_set_callback(void (*threadid_func)(void*)); |
wolfSSL | 11:cee25a834751 | 2174 | |
wolfSSL | 11:cee25a834751 | 2175 | WOLFSSL_API void wolfSSL_THREADID_set_numeric(void* id, unsigned long val); |
wolfSSL | 11:cee25a834751 | 2176 | |
wolfSSL | 11:cee25a834751 | 2177 | WOLFSSL_API STACK_OF(WOLFSSL_X509)* wolfSSL_X509_STORE_get1_certs( |
wolfSSL | 11:cee25a834751 | 2178 | WOLFSSL_X509_STORE_CTX*, WOLFSSL_X509_NAME*); |
wolfSSL | 11:cee25a834751 | 2179 | |
wolfSSL | 11:cee25a834751 | 2180 | WOLFSSL_API void wolfSSL_sk_X509_pop_free(STACK_OF(WOLFSSL_X509)* sk, void f (WOLFSSL_X509*)); |
wolfSSL | 11:cee25a834751 | 2181 | #endif /* HAVE_STUNNEL || WOLFSSL_NGINX || WOLFSSL_HAPROXY */ |
wolfSSL | 11:cee25a834751 | 2182 | |
wolfSSL | 11:cee25a834751 | 2183 | #if defined(HAVE_STUNNEL) || defined(WOLFSSL_MYSQL_COMPATIBLE) \ |
wolfSSL | 11:cee25a834751 | 2184 | || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) |
wolfSSL | 11:cee25a834751 | 2185 | |
wolfSSL | 11:cee25a834751 | 2186 | WOLFSSL_API int wolfSSL_CTX_get_verify_mode(WOLFSSL_CTX* ctx); |
wolfSSL | 11:cee25a834751 | 2187 | |
wolfSSL | 11:cee25a834751 | 2188 | #endif |
wolfSSL | 11:cee25a834751 | 2189 | |
wolfSSL | 11:cee25a834751 | 2190 | #ifdef WOLFSSL_JNI |
wolfSSL | 11:cee25a834751 | 2191 | WOLFSSL_API int wolfSSL_set_jobject(WOLFSSL* ssl, void* objPtr); |
wolfSSL | 11:cee25a834751 | 2192 | WOLFSSL_API void* wolfSSL_get_jobject(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 2193 | #endif /* WOLFSSL_JNI */ |
wolfSSL | 11:cee25a834751 | 2194 | |
wolfSSL | 11:cee25a834751 | 2195 | |
wolfSSL | 11:cee25a834751 | 2196 | #ifdef WOLFSSL_ASYNC_CRYPT |
wolfSSL | 11:cee25a834751 | 2197 | WOLFSSL_API int wolfSSL_AsyncPoll(WOLFSSL* ssl, WOLF_EVENT_FLAG flags); |
wolfSSL | 11:cee25a834751 | 2198 | WOLFSSL_API int wolfSSL_CTX_AsyncPoll(WOLFSSL_CTX* ctx, WOLF_EVENT** events, int maxEvents, |
wolfSSL | 11:cee25a834751 | 2199 | WOLF_EVENT_FLAG flags, int* eventCount); |
wolfSSL | 11:cee25a834751 | 2200 | #endif /* WOLFSSL_ASYNC_CRYPT */ |
wolfSSL | 11:cee25a834751 | 2201 | |
wolfSSL | 11:cee25a834751 | 2202 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 2203 | typedef void (*SSL_Msg_Cb)(int write_p, int version, int content_type, |
wolfSSL | 11:cee25a834751 | 2204 | const void *buf, size_t len, WOLFSSL *ssl, void *arg); |
wolfSSL | 11:cee25a834751 | 2205 | |
wolfSSL | 11:cee25a834751 | 2206 | WOLFSSL_API int wolfSSL_CTX_set_msg_callback(WOLFSSL_CTX *ctx, SSL_Msg_Cb cb); |
wolfSSL | 11:cee25a834751 | 2207 | WOLFSSL_API int wolfSSL_set_msg_callback(WOLFSSL *ssl, SSL_Msg_Cb cb); |
wolfSSL | 11:cee25a834751 | 2208 | WOLFSSL_API int wolfSSL_CTX_set_msg_callback_arg(WOLFSSL_CTX *ctx, void* arg); |
wolfSSL | 11:cee25a834751 | 2209 | WOLFSSL_API int wolfSSL_set_msg_callback_arg(WOLFSSL *ssl, void* arg); |
wolfSSL | 11:cee25a834751 | 2210 | #endif |
wolfSSL | 11:cee25a834751 | 2211 | |
wolfSSL | 11:cee25a834751 | 2212 | #ifdef OPENSSL_EXTRA |
wolfSSL | 11:cee25a834751 | 2213 | WOLFSSL_API unsigned long wolfSSL_ERR_peek_error_line_data(const char **file, |
wolfSSL | 11:cee25a834751 | 2214 | int *line, const char **data, int *flags); |
wolfSSL | 11:cee25a834751 | 2215 | #endif |
wolfSSL | 11:cee25a834751 | 2216 | |
wolfSSL | 11:cee25a834751 | 2217 | #if defined WOLFSSL_NGINX || defined WOLFSSL_HAPROXY |
wolfSSL | 11:cee25a834751 | 2218 | /* Not an OpenSSL API. */ |
wolfSSL | 11:cee25a834751 | 2219 | WOLFSSL_LOCAL int wolfSSL_get_ocsp_response(WOLFSSL* ssl, byte** response); |
wolfSSL | 11:cee25a834751 | 2220 | /* Not an OpenSSL API. */ |
wolfSSL | 11:cee25a834751 | 2221 | WOLFSSL_LOCAL char* wolfSSL_get_ocsp_url(WOLFSSL* ssl); |
wolfSSL | 11:cee25a834751 | 2222 | /* Not an OpenSSL API. */ |
wolfSSL | 11:cee25a834751 | 2223 | WOLFSSL_API int wolfSSL_set_ocsp_url(WOLFSSL* ssl, char* url); |
wolfSSL | 11:cee25a834751 | 2224 | |
wolfSSL | 11:cee25a834751 | 2225 | WOLFSSL_API STACK_OF(WOLFSSL_CIPHER) *wolfSSL_get_ciphers_compat(const WOLFSSL *ssl); |
wolfSSL | 11:cee25a834751 | 2226 | WOLFSSL_API void wolfSSL_OPENSSL_config(char *config_name); |
wolfSSL | 11:cee25a834751 | 2227 | WOLFSSL_API int wolfSSL_X509_get_ex_new_index(int idx, void *arg, void *a, |
wolfSSL | 11:cee25a834751 | 2228 | void *b, void *c); |
wolfSSL | 11:cee25a834751 | 2229 | WOLFSSL_API void *wolfSSL_X509_get_ex_data(WOLFSSL_X509 *x509, int idx); |
wolfSSL | 11:cee25a834751 | 2230 | WOLFSSL_API int wolfSSL_X509_set_ex_data(WOLFSSL_X509 *x509, int idx, |
wolfSSL | 11:cee25a834751 | 2231 | void *data); |
wolfSSL | 11:cee25a834751 | 2232 | |
wolfSSL | 11:cee25a834751 | 2233 | WOLFSSL_API int wolfSSL_X509_NAME_digest(const WOLFSSL_X509_NAME *data, |
wolfSSL | 11:cee25a834751 | 2234 | const WOLFSSL_EVP_MD *type, unsigned char *md, unsigned int *len); |
wolfSSL | 11:cee25a834751 | 2235 | |
wolfSSL | 11:cee25a834751 | 2236 | WOLFSSL_API long wolfSSL_SSL_CTX_get_timeout(const WOLFSSL_CTX *ctx); |
wolfSSL | 11:cee25a834751 | 2237 | WOLFSSL_API int wolfSSL_SSL_CTX_set_tmp_ecdh(WOLFSSL_CTX *ctx, |
wolfSSL | 11:cee25a834751 | 2238 | WOLFSSL_EC_KEY *ecdh); |
wolfSSL | 11:cee25a834751 | 2239 | WOLFSSL_API int wolfSSL_SSL_CTX_remove_session(WOLFSSL_CTX *, |
wolfSSL | 11:cee25a834751 | 2240 | WOLFSSL_SESSION *c); |
wolfSSL | 11:cee25a834751 | 2241 | |
wolfSSL | 11:cee25a834751 | 2242 | WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_rbio(const WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 2243 | WOLFSSL_API WOLFSSL_BIO *wolfSSL_SSL_get_wbio(const WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 2244 | WOLFSSL_API int wolfSSL_SSL_do_handshake(WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 2245 | WOLFSSL_API int wolfSSL_SSL_in_init(WOLFSSL *a); /* #define in OpenSSL */ |
wolfSSL | 11:cee25a834751 | 2246 | WOLFSSL_API WOLFSSL_SESSION *wolfSSL_SSL_get0_session(const WOLFSSL *s); |
wolfSSL | 11:cee25a834751 | 2247 | WOLFSSL_API int wolfSSL_X509_check_host(WOLFSSL_X509 *x, const char *chk, |
wolfSSL | 11:cee25a834751 | 2248 | size_t chklen, unsigned int flags, char **peername); |
wolfSSL | 11:cee25a834751 | 2249 | |
wolfSSL | 11:cee25a834751 | 2250 | WOLFSSL_API int wolfSSL_i2a_ASN1_INTEGER(WOLFSSL_BIO *bp, |
wolfSSL | 11:cee25a834751 | 2251 | const WOLFSSL_ASN1_INTEGER *a); |
wolfSSL | 11:cee25a834751 | 2252 | |
wolfSSL | 11:cee25a834751 | 2253 | #ifdef HAVE_SESSION_TICKET |
wolfSSL | 11:cee25a834751 | 2254 | WOLFSSL_API int wolfSSL_CTX_set_tlsext_ticket_key_cb(WOLFSSL_CTX *, int (*)( |
wolfSSL | 11:cee25a834751 | 2255 | WOLFSSL *ssl, unsigned char *name, unsigned char *iv, |
wolfSSL | 11:cee25a834751 | 2256 | WOLFSSL_EVP_CIPHER_CTX *ectx, WOLFSSL_HMAC_CTX *hctx, int enc)); |
wolfSSL | 11:cee25a834751 | 2257 | #endif |
wolfSSL | 11:cee25a834751 | 2258 | |
wolfSSL | 11:cee25a834751 | 2259 | #ifdef HAVE_OCSP |
wolfSSL | 11:cee25a834751 | 2260 | WOLFSSL_API int wolfSSL_CTX_get_extra_chain_certs(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 2261 | STACK_OF(X509)** chain); |
wolfSSL | 11:cee25a834751 | 2262 | WOLFSSL_API int wolfSSL_CTX_set_tlsext_status_cb(WOLFSSL_CTX* ctx, |
wolfSSL | 11:cee25a834751 | 2263 | int(*)(WOLFSSL*, void*)); |
wolfSSL | 11:cee25a834751 | 2264 | |
wolfSSL | 11:cee25a834751 | 2265 | WOLFSSL_API int wolfSSL_X509_STORE_CTX_get1_issuer(WOLFSSL_X509 **issuer, |
wolfSSL | 11:cee25a834751 | 2266 | WOLFSSL_X509_STORE_CTX *ctx, WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2267 | |
wolfSSL | 11:cee25a834751 | 2268 | WOLFSSL_API void wolfSSL_X509_email_free(STACK_OF(WOLFSSL_STRING) *sk); |
wolfSSL | 11:cee25a834751 | 2269 | WOLFSSL_API STACK_OF(WOLFSSL_STRING) *wolfSSL_X509_get1_ocsp(WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2270 | |
wolfSSL | 11:cee25a834751 | 2271 | WOLFSSL_API int wolfSSL_X509_check_issued(WOLFSSL_X509 *issuer, |
wolfSSL | 11:cee25a834751 | 2272 | WOLFSSL_X509 *subject); |
wolfSSL | 11:cee25a834751 | 2273 | |
wolfSSL | 11:cee25a834751 | 2274 | WOLFSSL_API WOLFSSL_X509* wolfSSL_X509_dup(WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2275 | |
wolfSSL | 11:cee25a834751 | 2276 | WOLFSSL_API char* wolfSSL_sk_WOLFSSL_STRING_value( |
wolfSSL | 11:cee25a834751 | 2277 | STACK_OF(WOLFSSL_STRING)* strings, int idx); |
wolfSSL | 11:cee25a834751 | 2278 | #endif /* HAVE_OCSP */ |
wolfSSL | 11:cee25a834751 | 2279 | |
wolfSSL | 11:cee25a834751 | 2280 | WOLFSSL_API int PEM_write_bio_WOLFSSL_X509(WOLFSSL_BIO *bio, |
wolfSSL | 11:cee25a834751 | 2281 | WOLFSSL_X509 *cert); |
wolfSSL | 11:cee25a834751 | 2282 | #endif /* WOLFSSL_NGINX */ |
wolfSSL | 11:cee25a834751 | 2283 | |
wolfSSL | 11:cee25a834751 | 2284 | WOLFSSL_API void wolfSSL_get0_alpn_selected(const WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 2285 | const unsigned char **data, unsigned int *len); |
wolfSSL | 11:cee25a834751 | 2286 | WOLFSSL_API int wolfSSL_select_next_proto(unsigned char **out, |
wolfSSL | 11:cee25a834751 | 2287 | unsigned char *outlen, |
wolfSSL | 11:cee25a834751 | 2288 | const unsigned char *in, unsigned int inlen, |
wolfSSL | 11:cee25a834751 | 2289 | const unsigned char *client, |
wolfSSL | 11:cee25a834751 | 2290 | unsigned int client_len); |
wolfSSL | 11:cee25a834751 | 2291 | WOLFSSL_API void wolfSSL_CTX_set_alpn_select_cb(WOLFSSL_CTX *ctx, |
wolfSSL | 11:cee25a834751 | 2292 | int (*cb) (WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 2293 | const unsigned char **out, |
wolfSSL | 11:cee25a834751 | 2294 | unsigned char *outlen, |
wolfSSL | 11:cee25a834751 | 2295 | const unsigned char *in, |
wolfSSL | 11:cee25a834751 | 2296 | unsigned int inlen, |
wolfSSL | 11:cee25a834751 | 2297 | void *arg), void *arg); |
wolfSSL | 11:cee25a834751 | 2298 | WOLFSSL_API void wolfSSL_CTX_set_next_protos_advertised_cb(WOLFSSL_CTX *s, |
wolfSSL | 11:cee25a834751 | 2299 | int (*cb) (WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 2300 | const unsigned char **out, |
wolfSSL | 11:cee25a834751 | 2301 | unsigned int *outlen, |
wolfSSL | 11:cee25a834751 | 2302 | void *arg), void *arg); |
wolfSSL | 11:cee25a834751 | 2303 | WOLFSSL_API void wolfSSL_CTX_set_next_proto_select_cb(WOLFSSL_CTX *s, |
wolfSSL | 11:cee25a834751 | 2304 | int (*cb) (WOLFSSL *ssl, |
wolfSSL | 11:cee25a834751 | 2305 | unsigned char **out, |
wolfSSL | 11:cee25a834751 | 2306 | unsigned char *outlen, |
wolfSSL | 11:cee25a834751 | 2307 | const unsigned char *in, |
wolfSSL | 11:cee25a834751 | 2308 | unsigned int inlen, |
wolfSSL | 11:cee25a834751 | 2309 | void *arg), void *arg); |
wolfSSL | 11:cee25a834751 | 2310 | WOLFSSL_API void wolfSSL_get0_next_proto_negotiated(const WOLFSSL *s, const unsigned char **data, |
wolfSSL | 11:cee25a834751 | 2311 | unsigned *len); |
wolfSSL | 11:cee25a834751 | 2312 | |
wolfSSL | 11:cee25a834751 | 2313 | |
wolfSSL | 11:cee25a834751 | 2314 | #ifdef WOLFSSL_HAPROXY |
wolfSSL | 11:cee25a834751 | 2315 | WOLFSSL_API const unsigned char *SSL_SESSION_get0_id_context( |
wolfSSL | 11:cee25a834751 | 2316 | const WOLFSSL_SESSION *sess, unsigned int *sid_ctx_length); |
wolfSSL | 11:cee25a834751 | 2317 | #endif |
wolfSSL | 11:cee25a834751 | 2318 | |
wolfSSL | 11:cee25a834751 | 2319 | WOLFSSL_API int SSL_SESSION_set1_id(WOLFSSL_SESSION *s, const unsigned char *sid, unsigned int sid_len); |
wolfSSL | 11:cee25a834751 | 2320 | WOLFSSL_API int SSL_SESSION_set1_id_context(WOLFSSL_SESSION *s, const unsigned char *sid_ctx, unsigned int sid_ctx_len); |
wolfSSL | 11:cee25a834751 | 2321 | WOLFSSL_API void *X509_get0_tbs_sigalg(const WOLFSSL_X509 *x); |
wolfSSL | 11:cee25a834751 | 2322 | WOLFSSL_API void X509_ALGOR_get0(WOLFSSL_ASN1_OBJECT **paobj, int *pptype, const void **ppval, const void *algor); |
wolfSSL | 11:cee25a834751 | 2323 | WOLFSSL_API void *X509_get_X509_PUBKEY(void * x); |
wolfSSL | 11:cee25a834751 | 2324 | WOLFSSL_API int X509_PUBKEY_get0_param(WOLFSSL_ASN1_OBJECT **ppkalg, const unsigned char **pk, int *ppklen, void **pa, WOLFSSL_EVP_PKEY *pub); |
wolfSSL | 11:cee25a834751 | 2325 | WOLFSSL_API int EVP_PKEY_bits(WOLFSSL_EVP_PKEY *pkey); |
wolfSSL | 11:cee25a834751 | 2326 | WOLFSSL_API int i2d_X509(WOLFSSL_X509 *x, unsigned char **out); |
wolfSSL | 11:cee25a834751 | 2327 | WOLFSSL_API int i2t_ASN1_OBJECT(char *buf, int buf_len, WOLFSSL_ASN1_OBJECT *a); |
wolfSSL | 11:cee25a834751 | 2328 | WOLFSSL_API size_t SSL_get_finished(const WOLFSSL *s, void *buf, size_t count); |
wolfSSL | 11:cee25a834751 | 2329 | WOLFSSL_API size_t SSL_get_peer_finished(const WOLFSSL *s, void *buf, size_t count); |
wolfSSL | 11:cee25a834751 | 2330 | WOLFSSL_API void SSL_CTX_set_tmp_dh_callback(WOLFSSL_CTX *ctx, WOLFSSL_DH *(*dh) (WOLFSSL *ssl, int is_export, int keylength)); |
wolfSSL | 11:cee25a834751 | 2331 | WOLFSSL_API STACK_OF(SSL_COMP) *SSL_COMP_get_compression_methods(void); |
wolfSSL | 11:cee25a834751 | 2332 | WOLFSSL_API int X509_STORE_load_locations(WOLFSSL_X509_STORE *ctx, const char *file, const char *dir); |
wolfSSL | 11:cee25a834751 | 2333 | WOLFSSL_API int wolfSSL_sk_SSL_CIPHER_num(const void * p); |
wolfSSL | 11:cee25a834751 | 2334 | WOLFSSL_API int wolfSSL_sk_SSL_COMP_zero(WOLFSSL_STACK* st); |
wolfSSL | 11:cee25a834751 | 2335 | WOLFSSL_API WOLFSSL_CIPHER* wolfSSL_sk_SSL_CIPHER_value(void *ciphers, int idx); |
wolfSSL | 11:cee25a834751 | 2336 | WOLFSSL_API void ERR_load_SSL_strings(void); |
wolfSSL | 11:cee25a834751 | 2337 | |
wolfSSL | 11:cee25a834751 | 2338 | #ifdef __cplusplus |
wolfSSL | 11:cee25a834751 | 2339 | } /* extern "C" */ |
wolfSSL | 11:cee25a834751 | 2340 | #endif |
wolfSSL | 11:cee25a834751 | 2341 | |
wolfSSL | 11:cee25a834751 | 2342 | |
wolfSSL | 11:cee25a834751 | 2343 | #endif /* WOLFSSL_SSL_H */ |
wolfSSL | 11:cee25a834751 | 2344 |