fork of cyassl-lib
Dependents: TLS_cyassl TLS_cyassl
cyassl/ssl.h@0:714293de3836, 2013-09-05 (annotated)
- Committer:
- ashleymills
- Date:
- Thu Sep 05 10:33:04 2013 +0000
- Revision:
- 0:714293de3836
Initial commit
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
ashleymills | 0:714293de3836 | 1 | /* ssl.h |
ashleymills | 0:714293de3836 | 2 | * |
ashleymills | 0:714293de3836 | 3 | * Copyright (C) 2006-2013 wolfSSL Inc. |
ashleymills | 0:714293de3836 | 4 | * |
ashleymills | 0:714293de3836 | 5 | * This file is part of CyaSSL. |
ashleymills | 0:714293de3836 | 6 | * |
ashleymills | 0:714293de3836 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
ashleymills | 0:714293de3836 | 8 | * it under the terms of the GNU General Public License as published by |
ashleymills | 0:714293de3836 | 9 | * the Free Software Foundation; either version 2 of the License, or |
ashleymills | 0:714293de3836 | 10 | * (at your option) any later version. |
ashleymills | 0:714293de3836 | 11 | * |
ashleymills | 0:714293de3836 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
ashleymills | 0:714293de3836 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
ashleymills | 0:714293de3836 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
ashleymills | 0:714293de3836 | 15 | * GNU General Public License for more details. |
ashleymills | 0:714293de3836 | 16 | * |
ashleymills | 0:714293de3836 | 17 | * You should have received a copy of the GNU General Public License |
ashleymills | 0:714293de3836 | 18 | * along with this program; if not, write to the Free Software |
ashleymills | 0:714293de3836 | 19 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA |
ashleymills | 0:714293de3836 | 20 | */ |
ashleymills | 0:714293de3836 | 21 | |
ashleymills | 0:714293de3836 | 22 | |
ashleymills | 0:714293de3836 | 23 | /* CyaSSL API */ |
ashleymills | 0:714293de3836 | 24 | |
ashleymills | 0:714293de3836 | 25 | #ifndef CYASSL_SSL_H |
ashleymills | 0:714293de3836 | 26 | #define CYASSL_SSL_H |
ashleymills | 0:714293de3836 | 27 | |
ashleymills | 0:714293de3836 | 28 | |
ashleymills | 0:714293de3836 | 29 | /* for users not using preprocessor flags*/ |
ashleymills | 0:714293de3836 | 30 | #include <cyassl/ctaocrypt/settings.h> |
ashleymills | 0:714293de3836 | 31 | #include <cyassl/version.h> |
ashleymills | 0:714293de3836 | 32 | |
ashleymills | 0:714293de3836 | 33 | |
ashleymills | 0:714293de3836 | 34 | #ifndef NO_FILESYSTEM |
ashleymills | 0:714293de3836 | 35 | #ifdef FREESCALE_MQX |
ashleymills | 0:714293de3836 | 36 | #include <fio.h> |
ashleymills | 0:714293de3836 | 37 | #else |
ashleymills | 0:714293de3836 | 38 | #include <stdio.h> /* ERR_printf */ |
ashleymills | 0:714293de3836 | 39 | #endif |
ashleymills | 0:714293de3836 | 40 | #endif |
ashleymills | 0:714293de3836 | 41 | |
ashleymills | 0:714293de3836 | 42 | #ifdef YASSL_PREFIX |
ashleymills | 0:714293de3836 | 43 | #include "prefix_ssl.h" |
ashleymills | 0:714293de3836 | 44 | #endif |
ashleymills | 0:714293de3836 | 45 | |
ashleymills | 0:714293de3836 | 46 | #ifdef LIBCYASSL_VERSION_STRING |
ashleymills | 0:714293de3836 | 47 | #define CYASSL_VERSION LIBCYASSL_VERSION_STRING |
ashleymills | 0:714293de3836 | 48 | #endif |
ashleymills | 0:714293de3836 | 49 | |
ashleymills | 0:714293de3836 | 50 | #ifdef _WIN32 |
ashleymills | 0:714293de3836 | 51 | /* wincrypt.h clashes */ |
ashleymills | 0:714293de3836 | 52 | #undef OCSP_REQUEST |
ashleymills | 0:714293de3836 | 53 | #undef OCSP_RESPONSE |
ashleymills | 0:714293de3836 | 54 | #endif |
ashleymills | 0:714293de3836 | 55 | |
ashleymills | 0:714293de3836 | 56 | |
ashleymills | 0:714293de3836 | 57 | |
ashleymills | 0:714293de3836 | 58 | #ifdef __cplusplus |
ashleymills | 0:714293de3836 | 59 | extern "C" { |
ashleymills | 0:714293de3836 | 60 | #endif |
ashleymills | 0:714293de3836 | 61 | |
ashleymills | 0:714293de3836 | 62 | typedef struct CYASSL CYASSL; |
ashleymills | 0:714293de3836 | 63 | typedef struct CYASSL_SESSION CYASSL_SESSION; |
ashleymills | 0:714293de3836 | 64 | typedef struct CYASSL_METHOD CYASSL_METHOD; |
ashleymills | 0:714293de3836 | 65 | typedef struct CYASSL_CTX CYASSL_CTX; |
ashleymills | 0:714293de3836 | 66 | |
ashleymills | 0:714293de3836 | 67 | typedef struct CYASSL_X509 CYASSL_X509; |
ashleymills | 0:714293de3836 | 68 | typedef struct CYASSL_X509_NAME CYASSL_X509_NAME; |
ashleymills | 0:714293de3836 | 69 | typedef struct CYASSL_X509_CHAIN CYASSL_X509_CHAIN; |
ashleymills | 0:714293de3836 | 70 | |
ashleymills | 0:714293de3836 | 71 | typedef struct CYASSL_CERT_MANAGER CYASSL_CERT_MANAGER; |
ashleymills | 0:714293de3836 | 72 | typedef struct CYASSL_SOCKADDR CYASSL_SOCKADDR; |
ashleymills | 0:714293de3836 | 73 | |
ashleymills | 0:714293de3836 | 74 | /* redeclare guard */ |
ashleymills | 0:714293de3836 | 75 | #define CYASSL_TYPES_DEFINED |
ashleymills | 0:714293de3836 | 76 | |
ashleymills | 0:714293de3836 | 77 | |
ashleymills | 0:714293de3836 | 78 | typedef struct CYASSL_RSA CYASSL_RSA; |
ashleymills | 0:714293de3836 | 79 | typedef struct CYASSL_DSA CYASSL_DSA; |
ashleymills | 0:714293de3836 | 80 | typedef struct CYASSL_CIPHER CYASSL_CIPHER; |
ashleymills | 0:714293de3836 | 81 | typedef struct CYASSL_X509_LOOKUP CYASSL_X509_LOOKUP; |
ashleymills | 0:714293de3836 | 82 | typedef struct CYASSL_X509_LOOKUP_METHOD CYASSL_X509_LOOKUP_METHOD; |
ashleymills | 0:714293de3836 | 83 | typedef struct CYASSL_X509_CRL CYASSL_X509_CRL; |
ashleymills | 0:714293de3836 | 84 | typedef struct CYASSL_BIO CYASSL_BIO; |
ashleymills | 0:714293de3836 | 85 | typedef struct CYASSL_BIO_METHOD CYASSL_BIO_METHOD; |
ashleymills | 0:714293de3836 | 86 | typedef struct CYASSL_X509_EXTENSION CYASSL_X509_EXTENSION; |
ashleymills | 0:714293de3836 | 87 | typedef struct CYASSL_ASN1_TIME CYASSL_ASN1_TIME; |
ashleymills | 0:714293de3836 | 88 | typedef struct CYASSL_ASN1_INTEGER CYASSL_ASN1_INTEGER; |
ashleymills | 0:714293de3836 | 89 | typedef struct CYASSL_ASN1_OBJECT CYASSL_ASN1_OBJECT; |
ashleymills | 0:714293de3836 | 90 | typedef struct CYASSL_ASN1_STRING CYASSL_ASN1_STRING; |
ashleymills | 0:714293de3836 | 91 | typedef struct CYASSL_dynlock_value CYASSL_dynlock_value; |
ashleymills | 0:714293de3836 | 92 | |
ashleymills | 0:714293de3836 | 93 | #define CYASSL_ASN1_UTCTIME CYASSL_ASN1_TIME |
ashleymills | 0:714293de3836 | 94 | |
ashleymills | 0:714293de3836 | 95 | typedef struct CYASSL_EVP_PKEY { |
ashleymills | 0:714293de3836 | 96 | int type; /* openssh dereference */ |
ashleymills | 0:714293de3836 | 97 | int save_type; /* openssh dereference */ |
ashleymills | 0:714293de3836 | 98 | } CYASSL_EVP_PKEY; |
ashleymills | 0:714293de3836 | 99 | |
ashleymills | 0:714293de3836 | 100 | typedef struct CYASSL_MD4_CTX { |
ashleymills | 0:714293de3836 | 101 | int buffer[32]; /* big enough to hold, check size in Init */ |
ashleymills | 0:714293de3836 | 102 | } CYASSL_MD4_CTX; |
ashleymills | 0:714293de3836 | 103 | |
ashleymills | 0:714293de3836 | 104 | |
ashleymills | 0:714293de3836 | 105 | typedef struct CYASSL_COMP_METHOD { |
ashleymills | 0:714293de3836 | 106 | int type; /* stunnel dereference */ |
ashleymills | 0:714293de3836 | 107 | } CYASSL_COMP_METHOD; |
ashleymills | 0:714293de3836 | 108 | |
ashleymills | 0:714293de3836 | 109 | |
ashleymills | 0:714293de3836 | 110 | typedef struct CYASSL_X509_STORE { |
ashleymills | 0:714293de3836 | 111 | int cache; /* stunnel dereference */ |
ashleymills | 0:714293de3836 | 112 | } CYASSL_X509_STORE; |
ashleymills | 0:714293de3836 | 113 | |
ashleymills | 0:714293de3836 | 114 | typedef struct CYASSL_ALERT { |
ashleymills | 0:714293de3836 | 115 | int code; |
ashleymills | 0:714293de3836 | 116 | int level; |
ashleymills | 0:714293de3836 | 117 | } CYASSL_ALERT; |
ashleymills | 0:714293de3836 | 118 | |
ashleymills | 0:714293de3836 | 119 | typedef struct CYASSL_ALERT_HISTORY { |
ashleymills | 0:714293de3836 | 120 | CYASSL_ALERT last_rx; |
ashleymills | 0:714293de3836 | 121 | CYASSL_ALERT last_tx; |
ashleymills | 0:714293de3836 | 122 | } CYASSL_ALERT_HISTORY; |
ashleymills | 0:714293de3836 | 123 | |
ashleymills | 0:714293de3836 | 124 | typedef struct CYASSL_X509_REVOKED { |
ashleymills | 0:714293de3836 | 125 | CYASSL_ASN1_INTEGER* serialNumber; /* stunnel dereference */ |
ashleymills | 0:714293de3836 | 126 | } CYASSL_X509_REVOKED; |
ashleymills | 0:714293de3836 | 127 | |
ashleymills | 0:714293de3836 | 128 | |
ashleymills | 0:714293de3836 | 129 | typedef struct CYASSL_X509_OBJECT { |
ashleymills | 0:714293de3836 | 130 | union { |
ashleymills | 0:714293de3836 | 131 | char* ptr; |
ashleymills | 0:714293de3836 | 132 | CYASSL_X509_CRL* crl; /* stunnel dereference */ |
ashleymills | 0:714293de3836 | 133 | } data; |
ashleymills | 0:714293de3836 | 134 | } CYASSL_X509_OBJECT; |
ashleymills | 0:714293de3836 | 135 | |
ashleymills | 0:714293de3836 | 136 | |
ashleymills | 0:714293de3836 | 137 | typedef struct CYASSL_X509_STORE_CTX { |
ashleymills | 0:714293de3836 | 138 | CYASSL_X509* current_cert; /* stunnel dereference */ |
ashleymills | 0:714293de3836 | 139 | char* domain; /* subject CN domain name */ |
ashleymills | 0:714293de3836 | 140 | void* ex_data; /* external data, for fortress build */ |
ashleymills | 0:714293de3836 | 141 | void* userCtx; /* user ctx */ |
ashleymills | 0:714293de3836 | 142 | int error; /* current error */ |
ashleymills | 0:714293de3836 | 143 | int error_depth; /* cert depth for this error */ |
ashleymills | 0:714293de3836 | 144 | int discardSessionCerts; /* so verify callback can flag for discard */ |
ashleymills | 0:714293de3836 | 145 | } CYASSL_X509_STORE_CTX; |
ashleymills | 0:714293de3836 | 146 | |
ashleymills | 0:714293de3836 | 147 | |
ashleymills | 0:714293de3836 | 148 | CYASSL_API CYASSL_METHOD *CyaSSLv3_server_method(void); |
ashleymills | 0:714293de3836 | 149 | CYASSL_API CYASSL_METHOD *CyaSSLv3_client_method(void); |
ashleymills | 0:714293de3836 | 150 | CYASSL_API CYASSL_METHOD *CyaTLSv1_server_method(void); |
ashleymills | 0:714293de3836 | 151 | CYASSL_API CYASSL_METHOD *CyaTLSv1_client_method(void); |
ashleymills | 0:714293de3836 | 152 | CYASSL_API CYASSL_METHOD *CyaTLSv1_1_server_method(void); |
ashleymills | 0:714293de3836 | 153 | CYASSL_API CYASSL_METHOD *CyaTLSv1_1_client_method(void); |
ashleymills | 0:714293de3836 | 154 | CYASSL_API CYASSL_METHOD *CyaTLSv1_2_server_method(void); |
ashleymills | 0:714293de3836 | 155 | CYASSL_API CYASSL_METHOD *CyaTLSv1_2_client_method(void); |
ashleymills | 0:714293de3836 | 156 | |
ashleymills | 0:714293de3836 | 157 | #ifdef CYASSL_DTLS |
ashleymills | 0:714293de3836 | 158 | CYASSL_API CYASSL_METHOD *CyaDTLSv1_client_method(void); |
ashleymills | 0:714293de3836 | 159 | CYASSL_API CYASSL_METHOD *CyaDTLSv1_server_method(void); |
ashleymills | 0:714293de3836 | 160 | CYASSL_API CYASSL_METHOD *CyaDTLSv1_2_client_method(void); |
ashleymills | 0:714293de3836 | 161 | CYASSL_API CYASSL_METHOD *CyaDTLSv1_2_server_method(void); |
ashleymills | 0:714293de3836 | 162 | #endif |
ashleymills | 0:714293de3836 | 163 | |
ashleymills | 0:714293de3836 | 164 | #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) |
ashleymills | 0:714293de3836 | 165 | |
ashleymills | 0:714293de3836 | 166 | CYASSL_API int CyaSSL_CTX_use_certificate_file(CYASSL_CTX*, const char*, int); |
ashleymills | 0:714293de3836 | 167 | CYASSL_API int CyaSSL_CTX_use_PrivateKey_file(CYASSL_CTX*, const char*, int); |
ashleymills | 0:714293de3836 | 168 | CYASSL_API int CyaSSL_CTX_load_verify_locations(CYASSL_CTX*, const char*, |
ashleymills | 0:714293de3836 | 169 | const char*); |
ashleymills | 0:714293de3836 | 170 | CYASSL_API int CyaSSL_CTX_use_certificate_chain_file(CYASSL_CTX *, |
ashleymills | 0:714293de3836 | 171 | const char *file); |
ashleymills | 0:714293de3836 | 172 | CYASSL_API int CyaSSL_CTX_use_RSAPrivateKey_file(CYASSL_CTX*, const char*, int); |
ashleymills | 0:714293de3836 | 173 | |
ashleymills | 0:714293de3836 | 174 | CYASSL_API int CyaSSL_use_certificate_file(CYASSL*, const char*, int); |
ashleymills | 0:714293de3836 | 175 | CYASSL_API int CyaSSL_use_PrivateKey_file(CYASSL*, const char*, int); |
ashleymills | 0:714293de3836 | 176 | CYASSL_API int CyaSSL_use_certificate_chain_file(CYASSL*, const char *file); |
ashleymills | 0:714293de3836 | 177 | CYASSL_API int CyaSSL_use_RSAPrivateKey_file(CYASSL*, const char*, int); |
ashleymills | 0:714293de3836 | 178 | |
ashleymills | 0:714293de3836 | 179 | #ifdef CYASSL_DER_LOAD |
ashleymills | 0:714293de3836 | 180 | CYASSL_API int CyaSSL_CTX_der_load_verify_locations(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 181 | const char*, int); |
ashleymills | 0:714293de3836 | 182 | #endif |
ashleymills | 0:714293de3836 | 183 | |
ashleymills | 0:714293de3836 | 184 | #ifdef HAVE_NTRU |
ashleymills | 0:714293de3836 | 185 | CYASSL_API int CyaSSL_CTX_use_NTRUPrivateKey_file(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 186 | /* load NTRU private key blob */ |
ashleymills | 0:714293de3836 | 187 | #endif |
ashleymills | 0:714293de3836 | 188 | |
ashleymills | 0:714293de3836 | 189 | CYASSL_API int CyaSSL_PemCertToDer(const char*, unsigned char*, int); |
ashleymills | 0:714293de3836 | 190 | |
ashleymills | 0:714293de3836 | 191 | #endif /* !NO_FILESYSTEM && !NO_CERTS */ |
ashleymills | 0:714293de3836 | 192 | |
ashleymills | 0:714293de3836 | 193 | CYASSL_API CYASSL_CTX* CyaSSL_CTX_new(CYASSL_METHOD*); |
ashleymills | 0:714293de3836 | 194 | CYASSL_API CYASSL* CyaSSL_new(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 195 | CYASSL_API int CyaSSL_set_fd (CYASSL*, int); |
ashleymills | 0:714293de3836 | 196 | CYASSL_API int CyaSSL_get_fd(const CYASSL*); |
ashleymills | 0:714293de3836 | 197 | CYASSL_API void CyaSSL_set_using_nonblock(CYASSL*, int); |
ashleymills | 0:714293de3836 | 198 | CYASSL_API int CyaSSL_get_using_nonblock(CYASSL*); |
ashleymills | 0:714293de3836 | 199 | CYASSL_API int CyaSSL_connect(CYASSL*); /* please see note at top of README |
ashleymills | 0:714293de3836 | 200 | if you get an error from connect */ |
ashleymills | 0:714293de3836 | 201 | CYASSL_API int CyaSSL_write(CYASSL*, const void*, int); |
ashleymills | 0:714293de3836 | 202 | CYASSL_API int CyaSSL_read(CYASSL*, void*, int); |
ashleymills | 0:714293de3836 | 203 | CYASSL_API int CyaSSL_peek(CYASSL*, void*, int); |
ashleymills | 0:714293de3836 | 204 | CYASSL_API int CyaSSL_accept(CYASSL*); |
ashleymills | 0:714293de3836 | 205 | CYASSL_API void CyaSSL_CTX_free(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 206 | CYASSL_API void CyaSSL_free(CYASSL*); |
ashleymills | 0:714293de3836 | 207 | CYASSL_API int CyaSSL_shutdown(CYASSL*); |
ashleymills | 0:714293de3836 | 208 | CYASSL_API int CyaSSL_send(CYASSL*, const void*, int sz, int flags); |
ashleymills | 0:714293de3836 | 209 | CYASSL_API int CyaSSL_recv(CYASSL*, void*, int sz, int flags); |
ashleymills | 0:714293de3836 | 210 | |
ashleymills | 0:714293de3836 | 211 | CYASSL_API void CyaSSL_CTX_set_quiet_shutdown(CYASSL_CTX*, int); |
ashleymills | 0:714293de3836 | 212 | CYASSL_API void CyaSSL_set_quiet_shutdown(CYASSL*, int); |
ashleymills | 0:714293de3836 | 213 | |
ashleymills | 0:714293de3836 | 214 | CYASSL_API int CyaSSL_get_error(CYASSL*, int); |
ashleymills | 0:714293de3836 | 215 | CYASSL_API int CyaSSL_get_alert_history(CYASSL*, CYASSL_ALERT_HISTORY *); |
ashleymills | 0:714293de3836 | 216 | |
ashleymills | 0:714293de3836 | 217 | CYASSL_API int CyaSSL_set_session(CYASSL* ssl,CYASSL_SESSION* session); |
ashleymills | 0:714293de3836 | 218 | CYASSL_API CYASSL_SESSION* CyaSSL_get_session(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 219 | CYASSL_API void CyaSSL_flush_sessions(CYASSL_CTX *ctx, long tm); |
ashleymills | 0:714293de3836 | 220 | CYASSL_API int CyaSSL_SetServerID(CYASSL* ssl, const unsigned char*, |
ashleymills | 0:714293de3836 | 221 | int, int); |
ashleymills | 0:714293de3836 | 222 | |
ashleymills | 0:714293de3836 | 223 | typedef int (*VerifyCallback)(int, CYASSL_X509_STORE_CTX*); |
ashleymills | 0:714293de3836 | 224 | typedef int (*pem_password_cb)(char*, int, int, void*); |
ashleymills | 0:714293de3836 | 225 | |
ashleymills | 0:714293de3836 | 226 | CYASSL_API void CyaSSL_CTX_set_verify(CYASSL_CTX*, int, |
ashleymills | 0:714293de3836 | 227 | VerifyCallback verify_callback); |
ashleymills | 0:714293de3836 | 228 | CYASSL_API void CyaSSL_set_verify(CYASSL*, int, VerifyCallback verify_callback); |
ashleymills | 0:714293de3836 | 229 | CYASSL_API void CyaSSL_SetCertCbCtx(CYASSL*, void*); |
ashleymills | 0:714293de3836 | 230 | |
ashleymills | 0:714293de3836 | 231 | CYASSL_API int CyaSSL_pending(CYASSL*); |
ashleymills | 0:714293de3836 | 232 | |
ashleymills | 0:714293de3836 | 233 | CYASSL_API void CyaSSL_load_error_strings(void); |
ashleymills | 0:714293de3836 | 234 | CYASSL_API int CyaSSL_library_init(void); |
ashleymills | 0:714293de3836 | 235 | CYASSL_API long CyaSSL_CTX_set_session_cache_mode(CYASSL_CTX*, long); |
ashleymills | 0:714293de3836 | 236 | |
ashleymills | 0:714293de3836 | 237 | /* session cache persistence */ |
ashleymills | 0:714293de3836 | 238 | CYASSL_API int CyaSSL_save_session_cache(const char*); |
ashleymills | 0:714293de3836 | 239 | CYASSL_API int CyaSSL_restore_session_cache(const char*); |
ashleymills | 0:714293de3836 | 240 | CYASSL_API int CyaSSL_memsave_session_cache(void*, int); |
ashleymills | 0:714293de3836 | 241 | CYASSL_API int CyaSSL_memrestore_session_cache(const void*, int); |
ashleymills | 0:714293de3836 | 242 | CYASSL_API int CyaSSL_get_session_cache_memsize(void); |
ashleymills | 0:714293de3836 | 243 | |
ashleymills | 0:714293de3836 | 244 | /* certificate cache persistence, uses ctx since certs are per ctx */ |
ashleymills | 0:714293de3836 | 245 | CYASSL_API int CyaSSL_CTX_save_cert_cache(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 246 | CYASSL_API int CyaSSL_CTX_restore_cert_cache(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 247 | CYASSL_API int CyaSSL_CTX_memsave_cert_cache(CYASSL_CTX*, void*, int, int*); |
ashleymills | 0:714293de3836 | 248 | CYASSL_API int CyaSSL_CTX_memrestore_cert_cache(CYASSL_CTX*, const void*, int); |
ashleymills | 0:714293de3836 | 249 | CYASSL_API int CyaSSL_CTX_get_cert_cache_memsize(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 250 | |
ashleymills | 0:714293de3836 | 251 | /* only supports full name from cipher_name[] delimited by : */ |
ashleymills | 0:714293de3836 | 252 | CYASSL_API int CyaSSL_CTX_set_cipher_list(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 253 | CYASSL_API int CyaSSL_set_cipher_list(CYASSL*, const char*); |
ashleymills | 0:714293de3836 | 254 | |
ashleymills | 0:714293de3836 | 255 | /* Nonblocking DTLS helper functions */ |
ashleymills | 0:714293de3836 | 256 | CYASSL_API int CyaSSL_dtls_get_current_timeout(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 257 | CYASSL_API int CyaSSL_dtls_set_timeout_init(CYASSL* ssl, int); |
ashleymills | 0:714293de3836 | 258 | CYASSL_API int CyaSSL_dtls_set_timeout_max(CYASSL* ssl, int); |
ashleymills | 0:714293de3836 | 259 | CYASSL_API int CyaSSL_dtls_got_timeout(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 260 | CYASSL_API int CyaSSL_dtls(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 261 | |
ashleymills | 0:714293de3836 | 262 | CYASSL_API int CyaSSL_dtls_set_peer(CYASSL*, void*, unsigned int); |
ashleymills | 0:714293de3836 | 263 | CYASSL_API int CyaSSL_dtls_get_peer(CYASSL*, void*, unsigned int*); |
ashleymills | 0:714293de3836 | 264 | |
ashleymills | 0:714293de3836 | 265 | CYASSL_API int CyaSSL_ERR_GET_REASON(int err); |
ashleymills | 0:714293de3836 | 266 | CYASSL_API char* CyaSSL_ERR_error_string(unsigned long,char*); |
ashleymills | 0:714293de3836 | 267 | CYASSL_API void CyaSSL_ERR_error_string_n(unsigned long e, char* buf, |
ashleymills | 0:714293de3836 | 268 | unsigned long sz); |
ashleymills | 0:714293de3836 | 269 | |
ashleymills | 0:714293de3836 | 270 | /* extras */ |
ashleymills | 0:714293de3836 | 271 | |
ashleymills | 0:714293de3836 | 272 | #define STACK_OF(x) x |
ashleymills | 0:714293de3836 | 273 | |
ashleymills | 0:714293de3836 | 274 | CYASSL_API int CyaSSL_set_ex_data(CYASSL*, int, void*); |
ashleymills | 0:714293de3836 | 275 | CYASSL_API int CyaSSL_get_shutdown(const CYASSL*); |
ashleymills | 0:714293de3836 | 276 | CYASSL_API int CyaSSL_set_rfd(CYASSL*, int); |
ashleymills | 0:714293de3836 | 277 | CYASSL_API int CyaSSL_set_wfd(CYASSL*, int); |
ashleymills | 0:714293de3836 | 278 | CYASSL_API void CyaSSL_set_shutdown(CYASSL*, int); |
ashleymills | 0:714293de3836 | 279 | CYASSL_API int CyaSSL_set_session_id_context(CYASSL*, const unsigned char*, |
ashleymills | 0:714293de3836 | 280 | unsigned int); |
ashleymills | 0:714293de3836 | 281 | CYASSL_API void CyaSSL_set_connect_state(CYASSL*); |
ashleymills | 0:714293de3836 | 282 | CYASSL_API void CyaSSL_set_accept_state(CYASSL*); |
ashleymills | 0:714293de3836 | 283 | CYASSL_API int CyaSSL_session_reused(CYASSL*); |
ashleymills | 0:714293de3836 | 284 | CYASSL_API void CyaSSL_SESSION_free(CYASSL_SESSION* session); |
ashleymills | 0:714293de3836 | 285 | CYASSL_API int CyaSSL_is_init_finished(CYASSL*); |
ashleymills | 0:714293de3836 | 286 | |
ashleymills | 0:714293de3836 | 287 | CYASSL_API const char* CyaSSL_get_version(CYASSL*); |
ashleymills | 0:714293de3836 | 288 | CYASSL_API int CyaSSL_get_current_cipher_suite(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 289 | CYASSL_API CYASSL_CIPHER* CyaSSL_get_current_cipher(CYASSL*); |
ashleymills | 0:714293de3836 | 290 | CYASSL_API char* CyaSSL_CIPHER_description(CYASSL_CIPHER*, char*, int); |
ashleymills | 0:714293de3836 | 291 | CYASSL_API const char* CyaSSL_CIPHER_get_name(const CYASSL_CIPHER* cipher); |
ashleymills | 0:714293de3836 | 292 | CYASSL_API const char* CyaSSL_get_cipher(CYASSL*); |
ashleymills | 0:714293de3836 | 293 | CYASSL_API CYASSL_SESSION* CyaSSL_get1_session(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 294 | /* what's ref count */ |
ashleymills | 0:714293de3836 | 295 | |
ashleymills | 0:714293de3836 | 296 | CYASSL_API void CyaSSL_X509_free(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 297 | CYASSL_API void CyaSSL_OPENSSL_free(void*); |
ashleymills | 0:714293de3836 | 298 | |
ashleymills | 0:714293de3836 | 299 | CYASSL_API int CyaSSL_OCSP_parse_url(char* url, char** host, char** port, |
ashleymills | 0:714293de3836 | 300 | char** path, int* ssl); |
ashleymills | 0:714293de3836 | 301 | |
ashleymills | 0:714293de3836 | 302 | CYASSL_API CYASSL_METHOD* CyaSSLv23_client_method(void); |
ashleymills | 0:714293de3836 | 303 | CYASSL_API CYASSL_METHOD* CyaSSLv2_client_method(void); |
ashleymills | 0:714293de3836 | 304 | CYASSL_API CYASSL_METHOD* CyaSSLv2_server_method(void); |
ashleymills | 0:714293de3836 | 305 | |
ashleymills | 0:714293de3836 | 306 | CYASSL_API void CyaSSL_MD4_Init(CYASSL_MD4_CTX*); |
ashleymills | 0:714293de3836 | 307 | CYASSL_API void CyaSSL_MD4_Update(CYASSL_MD4_CTX*, const void*, unsigned long); |
ashleymills | 0:714293de3836 | 308 | CYASSL_API void CyaSSL_MD4_Final(unsigned char*, CYASSL_MD4_CTX*); |
ashleymills | 0:714293de3836 | 309 | |
ashleymills | 0:714293de3836 | 310 | |
ashleymills | 0:714293de3836 | 311 | CYASSL_API CYASSL_BIO* CyaSSL_BIO_new(CYASSL_BIO_METHOD*); |
ashleymills | 0:714293de3836 | 312 | CYASSL_API int CyaSSL_BIO_free(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 313 | CYASSL_API int CyaSSL_BIO_free_all(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 314 | CYASSL_API int CyaSSL_BIO_read(CYASSL_BIO*, void*, int); |
ashleymills | 0:714293de3836 | 315 | CYASSL_API int CyaSSL_BIO_write(CYASSL_BIO*, const void*, int); |
ashleymills | 0:714293de3836 | 316 | CYASSL_API CYASSL_BIO* CyaSSL_BIO_push(CYASSL_BIO*, CYASSL_BIO* append); |
ashleymills | 0:714293de3836 | 317 | CYASSL_API CYASSL_BIO* CyaSSL_BIO_pop(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 318 | CYASSL_API int CyaSSL_BIO_flush(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 319 | CYASSL_API int CyaSSL_BIO_pending(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 320 | |
ashleymills | 0:714293de3836 | 321 | CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_buffer(void); |
ashleymills | 0:714293de3836 | 322 | CYASSL_API long CyaSSL_BIO_set_write_buffer_size(CYASSL_BIO*, long size); |
ashleymills | 0:714293de3836 | 323 | CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_ssl(void); |
ashleymills | 0:714293de3836 | 324 | CYASSL_API CYASSL_BIO* CyaSSL_BIO_new_socket(int sfd, int flag); |
ashleymills | 0:714293de3836 | 325 | CYASSL_API int CyaSSL_BIO_eof(CYASSL_BIO*); |
ashleymills | 0:714293de3836 | 326 | |
ashleymills | 0:714293de3836 | 327 | CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_s_mem(void); |
ashleymills | 0:714293de3836 | 328 | CYASSL_API CYASSL_BIO_METHOD* CyaSSL_BIO_f_base64(void); |
ashleymills | 0:714293de3836 | 329 | CYASSL_API void CyaSSL_BIO_set_flags(CYASSL_BIO*, int); |
ashleymills | 0:714293de3836 | 330 | |
ashleymills | 0:714293de3836 | 331 | CYASSL_API int CyaSSL_BIO_get_mem_data(CYASSL_BIO* bio,const unsigned char** p); |
ashleymills | 0:714293de3836 | 332 | CYASSL_API CYASSL_BIO* CyaSSL_BIO_new_mem_buf(void* buf, int len); |
ashleymills | 0:714293de3836 | 333 | |
ashleymills | 0:714293de3836 | 334 | |
ashleymills | 0:714293de3836 | 335 | CYASSL_API long CyaSSL_BIO_set_ssl(CYASSL_BIO*, CYASSL*, int flag); |
ashleymills | 0:714293de3836 | 336 | CYASSL_API void CyaSSL_set_bio(CYASSL*, CYASSL_BIO* rd, CYASSL_BIO* wr); |
ashleymills | 0:714293de3836 | 337 | |
ashleymills | 0:714293de3836 | 338 | CYASSL_API int CyaSSL_add_all_algorithms(void); |
ashleymills | 0:714293de3836 | 339 | |
ashleymills | 0:714293de3836 | 340 | CYASSL_API void CyaSSL_RAND_screen(void); |
ashleymills | 0:714293de3836 | 341 | CYASSL_API const char* CyaSSL_RAND_file_name(char*, unsigned long); |
ashleymills | 0:714293de3836 | 342 | CYASSL_API int CyaSSL_RAND_write_file(const char*); |
ashleymills | 0:714293de3836 | 343 | CYASSL_API int CyaSSL_RAND_load_file(const char*, long); |
ashleymills | 0:714293de3836 | 344 | CYASSL_API int CyaSSL_RAND_egd(const char*); |
ashleymills | 0:714293de3836 | 345 | CYASSL_API int CyaSSL_RAND_seed(const void*, int); |
ashleymills | 0:714293de3836 | 346 | CYASSL_API void CyaSSL_RAND_add(const void*, int, double); |
ashleymills | 0:714293de3836 | 347 | |
ashleymills | 0:714293de3836 | 348 | CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_zlib(void); |
ashleymills | 0:714293de3836 | 349 | CYASSL_API CYASSL_COMP_METHOD* CyaSSL_COMP_rle(void); |
ashleymills | 0:714293de3836 | 350 | CYASSL_API int CyaSSL_COMP_add_compression_method(int, void*); |
ashleymills | 0:714293de3836 | 351 | |
ashleymills | 0:714293de3836 | 352 | CYASSL_API int CyaSSL_get_ex_new_index(long, void*, void*, void*, void*); |
ashleymills | 0:714293de3836 | 353 | |
ashleymills | 0:714293de3836 | 354 | CYASSL_API void CyaSSL_set_id_callback(unsigned long (*f)(void)); |
ashleymills | 0:714293de3836 | 355 | CYASSL_API void CyaSSL_set_locking_callback(void (*f)(int, int, const char*, |
ashleymills | 0:714293de3836 | 356 | int)); |
ashleymills | 0:714293de3836 | 357 | CYASSL_API void CyaSSL_set_dynlock_create_callback(CYASSL_dynlock_value* (*f) |
ashleymills | 0:714293de3836 | 358 | (const char*, int)); |
ashleymills | 0:714293de3836 | 359 | CYASSL_API void CyaSSL_set_dynlock_lock_callback(void (*f)(int, |
ashleymills | 0:714293de3836 | 360 | CYASSL_dynlock_value*, const char*, int)); |
ashleymills | 0:714293de3836 | 361 | CYASSL_API void CyaSSL_set_dynlock_destroy_callback(void (*f) |
ashleymills | 0:714293de3836 | 362 | (CYASSL_dynlock_value*, const char*, int)); |
ashleymills | 0:714293de3836 | 363 | CYASSL_API int CyaSSL_num_locks(void); |
ashleymills | 0:714293de3836 | 364 | |
ashleymills | 0:714293de3836 | 365 | CYASSL_API CYASSL_X509* CyaSSL_X509_STORE_CTX_get_current_cert( |
ashleymills | 0:714293de3836 | 366 | CYASSL_X509_STORE_CTX*); |
ashleymills | 0:714293de3836 | 367 | CYASSL_API int CyaSSL_X509_STORE_CTX_get_error(CYASSL_X509_STORE_CTX*); |
ashleymills | 0:714293de3836 | 368 | CYASSL_API int CyaSSL_X509_STORE_CTX_get_error_depth(CYASSL_X509_STORE_CTX*); |
ashleymills | 0:714293de3836 | 369 | |
ashleymills | 0:714293de3836 | 370 | CYASSL_API char* CyaSSL_X509_NAME_oneline(CYASSL_X509_NAME*, char*, int); |
ashleymills | 0:714293de3836 | 371 | CYASSL_API CYASSL_X509_NAME* CyaSSL_X509_get_issuer_name(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 372 | CYASSL_API CYASSL_X509_NAME* CyaSSL_X509_get_subject_name(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 373 | CYASSL_API const char* CyaSSL_X509_verify_cert_error_string(long); |
ashleymills | 0:714293de3836 | 374 | |
ashleymills | 0:714293de3836 | 375 | CYASSL_API int CyaSSL_X509_LOOKUP_add_dir(CYASSL_X509_LOOKUP*,const char*,long); |
ashleymills | 0:714293de3836 | 376 | CYASSL_API int CyaSSL_X509_LOOKUP_load_file(CYASSL_X509_LOOKUP*, const char*, |
ashleymills | 0:714293de3836 | 377 | long); |
ashleymills | 0:714293de3836 | 378 | CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_hash_dir(void); |
ashleymills | 0:714293de3836 | 379 | CYASSL_API CYASSL_X509_LOOKUP_METHOD* CyaSSL_X509_LOOKUP_file(void); |
ashleymills | 0:714293de3836 | 380 | |
ashleymills | 0:714293de3836 | 381 | CYASSL_API CYASSL_X509_LOOKUP* CyaSSL_X509_STORE_add_lookup(CYASSL_X509_STORE*, |
ashleymills | 0:714293de3836 | 382 | CYASSL_X509_LOOKUP_METHOD*); |
ashleymills | 0:714293de3836 | 383 | CYASSL_API CYASSL_X509_STORE* CyaSSL_X509_STORE_new(void); |
ashleymills | 0:714293de3836 | 384 | CYASSL_API int CyaSSL_X509_STORE_get_by_subject(CYASSL_X509_STORE_CTX*, |
ashleymills | 0:714293de3836 | 385 | int, CYASSL_X509_NAME*, CYASSL_X509_OBJECT*); |
ashleymills | 0:714293de3836 | 386 | CYASSL_API int CyaSSL_X509_STORE_CTX_init(CYASSL_X509_STORE_CTX*, |
ashleymills | 0:714293de3836 | 387 | CYASSL_X509_STORE*, CYASSL_X509*, STACK_OF(CYASSL_X509)*); |
ashleymills | 0:714293de3836 | 388 | CYASSL_API void CyaSSL_X509_STORE_CTX_cleanup(CYASSL_X509_STORE_CTX*); |
ashleymills | 0:714293de3836 | 389 | |
ashleymills | 0:714293de3836 | 390 | CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_lastUpdate(CYASSL_X509_CRL*); |
ashleymills | 0:714293de3836 | 391 | CYASSL_API CYASSL_ASN1_TIME* CyaSSL_X509_CRL_get_nextUpdate(CYASSL_X509_CRL*); |
ashleymills | 0:714293de3836 | 392 | |
ashleymills | 0:714293de3836 | 393 | CYASSL_API CYASSL_EVP_PKEY* CyaSSL_X509_get_pubkey(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 394 | CYASSL_API int CyaSSL_X509_CRL_verify(CYASSL_X509_CRL*, CYASSL_EVP_PKEY*); |
ashleymills | 0:714293de3836 | 395 | CYASSL_API void CyaSSL_X509_STORE_CTX_set_error(CYASSL_X509_STORE_CTX*, |
ashleymills | 0:714293de3836 | 396 | int); |
ashleymills | 0:714293de3836 | 397 | CYASSL_API void CyaSSL_X509_OBJECT_free_contents(CYASSL_X509_OBJECT*); |
ashleymills | 0:714293de3836 | 398 | CYASSL_API void CyaSSL_EVP_PKEY_free(CYASSL_EVP_PKEY*); |
ashleymills | 0:714293de3836 | 399 | CYASSL_API int CyaSSL_X509_cmp_current_time(const CYASSL_ASN1_TIME*); |
ashleymills | 0:714293de3836 | 400 | CYASSL_API int CyaSSL_sk_X509_REVOKED_num(CYASSL_X509_REVOKED*); |
ashleymills | 0:714293de3836 | 401 | |
ashleymills | 0:714293de3836 | 402 | CYASSL_API CYASSL_X509_REVOKED* CyaSSL_X509_CRL_get_REVOKED(CYASSL_X509_CRL*); |
ashleymills | 0:714293de3836 | 403 | CYASSL_API CYASSL_X509_REVOKED* CyaSSL_sk_X509_REVOKED_value( |
ashleymills | 0:714293de3836 | 404 | CYASSL_X509_REVOKED*,int); |
ashleymills | 0:714293de3836 | 405 | CYASSL_API CYASSL_ASN1_INTEGER* CyaSSL_X509_get_serialNumber(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 406 | |
ashleymills | 0:714293de3836 | 407 | CYASSL_API int CyaSSL_ASN1_TIME_print(CYASSL_BIO*, const CYASSL_ASN1_TIME*); |
ashleymills | 0:714293de3836 | 408 | |
ashleymills | 0:714293de3836 | 409 | CYASSL_API int CyaSSL_ASN1_INTEGER_cmp(const CYASSL_ASN1_INTEGER*, |
ashleymills | 0:714293de3836 | 410 | const CYASSL_ASN1_INTEGER*); |
ashleymills | 0:714293de3836 | 411 | CYASSL_API long CyaSSL_ASN1_INTEGER_get(const CYASSL_ASN1_INTEGER*); |
ashleymills | 0:714293de3836 | 412 | |
ashleymills | 0:714293de3836 | 413 | CYASSL_API STACK_OF(CYASSL_X509_NAME)* CyaSSL_load_client_CA_file(const char*); |
ashleymills | 0:714293de3836 | 414 | |
ashleymills | 0:714293de3836 | 415 | CYASSL_API void CyaSSL_CTX_set_client_CA_list(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 416 | STACK_OF(CYASSL_X509_NAME)*); |
ashleymills | 0:714293de3836 | 417 | CYASSL_API void* CyaSSL_X509_STORE_CTX_get_ex_data(CYASSL_X509_STORE_CTX*, int); |
ashleymills | 0:714293de3836 | 418 | CYASSL_API int CyaSSL_get_ex_data_X509_STORE_CTX_idx(void); |
ashleymills | 0:714293de3836 | 419 | CYASSL_API void* CyaSSL_get_ex_data(const CYASSL*, int); |
ashleymills | 0:714293de3836 | 420 | |
ashleymills | 0:714293de3836 | 421 | CYASSL_API void CyaSSL_CTX_set_default_passwd_cb_userdata(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 422 | void* userdata); |
ashleymills | 0:714293de3836 | 423 | CYASSL_API void CyaSSL_CTX_set_default_passwd_cb(CYASSL_CTX*, pem_password_cb); |
ashleymills | 0:714293de3836 | 424 | |
ashleymills | 0:714293de3836 | 425 | |
ashleymills | 0:714293de3836 | 426 | CYASSL_API void CyaSSL_CTX_set_info_callback(CYASSL_CTX*, void (*)(void)); |
ashleymills | 0:714293de3836 | 427 | |
ashleymills | 0:714293de3836 | 428 | CYASSL_API unsigned long CyaSSL_ERR_peek_error(void); |
ashleymills | 0:714293de3836 | 429 | CYASSL_API int CyaSSL_GET_REASON(int); |
ashleymills | 0:714293de3836 | 430 | |
ashleymills | 0:714293de3836 | 431 | CYASSL_API char* CyaSSL_alert_type_string_long(int); |
ashleymills | 0:714293de3836 | 432 | CYASSL_API char* CyaSSL_alert_desc_string_long(int); |
ashleymills | 0:714293de3836 | 433 | CYASSL_API char* CyaSSL_state_string_long(CYASSL*); |
ashleymills | 0:714293de3836 | 434 | |
ashleymills | 0:714293de3836 | 435 | CYASSL_API CYASSL_RSA* CyaSSL_RSA_generate_key(int, unsigned long, |
ashleymills | 0:714293de3836 | 436 | void(*)(int, int, void*), void*); |
ashleymills | 0:714293de3836 | 437 | CYASSL_API void CyaSSL_CTX_set_tmp_rsa_callback(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 438 | CYASSL_RSA*(*)(CYASSL*, int, int)); |
ashleymills | 0:714293de3836 | 439 | |
ashleymills | 0:714293de3836 | 440 | CYASSL_API int CyaSSL_PEM_def_callback(char*, int num, int w, void* key); |
ashleymills | 0:714293de3836 | 441 | |
ashleymills | 0:714293de3836 | 442 | CYASSL_API long CyaSSL_CTX_sess_accept(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 443 | CYASSL_API long CyaSSL_CTX_sess_connect(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 444 | CYASSL_API long CyaSSL_CTX_sess_accept_good(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 445 | CYASSL_API long CyaSSL_CTX_sess_connect_good(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 446 | CYASSL_API long CyaSSL_CTX_sess_accept_renegotiate(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 447 | CYASSL_API long CyaSSL_CTX_sess_connect_renegotiate(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 448 | CYASSL_API long CyaSSL_CTX_sess_hits(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 449 | CYASSL_API long CyaSSL_CTX_sess_cb_hits(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 450 | CYASSL_API long CyaSSL_CTX_sess_cache_full(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 451 | CYASSL_API long CyaSSL_CTX_sess_misses(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 452 | CYASSL_API long CyaSSL_CTX_sess_timeouts(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 453 | CYASSL_API long CyaSSL_CTX_sess_number(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 454 | CYASSL_API long CyaSSL_CTX_sess_get_cache_size(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 455 | |
ashleymills | 0:714293de3836 | 456 | #define CYASSL_DEFAULT_CIPHER_LIST "" /* default all */ |
ashleymills | 0:714293de3836 | 457 | #define CYASSL_RSA_F4 0x10001L |
ashleymills | 0:714293de3836 | 458 | |
ashleymills | 0:714293de3836 | 459 | enum { |
ashleymills | 0:714293de3836 | 460 | OCSP_NOCERTS = 1, |
ashleymills | 0:714293de3836 | 461 | OCSP_NOINTERN = 2, |
ashleymills | 0:714293de3836 | 462 | OCSP_NOSIGS = 4, |
ashleymills | 0:714293de3836 | 463 | OCSP_NOCHAIN = 8, |
ashleymills | 0:714293de3836 | 464 | OCSP_NOVERIFY = 16, |
ashleymills | 0:714293de3836 | 465 | OCSP_NOEXPLICIT = 32, |
ashleymills | 0:714293de3836 | 466 | OCSP_NOCASIGN = 64, |
ashleymills | 0:714293de3836 | 467 | OCSP_NODELEGATED = 128, |
ashleymills | 0:714293de3836 | 468 | OCSP_NOCHECKS = 256, |
ashleymills | 0:714293de3836 | 469 | OCSP_TRUSTOTHER = 512, |
ashleymills | 0:714293de3836 | 470 | OCSP_RESPID_KEY = 1024, |
ashleymills | 0:714293de3836 | 471 | OCSP_NOTIME = 2048, |
ashleymills | 0:714293de3836 | 472 | |
ashleymills | 0:714293de3836 | 473 | OCSP_CERTID = 2, |
ashleymills | 0:714293de3836 | 474 | OCSP_REQUEST = 4, |
ashleymills | 0:714293de3836 | 475 | OCSP_RESPONSE = 8, |
ashleymills | 0:714293de3836 | 476 | OCSP_BASICRESP = 16, |
ashleymills | 0:714293de3836 | 477 | |
ashleymills | 0:714293de3836 | 478 | CYASSL_CRL_CHECKALL = 1, |
ashleymills | 0:714293de3836 | 479 | |
ashleymills | 0:714293de3836 | 480 | ASN1_GENERALIZEDTIME = 4, |
ashleymills | 0:714293de3836 | 481 | |
ashleymills | 0:714293de3836 | 482 | SSL_OP_MICROSOFT_SESS_ID_BUG = 1, |
ashleymills | 0:714293de3836 | 483 | SSL_OP_NETSCAPE_CHALLENGE_BUG = 2, |
ashleymills | 0:714293de3836 | 484 | SSL_OP_NETSCAPE_REUSE_CIPHER_CHANGE_BUG = 3, |
ashleymills | 0:714293de3836 | 485 | SSL_OP_SSLREF2_REUSE_CERT_TYPE_BUG = 4, |
ashleymills | 0:714293de3836 | 486 | SSL_OP_MICROSOFT_BIG_SSLV3_BUFFER = 5, |
ashleymills | 0:714293de3836 | 487 | SSL_OP_MSIE_SSLV2_RSA_PADDING = 6, |
ashleymills | 0:714293de3836 | 488 | SSL_OP_SSLEAY_080_CLIENT_DH_BUG = 7, |
ashleymills | 0:714293de3836 | 489 | SSL_OP_TLS_D5_BUG = 8, |
ashleymills | 0:714293de3836 | 490 | SSL_OP_TLS_BLOCK_PADDING_BUG = 9, |
ashleymills | 0:714293de3836 | 491 | SSL_OP_TLS_ROLLBACK_BUG = 10, |
ashleymills | 0:714293de3836 | 492 | SSL_OP_ALL = 11, |
ashleymills | 0:714293de3836 | 493 | SSL_OP_EPHEMERAL_RSA = 12, |
ashleymills | 0:714293de3836 | 494 | SSL_OP_NO_SSLv3 = 13, |
ashleymills | 0:714293de3836 | 495 | SSL_OP_NO_TLSv1 = 14, |
ashleymills | 0:714293de3836 | 496 | SSL_OP_PKCS1_CHECK_1 = 15, |
ashleymills | 0:714293de3836 | 497 | SSL_OP_PKCS1_CHECK_2 = 16, |
ashleymills | 0:714293de3836 | 498 | SSL_OP_NETSCAPE_CA_DN_BUG = 17, |
ashleymills | 0:714293de3836 | 499 | SSL_OP_NETSCAPE_DEMO_CIPHER_CHANGE_BUG = 18, |
ashleymills | 0:714293de3836 | 500 | SSL_OP_SINGLE_DH_USE = 19, |
ashleymills | 0:714293de3836 | 501 | SSL_OP_NO_TICKET = 20, |
ashleymills | 0:714293de3836 | 502 | SSL_OP_DONT_INSERT_EMPTY_FRAGMENTS = 21, |
ashleymills | 0:714293de3836 | 503 | SSL_OP_NO_QUERY_MTU = 22, |
ashleymills | 0:714293de3836 | 504 | SSL_OP_COOKIE_EXCHANGE = 23, |
ashleymills | 0:714293de3836 | 505 | SSL_OP_NO_SESSION_RESUMPTION_ON_RENEGOTIATION = 24, |
ashleymills | 0:714293de3836 | 506 | SSL_OP_SINGLE_ECDH_USE = 25, |
ashleymills | 0:714293de3836 | 507 | SSL_OP_CIPHER_SERVER_PREFERENCE = 26, |
ashleymills | 0:714293de3836 | 508 | |
ashleymills | 0:714293de3836 | 509 | SSL_MAX_SSL_SESSION_ID_LENGTH = 32, |
ashleymills | 0:714293de3836 | 510 | |
ashleymills | 0:714293de3836 | 511 | EVP_R_BAD_DECRYPT = 2, |
ashleymills | 0:714293de3836 | 512 | |
ashleymills | 0:714293de3836 | 513 | SSL_CB_LOOP = 4, |
ashleymills | 0:714293de3836 | 514 | SSL_ST_CONNECT = 5, |
ashleymills | 0:714293de3836 | 515 | SSL_ST_ACCEPT = 6, |
ashleymills | 0:714293de3836 | 516 | SSL_CB_ALERT = 7, |
ashleymills | 0:714293de3836 | 517 | SSL_CB_READ = 8, |
ashleymills | 0:714293de3836 | 518 | SSL_CB_HANDSHAKE_DONE = 9, |
ashleymills | 0:714293de3836 | 519 | |
ashleymills | 0:714293de3836 | 520 | SSL_MODE_ENABLE_PARTIAL_WRITE = 2, |
ashleymills | 0:714293de3836 | 521 | |
ashleymills | 0:714293de3836 | 522 | BIO_FLAGS_BASE64_NO_NL = 1, |
ashleymills | 0:714293de3836 | 523 | BIO_CLOSE = 1, |
ashleymills | 0:714293de3836 | 524 | BIO_NOCLOSE = 0, |
ashleymills | 0:714293de3836 | 525 | |
ashleymills | 0:714293de3836 | 526 | NID_undef = 0, |
ashleymills | 0:714293de3836 | 527 | |
ashleymills | 0:714293de3836 | 528 | X509_FILETYPE_PEM = 8, |
ashleymills | 0:714293de3836 | 529 | X509_LU_X509 = 9, |
ashleymills | 0:714293de3836 | 530 | X509_LU_CRL = 12, |
ashleymills | 0:714293de3836 | 531 | |
ashleymills | 0:714293de3836 | 532 | X509_V_ERR_CRL_SIGNATURE_FAILURE = 13, |
ashleymills | 0:714293de3836 | 533 | X509_V_ERR_ERROR_IN_CRL_NEXT_UPDATE_FIELD = 14, |
ashleymills | 0:714293de3836 | 534 | X509_V_ERR_CRL_HAS_EXPIRED = 15, |
ashleymills | 0:714293de3836 | 535 | X509_V_ERR_CERT_REVOKED = 16, |
ashleymills | 0:714293de3836 | 536 | X509_V_ERR_CERT_CHAIN_TOO_LONG = 17, |
ashleymills | 0:714293de3836 | 537 | X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT = 18, |
ashleymills | 0:714293de3836 | 538 | X509_V_ERR_CERT_NOT_YET_VALID = 19, |
ashleymills | 0:714293de3836 | 539 | X509_V_ERR_ERROR_IN_CERT_NOT_BEFORE_FIELD = 20, |
ashleymills | 0:714293de3836 | 540 | X509_V_ERR_CERT_HAS_EXPIRED = 21, |
ashleymills | 0:714293de3836 | 541 | X509_V_ERR_ERROR_IN_CERT_NOT_AFTER_FIELD = 22, |
ashleymills | 0:714293de3836 | 542 | |
ashleymills | 0:714293de3836 | 543 | X509_V_OK = 0, |
ashleymills | 0:714293de3836 | 544 | |
ashleymills | 0:714293de3836 | 545 | CRYPTO_LOCK = 1, |
ashleymills | 0:714293de3836 | 546 | CRYPTO_NUM_LOCKS = 10 |
ashleymills | 0:714293de3836 | 547 | }; |
ashleymills | 0:714293de3836 | 548 | |
ashleymills | 0:714293de3836 | 549 | /* extras end */ |
ashleymills | 0:714293de3836 | 550 | |
ashleymills | 0:714293de3836 | 551 | #ifndef NO_FILESYSTEM |
ashleymills | 0:714293de3836 | 552 | /* CyaSSL extension, provide last error from SSL_get_error |
ashleymills | 0:714293de3836 | 553 | since not using thread storage error queue */ |
ashleymills | 0:714293de3836 | 554 | CYASSL_API void CyaSSL_ERR_print_errors_fp(FILE*, int err); |
ashleymills | 0:714293de3836 | 555 | #endif |
ashleymills | 0:714293de3836 | 556 | |
ashleymills | 0:714293de3836 | 557 | enum { /* ssl Constants */ |
ashleymills | 0:714293de3836 | 558 | SSL_ERROR_NONE = 0, /* for most functions */ |
ashleymills | 0:714293de3836 | 559 | SSL_FAILURE = 0, /* for some functions */ |
ashleymills | 0:714293de3836 | 560 | SSL_SUCCESS = 1, |
ashleymills | 0:714293de3836 | 561 | |
ashleymills | 0:714293de3836 | 562 | SSL_BAD_CERTTYPE = -8, |
ashleymills | 0:714293de3836 | 563 | SSL_BAD_STAT = -7, |
ashleymills | 0:714293de3836 | 564 | SSL_BAD_PATH = -6, |
ashleymills | 0:714293de3836 | 565 | SSL_BAD_FILETYPE = -5, |
ashleymills | 0:714293de3836 | 566 | SSL_BAD_FILE = -4, |
ashleymills | 0:714293de3836 | 567 | SSL_NOT_IMPLEMENTED = -3, |
ashleymills | 0:714293de3836 | 568 | SSL_UNKNOWN = -2, |
ashleymills | 0:714293de3836 | 569 | SSL_FATAL_ERROR = -1, |
ashleymills | 0:714293de3836 | 570 | |
ashleymills | 0:714293de3836 | 571 | SSL_FILETYPE_ASN1 = 2, |
ashleymills | 0:714293de3836 | 572 | SSL_FILETYPE_PEM = 1, |
ashleymills | 0:714293de3836 | 573 | SSL_FILETYPE_DEFAULT = 2, /* ASN1 */ |
ashleymills | 0:714293de3836 | 574 | SSL_FILETYPE_RAW = 3, /* NTRU raw key blob */ |
ashleymills | 0:714293de3836 | 575 | |
ashleymills | 0:714293de3836 | 576 | SSL_VERIFY_NONE = 0, |
ashleymills | 0:714293de3836 | 577 | SSL_VERIFY_PEER = 1, |
ashleymills | 0:714293de3836 | 578 | SSL_VERIFY_FAIL_IF_NO_PEER_CERT = 2, |
ashleymills | 0:714293de3836 | 579 | SSL_VERIFY_CLIENT_ONCE = 4, |
ashleymills | 0:714293de3836 | 580 | |
ashleymills | 0:714293de3836 | 581 | SSL_SESS_CACHE_OFF = 30, |
ashleymills | 0:714293de3836 | 582 | SSL_SESS_CACHE_CLIENT = 31, |
ashleymills | 0:714293de3836 | 583 | SSL_SESS_CACHE_SERVER = 32, |
ashleymills | 0:714293de3836 | 584 | SSL_SESS_CACHE_BOTH = 33, |
ashleymills | 0:714293de3836 | 585 | SSL_SESS_CACHE_NO_AUTO_CLEAR = 34, |
ashleymills | 0:714293de3836 | 586 | SSL_SESS_CACHE_NO_INTERNAL_LOOKUP = 35, |
ashleymills | 0:714293de3836 | 587 | |
ashleymills | 0:714293de3836 | 588 | SSL_ERROR_WANT_READ = 2, |
ashleymills | 0:714293de3836 | 589 | SSL_ERROR_WANT_WRITE = 3, |
ashleymills | 0:714293de3836 | 590 | SSL_ERROR_WANT_CONNECT = 7, |
ashleymills | 0:714293de3836 | 591 | SSL_ERROR_WANT_ACCEPT = 8, |
ashleymills | 0:714293de3836 | 592 | SSL_ERROR_SYSCALL = 5, |
ashleymills | 0:714293de3836 | 593 | SSL_ERROR_WANT_X509_LOOKUP = 83, |
ashleymills | 0:714293de3836 | 594 | SSL_ERROR_ZERO_RETURN = 6, |
ashleymills | 0:714293de3836 | 595 | SSL_ERROR_SSL = 85, |
ashleymills | 0:714293de3836 | 596 | |
ashleymills | 0:714293de3836 | 597 | SSL_SENT_SHUTDOWN = 1, |
ashleymills | 0:714293de3836 | 598 | SSL_RECEIVED_SHUTDOWN = 2, |
ashleymills | 0:714293de3836 | 599 | SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER = 4, |
ashleymills | 0:714293de3836 | 600 | SSL_OP_NO_SSLv2 = 8, |
ashleymills | 0:714293de3836 | 601 | |
ashleymills | 0:714293de3836 | 602 | SSL_R_SSL_HANDSHAKE_FAILURE = 101, |
ashleymills | 0:714293de3836 | 603 | SSL_R_TLSV1_ALERT_UNKNOWN_CA = 102, |
ashleymills | 0:714293de3836 | 604 | SSL_R_SSLV3_ALERT_CERTIFICATE_UNKNOWN = 103, |
ashleymills | 0:714293de3836 | 605 | SSL_R_SSLV3_ALERT_BAD_CERTIFICATE = 104, |
ashleymills | 0:714293de3836 | 606 | |
ashleymills | 0:714293de3836 | 607 | PEM_BUFSIZE = 1024 |
ashleymills | 0:714293de3836 | 608 | }; |
ashleymills | 0:714293de3836 | 609 | |
ashleymills | 0:714293de3836 | 610 | |
ashleymills | 0:714293de3836 | 611 | #ifndef NO_PSK |
ashleymills | 0:714293de3836 | 612 | typedef unsigned int (*psk_client_callback)(CYASSL*, const char*, char*, |
ashleymills | 0:714293de3836 | 613 | unsigned int, unsigned char*, unsigned int); |
ashleymills | 0:714293de3836 | 614 | CYASSL_API void CyaSSL_CTX_set_psk_client_callback(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 615 | psk_client_callback); |
ashleymills | 0:714293de3836 | 616 | CYASSL_API void CyaSSL_set_psk_client_callback(CYASSL*,psk_client_callback); |
ashleymills | 0:714293de3836 | 617 | |
ashleymills | 0:714293de3836 | 618 | CYASSL_API const char* CyaSSL_get_psk_identity_hint(const CYASSL*); |
ashleymills | 0:714293de3836 | 619 | CYASSL_API const char* CyaSSL_get_psk_identity(const CYASSL*); |
ashleymills | 0:714293de3836 | 620 | |
ashleymills | 0:714293de3836 | 621 | CYASSL_API int CyaSSL_CTX_use_psk_identity_hint(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 622 | CYASSL_API int CyaSSL_use_psk_identity_hint(CYASSL*, const char*); |
ashleymills | 0:714293de3836 | 623 | |
ashleymills | 0:714293de3836 | 624 | typedef unsigned int (*psk_server_callback)(CYASSL*, const char*, |
ashleymills | 0:714293de3836 | 625 | unsigned char*, unsigned int); |
ashleymills | 0:714293de3836 | 626 | CYASSL_API void CyaSSL_CTX_set_psk_server_callback(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 627 | psk_server_callback); |
ashleymills | 0:714293de3836 | 628 | CYASSL_API void CyaSSL_set_psk_server_callback(CYASSL*,psk_server_callback); |
ashleymills | 0:714293de3836 | 629 | |
ashleymills | 0:714293de3836 | 630 | #define PSK_TYPES_DEFINED |
ashleymills | 0:714293de3836 | 631 | #endif /* NO_PSK */ |
ashleymills | 0:714293de3836 | 632 | |
ashleymills | 0:714293de3836 | 633 | |
ashleymills | 0:714293de3836 | 634 | /* extra begins */ |
ashleymills | 0:714293de3836 | 635 | |
ashleymills | 0:714293de3836 | 636 | enum { /* ERR Constants */ |
ashleymills | 0:714293de3836 | 637 | ERR_TXT_STRING = 1 |
ashleymills | 0:714293de3836 | 638 | }; |
ashleymills | 0:714293de3836 | 639 | |
ashleymills | 0:714293de3836 | 640 | CYASSL_API unsigned long CyaSSL_ERR_get_error_line_data(const char**, int*, |
ashleymills | 0:714293de3836 | 641 | const char**, int *); |
ashleymills | 0:714293de3836 | 642 | |
ashleymills | 0:714293de3836 | 643 | CYASSL_API unsigned long CyaSSL_ERR_get_error(void); |
ashleymills | 0:714293de3836 | 644 | CYASSL_API void CyaSSL_ERR_clear_error(void); |
ashleymills | 0:714293de3836 | 645 | |
ashleymills | 0:714293de3836 | 646 | |
ashleymills | 0:714293de3836 | 647 | CYASSL_API int CyaSSL_RAND_status(void); |
ashleymills | 0:714293de3836 | 648 | CYASSL_API int CyaSSL_RAND_bytes(unsigned char* buf, int num); |
ashleymills | 0:714293de3836 | 649 | CYASSL_API CYASSL_METHOD *CyaSSLv23_server_method(void); |
ashleymills | 0:714293de3836 | 650 | CYASSL_API long CyaSSL_CTX_set_options(CYASSL_CTX*, long); |
ashleymills | 0:714293de3836 | 651 | #ifndef NO_CERTS |
ashleymills | 0:714293de3836 | 652 | CYASSL_API int CyaSSL_CTX_check_private_key(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 653 | #endif /* !NO_CERTS */ |
ashleymills | 0:714293de3836 | 654 | |
ashleymills | 0:714293de3836 | 655 | CYASSL_API void CyaSSL_ERR_free_strings(void); |
ashleymills | 0:714293de3836 | 656 | CYASSL_API void CyaSSL_ERR_remove_state(unsigned long); |
ashleymills | 0:714293de3836 | 657 | CYASSL_API void CyaSSL_EVP_cleanup(void); |
ashleymills | 0:714293de3836 | 658 | |
ashleymills | 0:714293de3836 | 659 | CYASSL_API void CyaSSL_cleanup_all_ex_data(void); |
ashleymills | 0:714293de3836 | 660 | CYASSL_API long CyaSSL_CTX_set_mode(CYASSL_CTX* ctx, long mode); |
ashleymills | 0:714293de3836 | 661 | CYASSL_API long CyaSSL_CTX_get_mode(CYASSL_CTX* ctx); |
ashleymills | 0:714293de3836 | 662 | CYASSL_API void CyaSSL_CTX_set_default_read_ahead(CYASSL_CTX* ctx, int m); |
ashleymills | 0:714293de3836 | 663 | |
ashleymills | 0:714293de3836 | 664 | CYASSL_API long CyaSSL_CTX_sess_set_cache_size(CYASSL_CTX*, long); |
ashleymills | 0:714293de3836 | 665 | |
ashleymills | 0:714293de3836 | 666 | CYASSL_API int CyaSSL_CTX_set_default_verify_paths(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 667 | CYASSL_API int CyaSSL_CTX_set_session_id_context(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 668 | const unsigned char*, unsigned int); |
ashleymills | 0:714293de3836 | 669 | CYASSL_API CYASSL_X509* CyaSSL_get_peer_certificate(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 670 | |
ashleymills | 0:714293de3836 | 671 | CYASSL_API int CyaSSL_want_read(CYASSL*); |
ashleymills | 0:714293de3836 | 672 | CYASSL_API int CyaSSL_want_write(CYASSL*); |
ashleymills | 0:714293de3836 | 673 | |
ashleymills | 0:714293de3836 | 674 | CYASSL_API int CyaSSL_BIO_printf(CYASSL_BIO*, const char*, ...); |
ashleymills | 0:714293de3836 | 675 | CYASSL_API int CyaSSL_ASN1_UTCTIME_print(CYASSL_BIO*, |
ashleymills | 0:714293de3836 | 676 | const CYASSL_ASN1_UTCTIME*); |
ashleymills | 0:714293de3836 | 677 | CYASSL_API int CyaSSL_sk_num(CYASSL_X509_REVOKED*); |
ashleymills | 0:714293de3836 | 678 | CYASSL_API void* CyaSSL_sk_value(CYASSL_X509_REVOKED*, int); |
ashleymills | 0:714293de3836 | 679 | |
ashleymills | 0:714293de3836 | 680 | /* stunnel 4.28 needs */ |
ashleymills | 0:714293de3836 | 681 | CYASSL_API void* CyaSSL_CTX_get_ex_data(const CYASSL_CTX*, int); |
ashleymills | 0:714293de3836 | 682 | CYASSL_API int CyaSSL_CTX_set_ex_data(CYASSL_CTX*, int, void*); |
ashleymills | 0:714293de3836 | 683 | CYASSL_API void CyaSSL_CTX_sess_set_get_cb(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 684 | CYASSL_SESSION*(*f)(CYASSL*, unsigned char*, int, int*)); |
ashleymills | 0:714293de3836 | 685 | CYASSL_API void CyaSSL_CTX_sess_set_new_cb(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 686 | int (*f)(CYASSL*, CYASSL_SESSION*)); |
ashleymills | 0:714293de3836 | 687 | CYASSL_API void CyaSSL_CTX_sess_set_remove_cb(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 688 | void (*f)(CYASSL_CTX*, CYASSL_SESSION*)); |
ashleymills | 0:714293de3836 | 689 | |
ashleymills | 0:714293de3836 | 690 | CYASSL_API int CyaSSL_i2d_SSL_SESSION(CYASSL_SESSION*,unsigned char**); |
ashleymills | 0:714293de3836 | 691 | CYASSL_API CYASSL_SESSION* CyaSSL_d2i_SSL_SESSION(CYASSL_SESSION**, |
ashleymills | 0:714293de3836 | 692 | const unsigned char**, long); |
ashleymills | 0:714293de3836 | 693 | |
ashleymills | 0:714293de3836 | 694 | CYASSL_API long CyaSSL_SESSION_get_timeout(const CYASSL_SESSION*); |
ashleymills | 0:714293de3836 | 695 | CYASSL_API long CyaSSL_SESSION_get_time(const CYASSL_SESSION*); |
ashleymills | 0:714293de3836 | 696 | CYASSL_API int CyaSSL_CTX_get_ex_new_index(long, void*, void*, void*, void*); |
ashleymills | 0:714293de3836 | 697 | |
ashleymills | 0:714293de3836 | 698 | /* extra ends */ |
ashleymills | 0:714293de3836 | 699 | |
ashleymills | 0:714293de3836 | 700 | |
ashleymills | 0:714293de3836 | 701 | /* CyaSSL extensions */ |
ashleymills | 0:714293de3836 | 702 | |
ashleymills | 0:714293de3836 | 703 | /* call before SSL_connect, if verifying will add name check to |
ashleymills | 0:714293de3836 | 704 | date check and signature check */ |
ashleymills | 0:714293de3836 | 705 | CYASSL_API int CyaSSL_check_domain_name(CYASSL* ssl, const char* dn); |
ashleymills | 0:714293de3836 | 706 | |
ashleymills | 0:714293de3836 | 707 | /* need to call once to load library (session cache) */ |
ashleymills | 0:714293de3836 | 708 | CYASSL_API int CyaSSL_Init(void); |
ashleymills | 0:714293de3836 | 709 | /* call when done to cleanup/free session cache mutex / resources */ |
ashleymills | 0:714293de3836 | 710 | CYASSL_API int CyaSSL_Cleanup(void); |
ashleymills | 0:714293de3836 | 711 | |
ashleymills | 0:714293de3836 | 712 | /* turn logging on, only if compiled in */ |
ashleymills | 0:714293de3836 | 713 | CYASSL_API int CyaSSL_Debugging_ON(void); |
ashleymills | 0:714293de3836 | 714 | /* turn logging off */ |
ashleymills | 0:714293de3836 | 715 | CYASSL_API void CyaSSL_Debugging_OFF(void); |
ashleymills | 0:714293de3836 | 716 | |
ashleymills | 0:714293de3836 | 717 | /* do accept or connect depedning on side */ |
ashleymills | 0:714293de3836 | 718 | CYASSL_API int CyaSSL_negotiate(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 719 | /* turn on CyaSSL data compression */ |
ashleymills | 0:714293de3836 | 720 | CYASSL_API int CyaSSL_set_compression(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 721 | |
ashleymills | 0:714293de3836 | 722 | CYASSL_API int CyaSSL_set_timeout(CYASSL*, unsigned int); |
ashleymills | 0:714293de3836 | 723 | CYASSL_API int CyaSSL_CTX_set_timeout(CYASSL_CTX*, unsigned int); |
ashleymills | 0:714293de3836 | 724 | |
ashleymills | 0:714293de3836 | 725 | /* get CyaSSL peer X509_CHAIN */ |
ashleymills | 0:714293de3836 | 726 | CYASSL_API CYASSL_X509_CHAIN* CyaSSL_get_peer_chain(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 727 | /* peer chain count */ |
ashleymills | 0:714293de3836 | 728 | CYASSL_API int CyaSSL_get_chain_count(CYASSL_X509_CHAIN* chain); |
ashleymills | 0:714293de3836 | 729 | /* index cert length */ |
ashleymills | 0:714293de3836 | 730 | CYASSL_API int CyaSSL_get_chain_length(CYASSL_X509_CHAIN*, int idx); |
ashleymills | 0:714293de3836 | 731 | /* index cert */ |
ashleymills | 0:714293de3836 | 732 | CYASSL_API unsigned char* CyaSSL_get_chain_cert(CYASSL_X509_CHAIN*, int idx); |
ashleymills | 0:714293de3836 | 733 | /* index cert in X509 */ |
ashleymills | 0:714293de3836 | 734 | CYASSL_API CYASSL_X509* CyaSSL_get_chain_X509(CYASSL_X509_CHAIN*, int idx); |
ashleymills | 0:714293de3836 | 735 | /* free X509 */ |
ashleymills | 0:714293de3836 | 736 | CYASSL_API void CyaSSL_FreeX509(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 737 | /* get index cert in PEM */ |
ashleymills | 0:714293de3836 | 738 | CYASSL_API int CyaSSL_get_chain_cert_pem(CYASSL_X509_CHAIN*, int idx, |
ashleymills | 0:714293de3836 | 739 | unsigned char* buffer, int inLen, int* outLen); |
ashleymills | 0:714293de3836 | 740 | CYASSL_API const unsigned char* CyaSSL_get_sessionID(const CYASSL_SESSION* s); |
ashleymills | 0:714293de3836 | 741 | CYASSL_API int CyaSSL_X509_get_serial_number(CYASSL_X509*,unsigned char*,int*); |
ashleymills | 0:714293de3836 | 742 | CYASSL_API char* CyaSSL_X509_get_subjectCN(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 743 | CYASSL_API const unsigned char* CyaSSL_X509_get_der(CYASSL_X509*, int*); |
ashleymills | 0:714293de3836 | 744 | |
ashleymills | 0:714293de3836 | 745 | CYASSL_API int CyaSSL_cmp_peer_cert_to_file(CYASSL*, const char*); |
ashleymills | 0:714293de3836 | 746 | |
ashleymills | 0:714293de3836 | 747 | CYASSL_API char* CyaSSL_X509_get_next_altname(CYASSL_X509*); |
ashleymills | 0:714293de3836 | 748 | |
ashleymills | 0:714293de3836 | 749 | /* connect enough to get peer cert */ |
ashleymills | 0:714293de3836 | 750 | CYASSL_API int CyaSSL_connect_cert(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 751 | |
ashleymills | 0:714293de3836 | 752 | /* XXX This should be #ifndef NO_DH */ |
ashleymills | 0:714293de3836 | 753 | #ifndef NO_CERTS |
ashleymills | 0:714293de3836 | 754 | /* server Diffie-Hellman parameters */ |
ashleymills | 0:714293de3836 | 755 | CYASSL_API int CyaSSL_SetTmpDH(CYASSL*, const unsigned char* p, int pSz, |
ashleymills | 0:714293de3836 | 756 | const unsigned char* g, int gSz); |
ashleymills | 0:714293de3836 | 757 | CYASSL_API int CyaSSL_SetTmpDH_buffer(CYASSL*, const unsigned char* b, long sz, |
ashleymills | 0:714293de3836 | 758 | int format); |
ashleymills | 0:714293de3836 | 759 | CYASSL_API int CyaSSL_SetTmpEC_DHE_Sz(CYASSL*, unsigned short); |
ashleymills | 0:714293de3836 | 760 | #ifndef NO_FILESYSTEM |
ashleymills | 0:714293de3836 | 761 | CYASSL_API int CyaSSL_SetTmpDH_file(CYASSL*, const char* f, int format); |
ashleymills | 0:714293de3836 | 762 | #endif |
ashleymills | 0:714293de3836 | 763 | |
ashleymills | 0:714293de3836 | 764 | /* server ctx Diffie-Hellman parameters */ |
ashleymills | 0:714293de3836 | 765 | CYASSL_API int CyaSSL_CTX_SetTmpDH(CYASSL_CTX*, const unsigned char* p, |
ashleymills | 0:714293de3836 | 766 | int pSz, const unsigned char* g, int gSz); |
ashleymills | 0:714293de3836 | 767 | CYASSL_API int CyaSSL_CTX_SetTmpDH_buffer(CYASSL_CTX*, const unsigned char* b, |
ashleymills | 0:714293de3836 | 768 | long sz, int format); |
ashleymills | 0:714293de3836 | 769 | CYASSL_API int CyaSSL_CTX_SetTmpEC_DHE_Sz(CYASSL_CTX*, unsigned short); |
ashleymills | 0:714293de3836 | 770 | |
ashleymills | 0:714293de3836 | 771 | #ifndef NO_FILESYSTEM |
ashleymills | 0:714293de3836 | 772 | CYASSL_API int CyaSSL_CTX_SetTmpDH_file(CYASSL_CTX*, const char* f, |
ashleymills | 0:714293de3836 | 773 | int format); |
ashleymills | 0:714293de3836 | 774 | #endif |
ashleymills | 0:714293de3836 | 775 | #endif |
ashleymills | 0:714293de3836 | 776 | |
ashleymills | 0:714293de3836 | 777 | /* keyblock size in bytes or -1 */ |
ashleymills | 0:714293de3836 | 778 | /* need to call CyaSSL_KeepArrays before handshake to save keys */ |
ashleymills | 0:714293de3836 | 779 | CYASSL_API int CyaSSL_get_keyblock_size(CYASSL*); |
ashleymills | 0:714293de3836 | 780 | CYASSL_API int CyaSSL_get_keys(CYASSL*,unsigned char** ms, unsigned int* msLen, |
ashleymills | 0:714293de3836 | 781 | unsigned char** sr, unsigned int* srLen, |
ashleymills | 0:714293de3836 | 782 | unsigned char** cr, unsigned int* crLen); |
ashleymills | 0:714293de3836 | 783 | |
ashleymills | 0:714293de3836 | 784 | /* Computes EAP-TLS and EAP-TTLS keying material from the master_secret. */ |
ashleymills | 0:714293de3836 | 785 | CYASSL_API int CyaSSL_make_eap_keys(CYASSL*, void* key, unsigned int len, |
ashleymills | 0:714293de3836 | 786 | const char* label); |
ashleymills | 0:714293de3836 | 787 | |
ashleymills | 0:714293de3836 | 788 | |
ashleymills | 0:714293de3836 | 789 | #ifndef _WIN32 |
ashleymills | 0:714293de3836 | 790 | #ifndef NO_WRITEV |
ashleymills | 0:714293de3836 | 791 | #ifdef __PPU |
ashleymills | 0:714293de3836 | 792 | #include <sys/types.h> |
ashleymills | 0:714293de3836 | 793 | #include <sys/socket.h> |
ashleymills | 0:714293de3836 | 794 | #elif !defined(CYASSL_MDK_ARM) |
ashleymills | 0:714293de3836 | 795 | #include <sys/uio.h> |
ashleymills | 0:714293de3836 | 796 | #endif |
ashleymills | 0:714293de3836 | 797 | /* allow writev style writing */ |
ashleymills | 0:714293de3836 | 798 | CYASSL_API int CyaSSL_writev(CYASSL* ssl, const struct iovec* iov, |
ashleymills | 0:714293de3836 | 799 | int iovcnt); |
ashleymills | 0:714293de3836 | 800 | #endif |
ashleymills | 0:714293de3836 | 801 | #endif |
ashleymills | 0:714293de3836 | 802 | |
ashleymills | 0:714293de3836 | 803 | |
ashleymills | 0:714293de3836 | 804 | #ifndef NO_CERTS |
ashleymills | 0:714293de3836 | 805 | /* SSL_CTX versions */ |
ashleymills | 0:714293de3836 | 806 | CYASSL_API int CyaSSL_CTX_UnloadCAs(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 807 | CYASSL_API int CyaSSL_CTX_load_verify_buffer(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 808 | const unsigned char*, long, int); |
ashleymills | 0:714293de3836 | 809 | CYASSL_API int CyaSSL_CTX_use_certificate_buffer(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 810 | const unsigned char*, long, int); |
ashleymills | 0:714293de3836 | 811 | CYASSL_API int CyaSSL_CTX_use_PrivateKey_buffer(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 812 | const unsigned char*, long, int); |
ashleymills | 0:714293de3836 | 813 | CYASSL_API int CyaSSL_CTX_use_certificate_chain_buffer(CYASSL_CTX*, |
ashleymills | 0:714293de3836 | 814 | const unsigned char*, long); |
ashleymills | 0:714293de3836 | 815 | |
ashleymills | 0:714293de3836 | 816 | /* SSL versions */ |
ashleymills | 0:714293de3836 | 817 | CYASSL_API int CyaSSL_use_certificate_buffer(CYASSL*, const unsigned char*, |
ashleymills | 0:714293de3836 | 818 | long, int); |
ashleymills | 0:714293de3836 | 819 | CYASSL_API int CyaSSL_use_PrivateKey_buffer(CYASSL*, const unsigned char*, |
ashleymills | 0:714293de3836 | 820 | long, int); |
ashleymills | 0:714293de3836 | 821 | CYASSL_API int CyaSSL_use_certificate_chain_buffer(CYASSL*, |
ashleymills | 0:714293de3836 | 822 | const unsigned char*, long); |
ashleymills | 0:714293de3836 | 823 | #endif |
ashleymills | 0:714293de3836 | 824 | |
ashleymills | 0:714293de3836 | 825 | CYASSL_API int CyaSSL_CTX_set_group_messages(CYASSL_CTX*); |
ashleymills | 0:714293de3836 | 826 | CYASSL_API int CyaSSL_set_group_messages(CYASSL*); |
ashleymills | 0:714293de3836 | 827 | |
ashleymills | 0:714293de3836 | 828 | /* I/O callbacks */ |
ashleymills | 0:714293de3836 | 829 | typedef int (*CallbackIORecv)(CYASSL *ssl, char *buf, int sz, void *ctx); |
ashleymills | 0:714293de3836 | 830 | typedef int (*CallbackIOSend)(CYASSL *ssl, char *buf, int sz, void *ctx); |
ashleymills | 0:714293de3836 | 831 | |
ashleymills | 0:714293de3836 | 832 | CYASSL_API void CyaSSL_SetIORecv(CYASSL_CTX*, CallbackIORecv); |
ashleymills | 0:714293de3836 | 833 | CYASSL_API void CyaSSL_SetIOSend(CYASSL_CTX*, CallbackIOSend); |
ashleymills | 0:714293de3836 | 834 | |
ashleymills | 0:714293de3836 | 835 | CYASSL_API void CyaSSL_SetIOReadCtx( CYASSL* ssl, void *ctx); |
ashleymills | 0:714293de3836 | 836 | CYASSL_API void CyaSSL_SetIOWriteCtx(CYASSL* ssl, void *ctx); |
ashleymills | 0:714293de3836 | 837 | |
ashleymills | 0:714293de3836 | 838 | CYASSL_API void CyaSSL_SetIOReadFlags( CYASSL* ssl, int flags); |
ashleymills | 0:714293de3836 | 839 | CYASSL_API void CyaSSL_SetIOWriteFlags(CYASSL* ssl, int flags); |
ashleymills | 0:714293de3836 | 840 | |
ashleymills | 0:714293de3836 | 841 | typedef int (*CallbackGenCookie)(CYASSL* ssl, unsigned char* buf, int sz, |
ashleymills | 0:714293de3836 | 842 | void* ctx); |
ashleymills | 0:714293de3836 | 843 | CYASSL_API void CyaSSL_CTX_SetGenCookie(CYASSL_CTX*, CallbackGenCookie); |
ashleymills | 0:714293de3836 | 844 | CYASSL_API void CyaSSL_SetCookieCtx(CYASSL* ssl, void *ctx); |
ashleymills | 0:714293de3836 | 845 | |
ashleymills | 0:714293de3836 | 846 | typedef int (*CallbackIOOcsp)(void*, const char*, int, |
ashleymills | 0:714293de3836 | 847 | unsigned char*, int, unsigned char**); |
ashleymills | 0:714293de3836 | 848 | typedef void (*CallbackIOOcspRespFree)(void*,unsigned char*); |
ashleymills | 0:714293de3836 | 849 | #ifdef HAVE_OCSP |
ashleymills | 0:714293de3836 | 850 | CYASSL_API void CyaSSL_SetIOOcsp(CYASSL_CTX *ocsp, CallbackIOOcsp cb); |
ashleymills | 0:714293de3836 | 851 | CYASSL_API void CyaSSL_SetIOOcspRespFree(CYASSL_CTX *ocsp, |
ashleymills | 0:714293de3836 | 852 | CallbackIOOcspRespFree cb); |
ashleymills | 0:714293de3836 | 853 | CYASSL_API void CyaSSL_SetIOOcspCtx(CYASSL_CTX *ocsp, void *octx); |
ashleymills | 0:714293de3836 | 854 | #endif |
ashleymills | 0:714293de3836 | 855 | |
ashleymills | 0:714293de3836 | 856 | /* I/O Callback default errors */ |
ashleymills | 0:714293de3836 | 857 | enum IOerrors { |
ashleymills | 0:714293de3836 | 858 | CYASSL_CBIO_ERR_GENERAL = -1, /* general unexpected err */ |
ashleymills | 0:714293de3836 | 859 | CYASSL_CBIO_ERR_WANT_READ = -2, /* need to call read again */ |
ashleymills | 0:714293de3836 | 860 | CYASSL_CBIO_ERR_WANT_WRITE = -2, /* need to call write again */ |
ashleymills | 0:714293de3836 | 861 | CYASSL_CBIO_ERR_CONN_RST = -3, /* connection reset */ |
ashleymills | 0:714293de3836 | 862 | CYASSL_CBIO_ERR_ISR = -4, /* interrupt */ |
ashleymills | 0:714293de3836 | 863 | CYASSL_CBIO_ERR_CONN_CLOSE = -5, /* connection closed or epipe */ |
ashleymills | 0:714293de3836 | 864 | CYASSL_CBIO_ERR_TIMEOUT = -6 /* socket timeout */ |
ashleymills | 0:714293de3836 | 865 | }; |
ashleymills | 0:714293de3836 | 866 | |
ashleymills | 0:714293de3836 | 867 | |
ashleymills | 0:714293de3836 | 868 | /* CA cache callbacks */ |
ashleymills | 0:714293de3836 | 869 | enum { |
ashleymills | 0:714293de3836 | 870 | CYASSL_SSLV3 = 0, |
ashleymills | 0:714293de3836 | 871 | CYASSL_TLSV1 = 1, |
ashleymills | 0:714293de3836 | 872 | CYASSL_TLSV1_1 = 2, |
ashleymills | 0:714293de3836 | 873 | CYASSL_TLSV1_2 = 3, |
ashleymills | 0:714293de3836 | 874 | CYASSL_USER_CA = 1, /* user added as trusted */ |
ashleymills | 0:714293de3836 | 875 | CYASSL_CHAIN_CA = 2 /* added to cache from trusted chain */ |
ashleymills | 0:714293de3836 | 876 | }; |
ashleymills | 0:714293de3836 | 877 | |
ashleymills | 0:714293de3836 | 878 | CYASSL_API int CyaSSL_GetObjectSize(void); /* object size based on build */ |
ashleymills | 0:714293de3836 | 879 | CYASSL_API int CyaSSL_SetVersion(CYASSL* ssl, int version); |
ashleymills | 0:714293de3836 | 880 | CYASSL_API int CyaSSL_KeyPemToDer(const unsigned char*, int sz, unsigned char*, |
ashleymills | 0:714293de3836 | 881 | int, const char*); |
ashleymills | 0:714293de3836 | 882 | |
ashleymills | 0:714293de3836 | 883 | typedef void (*CallbackCACache)(unsigned char* der, int sz, int type); |
ashleymills | 0:714293de3836 | 884 | typedef void (*CbMissingCRL)(const char* url); |
ashleymills | 0:714293de3836 | 885 | |
ashleymills | 0:714293de3836 | 886 | |
ashleymills | 0:714293de3836 | 887 | #ifndef NO_CERTS |
ashleymills | 0:714293de3836 | 888 | CYASSL_API void CyaSSL_CTX_SetCACb(CYASSL_CTX*, CallbackCACache); |
ashleymills | 0:714293de3836 | 889 | |
ashleymills | 0:714293de3836 | 890 | CYASSL_API CYASSL_CERT_MANAGER* CyaSSL_CertManagerNew(void); |
ashleymills | 0:714293de3836 | 891 | CYASSL_API void CyaSSL_CertManagerFree(CYASSL_CERT_MANAGER*); |
ashleymills | 0:714293de3836 | 892 | |
ashleymills | 0:714293de3836 | 893 | CYASSL_API int CyaSSL_CertManagerLoadCA(CYASSL_CERT_MANAGER*, const char* f, |
ashleymills | 0:714293de3836 | 894 | const char* d); |
ashleymills | 0:714293de3836 | 895 | CYASSL_API int CyaSSL_CertManagerUnloadCAs(CYASSL_CERT_MANAGER* cm); |
ashleymills | 0:714293de3836 | 896 | CYASSL_API int CyaSSL_CertManagerVerify(CYASSL_CERT_MANAGER*, const char* f, |
ashleymills | 0:714293de3836 | 897 | int format); |
ashleymills | 0:714293de3836 | 898 | CYASSL_API int CyaSSL_CertManagerVerifyBuffer(CYASSL_CERT_MANAGER* cm, |
ashleymills | 0:714293de3836 | 899 | const unsigned char* buff, long sz, int format); |
ashleymills | 0:714293de3836 | 900 | CYASSL_API int CyaSSL_CertManagerCheckCRL(CYASSL_CERT_MANAGER*, |
ashleymills | 0:714293de3836 | 901 | unsigned char*, int sz); |
ashleymills | 0:714293de3836 | 902 | CYASSL_API int CyaSSL_CertManagerEnableCRL(CYASSL_CERT_MANAGER*, |
ashleymills | 0:714293de3836 | 903 | int options); |
ashleymills | 0:714293de3836 | 904 | CYASSL_API int CyaSSL_CertManagerDisableCRL(CYASSL_CERT_MANAGER*); |
ashleymills | 0:714293de3836 | 905 | CYASSL_API int CyaSSL_CertManagerLoadCRL(CYASSL_CERT_MANAGER*, const char*, |
ashleymills | 0:714293de3836 | 906 | int, int); |
ashleymills | 0:714293de3836 | 907 | CYASSL_API int CyaSSL_CertManagerSetCRL_Cb(CYASSL_CERT_MANAGER*, |
ashleymills | 0:714293de3836 | 908 | CbMissingCRL); |
ashleymills | 0:714293de3836 | 909 | |
ashleymills | 0:714293de3836 | 910 | CYASSL_API int CyaSSL_EnableCRL(CYASSL* ssl, int options); |
ashleymills | 0:714293de3836 | 911 | CYASSL_API int CyaSSL_DisableCRL(CYASSL* ssl); |
ashleymills | 0:714293de3836 | 912 | CYASSL_API int CyaSSL_LoadCRL(CYASSL*, const char*, int, int); |
ashleymills | 0:714293de3836 | 913 | CYASSL_API int CyaSSL_SetCRL_Cb(CYASSL*, CbMissingCRL); |
ashleymills | 0:714293de3836 | 914 | |
ashleymills | 0:714293de3836 | 915 | CYASSL_API int CyaSSL_CTX_EnableCRL(CYASSL_CTX* ctx, int options); |
ashleymills | 0:714293de3836 | 916 | CYASSL_API int CyaSSL_CTX_DisableCRL(CYASSL_CTX* ctx); |
ashleymills | 0:714293de3836 | 917 | CYASSL_API int CyaSSL_CTX_LoadCRL(CYASSL_CTX*, const char*, int, int); |
ashleymills | 0:714293de3836 | 918 | CYASSL_API int CyaSSL_CTX_SetCRL_Cb(CYASSL_CTX*, CbMissingCRL); |
ashleymills | 0:714293de3836 | 919 | #endif /* !NO_CERTS */ |
ashleymills | 0:714293de3836 | 920 | |
ashleymills | 0:714293de3836 | 921 | /* end of handshake frees temporary arrays, if user needs for get_keys or |
ashleymills | 0:714293de3836 | 922 | psk hints, call KeepArrays before handshake and then FreeArrays when done |
ashleymills | 0:714293de3836 | 923 | if don't want to wait for object free */ |
ashleymills | 0:714293de3836 | 924 | CYASSL_API void CyaSSL_KeepArrays(CYASSL*); |
ashleymills | 0:714293de3836 | 925 | CYASSL_API void CyaSSL_FreeArrays(CYASSL*); |
ashleymills | 0:714293de3836 | 926 | |
ashleymills | 0:714293de3836 | 927 | |
ashleymills | 0:714293de3836 | 928 | /* cavium additions */ |
ashleymills | 0:714293de3836 | 929 | CYASSL_API int CyaSSL_UseCavium(CYASSL*, int devId); |
ashleymills | 0:714293de3836 | 930 | CYASSL_API int CyaSSL_CTX_UseCavium(CYASSL_CTX*, int devId); |
ashleymills | 0:714293de3836 | 931 | |
ashleymills | 0:714293de3836 | 932 | /* tls extensions */ |
ashleymills | 0:714293de3836 | 933 | #ifdef HAVE_SNI |
ashleymills | 0:714293de3836 | 934 | /* SNI types */ |
ashleymills | 0:714293de3836 | 935 | enum { |
ashleymills | 0:714293de3836 | 936 | CYASSL_SNI_HOST_NAME = 0 |
ashleymills | 0:714293de3836 | 937 | }; |
ashleymills | 0:714293de3836 | 938 | |
ashleymills | 0:714293de3836 | 939 | CYASSL_API int CyaSSL_UseSNI(CYASSL* ssl, unsigned char type, const void* data, |
ashleymills | 0:714293de3836 | 940 | unsigned short size); |
ashleymills | 0:714293de3836 | 941 | CYASSL_API int CyaSSL_CTX_UseSNI(CYASSL_CTX* ctx, unsigned char type, |
ashleymills | 0:714293de3836 | 942 | const void* data, unsigned short size); |
ashleymills | 0:714293de3836 | 943 | |
ashleymills | 0:714293de3836 | 944 | #ifndef NO_CYASSL_SERVER |
ashleymills | 0:714293de3836 | 945 | /* SNI options */ |
ashleymills | 0:714293de3836 | 946 | enum { |
ashleymills | 0:714293de3836 | 947 | CYASSL_SNI_CONTINUE_ON_MISMATCH = 0x01, /* do not abort on mismatch flag */ |
ashleymills | 0:714293de3836 | 948 | CYASSL_SNI_ANSWER_ON_MISMATCH = 0x02 /* fake match on mismatch flag */ |
ashleymills | 0:714293de3836 | 949 | }; |
ashleymills | 0:714293de3836 | 950 | |
ashleymills | 0:714293de3836 | 951 | CYASSL_API unsigned char CyaSSL_SNI_Matched(CYASSL* ssl, unsigned char type); |
ashleymills | 0:714293de3836 | 952 | |
ashleymills | 0:714293de3836 | 953 | CYASSL_API void CyaSSL_SNI_SetOptions(CYASSL* ssl, unsigned char type, |
ashleymills | 0:714293de3836 | 954 | unsigned char options); |
ashleymills | 0:714293de3836 | 955 | CYASSL_API void CyaSSL_CTX_SNI_SetOptions(CYASSL_CTX* ctx, unsigned char type, |
ashleymills | 0:714293de3836 | 956 | unsigned char options); |
ashleymills | 0:714293de3836 | 957 | #endif |
ashleymills | 0:714293de3836 | 958 | #endif |
ashleymills | 0:714293de3836 | 959 | |
ashleymills | 0:714293de3836 | 960 | #define CYASSL_CRL_MONITOR 0x01 /* monitor this dir flag */ |
ashleymills | 0:714293de3836 | 961 | #define CYASSL_CRL_START_MON 0x02 /* start monitoring flag */ |
ashleymills | 0:714293de3836 | 962 | |
ashleymills | 0:714293de3836 | 963 | #ifdef CYASSL_CALLBACKS |
ashleymills | 0:714293de3836 | 964 | |
ashleymills | 0:714293de3836 | 965 | /* used internally by CyaSSL while OpenSSL types aren't */ |
ashleymills | 0:714293de3836 | 966 | #include <cyassl/callbacks.h> |
ashleymills | 0:714293de3836 | 967 | |
ashleymills | 0:714293de3836 | 968 | typedef int (*HandShakeCallBack)(HandShakeInfo*); |
ashleymills | 0:714293de3836 | 969 | typedef int (*TimeoutCallBack)(TimeoutInfo*); |
ashleymills | 0:714293de3836 | 970 | |
ashleymills | 0:714293de3836 | 971 | /* CyaSSL connect extension allowing HandShakeCallBack and/or TimeoutCallBack |
ashleymills | 0:714293de3836 | 972 | for diagnostics */ |
ashleymills | 0:714293de3836 | 973 | CYASSL_API int CyaSSL_connect_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack, |
ashleymills | 0:714293de3836 | 974 | Timeval); |
ashleymills | 0:714293de3836 | 975 | CYASSL_API int CyaSSL_accept_ex(CYASSL*, HandShakeCallBack, TimeoutCallBack, |
ashleymills | 0:714293de3836 | 976 | Timeval); |
ashleymills | 0:714293de3836 | 977 | |
ashleymills | 0:714293de3836 | 978 | #endif /* CYASSL_CALLBACKS */ |
ashleymills | 0:714293de3836 | 979 | |
ashleymills | 0:714293de3836 | 980 | |
ashleymills | 0:714293de3836 | 981 | CYASSL_API long CyaSSL_CTX_OCSP_set_options(CYASSL_CTX*, long); |
ashleymills | 0:714293de3836 | 982 | CYASSL_API int CyaSSL_CTX_OCSP_set_override_url(CYASSL_CTX*, const char*); |
ashleymills | 0:714293de3836 | 983 | |
ashleymills | 0:714293de3836 | 984 | /* OCSP Options */ |
ashleymills | 0:714293de3836 | 985 | #define CYASSL_OCSP_ENABLE 0x0001 /* Enable OCSP lookups */ |
ashleymills | 0:714293de3836 | 986 | #define CYASSL_OCSP_URL_OVERRIDE 0x0002 /* Use the override URL instead of URL |
ashleymills | 0:714293de3836 | 987 | * in certificate */ |
ashleymills | 0:714293de3836 | 988 | #define CYASSL_OCSP_NO_NONCE 0x0004 /* Disables the request nonce. */ |
ashleymills | 0:714293de3836 | 989 | |
ashleymills | 0:714293de3836 | 990 | |
ashleymills | 0:714293de3836 | 991 | #ifdef __cplusplus |
ashleymills | 0:714293de3836 | 992 | } /* extern "C" */ |
ashleymills | 0:714293de3836 | 993 | #endif |
ashleymills | 0:714293de3836 | 994 | |
ashleymills | 0:714293de3836 | 995 | |
ashleymills | 0:714293de3836 | 996 | #endif /* CYASSL_SSL_H */ |
ashleymills | 0:714293de3836 | 997 |