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@3:b777bfcb1381, 2015-02-09 (annotated)
- Committer:
- Vanger
- Date:
- Mon Feb 09 22:51:58 2015 +0000
- Revision:
- 3:b777bfcb1381
- Parent:
- 2:dc991c4ab35e
- Parent:
- 1:561bad221c72
- Child:
- 4:571a0c156d9d
Merged two CyaSSL revision branches that were implementing the same thing.
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 | 1:561bad221c72 | 200 | #define SIZE_OF_LONG 4 |
Vanger | 0:b86d15c6ba29 | 201 | #define SIZE_OF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 202 | #define MAX_CHAIN_DEPTH 15 |
Vanger | 1:561bad221c72 | 203 | #define NO_TIME_VERIFY //Define to disable certificate date verification |
Vanger | 0:b86d15c6ba29 | 204 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 205 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 206 | #define NO_CERT |
Vanger | 0:b86d15c6ba29 | 207 | #define USE_CERT_BUFFERS_1024 |
Vanger | 0:b86d15c6ba29 | 208 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 209 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 210 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 211 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 212 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 213 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 214 | #define HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 215 | #define NO_SESSION_CACHE |
Vanger | 0:b86d15c6ba29 | 216 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 217 | //#define CYASSL_CMSIS_RTOS |
Vanger | 0:b86d15c6ba29 | 218 | #endif |
Vanger | 0:b86d15c6ba29 | 219 | |
Vanger | 0:b86d15c6ba29 | 220 | |
Vanger | 0:b86d15c6ba29 | 221 | #ifdef CYASSL_EROAD |
Vanger | 0:b86d15c6ba29 | 222 | #define FREESCALE_MQX |
Vanger | 0:b86d15c6ba29 | 223 | #define FREESCALE_MMCAU |
Vanger | 0:b86d15c6ba29 | 224 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 225 | #define NO_STDIO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 226 | #define CYASSL_LEANPSK |
Vanger | 0:b86d15c6ba29 | 227 | #define HAVE_NULL_CIPHER |
Vanger | 0:b86d15c6ba29 | 228 | #define NO_OLD_TLS |
Vanger | 0:b86d15c6ba29 | 229 | #define NO_ASN |
Vanger | 0:b86d15c6ba29 | 230 | #define NO_BIG_INT |
Vanger | 0:b86d15c6ba29 | 231 | #define NO_RSA |
Vanger | 0:b86d15c6ba29 | 232 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 233 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 234 | #define NO_CERTS |
Vanger | 0:b86d15c6ba29 | 235 | #define NO_PWDBASED |
Vanger | 0:b86d15c6ba29 | 236 | #define NO_DES3 |
Vanger | 0:b86d15c6ba29 | 237 | #define NO_MD4 |
Vanger | 0:b86d15c6ba29 | 238 | #define NO_RC4 |
Vanger | 0:b86d15c6ba29 | 239 | #define NO_MD5 |
Vanger | 0:b86d15c6ba29 | 240 | #define NO_SESSION_CACHE |
Vanger | 0:b86d15c6ba29 | 241 | #define NO_MAIN_DRIVER |
Vanger | 0:b86d15c6ba29 | 242 | #endif |
Vanger | 0:b86d15c6ba29 | 243 | |
Vanger | 0:b86d15c6ba29 | 244 | #ifdef CYASSL_PICOTCP |
Vanger | 0:b86d15c6ba29 | 245 | #define errno pico_err |
Vanger | 0:b86d15c6ba29 | 246 | #include "pico_defines.h" |
Vanger | 0:b86d15c6ba29 | 247 | #include "pico_stack.h" |
Vanger | 0:b86d15c6ba29 | 248 | #include "pico_constants.h" |
Vanger | 0:b86d15c6ba29 | 249 | #define CUSTOM_RAND_GENERATE pico_rand |
Vanger | 0:b86d15c6ba29 | 250 | #endif |
Vanger | 0:b86d15c6ba29 | 251 | |
Vanger | 0:b86d15c6ba29 | 252 | #ifdef CYASSL_PICOTCP_DEMO |
Vanger | 0:b86d15c6ba29 | 253 | #define CYASSL_STM32 |
Vanger | 0:b86d15c6ba29 | 254 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 255 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 256 | #define XMALLOC(s, h, type) PICO_ZALLOC((s)) |
Vanger | 0:b86d15c6ba29 | 257 | #define XFREE(p, h, type) PICO_FREE((p)) |
Vanger | 0:b86d15c6ba29 | 258 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 259 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 260 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 261 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 262 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 263 | #endif |
Vanger | 0:b86d15c6ba29 | 264 | |
Vanger | 0:b86d15c6ba29 | 265 | #ifdef FREERTOS_WINSIM |
Vanger | 0:b86d15c6ba29 | 266 | #define FREERTOS |
Vanger | 0:b86d15c6ba29 | 267 | #define USE_WINDOWS_API |
Vanger | 0:b86d15c6ba29 | 268 | #endif |
Vanger | 0:b86d15c6ba29 | 269 | |
Vanger | 0:b86d15c6ba29 | 270 | |
Vanger | 0:b86d15c6ba29 | 271 | /* Micrium will use Visual Studio for compilation but not the Win32 API */ |
Vanger | 0:b86d15c6ba29 | 272 | #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ |
Vanger | 0:b86d15c6ba29 | 273 | && !defined(EBSNET) && !defined(CYASSL_EROAD) |
Vanger | 0:b86d15c6ba29 | 274 | #define USE_WINDOWS_API |
Vanger | 0:b86d15c6ba29 | 275 | #endif |
Vanger | 0:b86d15c6ba29 | 276 | |
Vanger | 0:b86d15c6ba29 | 277 | |
Vanger | 0:b86d15c6ba29 | 278 | #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) |
Vanger | 0:b86d15c6ba29 | 279 | #include <stdlib.h> |
Vanger | 0:b86d15c6ba29 | 280 | #define XMALLOC(s, h, type) malloc((s)) |
Vanger | 0:b86d15c6ba29 | 281 | #define XFREE(p, h, type) free((p)) |
Vanger | 0:b86d15c6ba29 | 282 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 283 | #endif |
Vanger | 0:b86d15c6ba29 | 284 | |
Vanger | 0:b86d15c6ba29 | 285 | #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) |
Vanger | 0:b86d15c6ba29 | 286 | #undef XMALLOC |
Vanger | 0:b86d15c6ba29 | 287 | #define XMALLOC yaXMALLOC |
Vanger | 0:b86d15c6ba29 | 288 | #undef XFREE |
Vanger | 0:b86d15c6ba29 | 289 | #define XFREE yaXFREE |
Vanger | 0:b86d15c6ba29 | 290 | #undef XREALLOC |
Vanger | 0:b86d15c6ba29 | 291 | #define XREALLOC yaXREALLOC |
Vanger | 0:b86d15c6ba29 | 292 | #endif |
Vanger | 0:b86d15c6ba29 | 293 | |
Vanger | 0:b86d15c6ba29 | 294 | |
Vanger | 0:b86d15c6ba29 | 295 | #ifdef FREERTOS |
Vanger | 0:b86d15c6ba29 | 296 | #ifndef NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 297 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 298 | #endif |
Vanger | 0:b86d15c6ba29 | 299 | #ifndef NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 300 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 301 | #endif |
Vanger | 0:b86d15c6ba29 | 302 | #ifndef NO_DH |
Vanger | 0:b86d15c6ba29 | 303 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 304 | #endif |
Vanger | 0:b86d15c6ba29 | 305 | #ifndef NO_DSA |
Vanger | 0:b86d15c6ba29 | 306 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 307 | #endif |
Vanger | 0:b86d15c6ba29 | 308 | #ifndef NO_HC128 |
Vanger | 0:b86d15c6ba29 | 309 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 310 | #endif |
Vanger | 0:b86d15c6ba29 | 311 | |
Vanger | 0:b86d15c6ba29 | 312 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 313 | #include "FreeRTOS.h" |
Vanger | 0:b86d15c6ba29 | 314 | #include "semphr.h" |
Vanger | 0:b86d15c6ba29 | 315 | #endif |
Vanger | 0:b86d15c6ba29 | 316 | #endif |
Vanger | 0:b86d15c6ba29 | 317 | |
Vanger | 0:b86d15c6ba29 | 318 | #ifdef CYASSL_TIRTOS |
Vanger | 0:b86d15c6ba29 | 319 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 320 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 321 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 322 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 323 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 324 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 325 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 326 | #define USE_CERT_BUFFERS_2048 |
Vanger | 0:b86d15c6ba29 | 327 | #define NO_ERROR_STRINGS |
Vanger | 0:b86d15c6ba29 | 328 | #define USER_TIME |
Vanger | 0:b86d15c6ba29 | 329 | |
Vanger | 0:b86d15c6ba29 | 330 | #ifdef __IAR_SYSTEMS_ICC__ |
Vanger | 0:b86d15c6ba29 | 331 | #pragma diag_suppress=Pa089 |
Vanger | 0:b86d15c6ba29 | 332 | #elif !defined(__GNUC__) |
Vanger | 0:b86d15c6ba29 | 333 | /* Suppress the sslpro warning */ |
Vanger | 0:b86d15c6ba29 | 334 | #pragma diag_suppress=11 |
Vanger | 0:b86d15c6ba29 | 335 | #endif |
Vanger | 0:b86d15c6ba29 | 336 | |
Vanger | 0:b86d15c6ba29 | 337 | #include <ti/ndk/nettools/mytime/mytime.h> |
Vanger | 0:b86d15c6ba29 | 338 | #endif |
Vanger | 0:b86d15c6ba29 | 339 | |
Vanger | 0:b86d15c6ba29 | 340 | #ifdef EBSNET |
Vanger | 0:b86d15c6ba29 | 341 | #include "rtip.h" |
Vanger | 0:b86d15c6ba29 | 342 | |
Vanger | 0:b86d15c6ba29 | 343 | /* #define DEBUG_CYASSL */ |
Vanger | 0:b86d15c6ba29 | 344 | #define NO_CYASSL_DIR /* tbd */ |
Vanger | 0:b86d15c6ba29 | 345 | |
Vanger | 0:b86d15c6ba29 | 346 | #if (POLLOS) |
Vanger | 0:b86d15c6ba29 | 347 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 348 | #endif |
Vanger | 0:b86d15c6ba29 | 349 | |
Vanger | 0:b86d15c6ba29 | 350 | #if (RTPLATFORM) |
Vanger | 0:b86d15c6ba29 | 351 | #if (!RTP_LITTLE_ENDIAN) |
Vanger | 0:b86d15c6ba29 | 352 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 353 | #endif |
Vanger | 0:b86d15c6ba29 | 354 | #else |
Vanger | 0:b86d15c6ba29 | 355 | #if (!KS_LITTLE_ENDIAN) |
Vanger | 0:b86d15c6ba29 | 356 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 357 | #endif |
Vanger | 0:b86d15c6ba29 | 358 | #endif |
Vanger | 0:b86d15c6ba29 | 359 | |
Vanger | 0:b86d15c6ba29 | 360 | #if (WINMSP3) |
Vanger | 0:b86d15c6ba29 | 361 | #undef SIZEOF_LONG |
Vanger | 0:b86d15c6ba29 | 362 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 363 | #else |
Vanger | 0:b86d15c6ba29 | 364 | #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG |
Vanger | 0:b86d15c6ba29 | 365 | #endif |
Vanger | 0:b86d15c6ba29 | 366 | |
Vanger | 0:b86d15c6ba29 | 367 | #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) |
Vanger | 0:b86d15c6ba29 | 368 | #define XFREE(p, h, type) (rtp_free(p)) |
Vanger | 0:b86d15c6ba29 | 369 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 370 | |
Vanger | 0:b86d15c6ba29 | 371 | #endif /* EBSNET */ |
Vanger | 0:b86d15c6ba29 | 372 | |
Vanger | 0:b86d15c6ba29 | 373 | #ifdef CYASSL_GAME_BUILD |
Vanger | 0:b86d15c6ba29 | 374 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 375 | #if defined(__PPU) || defined(__XENON) |
Vanger | 0:b86d15c6ba29 | 376 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 377 | #endif |
Vanger | 0:b86d15c6ba29 | 378 | #endif |
Vanger | 0:b86d15c6ba29 | 379 | |
Vanger | 0:b86d15c6ba29 | 380 | #ifdef CYASSL_LSR |
Vanger | 0:b86d15c6ba29 | 381 | #define HAVE_WEBSERVER |
Vanger | 0:b86d15c6ba29 | 382 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 383 | #define CYASSL_LOW_MEMORY |
Vanger | 0:b86d15c6ba29 | 384 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 385 | #define NO_SHA512 |
Vanger | 0:b86d15c6ba29 | 386 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 387 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 388 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 389 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 390 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 391 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 392 | #ifndef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 393 | #define LSR_FS |
Vanger | 0:b86d15c6ba29 | 394 | #include "inc/hw_types.h" |
Vanger | 0:b86d15c6ba29 | 395 | #include "fs.h" |
Vanger | 0:b86d15c6ba29 | 396 | #endif |
Vanger | 0:b86d15c6ba29 | 397 | #define CYASSL_LWIP |
Vanger | 0:b86d15c6ba29 | 398 | #include <errno.h> /* for tcp errno */ |
Vanger | 0:b86d15c6ba29 | 399 | #define CYASSL_SAFERTOS |
Vanger | 0:b86d15c6ba29 | 400 | #if defined(__IAR_SYSTEMS_ICC__) |
Vanger | 0:b86d15c6ba29 | 401 | /* enum uses enum */ |
Vanger | 0:b86d15c6ba29 | 402 | #pragma diag_suppress=Pa089 |
Vanger | 0:b86d15c6ba29 | 403 | #endif |
Vanger | 0:b86d15c6ba29 | 404 | #endif |
Vanger | 0:b86d15c6ba29 | 405 | |
Vanger | 0:b86d15c6ba29 | 406 | #ifdef CYASSL_SAFERTOS |
Vanger | 0:b86d15c6ba29 | 407 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 408 | #include "SafeRTOS/semphr.h" |
Vanger | 0:b86d15c6ba29 | 409 | #endif |
Vanger | 0:b86d15c6ba29 | 410 | |
Vanger | 0:b86d15c6ba29 | 411 | #include "SafeRTOS/heap.h" |
Vanger | 0:b86d15c6ba29 | 412 | #define XMALLOC(s, h, type) pvPortMalloc((s)) |
Vanger | 0:b86d15c6ba29 | 413 | #define XFREE(p, h, type) vPortFree((p)) |
Vanger | 0:b86d15c6ba29 | 414 | #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 415 | #endif |
Vanger | 0:b86d15c6ba29 | 416 | |
Vanger | 0:b86d15c6ba29 | 417 | #ifdef CYASSL_LOW_MEMORY |
Vanger | 0:b86d15c6ba29 | 418 | #undef RSA_LOW_MEM |
Vanger | 0:b86d15c6ba29 | 419 | #define RSA_LOW_MEM |
Vanger | 0:b86d15c6ba29 | 420 | #undef CYASSL_SMALL_STACK |
Vanger | 0:b86d15c6ba29 | 421 | #define CYASSL_SMALL_STACK |
Vanger | 0:b86d15c6ba29 | 422 | #undef TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 423 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 424 | #endif |
Vanger | 0:b86d15c6ba29 | 425 | |
Vanger | 0:b86d15c6ba29 | 426 | #ifdef FREESCALE_MQX |
Vanger | 0:b86d15c6ba29 | 427 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 428 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 429 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 430 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 431 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 432 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 433 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 434 | #define FREESCALE_K70_RNGA |
Vanger | 0:b86d15c6ba29 | 435 | /* #define FREESCALE_K53_RNGB */ |
Vanger | 0:b86d15c6ba29 | 436 | #include "mqx.h" |
Vanger | 0:b86d15c6ba29 | 437 | #ifndef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 438 | #include "mfs.h" |
Vanger | 0:b86d15c6ba29 | 439 | #include "fio.h" |
Vanger | 0:b86d15c6ba29 | 440 | #endif |
Vanger | 0:b86d15c6ba29 | 441 | #ifndef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 442 | #include "mutex.h" |
Vanger | 0:b86d15c6ba29 | 443 | #endif |
Vanger | 0:b86d15c6ba29 | 444 | |
Vanger | 0:b86d15c6ba29 | 445 | #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) |
Vanger | 0:b86d15c6ba29 | 446 | #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} |
Vanger | 0:b86d15c6ba29 | 447 | /* Note: MQX has no realloc, using fastmath above */ |
Vanger | 0:b86d15c6ba29 | 448 | #endif |
Vanger | 0:b86d15c6ba29 | 449 | |
Vanger | 0:b86d15c6ba29 | 450 | #ifdef CYASSL_STM32F2 |
Vanger | 0:b86d15c6ba29 | 451 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 452 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 453 | #define NO_CYASSL_DIR |
Vanger | 0:b86d15c6ba29 | 454 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 455 | #define STM32F2_RNG |
Vanger | 0:b86d15c6ba29 | 456 | #define STM32F2_CRYPTO |
Vanger | 0:b86d15c6ba29 | 457 | #define KEIL_INTRINSICS |
Vanger | 0:b86d15c6ba29 | 458 | #endif |
Vanger | 0:b86d15c6ba29 | 459 | |
Vanger | 0:b86d15c6ba29 | 460 | #ifdef MICRIUM |
Vanger | 0:b86d15c6ba29 | 461 | |
Vanger | 0:b86d15c6ba29 | 462 | #include "stdlib.h" |
Vanger | 0:b86d15c6ba29 | 463 | #include "net_cfg.h" |
Vanger | 0:b86d15c6ba29 | 464 | #include "ssl_cfg.h" |
Vanger | 0:b86d15c6ba29 | 465 | #include "net_secure_os.h" |
Vanger | 0:b86d15c6ba29 | 466 | |
Vanger | 0:b86d15c6ba29 | 467 | #define CYASSL_TYPES |
Vanger | 0:b86d15c6ba29 | 468 | |
Vanger | 0:b86d15c6ba29 | 469 | typedef CPU_INT08U byte; |
Vanger | 0:b86d15c6ba29 | 470 | typedef CPU_INT16U word16; |
Vanger | 0:b86d15c6ba29 | 471 | typedef CPU_INT32U word32; |
Vanger | 0:b86d15c6ba29 | 472 | |
Vanger | 0:b86d15c6ba29 | 473 | #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) |
Vanger | 0:b86d15c6ba29 | 474 | #define SIZEOF_LONG 4 |
Vanger | 0:b86d15c6ba29 | 475 | #undef SIZEOF_LONG_LONG |
Vanger | 0:b86d15c6ba29 | 476 | #else |
Vanger | 0:b86d15c6ba29 | 477 | #undef SIZEOF_LONG |
Vanger | 0:b86d15c6ba29 | 478 | #define SIZEOF_LONG_LONG 8 |
Vanger | 0:b86d15c6ba29 | 479 | #endif |
Vanger | 0:b86d15c6ba29 | 480 | |
Vanger | 0:b86d15c6ba29 | 481 | #define STRING_USER |
Vanger | 0:b86d15c6ba29 | 482 | |
Vanger | 0:b86d15c6ba29 | 483 | #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) |
Vanger | 0:b86d15c6ba29 | 484 | #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ |
Vanger | 0:b86d15c6ba29 | 485 | ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ |
Vanger | 0:b86d15c6ba29 | 486 | (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) |
Vanger | 0:b86d15c6ba29 | 487 | #define XSTRNCMP(pstr_1, pstr_2, len_max) \ |
Vanger | 0:b86d15c6ba29 | 488 | ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ |
Vanger | 0:b86d15c6ba29 | 489 | (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) |
Vanger | 0:b86d15c6ba29 | 490 | #define XSTRSTR(pstr, pstr_srch) \ |
Vanger | 0:b86d15c6ba29 | 491 | ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ |
Vanger | 0:b86d15c6ba29 | 492 | (CPU_CHAR *)(pstr_srch))) |
Vanger | 0:b86d15c6ba29 | 493 | #define XMEMSET(pmem, data_val, size) \ |
Vanger | 0:b86d15c6ba29 | 494 | ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ |
Vanger | 0:b86d15c6ba29 | 495 | (CPU_SIZE_T)(size))) |
Vanger | 0:b86d15c6ba29 | 496 | #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ |
Vanger | 0:b86d15c6ba29 | 497 | (void *)(psrc), (CPU_SIZE_T)(size))) |
Vanger | 0:b86d15c6ba29 | 498 | #define XMEMCMP(pmem_1, pmem_2, size) \ |
Vanger | 0:b86d15c6ba29 | 499 | (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ |
Vanger | 0:b86d15c6ba29 | 500 | (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) |
Vanger | 0:b86d15c6ba29 | 501 | #define XMEMMOVE XMEMCPY |
Vanger | 0:b86d15c6ba29 | 502 | |
Vanger | 0:b86d15c6ba29 | 503 | #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 504 | #define MICRIUM_MALLOC |
Vanger | 0:b86d15c6ba29 | 505 | #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ |
Vanger | 0:b86d15c6ba29 | 506 | (CPU_SIZE_T)(s), (void *)0)) |
Vanger | 0:b86d15c6ba29 | 507 | #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ |
Vanger | 0:b86d15c6ba29 | 508 | (p), (void *)0)) |
Vanger | 0:b86d15c6ba29 | 509 | #define XREALLOC(p, n, h, t) realloc((p), (n)) |
Vanger | 0:b86d15c6ba29 | 510 | #endif |
Vanger | 0:b86d15c6ba29 | 511 | |
Vanger | 0:b86d15c6ba29 | 512 | #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 513 | #undef NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 514 | #else |
Vanger | 0:b86d15c6ba29 | 515 | #define NO_FILESYSTEM |
Vanger | 0:b86d15c6ba29 | 516 | #endif |
Vanger | 0:b86d15c6ba29 | 517 | |
Vanger | 0:b86d15c6ba29 | 518 | #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) |
Vanger | 0:b86d15c6ba29 | 519 | #define DEBUG_CYASSL |
Vanger | 0:b86d15c6ba29 | 520 | #else |
Vanger | 0:b86d15c6ba29 | 521 | #undef DEBUG_CYASSL |
Vanger | 0:b86d15c6ba29 | 522 | #endif |
Vanger | 0:b86d15c6ba29 | 523 | |
Vanger | 0:b86d15c6ba29 | 524 | #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 525 | #define OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 526 | #else |
Vanger | 0:b86d15c6ba29 | 527 | #undef OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 528 | #endif |
Vanger | 0:b86d15c6ba29 | 529 | |
Vanger | 0:b86d15c6ba29 | 530 | #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 531 | #undef SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 532 | #else |
Vanger | 0:b86d15c6ba29 | 533 | #define SINGLE_THREADED |
Vanger | 0:b86d15c6ba29 | 534 | #endif |
Vanger | 0:b86d15c6ba29 | 535 | |
Vanger | 0:b86d15c6ba29 | 536 | #if (SSL_CFG_DH_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 537 | #undef NO_DH |
Vanger | 0:b86d15c6ba29 | 538 | #else |
Vanger | 0:b86d15c6ba29 | 539 | #define NO_DH |
Vanger | 0:b86d15c6ba29 | 540 | #endif |
Vanger | 0:b86d15c6ba29 | 541 | |
Vanger | 0:b86d15c6ba29 | 542 | #if (SSL_CFG_DSA_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 543 | #undef NO_DSA |
Vanger | 0:b86d15c6ba29 | 544 | #else |
Vanger | 0:b86d15c6ba29 | 545 | #define NO_DSA |
Vanger | 0:b86d15c6ba29 | 546 | #endif |
Vanger | 0:b86d15c6ba29 | 547 | |
Vanger | 0:b86d15c6ba29 | 548 | #if (SSL_CFG_PSK_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 549 | #undef NO_PSK |
Vanger | 0:b86d15c6ba29 | 550 | #else |
Vanger | 0:b86d15c6ba29 | 551 | #define NO_PSK |
Vanger | 0:b86d15c6ba29 | 552 | #endif |
Vanger | 0:b86d15c6ba29 | 553 | |
Vanger | 0:b86d15c6ba29 | 554 | #if (SSL_CFG_3DES_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 555 | #undef NO_DES |
Vanger | 0:b86d15c6ba29 | 556 | #else |
Vanger | 0:b86d15c6ba29 | 557 | #define NO_DES |
Vanger | 0:b86d15c6ba29 | 558 | #endif |
Vanger | 0:b86d15c6ba29 | 559 | |
Vanger | 0:b86d15c6ba29 | 560 | #if (SSL_CFG_AES_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 561 | #undef NO_AES |
Vanger | 0:b86d15c6ba29 | 562 | #else |
Vanger | 0:b86d15c6ba29 | 563 | #define NO_AES |
Vanger | 0:b86d15c6ba29 | 564 | #endif |
Vanger | 0:b86d15c6ba29 | 565 | |
Vanger | 0:b86d15c6ba29 | 566 | #if (SSL_CFG_RC4_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 567 | #undef NO_RC4 |
Vanger | 0:b86d15c6ba29 | 568 | #else |
Vanger | 0:b86d15c6ba29 | 569 | #define NO_RC4 |
Vanger | 0:b86d15c6ba29 | 570 | #endif |
Vanger | 0:b86d15c6ba29 | 571 | |
Vanger | 0:b86d15c6ba29 | 572 | #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 573 | #undef NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 574 | #else |
Vanger | 0:b86d15c6ba29 | 575 | #define NO_RABBIT |
Vanger | 0:b86d15c6ba29 | 576 | #endif |
Vanger | 0:b86d15c6ba29 | 577 | |
Vanger | 0:b86d15c6ba29 | 578 | #if (SSL_CFG_HC128_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 579 | #undef NO_HC128 |
Vanger | 0:b86d15c6ba29 | 580 | #else |
Vanger | 0:b86d15c6ba29 | 581 | #define NO_HC128 |
Vanger | 0:b86d15c6ba29 | 582 | #endif |
Vanger | 0:b86d15c6ba29 | 583 | |
Vanger | 0:b86d15c6ba29 | 584 | #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) |
Vanger | 0:b86d15c6ba29 | 585 | #define BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 586 | #else |
Vanger | 0:b86d15c6ba29 | 587 | #undef BIG_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 588 | #define LITTLE_ENDIAN_ORDER |
Vanger | 0:b86d15c6ba29 | 589 | #endif |
Vanger | 0:b86d15c6ba29 | 590 | |
Vanger | 0:b86d15c6ba29 | 591 | #if (SSL_CFG_MD4_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 592 | #undef NO_MD4 |
Vanger | 0:b86d15c6ba29 | 593 | #else |
Vanger | 0:b86d15c6ba29 | 594 | #define NO_MD4 |
Vanger | 0:b86d15c6ba29 | 595 | #endif |
Vanger | 0:b86d15c6ba29 | 596 | |
Vanger | 0:b86d15c6ba29 | 597 | #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 598 | #undef NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 599 | #else |
Vanger | 0:b86d15c6ba29 | 600 | #define NO_WRITEV |
Vanger | 0:b86d15c6ba29 | 601 | #endif |
Vanger | 0:b86d15c6ba29 | 602 | |
Vanger | 0:b86d15c6ba29 | 603 | #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 604 | #define NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 605 | #else |
Vanger | 0:b86d15c6ba29 | 606 | #undef NO_DEV_RANDOM |
Vanger | 0:b86d15c6ba29 | 607 | #endif |
Vanger | 0:b86d15c6ba29 | 608 | |
Vanger | 0:b86d15c6ba29 | 609 | #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 610 | #define CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 611 | #else |
Vanger | 0:b86d15c6ba29 | 612 | #undef CYASSL_USER_IO |
Vanger | 0:b86d15c6ba29 | 613 | #endif |
Vanger | 0:b86d15c6ba29 | 614 | |
Vanger | 0:b86d15c6ba29 | 615 | #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 616 | #undef LARGE_STATIC_BUFFERS |
Vanger | 0:b86d15c6ba29 | 617 | #undef STATIC_CHUNKS_ONLY |
Vanger | 0:b86d15c6ba29 | 618 | #else |
Vanger | 0:b86d15c6ba29 | 619 | #define LARGE_STATIC_BUFFERS |
Vanger | 0:b86d15c6ba29 | 620 | #define STATIC_CHUNKS_ONLY |
Vanger | 0:b86d15c6ba29 | 621 | #endif |
Vanger | 0:b86d15c6ba29 | 622 | |
Vanger | 0:b86d15c6ba29 | 623 | #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 624 | #define CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 625 | #else |
Vanger | 0:b86d15c6ba29 | 626 | #undef CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 627 | #endif |
Vanger | 0:b86d15c6ba29 | 628 | |
Vanger | 0:b86d15c6ba29 | 629 | #if (SSL_CFG_DTLS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 630 | #define CYASSL_DTLS |
Vanger | 0:b86d15c6ba29 | 631 | #else |
Vanger | 0:b86d15c6ba29 | 632 | #undef CYASSL_DTLS |
Vanger | 0:b86d15c6ba29 | 633 | #endif |
Vanger | 0:b86d15c6ba29 | 634 | |
Vanger | 0:b86d15c6ba29 | 635 | #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 636 | #define CYASSL_CALLBACKS |
Vanger | 0:b86d15c6ba29 | 637 | #else |
Vanger | 0:b86d15c6ba29 | 638 | #undef CYASSL_CALLBACKS |
Vanger | 0:b86d15c6ba29 | 639 | #endif |
Vanger | 0:b86d15c6ba29 | 640 | |
Vanger | 0:b86d15c6ba29 | 641 | #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 642 | #define USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 643 | #else |
Vanger | 0:b86d15c6ba29 | 644 | #undef USE_FAST_MATH |
Vanger | 0:b86d15c6ba29 | 645 | #endif |
Vanger | 0:b86d15c6ba29 | 646 | |
Vanger | 0:b86d15c6ba29 | 647 | #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) |
Vanger | 0:b86d15c6ba29 | 648 | #define TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 649 | #else |
Vanger | 0:b86d15c6ba29 | 650 | #undef TFM_TIMING_RESISTANT |
Vanger | 0:b86d15c6ba29 | 651 | #endif |
Vanger | 0:b86d15c6ba29 | 652 | |
Vanger | 0:b86d15c6ba29 | 653 | #endif /* MICRIUM */ |
Vanger | 0:b86d15c6ba29 | 654 | |
Vanger | 0:b86d15c6ba29 | 655 | |
Vanger | 0:b86d15c6ba29 | 656 | #ifdef CYASSL_QL |
Vanger | 0:b86d15c6ba29 | 657 | #ifndef CYASSL_SEP |
Vanger | 0:b86d15c6ba29 | 658 | #define CYASSL_SEP |
Vanger | 0:b86d15c6ba29 | 659 | #endif |
Vanger | 0:b86d15c6ba29 | 660 | #ifndef OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 661 | #define OPENSSL_EXTRA |
Vanger | 0:b86d15c6ba29 | 662 | #endif |
Vanger | 0:b86d15c6ba29 | 663 | #ifndef SESSION_CERTS |
Vanger | 0:b86d15c6ba29 | 664 | #define SESSION_CERTS |
Vanger | 0:b86d15c6ba29 | 665 | #endif |
Vanger | 0:b86d15c6ba29 | 666 | #ifndef HAVE_AESCCM |
Vanger | 0:b86d15c6ba29 | 667 | #define HAVE_AESCCM |
Vanger | 0:b86d15c6ba29 | 668 | #endif |
Vanger | 0:b86d15c6ba29 | 669 | #ifndef ATOMIC_USER |
Vanger | 0:b86d15c6ba29 | 670 | #define ATOMIC_USER |
Vanger | 0:b86d15c6ba29 | 671 | #endif |
Vanger | 0:b86d15c6ba29 | 672 | #ifndef CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 673 | #define CYASSL_DER_LOAD |
Vanger | 0:b86d15c6ba29 | 674 | #endif |
Vanger | 0:b86d15c6ba29 | 675 | #ifndef KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 676 | #define KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 677 | #endif |
Vanger | 0:b86d15c6ba29 | 678 | #ifndef HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 679 | #define HAVE_ECC |
Vanger | 0:b86d15c6ba29 | 680 | #endif |
Vanger | 0:b86d15c6ba29 | 681 | #ifndef SESSION_INDEX |
Vanger | 0:b86d15c6ba29 | 682 | #define SESSION_INDEX |
Vanger | 0:b86d15c6ba29 | 683 | #endif |
Vanger | 0:b86d15c6ba29 | 684 | #endif /* CYASSL_QL */ |
Vanger | 0:b86d15c6ba29 | 685 | |
Vanger | 0:b86d15c6ba29 | 686 | |
Vanger | 0:b86d15c6ba29 | 687 | #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ |
Vanger | 0:b86d15c6ba29 | 688 | !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) |
Vanger | 0:b86d15c6ba29 | 689 | #define USE_CYASSL_MEMORY |
Vanger | 0:b86d15c6ba29 | 690 | #endif |
Vanger | 0:b86d15c6ba29 | 691 | |
Vanger | 0:b86d15c6ba29 | 692 | |
Vanger | 0:b86d15c6ba29 | 693 | #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) |
Vanger | 0:b86d15c6ba29 | 694 | #undef KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 695 | #define KEEP_PEER_CERT |
Vanger | 0:b86d15c6ba29 | 696 | #endif |
Vanger | 0:b86d15c6ba29 | 697 | |
Vanger | 0:b86d15c6ba29 | 698 | |
Vanger | 0:b86d15c6ba29 | 699 | /* stream ciphers except arc4 need 32bit alignment, intel ok without */ |
Vanger | 0:b86d15c6ba29 | 700 | #ifndef XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 701 | #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) |
Vanger | 0:b86d15c6ba29 | 702 | #define NO_XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 703 | #else |
Vanger | 0:b86d15c6ba29 | 704 | #define XSTREAM_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 705 | #endif |
Vanger | 0:b86d15c6ba29 | 706 | #endif |
Vanger | 0:b86d15c6ba29 | 707 | |
Vanger | 0:b86d15c6ba29 | 708 | |
Vanger | 0:b86d15c6ba29 | 709 | /* FreeScale MMCAU hardware crypto has 4 byte alignment */ |
Vanger | 0:b86d15c6ba29 | 710 | #ifdef FREESCALE_MMCAU |
Vanger | 0:b86d15c6ba29 | 711 | #define CYASSL_MMCAU_ALIGNMENT 4 |
Vanger | 0:b86d15c6ba29 | 712 | #endif |
Vanger | 0:b86d15c6ba29 | 713 | |
Vanger | 0:b86d15c6ba29 | 714 | /* if using hardware crypto and have alignment requirements, specify the |
Vanger | 0:b86d15c6ba29 | 715 | requirement here. The record header of SSL/TLS will prvent easy alignment. |
Vanger | 0:b86d15c6ba29 | 716 | This hint tries to help as much as possible. */ |
Vanger | 0:b86d15c6ba29 | 717 | #ifndef CYASSL_GENERAL_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 718 | #ifdef CYASSL_AESNI |
Vanger | 0:b86d15c6ba29 | 719 | #define CYASSL_GENERAL_ALIGNMENT 16 |
Vanger | 0:b86d15c6ba29 | 720 | #elif defined(XSTREAM_ALIGNMENT) |
Vanger | 0:b86d15c6ba29 | 721 | #define CYASSL_GENERAL_ALIGNMENT 4 |
Vanger | 0:b86d15c6ba29 | 722 | #elif defined(FREESCALE_MMCAU) |
Vanger | 0:b86d15c6ba29 | 723 | #define CYASSL_GENERAL_ALIGNMENT CYASSL_MMCAU_ALIGNMENT |
Vanger | 0:b86d15c6ba29 | 724 | #else |
Vanger | 0:b86d15c6ba29 | 725 | #define CYASSL_GENERAL_ALIGNMENT 0 |
Vanger | 0:b86d15c6ba29 | 726 | #endif |
Vanger | 0:b86d15c6ba29 | 727 | #endif |
Vanger | 0:b86d15c6ba29 | 728 | |
Vanger | 0:b86d15c6ba29 | 729 | #ifdef HAVE_CRL |
Vanger | 0:b86d15c6ba29 | 730 | /* not widely supported yet */ |
Vanger | 0:b86d15c6ba29 | 731 | #undef NO_SKID |
Vanger | 0:b86d15c6ba29 | 732 | #define NO_SKID |
Vanger | 0:b86d15c6ba29 | 733 | #endif |
Vanger | 0:b86d15c6ba29 | 734 | |
Vanger | 0:b86d15c6ba29 | 735 | |
Vanger | 0:b86d15c6ba29 | 736 | #ifdef __INTEL_COMPILER |
Vanger | 0:b86d15c6ba29 | 737 | #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */ |
Vanger | 0:b86d15c6ba29 | 738 | #endif |
Vanger | 0:b86d15c6ba29 | 739 | |
Vanger | 0:b86d15c6ba29 | 740 | |
Vanger | 0:b86d15c6ba29 | 741 | /* Place any other flags or defines here */ |
Vanger | 0:b86d15c6ba29 | 742 | |
Vanger | 0:b86d15c6ba29 | 743 | |
Vanger | 0:b86d15c6ba29 | 744 | #ifdef __cplusplus |
Vanger | 0:b86d15c6ba29 | 745 | } /* extern "C" */ |
Vanger | 0:b86d15c6ba29 | 746 | #endif |
Vanger | 0:b86d15c6ba29 | 747 | |
Vanger | 0:b86d15c6ba29 | 748 | |
Vanger | 0:b86d15c6ba29 | 749 | #endif /* CTAO_CRYPT_SETTINGS_H */ |
Vanger | 0:b86d15c6ba29 | 750 |