A library for setting up Secure Socket Layer (SSL) connections and verifying remote hosts using certificates. Contains only the source files for mbed platform implementation of the library.
Dependents: HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL HTTPClient-SSL
cyassl/ctaocrypt/settings.h@0:b86d15c6ba29, 2015-01-19 (annotated)
- Committer:
- Vanger
- Date:
- Mon Jan 19 21:45:42 2015 +0000
- Revision:
- 0:b86d15c6ba29
- Child:
- 1:561bad221c72
- Child:
- 2:dc991c4ab35e
Updated CyaSSL Library to 3.3.0. Changed Settings and functions to be implemented for mbed platforms
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
Vanger | 0:b86d15c6ba29 | 1 | /* settings.h |
Vanger | 0:b86d15c6ba29 | 2 | * |
Vanger | 0:b86d15c6ba29 | 3 | * Copyright (C) 2006-2014 wolfSSL Inc. |
Vanger | 0:b86d15c6ba29 | 4 | * |
Vanger | 0:b86d15c6ba29 | 5 | * This file is part of CyaSSL. |
Vanger | 0:b86d15c6ba29 | 6 | * |
Vanger | 0:b86d15c6ba29 | 7 | * CyaSSL is free software; you can redistribute it and/or modify |
Vanger | 0:b86d15c6ba29 | 8 | * it under the terms of the GNU General Public License as published by |
Vanger | 0:b86d15c6ba29 | 9 | * the Free Software Foundation; either version 2 of the License, or |
Vanger | 0:b86d15c6ba29 | 10 | * (at your option) any later version. |
Vanger | 0:b86d15c6ba29 | 11 | * |
Vanger | 0:b86d15c6ba29 | 12 | * CyaSSL is distributed in the hope that it will be useful, |
Vanger | 0:b86d15c6ba29 | 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
Vanger | 0:b86d15c6ba29 | 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
Vanger | 0:b86d15c6ba29 | 15 | * GNU General Public License for more details. |
Vanger | 0:b86d15c6ba29 | 16 | * |
Vanger | 0:b86d15c6ba29 | 17 | * You should have received a copy of the GNU General Public License |
Vanger | 0:b86d15c6ba29 | 18 | * along with this program; if not, write to the Free Software |
Vanger | 0:b86d15c6ba29 | 19 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA |
Vanger | 0:b86d15c6ba29 | 20 | */ |
Vanger | 0:b86d15c6ba29 | 21 | |
Vanger | 0:b86d15c6ba29 | 22 | /* Place OS specific preprocessor flags, defines, includes here, will be |
Vanger | 0:b86d15c6ba29 | 23 | included into every file because types.h includes it */ |
Vanger | 0:b86d15c6ba29 | 24 | |
Vanger | 0:b86d15c6ba29 | 25 | |
Vanger | 0:b86d15c6ba29 | 26 | #ifndef CTAO_CRYPT_SETTINGS_H |
Vanger | 0:b86d15c6ba29 | 27 | #define CTAO_CRYPT_SETTINGS_H |
Vanger | 0:b86d15c6ba29 | 28 | |
Vanger | 0:b86d15c6ba29 | 29 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 30 | extern "C" { |
Vanger | 0:b86d15c6ba29 | 31 | #endif |
Vanger | 0:b86d15c6ba29 | 32 | |
Vanger | 0:b86d15c6ba29 | 33 | /* Uncomment next line if using IPHONE */ |
Vanger | 0:b86d15c6ba29 | 34 | /* #define IPHONE */ |
Vanger | 0:b86d15c6ba29 | 35 | |
Vanger | 0:b86d15c6ba29 | 36 | /* Uncomment next line if using ThreadX */ |
Vanger | 0:b86d15c6ba29 | 37 | /* #define THREADX */ |
Vanger | 0:b86d15c6ba29 | 38 | |
Vanger | 0:b86d15c6ba29 | 39 | /* Uncomment next line if using Micrium ucOS */ |
Vanger | 0:b86d15c6ba29 | 40 | /* #define MICRIUM */ |
Vanger | 0:b86d15c6ba29 | 41 | |
Vanger | 0:b86d15c6ba29 | 42 | /* Uncomment next line if using Mbed */ |
Vanger | 0:b86d15c6ba29 | 43 | #define MBED |
Vanger | 0:b86d15c6ba29 | 44 | |
Vanger | 0:b86d15c6ba29 | 45 | /* Uncomment next line if using Microchip PIC32 ethernet starter kit */ |
Vanger | 0:b86d15c6ba29 | 46 | /* #define MICROCHIP_PIC32 */ |
Vanger | 0:b86d15c6ba29 | 47 | |
Vanger | 0:b86d15c6ba29 | 48 | /* Uncomment next line if using Microchip TCP/IP stack, version 5 */ |
Vanger | 0:b86d15c6ba29 | 49 | /* #define MICROCHIP_TCPIP_V5 */ |
Vanger | 0:b86d15c6ba29 | 50 | |
Vanger | 0:b86d15c6ba29 | 51 | /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ |
Vanger | 0:b86d15c6ba29 | 52 | /* #define MICROCHIP_TCPIP */ |
Vanger | 0:b86d15c6ba29 | 53 | |
Vanger | 0:b86d15c6ba29 | 54 | /* Uncomment next line if using PIC32MZ Crypto Engine */ |
Vanger | 0:b86d15c6ba29 | 55 | /* #define CYASSL_MICROCHIP_PIC32MZ */ |
Vanger | 0:b86d15c6ba29 | 56 | |
Vanger | 0:b86d15c6ba29 | 57 | /* Uncomment next line if using FreeRTOS */ |
Vanger | 0:b86d15c6ba29 | 58 | /* #define FREERTOS */ |
Vanger | 0:b86d15c6ba29 | 59 | |
Vanger | 0:b86d15c6ba29 | 60 | /* Uncomment next line if using FreeRTOS Windows Simulator */ |
Vanger | 0:b86d15c6ba29 | 61 | /* #define FREERTOS_WINSIM */ |
Vanger | 0:b86d15c6ba29 | 62 | |
Vanger | 0:b86d15c6ba29 | 63 | /* Uncomment next line if using RTIP */ |
Vanger | 0:b86d15c6ba29 | 64 | /* #define EBSNET */ |
Vanger | 0:b86d15c6ba29 | 65 | |
Vanger | 0:b86d15c6ba29 | 66 | /* Uncomment next line if using lwip */ |
Vanger | 0:b86d15c6ba29 | 67 | /* #define CYASSL_LWIP */ |
Vanger | 0:b86d15c6ba29 | 68 | |
Vanger | 0:b86d15c6ba29 | 69 | /* Uncomment next line if building CyaSSL for a game console */ |
Vanger | 0:b86d15c6ba29 | 70 | /* #define CYASSL_GAME_BUILD */ |
Vanger | 0:b86d15c6ba29 | 71 | |
Vanger | 0:b86d15c6ba29 | 72 | /* Uncomment next line if building CyaSSL for LSR */ |
Vanger | 0:b86d15c6ba29 | 73 | /* #define CYASSL_LSR */ |
Vanger | 0:b86d15c6ba29 | 74 | |
Vanger | 0:b86d15c6ba29 | 75 | /* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ |
Vanger | 0:b86d15c6ba29 | 76 | /* #define FREESCALE_MQX */ |
Vanger | 0:b86d15c6ba29 | 77 | |
Vanger | 0:b86d15c6ba29 | 78 | /* Uncomment next line if using STM32F2 */ |
Vanger | 0:b86d15c6ba29 | 79 | /* #define CYASSL_STM32F2 */ |
Vanger | 0:b86d15c6ba29 | 80 | |
Vanger | 0:b86d15c6ba29 | 81 | /* Uncomment next line if using Comverge settings */ |
Vanger | 0:b86d15c6ba29 | 82 | /* #define COMVERGE */ |
Vanger | 0:b86d15c6ba29 | 83 | |
Vanger | 0:b86d15c6ba29 | 84 | /* Uncomment next line if using QL SEP settings */ |
Vanger | 0:b86d15c6ba29 | 85 | /* #define CYASSL_QL */ |
Vanger | 0:b86d15c6ba29 | 86 | |
Vanger | 0:b86d15c6ba29 | 87 | /* Uncomment next line if building for EROAD */ |
Vanger | 0:b86d15c6ba29 | 88 | /* #define CYASSL_EROAD */ |
Vanger | 0:b86d15c6ba29 | 89 | |
Vanger | 0:b86d15c6ba29 | 90 | /* Uncomment next line if building for IAR EWARM */ |
Vanger | 0:b86d15c6ba29 | 91 | /* #define CYASSL_IAR_ARM */ |
Vanger | 0:b86d15c6ba29 | 92 | |
Vanger | 0:b86d15c6ba29 | 93 | /* Uncomment next line if using TI-RTOS settings */ |
Vanger | 0:b86d15c6ba29 | 94 | /* #define CYASSL_TIRTOS */ |
Vanger | 0:b86d15c6ba29 | 95 | |
Vanger | 0:b86d15c6ba29 | 96 | /* Uncomment next line if building with PicoTCP */ |
Vanger | 0:b86d15c6ba29 | 97 | /* #define CYASSL_PICOTCP */ |
Vanger | 0:b86d15c6ba29 | 98 | |
Vanger | 0:b86d15c6ba29 | 99 | /* Uncomment next line if building for PicoTCP demo bundle */ |
Vanger | 0:b86d15c6ba29 | 100 | /* #define CYASSL_PICOTCP_DEMO */ |
Vanger | 0:b86d15c6ba29 | 101 | |
Vanger | 0:b86d15c6ba29 | 102 | #include <cyassl/ctaocrypt/visibility.h> |
Vanger | 0:b86d15c6ba29 | 103 | |
Vanger | 0:b86d15c6ba29 | 104 | #ifdef IPHONE |
Vanger | 0:b86d15c6ba29 | 105 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 106 | #endif |
Vanger | 0:b86d15c6ba29 | 107 | |
Vanger | 0:b86d15c6ba29 | 108 | |
Vanger | 0:b86d15c6ba29 | 109 | #ifdef CYASSL_USER_SETTINGS |
Vanger | 0:b86d15c6ba29 | 110 | #include <user_settings.h> |
Vanger | 0:b86d15c6ba29 | 111 | #endif |
Vanger | 0:b86d15c6ba29 | 112 | |
Vanger | 0:b86d15c6ba29 | 113 | |
Vanger | 0:b86d15c6ba29 | 114 | #ifdef COMVERGE |
Vanger | 0:b86d15c6ba29 | 115 | #define THREADX |
Vanger | 0:b86d15c6ba29 | 116 | #define HAVE_NETX |
Vanger | 0:b86d15c6ba29 | 117 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 118 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 119 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 120 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 121 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 122 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 123 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 124 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 125 | #define NO_RSA |
Vanger | 0:b86d15c6ba29 | 126 | #define NO_SESSION_CACHE |
Vanger | 0:b86d15c6ba29 | 127 | #define HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 128 | #endif |
Vanger | 0:b86d15c6ba29 | 129 | |
Vanger | 0:b86d15c6ba29 | 130 | |
Vanger | 0:b86d15c6ba29 | 131 | #ifdef THREADX |
Vanger | 0:b86d15c6ba29 | 132 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 133 | #endif |
Vanger | 0:b86d15c6ba29 | 134 | |
Vanger | 0:b86d15c6ba29 | 135 | #ifdef HAVE_NETX |
Vanger | 0:b86d15c6ba29 | 136 | #include "nx_api.h" |
Vanger | 0:b86d15c6ba29 | 137 | #endif |
Vanger | 0:b86d15c6ba29 | 138 | |
Vanger | 0:b86d15c6ba29 | 139 | #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ |
Vanger | 0:b86d15c6ba29 | 140 | #define CYASSL_LWIP |
Vanger | 0:b86d15c6ba29 | 141 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 142 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 143 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 144 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 145 | #endif |
Vanger | 0:b86d15c6ba29 | 146 | |
Vanger | 0:b86d15c6ba29 | 147 | #if defined(CYASSL_IAR_ARM) |
Vanger | 0:b86d15c6ba29 | 148 | #define NO_MAIN_DRIVER |
Vanger | 0:b86d15c6ba29 | 149 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 150 | #define USE_CERT_BUFFERS_1024 |
Vanger | 0:b86d15c6ba29 | 151 | #define BENCH_EMBEDDED |
Vanger | 0:b86d15c6ba29 | 152 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 153 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 154 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 155 | #define BENCH_EMBEDDED |
Vanger | 0:b86d15c6ba29 | 156 | #endif |
Vanger | 0:b86d15c6ba29 | 157 | |
Vanger | 0:b86d15c6ba29 | 158 | #ifdef MICROCHIP_PIC32 |
Vanger | 0:b86d15c6ba29 | 159 | /* #define CYASSL_MICROCHIP_PIC32MZ */ |
Vanger | 0:b86d15c6ba29 | 160 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 161 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 162 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 163 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 164 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 165 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 166 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 167 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 168 | #endif |
Vanger | 0:b86d15c6ba29 | 169 | |
Vanger | 0:b86d15c6ba29 | 170 | #ifdef CYASSL_MICROCHIP_PIC32MZ |
Vanger | 0:b86d15c6ba29 | 171 | #define CYASSL_PIC32MZ_CE |
Vanger | 0:b86d15c6ba29 | 172 | #define CYASSL_PIC32MZ_CRYPT |
Vanger | 0:b86d15c6ba29 | 173 | #define HAVE_AES_ENGINE |
Vanger | 0:b86d15c6ba29 | 174 | #define CYASSL_PIC32MZ_RNG |
Vanger | 0:b86d15c6ba29 | 175 | /* #define CYASSL_PIC32MZ_HASH */ |
Vanger | 0:b86d15c6ba29 | 176 | #define CYASSL_AES_COUNTER |
Vanger | 0:b86d15c6ba29 | 177 | #define HAVE_AESGCM |
Vanger | 0:b86d15c6ba29 | 178 | #define NO_BIG_INT |
Vanger | 0:b86d15c6ba29 | 179 | |
Vanger | 0:b86d15c6ba29 | 180 | #endif |
Vanger | 0:b86d15c6ba29 | 181 | |
Vanger | 0:b86d15c6ba29 | 182 | #ifdef MICROCHIP_TCPIP_V5 |
Vanger | 0:b86d15c6ba29 | 183 | /* include timer functions */ |
Vanger | 0:b86d15c6ba29 | 184 | #include "TCPIP Stack/TCPIP.h" |
Vanger | 0:b86d15c6ba29 | 185 | #endif |
Vanger | 0:b86d15c6ba29 | 186 | |
Vanger | 0:b86d15c6ba29 | 187 | #ifdef MICROCHIP_TCPIP |
Vanger | 0:b86d15c6ba29 | 188 | /* include timer, NTP functions */ |
Vanger | 0:b86d15c6ba29 | 189 | #ifdef MICROCHIP_MPLAB_HARMONY |
Vanger | 0:b86d15c6ba29 | 190 | #include "tcpip/tcpip.h" |
Vanger | 0:b86d15c6ba29 | 191 | #else |
Vanger | 0:b86d15c6ba29 | 192 | #include "system/system_services.h" |
Vanger | 0:b86d15c6ba29 | 193 | #include "tcpip/sntp.h" |
Vanger | 0:b86d15c6ba29 | 194 | #endif |
Vanger | 0:b86d15c6ba29 | 195 | #endif |
Vanger | 0:b86d15c6ba29 | 196 | |
Vanger | 0:b86d15c6ba29 | 197 | #ifdef MBED |
Vanger | 0:b86d15c6ba29 | 198 | #define USER_TIME |
Vanger | 0:b86d15c6ba29 | 199 | #define DEBUG_CYASSL |
Vanger | 0:b86d15c6ba29 | 200 | #define SIZE_OF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 201 | #define MAX_CHAIN_DEPTH 15 |
Vanger | 0:b86d15c6ba29 | 202 | |
Vanger | 0:b86d15c6ba29 | 203 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 204 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 205 | #define NO_CERT |
Vanger | 0:b86d15c6ba29 | 206 | #define USE_CERT_BUFFERS_1024 |
Vanger | 0:b86d15c6ba29 | 207 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 208 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 209 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 210 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 211 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 212 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 213 | #define HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 214 | #define NO_SESSION_CACHE |
Vanger | 0:b86d15c6ba29 | 215 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 216 | //#define CYASSL_CMSIS_RTOS |
Vanger | 0:b86d15c6ba29 | 217 | #endif |
Vanger | 0:b86d15c6ba29 | 218 | |
Vanger | 0:b86d15c6ba29 | 219 | |
Vanger | 0:b86d15c6ba29 | 220 | #ifdef CYASSL_EROAD |
Vanger | 0:b86d15c6ba29 | 221 | #define FREESCALE_MQX |
Vanger | 0:b86d15c6ba29 | 222 | #define FREESCALE_MMCAU |
Vanger | 0:b86d15c6ba29 | 223 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 224 | #define NO_STDIO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 225 | #define CYASSL_LEANPSK |
Vanger | 0:b86d15c6ba29 | 226 | #define HAVE_NULL_CIPHER |
Vanger | 0:b86d15c6ba29 | 227 | #define NO_OLD_TLS |
Vanger | 0:b86d15c6ba29 | 228 | #define NO_ASN |
Vanger | 0:b86d15c6ba29 | 229 | #define NO_BIG_INT |
Vanger | 0:b86d15c6ba29 | 230 | #define NO_RSA |
Vanger | 0:b86d15c6ba29 | 231 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 232 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 233 | #define NO_CERTS |
Vanger | 0:b86d15c6ba29 | 234 | #define NO_PWDBASED |
Vanger | 0:b86d15c6ba29 | 235 | #define NO_DES3 |
Vanger | 0:b86d15c6ba29 | 236 | #define NO_MD4 |
Vanger | 0:b86d15c6ba29 | 237 | #define NO_RC4 |
Vanger | 0:b86d15c6ba29 | 238 | #define NO_MD5 |
Vanger | 0:b86d15c6ba29 | 239 | #define NO_SESSION_CACHE |
Vanger | 0:b86d15c6ba29 | 240 | #define NO_MAIN_DRIVER |
Vanger | 0:b86d15c6ba29 | 241 | #endif |
Vanger | 0:b86d15c6ba29 | 242 | |
Vanger | 0:b86d15c6ba29 | 243 | #ifdef CYASSL_PICOTCP |
Vanger | 0:b86d15c6ba29 | 244 | #define errno pico_err |
Vanger | 0:b86d15c6ba29 | 245 | #include "pico_defines.h" |
Vanger | 0:b86d15c6ba29 | 246 | #include "pico_stack.h" |
Vanger | 0:b86d15c6ba29 | 247 | #include "pico_constants.h" |
Vanger | 0:b86d15c6ba29 | 248 | #define CUSTOM_RAND_GENERATE pico_rand |
Vanger | 0:b86d15c6ba29 | 249 | #endif |
Vanger | 0:b86d15c6ba29 | 250 | |
Vanger | 0:b86d15c6ba29 | 251 | #ifdef CYASSL_PICOTCP_DEMO |
Vanger | 0:b86d15c6ba29 | 252 | #define CYASSL_STM32 |
Vanger | 0:b86d15c6ba29 | 253 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 254 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 255 | #define XMALLOC(s, h, type) PICO_ZALLOC((s)) |
Vanger | 0:b86d15c6ba29 | 256 | #define XFREE(p, h, type) PICO_FREE((p)) |
Vanger | 0:b86d15c6ba29 | 257 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 258 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 259 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 260 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 261 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 262 | #endif |
Vanger | 0:b86d15c6ba29 | 263 | |
Vanger | 0:b86d15c6ba29 | 264 | #ifdef FREERTOS_WINSIM |
Vanger | 0:b86d15c6ba29 | 265 | #define FREERTOS |
Vanger | 0:b86d15c6ba29 | 266 | #define USE_WINDOWS_API |
Vanger | 0:b86d15c6ba29 | 267 | #endif |
Vanger | 0:b86d15c6ba29 | 268 | |
Vanger | 0:b86d15c6ba29 | 269 | |
Vanger | 0:b86d15c6ba29 | 270 | /* Micrium will use Visual Studio for compilation but not the Win32 API */ |
Vanger | 0:b86d15c6ba29 | 271 | #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ |
Vanger | 0:b86d15c6ba29 | 272 | && !defined(EBSNET) && !defined(CYASSL_EROAD) |
Vanger | 0:b86d15c6ba29 | 273 | #define USE_WINDOWS_API |
Vanger | 0:b86d15c6ba29 | 274 | #endif |
Vanger | 0:b86d15c6ba29 | 275 | |
Vanger | 0:b86d15c6ba29 | 276 | |
Vanger | 0:b86d15c6ba29 | 277 | #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) |
Vanger | 0:b86d15c6ba29 | 278 | #include <stdlib.h> |
Vanger | 0:b86d15c6ba29 | 279 | #define XMALLOC(s, h, type) malloc((s)) |
Vanger | 0:b86d15c6ba29 | 280 | #define XFREE(p, h, type) free((p)) |
Vanger | 0:b86d15c6ba29 | 281 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 282 | #endif |
Vanger | 0:b86d15c6ba29 | 283 | |
Vanger | 0:b86d15c6ba29 | 284 | #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) |
Vanger | 0:b86d15c6ba29 | 285 | #undef XMALLOC |
Vanger | 0:b86d15c6ba29 | 286 | #define XMALLOC yaXMALLOC |
Vanger | 0:b86d15c6ba29 | 287 | #undef XFREE |
Vanger | 0:b86d15c6ba29 | 288 | #define XFREE yaXFREE |
Vanger | 0:b86d15c6ba29 | 289 | #undef XREALLOC |
Vanger | 0:b86d15c6ba29 | 290 | #define XREALLOC yaXREALLOC |
Vanger | 0:b86d15c6ba29 | 291 | #endif |
Vanger | 0:b86d15c6ba29 | 292 | |
Vanger | 0:b86d15c6ba29 | 293 | |
Vanger | 0:b86d15c6ba29 | 294 | #ifdef FREERTOS |
Vanger | 0:b86d15c6ba29 | 295 | #ifndef NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 296 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 297 | #endif |
Vanger | 0:b86d15c6ba29 | 298 | #ifndef NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 299 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 300 | #endif |
Vanger | 0:b86d15c6ba29 | 301 | #ifndef NO_DH |
Vanger | 0:b86d15c6ba29 | 302 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 303 | #endif |
Vanger | 0:b86d15c6ba29 | 304 | #ifndef NO_DSA |
Vanger | 0:b86d15c6ba29 | 305 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 306 | #endif |
Vanger | 0:b86d15c6ba29 | 307 | #ifndef NO_HC128 |
Vanger | 0:b86d15c6ba29 | 308 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 309 | #endif |
Vanger | 0:b86d15c6ba29 | 310 | |
Vanger | 0:b86d15c6ba29 | 311 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 312 | #include "FreeRTOS.h" |
Vanger | 0:b86d15c6ba29 | 313 | #include "semphr.h" |
Vanger | 0:b86d15c6ba29 | 314 | #endif |
Vanger | 0:b86d15c6ba29 | 315 | #endif |
Vanger | 0:b86d15c6ba29 | 316 | |
Vanger | 0:b86d15c6ba29 | 317 | #ifdef CYASSL_TIRTOS |
Vanger | 0:b86d15c6ba29 | 318 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 319 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 320 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 321 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 322 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 323 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 324 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 325 | #define USE_CERT_BUFFERS_2048 |
Vanger | 0:b86d15c6ba29 | 326 | #define NO_ERROR_STRINGS |
Vanger | 0:b86d15c6ba29 | 327 | #define USER_TIME |
Vanger | 0:b86d15c6ba29 | 328 | |
Vanger | 0:b86d15c6ba29 | 329 | #ifdef __IAR_SYSTEMS_ICC__ |
Vanger | 0:b86d15c6ba29 | 330 | #pragma diag_suppress=Pa089 |
Vanger | 0:b86d15c6ba29 | 331 | #elif !defined(__GNUC__) |
Vanger | 0:b86d15c6ba29 | 332 | /* Suppress the sslpro warning */ |
Vanger | 0:b86d15c6ba29 | 333 | #pragma diag_suppress=11 |
Vanger | 0:b86d15c6ba29 | 334 | #endif |
Vanger | 0:b86d15c6ba29 | 335 | |
Vanger | 0:b86d15c6ba29 | 336 | #include <ti/ndk/nettools/mytime/mytime.h> |
Vanger | 0:b86d15c6ba29 | 337 | #endif |
Vanger | 0:b86d15c6ba29 | 338 | |
Vanger | 0:b86d15c6ba29 | 339 | #ifdef EBSNET |
Vanger | 0:b86d15c6ba29 | 340 | #include "rtip.h" |
Vanger | 0:b86d15c6ba29 | 341 | |
Vanger | 0:b86d15c6ba29 | 342 | /* #define DEBUG_CYASSL */ |
Vanger | 0:b86d15c6ba29 | 343 | #define NO_CYASSL_DIR /* tbd */ |
Vanger | 0:b86d15c6ba29 | 344 | |
Vanger | 0:b86d15c6ba29 | 345 | #if (POLLOS) |
Vanger | 0:b86d15c6ba29 | 346 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 347 | #endif |
Vanger | 0:b86d15c6ba29 | 348 | |
Vanger | 0:b86d15c6ba29 | 349 | #if (RTPLATFORM) |
Vanger | 0:b86d15c6ba29 | 350 | #if (!RTP_LITTLE_ENDIAN) |
Vanger | 0:b86d15c6ba29 | 351 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 352 | #endif |
Vanger | 0:b86d15c6ba29 | 353 | #else |
Vanger | 0:b86d15c6ba29 | 354 | #if (!KS_LITTLE_ENDIAN) |
Vanger | 0:b86d15c6ba29 | 355 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 356 | #endif |
Vanger | 0:b86d15c6ba29 | 357 | #endif |
Vanger | 0:b86d15c6ba29 | 358 | |
Vanger | 0:b86d15c6ba29 | 359 | #if (WINMSP3) |
Vanger | 0:b86d15c6ba29 | 360 | #undef SIZEOF_LONG |
Vanger | 0:b86d15c6ba29 | 361 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 362 | #else |
Vanger | 0:b86d15c6ba29 | 363 | #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG |
Vanger | 0:b86d15c6ba29 | 364 | #endif |
Vanger | 0:b86d15c6ba29 | 365 | |
Vanger | 0:b86d15c6ba29 | 366 | #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) |
Vanger | 0:b86d15c6ba29 | 367 | #define XFREE(p, h, type) (rtp_free(p)) |
Vanger | 0:b86d15c6ba29 | 368 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 369 | |
Vanger | 0:b86d15c6ba29 | 370 | #endif /* EBSNET */ |
Vanger | 0:b86d15c6ba29 | 371 | |
Vanger | 0:b86d15c6ba29 | 372 | #ifdef CYASSL_GAME_BUILD |
Vanger | 0:b86d15c6ba29 | 373 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 374 | #if defined(__PPU) || defined(__XENON) |
Vanger | 0:b86d15c6ba29 | 375 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 376 | #endif |
Vanger | 0:b86d15c6ba29 | 377 | #endif |
Vanger | 0:b86d15c6ba29 | 378 | |
Vanger | 0:b86d15c6ba29 | 379 | #ifdef CYASSL_LSR |
Vanger | 0:b86d15c6ba29 | 380 | #define HAVE_WEBSERVER |
Vanger | 0:b86d15c6ba29 | 381 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 382 | #define CYASSL_LOW_MEMORY |
Vanger | 0:b86d15c6ba29 | 383 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 384 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 385 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 386 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 387 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 388 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 389 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 390 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 391 | #ifndef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 392 | #define LSR_FS |
Vanger | 0:b86d15c6ba29 | 393 | #include "inc/hw_types.h" |
Vanger | 0:b86d15c6ba29 | 394 | #include "fs.h" |
Vanger | 0:b86d15c6ba29 | 395 | #endif |
Vanger | 0:b86d15c6ba29 | 396 | #define CYASSL_LWIP |
Vanger | 0:b86d15c6ba29 | 397 | #include <errno.h> /* for tcp errno */ |
Vanger | 0:b86d15c6ba29 | 398 | #define CYASSL_SAFERTOS |
Vanger | 0:b86d15c6ba29 | 399 | #if defined(__IAR_SYSTEMS_ICC__) |
Vanger | 0:b86d15c6ba29 | 400 | /* enum uses enum */ |
Vanger | 0:b86d15c6ba29 | 401 | #pragma diag_suppress=Pa089 |
Vanger | 0:b86d15c6ba29 | 402 | #endif |
Vanger | 0:b86d15c6ba29 | 403 | #endif |
Vanger | 0:b86d15c6ba29 | 404 | |
Vanger | 0:b86d15c6ba29 | 405 | #ifdef CYASSL_SAFERTOS |
Vanger | 0:b86d15c6ba29 | 406 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 407 | #include "SafeRTOS/semphr.h" |
Vanger | 0:b86d15c6ba29 | 408 | #endif |
Vanger | 0:b86d15c6ba29 | 409 | |
Vanger | 0:b86d15c6ba29 | 410 | #include "SafeRTOS/heap.h" |
Vanger | 0:b86d15c6ba29 | 411 | #define XMALLOC(s, h, type) pvPortMalloc((s)) |
Vanger | 0:b86d15c6ba29 | 412 | #define XFREE(p, h, type) vPortFree((p)) |
Vanger | 0:b86d15c6ba29 | 413 | #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 414 | #endif |
Vanger | 0:b86d15c6ba29 | 415 | |
Vanger | 0:b86d15c6ba29 | 416 | #ifdef CYASSL_LOW_MEMORY |
Vanger | 0:b86d15c6ba29 | 417 | #undef RSA_LOW_MEM |
Vanger | 0:b86d15c6ba29 | 418 | #define RSA_LOW_MEM |
Vanger | 0:b86d15c6ba29 | 419 | #undef CYASSL_SMALL_STACK |
Vanger | 0:b86d15c6ba29 | 420 | #define CYASSL_SMALL_STACK |
Vanger | 0:b86d15c6ba29 | 421 | #undef TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 422 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 423 | #endif |
Vanger | 0:b86d15c6ba29 | 424 | |
Vanger | 0:b86d15c6ba29 | 425 | #ifdef FREESCALE_MQX |
Vanger | 0:b86d15c6ba29 | 426 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 427 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 428 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 429 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 430 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 431 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 432 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 433 | #define FREESCALE_K70_RNGA |
Vanger | 0:b86d15c6ba29 | 434 | /* #define FREESCALE_K53_RNGB */ |
Vanger | 0:b86d15c6ba29 | 435 | #include "mqx.h" |
Vanger | 0:b86d15c6ba29 | 436 | #ifndef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 437 | #include "mfs.h" |
Vanger | 0:b86d15c6ba29 | 438 | #include "fio.h" |
Vanger | 0:b86d15c6ba29 | 439 | #endif |
Vanger | 0:b86d15c6ba29 | 440 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 441 | #include "mutex.h" |
Vanger | 0:b86d15c6ba29 | 442 | #endif |
Vanger | 0:b86d15c6ba29 | 443 | |
Vanger | 0:b86d15c6ba29 | 444 | #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) |
Vanger | 0:b86d15c6ba29 | 445 | #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} |
Vanger | 0:b86d15c6ba29 | 446 | /* Note: MQX has no realloc, using fastmath above */ |
Vanger | 0:b86d15c6ba29 | 447 | #endif |
Vanger | 0:b86d15c6ba29 | 448 | |
Vanger | 0:b86d15c6ba29 | 449 | #ifdef CYASSL_STM32F2 |
Vanger | 0:b86d15c6ba29 | 450 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 451 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 452 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 453 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 454 | #define STM32F2_RNG |
Vanger | 0:b86d15c6ba29 | 455 | #define STM32F2_CRYPTO |
Vanger | 0:b86d15c6ba29 | 456 | #define KEIL_INTRINSICS |
Vanger | 0:b86d15c6ba29 | 457 | #endif |
Vanger | 0:b86d15c6ba29 | 458 | |
Vanger | 0:b86d15c6ba29 | 459 | #ifdef MICRIUM |
Vanger | 0:b86d15c6ba29 | 460 | |
Vanger | 0:b86d15c6ba29 | 461 | #include "stdlib.h" |
Vanger | 0:b86d15c6ba29 | 462 | #include "net_cfg.h" |
Vanger | 0:b86d15c6ba29 | 463 | #include "ssl_cfg.h" |
Vanger | 0:b86d15c6ba29 | 464 | #include "net_secure_os.h" |
Vanger | 0:b86d15c6ba29 | 465 | |
Vanger | 0:b86d15c6ba29 | 466 | #define CYASSL_TYPES |
Vanger | 0:b86d15c6ba29 | 467 | |
Vanger | 0:b86d15c6ba29 | 468 | typedef CPU_INT08U byte; |
Vanger | 0:b86d15c6ba29 | 469 | typedef CPU_INT16U word16; |
Vanger | 0:b86d15c6ba29 | 470 | typedef CPU_INT32U word32; |
Vanger | 0:b86d15c6ba29 | 471 | |
Vanger | 0:b86d15c6ba29 | 472 | #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) |
Vanger | 0:b86d15c6ba29 | 473 | #define SIZEOF_LONG 4 |
Vanger | 0:b86d15c6ba29 | 474 | #undef SIZEOF_LONG_LONG |
Vanger | 0:b86d15c6ba29 | 475 | #else |
Vanger | 0:b86d15c6ba29 | 476 | #undef SIZEOF_LONG |
Vanger | 0:b86d15c6ba29 | 477 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 478 | #endif |
Vanger | 0:b86d15c6ba29 | 479 | |
Vanger | 0:b86d15c6ba29 | 480 | #define STRING_USER |
Vanger | 0:b86d15c6ba29 | 481 | |
Vanger | 0:b86d15c6ba29 | 482 | #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) |
Vanger | 0:b86d15c6ba29 | 483 | #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ |
Vanger | 0:b86d15c6ba29 | 484 | ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ |
Vanger | 0:b86d15c6ba29 | 485 | (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) |
Vanger | 0:b86d15c6ba29 | 486 | #define XSTRNCMP(pstr_1, pstr_2, len_max) \ |
Vanger | 0:b86d15c6ba29 | 487 | ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ |
Vanger | 0:b86d15c6ba29 | 488 | (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) |
Vanger | 0:b86d15c6ba29 | 489 | #define XSTRSTR(pstr, pstr_srch) \ |
Vanger | 0:b86d15c6ba29 | 490 | ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ |
Vanger | 0:b86d15c6ba29 | 491 | (CPU_CHAR *)(pstr_srch))) |
Vanger | 0:b86d15c6ba29 | 492 | #define XMEMSET(pmem, data_val, size) \ |
Vanger | 0:b86d15c6ba29 | 493 | ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ |
Vanger | 0:b86d15c6ba29 | 494 | (CPU_SIZE_T)(size))) |
Vanger | 0:b86d15c6ba29 | 495 | #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ |
Vanger | 0:b86d15c6ba29 | 496 | (void *)(psrc), (CPU_SIZE_T)(size))) |
Vanger | 0:b86d15c6ba29 | 497 | #define XMEMCMP(pmem_1, pmem_2, size) \ |
Vanger | 0:b86d15c6ba29 | 498 | (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ |
Vanger | 0:b86d15c6ba29 | 499 | (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) |
Vanger | 0:b86d15c6ba29 | 500 | #define XMEMMOVE XMEMCPY |
Vanger | 0:b86d15c6ba29 | 501 | |
Vanger | 0:b86d15c6ba29 | 502 | #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 503 | #define MICRIUM_MALLOC |
Vanger | 0:b86d15c6ba29 | 504 | #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ |
Vanger | 0:b86d15c6ba29 | 505 | (CPU_SIZE_T)(s), (void *)0)) |
Vanger | 0:b86d15c6ba29 | 506 | #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ |
Vanger | 0:b86d15c6ba29 | 507 | (p), (void *)0)) |
Vanger | 0:b86d15c6ba29 | 508 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 509 | #endif |
Vanger | 0:b86d15c6ba29 | 510 | |
Vanger | 0:b86d15c6ba29 | 511 | #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 512 | #undef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 513 | #else |
Vanger | 0:b86d15c6ba29 | 514 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 515 | #endif |
Vanger | 0:b86d15c6ba29 | 516 | |
Vanger | 0:b86d15c6ba29 | 517 | #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) |
Vanger | 0:b86d15c6ba29 | 518 | #define DEBUG_CYASSL |
Vanger | 0:b86d15c6ba29 | 519 | #else |
Vanger | 0:b86d15c6ba29 | 520 | #undef DEBUG_CYASSL |
Vanger | 0:b86d15c6ba29 | 521 | #endif |
Vanger | 0:b86d15c6ba29 | 522 | |
Vanger | 0:b86d15c6ba29 | 523 | #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 524 | #define OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 525 | #else |
Vanger | 0:b86d15c6ba29 | 526 | #undef OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 527 | #endif |
Vanger | 0:b86d15c6ba29 | 528 | |
Vanger | 0:b86d15c6ba29 | 529 | #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 530 | #undef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 531 | #else |
Vanger | 0:b86d15c6ba29 | 532 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 533 | #endif |
Vanger | 0:b86d15c6ba29 | 534 | |
Vanger | 0:b86d15c6ba29 | 535 | #if (SSL_CFG_DH_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 536 | #undef NO_DH |
Vanger | 0:b86d15c6ba29 | 537 | #else |
Vanger | 0:b86d15c6ba29 | 538 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 539 | #endif |
Vanger | 0:b86d15c6ba29 | 540 | |
Vanger | 0:b86d15c6ba29 | 541 | #if (SSL_CFG_DSA_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 542 | #undef NO_DSA |
Vanger | 0:b86d15c6ba29 | 543 | #else |
Vanger | 0:b86d15c6ba29 | 544 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 545 | #endif |
Vanger | 0:b86d15c6ba29 | 546 | |
Vanger | 0:b86d15c6ba29 | 547 | #if (SSL_CFG_PSK_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 548 | #undef NO_PSK |
Vanger | 0:b86d15c6ba29 | 549 | #else |
Vanger | 0:b86d15c6ba29 | 550 | #define NO_PSK |
Vanger | 0:b86d15c6ba29 | 551 | #endif |
Vanger | 0:b86d15c6ba29 | 552 | |
Vanger | 0:b86d15c6ba29 | 553 | #if (SSL_CFG_3DES_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 554 | #undef NO_DES |
Vanger | 0:b86d15c6ba29 | 555 | #else |
Vanger | 0:b86d15c6ba29 | 556 | #define NO_DES |
Vanger | 0:b86d15c6ba29 | 557 | #endif |
Vanger | 0:b86d15c6ba29 | 558 | |
Vanger | 0:b86d15c6ba29 | 559 | #if (SSL_CFG_AES_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 560 | #undef NO_AES |
Vanger | 0:b86d15c6ba29 | 561 | #else |
Vanger | 0:b86d15c6ba29 | 562 | #define NO_AES |
Vanger | 0:b86d15c6ba29 | 563 | #endif |
Vanger | 0:b86d15c6ba29 | 564 | |
Vanger | 0:b86d15c6ba29 | 565 | #if (SSL_CFG_RC4_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 566 | #undef NO_RC4 |
Vanger | 0:b86d15c6ba29 | 567 | #else |
Vanger | 0:b86d15c6ba29 | 568 | #define NO_RC4 |
Vanger | 0:b86d15c6ba29 | 569 | #endif |
Vanger | 0:b86d15c6ba29 | 570 | |
Vanger | 0:b86d15c6ba29 | 571 | #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 572 | #undef NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 573 | #else |
Vanger | 0:b86d15c6ba29 | 574 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 575 | #endif |
Vanger | 0:b86d15c6ba29 | 576 | |
Vanger | 0:b86d15c6ba29 | 577 | #if (SSL_CFG_HC128_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 578 | #undef NO_HC128 |
Vanger | 0:b86d15c6ba29 | 579 | #else |
Vanger | 0:b86d15c6ba29 | 580 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 581 | #endif |
Vanger | 0:b86d15c6ba29 | 582 | |
Vanger | 0:b86d15c6ba29 | 583 | #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) |
Vanger | 0:b86d15c6ba29 | 584 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 585 | #else |
Vanger | 0:b86d15c6ba29 | 586 | #undef BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 587 | #define LITTLE_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 588 | #endif |
Vanger | 0:b86d15c6ba29 | 589 | |
Vanger | 0:b86d15c6ba29 | 590 | #if (SSL_CFG_MD4_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 591 | #undef NO_MD4 |
Vanger | 0:b86d15c6ba29 | 592 | #else |
Vanger | 0:b86d15c6ba29 | 593 | #define NO_MD4 |
Vanger | 0:b86d15c6ba29 | 594 | #endif |
Vanger | 0:b86d15c6ba29 | 595 | |
Vanger | 0:b86d15c6ba29 | 596 | #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 597 | #undef NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 598 | #else |
Vanger | 0:b86d15c6ba29 | 599 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 600 | #endif |
Vanger | 0:b86d15c6ba29 | 601 | |
Vanger | 0:b86d15c6ba29 | 602 | #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 603 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 604 | #else |
Vanger | 0:b86d15c6ba29 | 605 | #undef NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 606 | #endif |
Vanger | 0:b86d15c6ba29 | 607 | |
Vanger | 0:b86d15c6ba29 | 608 | #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 609 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 610 | #else |
Vanger | 0:b86d15c6ba29 | 611 | #undef CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 612 | #endif |
Vanger | 0:b86d15c6ba29 | 613 | |
Vanger | 0:b86d15c6ba29 | 614 | #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 615 | #undef LARGE_STATIC_BUFFERS |
Vanger | 0:b86d15c6ba29 | 616 | #undef STATIC_CHUNKS_ONLY |
Vanger | 0:b86d15c6ba29 | 617 | #else |
Vanger | 0:b86d15c6ba29 | 618 | #define LARGE_STATIC_BUFFERS |
Vanger | 0:b86d15c6ba29 | 619 | #define STATIC_CHUNKS_ONLY |
Vanger | 0:b86d15c6ba29 | 620 | #endif |
Vanger | 0:b86d15c6ba29 | 621 | |
Vanger | 0:b86d15c6ba29 | 622 | #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 623 | #define CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 624 | #else |
Vanger | 0:b86d15c6ba29 | 625 | #undef CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 626 | #endif |
Vanger | 0:b86d15c6ba29 | 627 | |
Vanger | 0:b86d15c6ba29 | 628 | #if (SSL_CFG_DTLS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 629 | #define CYASSL_DTLS |
Vanger | 0:b86d15c6ba29 | 630 | #else |
Vanger | 0:b86d15c6ba29 | 631 | #undef CYASSL_DTLS |
Vanger | 0:b86d15c6ba29 | 632 | #endif |
Vanger | 0:b86d15c6ba29 | 633 | |
Vanger | 0:b86d15c6ba29 | 634 | #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 635 | #define CYASSL_CALLBACKS |
Vanger | 0:b86d15c6ba29 | 636 | #else |
Vanger | 0:b86d15c6ba29 | 637 | #undef CYASSL_CALLBACKS |
Vanger | 0:b86d15c6ba29 | 638 | #endif |
Vanger | 0:b86d15c6ba29 | 639 | |
Vanger | 0:b86d15c6ba29 | 640 | #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 641 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 642 | #else |
Vanger | 0:b86d15c6ba29 | 643 | #undef USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 644 | #endif |
Vanger | 0:b86d15c6ba29 | 645 | |
Vanger | 0:b86d15c6ba29 | 646 | #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 647 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 648 | #else |
Vanger | 0:b86d15c6ba29 | 649 | #undef TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 650 | #endif |
Vanger | 0:b86d15c6ba29 | 651 | |
Vanger | 0:b86d15c6ba29 | 652 | #endif /* MICRIUM */ |
Vanger | 0:b86d15c6ba29 | 653 | |
Vanger | 0:b86d15c6ba29 | 654 | |
Vanger | 0:b86d15c6ba29 | 655 | #ifdef CYASSL_QL |
Vanger | 0:b86d15c6ba29 | 656 | #ifndef CYASSL_SEP |
Vanger | 0:b86d15c6ba29 | 657 | #define CYASSL_SEP |
Vanger | 0:b86d15c6ba29 | 658 | #endif |
Vanger | 0:b86d15c6ba29 | 659 | #ifndef OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 660 | #define OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 661 | #endif |
Vanger | 0:b86d15c6ba29 | 662 | #ifndef SESSION_CERTS |
Vanger | 0:b86d15c6ba29 | 663 | #define SESSION_CERTS |
Vanger | 0:b86d15c6ba29 | 664 | #endif |
Vanger | 0:b86d15c6ba29 | 665 | #ifndef HAVE_AESCCM |
Vanger | 0:b86d15c6ba29 | 666 | #define HAVE_AESCCM |
Vanger | 0:b86d15c6ba29 | 667 | #endif |
Vanger | 0:b86d15c6ba29 | 668 | #ifndef ATOMIC_USER |
Vanger | 0:b86d15c6ba29 | 669 | #define ATOMIC_USER |
Vanger | 0:b86d15c6ba29 | 670 | #endif |
Vanger | 0:b86d15c6ba29 | 671 | #ifndef CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 672 | #define CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 673 | #endif |
Vanger | 0:b86d15c6ba29 | 674 | #ifndef KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 675 | #define KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 676 | #endif |
Vanger | 0:b86d15c6ba29 | 677 | #ifndef HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 678 | #define HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 679 | #endif |
Vanger | 0:b86d15c6ba29 | 680 | #ifndef SESSION_INDEX |
Vanger | 0:b86d15c6ba29 | 681 | #define SESSION_INDEX |
Vanger | 0:b86d15c6ba29 | 682 | #endif |
Vanger | 0:b86d15c6ba29 | 683 | #endif /* CYASSL_QL */ |
Vanger | 0:b86d15c6ba29 | 684 | |
Vanger | 0:b86d15c6ba29 | 685 | |
Vanger | 0:b86d15c6ba29 | 686 | #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ |
Vanger | 0:b86d15c6ba29 | 687 | !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) |
Vanger | 0:b86d15c6ba29 | 688 | #define USE_CYASSL_MEMORY |
Vanger | 0:b86d15c6ba29 | 689 | #endif |
Vanger | 0:b86d15c6ba29 | 690 | |
Vanger | 0:b86d15c6ba29 | 691 | |
Vanger | 0:b86d15c6ba29 | 692 | #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) |
Vanger | 0:b86d15c6ba29 | 693 | #undef KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 694 | #define KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 695 | #endif |
Vanger | 0:b86d15c6ba29 | 696 | |
Vanger | 0:b86d15c6ba29 | 697 | |
Vanger | 0:b86d15c6ba29 | 698 | /* stream ciphers except arc4 need 32bit alignment, intel ok without */ |
Vanger | 0:b86d15c6ba29 | 699 | #ifndef XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 700 | #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) |
Vanger | 0:b86d15c6ba29 | 701 | #define NO_XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 702 | #else |
Vanger | 0:b86d15c6ba29 | 703 | #define XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 704 | #endif |
Vanger | 0:b86d15c6ba29 | 705 | #endif |
Vanger | 0:b86d15c6ba29 | 706 | |
Vanger | 0:b86d15c6ba29 | 707 | |
Vanger | 0:b86d15c6ba29 | 708 | /* FreeScale MMCAU hardware crypto has 4 byte alignment */ |
Vanger | 0:b86d15c6ba29 | 709 | #ifdef FREESCALE_MMCAU |
Vanger | 0:b86d15c6ba29 | 710 | #define CYASSL_MMCAU_ALIGNMENT 4 |
Vanger | 0:b86d15c6ba29 | 711 | #endif |
Vanger | 0:b86d15c6ba29 | 712 | |
Vanger | 0:b86d15c6ba29 | 713 | /* if using hardware crypto and have alignment requirements, specify the |
Vanger | 0:b86d15c6ba29 | 714 | requirement here. The record header of SSL/TLS will prvent easy alignment. |
Vanger | 0:b86d15c6ba29 | 715 | This hint tries to help as much as possible. */ |
Vanger | 0:b86d15c6ba29 | 716 | #ifndef CYASSL_GENERAL_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 717 | #ifdef CYASSL_AESNI |
Vanger | 0:b86d15c6ba29 | 718 | #define CYASSL_GENERAL_ALIGNMENT 16 |
Vanger | 0:b86d15c6ba29 | 719 | #elif defined(XSTREAM_ALIGNMENT) |
Vanger | 0:b86d15c6ba29 | 720 | #define CYASSL_GENERAL_ALIGNMENT 4 |
Vanger | 0:b86d15c6ba29 | 721 | #elif defined(FREESCALE_MMCAU) |
Vanger | 0:b86d15c6ba29 | 722 | #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 723 | #else |
Vanger | 0:b86d15c6ba29 | 724 | #define CYASSL_GENERAL_ALIGNMENT 0 |
Vanger | 0:b86d15c6ba29 | 725 | #endif |
Vanger | 0:b86d15c6ba29 | 726 | #endif |
Vanger | 0:b86d15c6ba29 | 727 | |
Vanger | 0:b86d15c6ba29 | 728 | #ifdef HAVE_CRL |
Vanger | 0:b86d15c6ba29 | 729 | /* not widely supported yet */ |
Vanger | 0:b86d15c6ba29 | 730 | #undef NO_SKID |
Vanger | 0:b86d15c6ba29 | 731 | #define NO_SKID |
Vanger | 0:b86d15c6ba29 | 732 | #endif |
Vanger | 0:b86d15c6ba29 | 733 | |
Vanger | 0:b86d15c6ba29 | 734 | |
Vanger | 0:b86d15c6ba29 | 735 | #ifdef __INTEL_COMPILER |
Vanger | 0:b86d15c6ba29 | 736 | #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */ |
Vanger | 0:b86d15c6ba29 | 737 | #endif |
Vanger | 0:b86d15c6ba29 | 738 | |
Vanger | 0:b86d15c6ba29 | 739 | |
Vanger | 0:b86d15c6ba29 | 740 | /* Place any other flags or defines here */ |
Vanger | 0:b86d15c6ba29 | 741 | |
Vanger | 0:b86d15c6ba29 | 742 | |
Vanger | 0:b86d15c6ba29 | 743 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 744 | } /* extern "C" */ |
Vanger | 0:b86d15c6ba29 | 745 | #endif |
Vanger | 0:b86d15c6ba29 | 746 | |
Vanger | 0:b86d15c6ba29 | 747 | |
Vanger | 0:b86d15c6ba29 | 748 | #endif /* CTAO_CRYPT_SETTINGS_H */ |
Vanger | 0:b86d15c6ba29 | 749 |