CyaSSL 3.0.0

Dependents:   HTTPClient-SSL HTTPClient HTTPClient-SSL http_access ... more

Committer:
wolfSSL
Date:
Sat Jul 12 07:18:23 2014 +0000
Revision:
0:1239e9b70ca2
Child:
1:f01293e6e7b8
CyaSSL 3.0.0;

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 0:1239e9b70ca2 1 /* settings.h
wolfSSL 0:1239e9b70ca2 2 *
wolfSSL 0:1239e9b70ca2 3 * Copyright (C) 2006-2013 wolfSSL Inc.
wolfSSL 0:1239e9b70ca2 4 *
wolfSSL 0:1239e9b70ca2 5 * This file is part of CyaSSL.
wolfSSL 0:1239e9b70ca2 6 *
wolfSSL 0:1239e9b70ca2 7 * CyaSSL is free software; you can redistribute it and/or modify
wolfSSL 0:1239e9b70ca2 8 * it under the terms of the GNU General Public License as published by
wolfSSL 0:1239e9b70ca2 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 0:1239e9b70ca2 10 * (at your option) any later version.
wolfSSL 0:1239e9b70ca2 11 *
wolfSSL 0:1239e9b70ca2 12 * CyaSSL is distributed in the hope that it will be useful,
wolfSSL 0:1239e9b70ca2 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 0:1239e9b70ca2 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 0:1239e9b70ca2 15 * GNU General Public License for more details.
wolfSSL 0:1239e9b70ca2 16 *
wolfSSL 0:1239e9b70ca2 17 * You should have received a copy of the GNU General Public License
wolfSSL 0:1239e9b70ca2 18 * along with this program; if not, write to the Free Software
wolfSSL 0:1239e9b70ca2 19 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
wolfSSL 0:1239e9b70ca2 20 */
wolfSSL 0:1239e9b70ca2 21
wolfSSL 0:1239e9b70ca2 22 /* Place OS specific preprocessor flags, defines, includes here, will be
wolfSSL 0:1239e9b70ca2 23 included into every file because types.h includes it */
wolfSSL 0:1239e9b70ca2 24
wolfSSL 0:1239e9b70ca2 25
wolfSSL 0:1239e9b70ca2 26 #ifndef CTAO_CRYPT_SETTINGS_H
wolfSSL 0:1239e9b70ca2 27 #define CTAO_CRYPT_SETTINGS_H
wolfSSL 0:1239e9b70ca2 28
wolfSSL 0:1239e9b70ca2 29 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 30 extern "C" {
wolfSSL 0:1239e9b70ca2 31 #endif
wolfSSL 0:1239e9b70ca2 32
wolfSSL 0:1239e9b70ca2 33 /* Uncomment next line if using IPHONE */
wolfSSL 0:1239e9b70ca2 34 /* #define IPHONE */
wolfSSL 0:1239e9b70ca2 35
wolfSSL 0:1239e9b70ca2 36 /* Uncomment next line if using ThreadX */
wolfSSL 0:1239e9b70ca2 37 /* #define THREADX */
wolfSSL 0:1239e9b70ca2 38
wolfSSL 0:1239e9b70ca2 39 /* Uncomment next line if using Micrium ucOS */
wolfSSL 0:1239e9b70ca2 40 /* #define MICRIUM */
wolfSSL 0:1239e9b70ca2 41
wolfSSL 0:1239e9b70ca2 42 /* Uncomment next line if using Mbed */
wolfSSL 0:1239e9b70ca2 43 #define MBED
wolfSSL 0:1239e9b70ca2 44
wolfSSL 0:1239e9b70ca2 45 /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
wolfSSL 0:1239e9b70ca2 46 /* #define MICROCHIP_PIC32 */
wolfSSL 0:1239e9b70ca2 47
wolfSSL 0:1239e9b70ca2 48 /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
wolfSSL 0:1239e9b70ca2 49 /* #define MICROCHIP_TCPIP_V5 */
wolfSSL 0:1239e9b70ca2 50
wolfSSL 0:1239e9b70ca2 51 /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
wolfSSL 0:1239e9b70ca2 52 /* #define MICROCHIP_TCPIP */
wolfSSL 0:1239e9b70ca2 53
wolfSSL 0:1239e9b70ca2 54 /* Uncomment next line if using FreeRTOS */
wolfSSL 0:1239e9b70ca2 55 /* #define FREERTOS */
wolfSSL 0:1239e9b70ca2 56
wolfSSL 0:1239e9b70ca2 57 /* Uncomment next line if using FreeRTOS Windows Simulator */
wolfSSL 0:1239e9b70ca2 58 /* #define FREERTOS_WINSIM */
wolfSSL 0:1239e9b70ca2 59
wolfSSL 0:1239e9b70ca2 60 /* Uncomment next line if using RTIP */
wolfSSL 0:1239e9b70ca2 61 /* #define EBSNET */
wolfSSL 0:1239e9b70ca2 62
wolfSSL 0:1239e9b70ca2 63 /* Uncomment next line if using lwip */
wolfSSL 0:1239e9b70ca2 64 /* #define CYASSL_LWIP */
wolfSSL 0:1239e9b70ca2 65
wolfSSL 0:1239e9b70ca2 66 /* Uncomment next line if building CyaSSL for a game console */
wolfSSL 0:1239e9b70ca2 67 /* #define CYASSL_GAME_BUILD */
wolfSSL 0:1239e9b70ca2 68
wolfSSL 0:1239e9b70ca2 69 /* Uncomment next line if building CyaSSL for LSR */
wolfSSL 0:1239e9b70ca2 70 /* #define CYASSL_LSR */
wolfSSL 0:1239e9b70ca2 71
wolfSSL 0:1239e9b70ca2 72 /* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */
wolfSSL 0:1239e9b70ca2 73 /* #define FREESCALE_MQX */
wolfSSL 0:1239e9b70ca2 74
wolfSSL 0:1239e9b70ca2 75 /* Uncomment next line if using STM32F2 */
wolfSSL 0:1239e9b70ca2 76 /* #define CYASSL_STM32F2 */
wolfSSL 0:1239e9b70ca2 77
wolfSSL 0:1239e9b70ca2 78 /* Uncomment next line if using Comverge settings */
wolfSSL 0:1239e9b70ca2 79 /* #define COMVERGE */
wolfSSL 0:1239e9b70ca2 80
wolfSSL 0:1239e9b70ca2 81
wolfSSL 0:1239e9b70ca2 82 #include <cyassl/ctaocrypt/visibility.h>
wolfSSL 0:1239e9b70ca2 83
wolfSSL 0:1239e9b70ca2 84 #ifdef IPHONE
wolfSSL 0:1239e9b70ca2 85 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 86 #endif
wolfSSL 0:1239e9b70ca2 87
wolfSSL 0:1239e9b70ca2 88
wolfSSL 0:1239e9b70ca2 89 #ifdef COMVERGE
wolfSSL 0:1239e9b70ca2 90 #define THREADX
wolfSSL 0:1239e9b70ca2 91 #define HAVE_NETX
wolfSSL 0:1239e9b70ca2 92 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 93 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 94 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 95 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 96 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 97 #define NO_DH
wolfSSL 0:1239e9b70ca2 98 #define NO_DSA
wolfSSL 0:1239e9b70ca2 99 #define NO_HC128
wolfSSL 0:1239e9b70ca2 100 #define NO_RSA
wolfSSL 0:1239e9b70ca2 101 #define NO_SESSION_CACHE
wolfSSL 0:1239e9b70ca2 102 #define HAVE_ECC
wolfSSL 0:1239e9b70ca2 103 #endif
wolfSSL 0:1239e9b70ca2 104
wolfSSL 0:1239e9b70ca2 105
wolfSSL 0:1239e9b70ca2 106 #ifdef THREADX
wolfSSL 0:1239e9b70ca2 107 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 108 #endif
wolfSSL 0:1239e9b70ca2 109
wolfSSL 0:1239e9b70ca2 110 #ifdef HAVE_NETX
wolfSSL 0:1239e9b70ca2 111 #include "nx_api.h"
wolfSSL 0:1239e9b70ca2 112 #endif
wolfSSL 0:1239e9b70ca2 113
wolfSSL 0:1239e9b70ca2 114 #ifdef MICROCHIP_PIC32
wolfSSL 0:1239e9b70ca2 115 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 116 #define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 117 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 118 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 119 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 120 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 121 #define USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 122 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 123 #endif
wolfSSL 0:1239e9b70ca2 124
wolfSSL 0:1239e9b70ca2 125 #ifdef MICROCHIP_TCPIP_V5
wolfSSL 0:1239e9b70ca2 126 /* include timer functions */
wolfSSL 0:1239e9b70ca2 127 #include "TCPIP Stack/TCPIP.h"
wolfSSL 0:1239e9b70ca2 128 #endif
wolfSSL 0:1239e9b70ca2 129
wolfSSL 0:1239e9b70ca2 130 #ifdef MICROCHIP_TCPIP
wolfSSL 0:1239e9b70ca2 131 /* include timer, NTP functions */
wolfSSL 0:1239e9b70ca2 132 #include "system/system_services.h"
wolfSSL 0:1239e9b70ca2 133 #ifdef MICROCHIP_MPLAB_HARMONY
wolfSSL 0:1239e9b70ca2 134 #include "tcpip/tcpip.h"
wolfSSL 0:1239e9b70ca2 135 #else
wolfSSL 0:1239e9b70ca2 136 #include "tcpip/sntp.h"
wolfSSL 0:1239e9b70ca2 137 #endif
wolfSSL 0:1239e9b70ca2 138 #endif
wolfSSL 0:1239e9b70ca2 139
wolfSSL 0:1239e9b70ca2 140 #ifdef MBED
wolfSSL 0:1239e9b70ca2 141 //#define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 142 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 143 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 144 //#define NO_CERTS
wolfSSL 0:1239e9b70ca2 145 //#define USE_CERT_BUFFERS_1024
wolfSSL 0:1239e9b70ca2 146 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 147 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 148 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 149 #define NO_DH
wolfSSL 0:1239e9b70ca2 150 #define NO_DSA
wolfSSL 0:1239e9b70ca2 151 #define NO_HC128
wolfSSL 0:1239e9b70ca2 152 #define HAVE_ECC
wolfSSL 0:1239e9b70ca2 153 #define NO_SESSION_CACHE
wolfSSL 0:1239e9b70ca2 154 #define CYASSL_CMSIS_RTOS
wolfSSL 0:1239e9b70ca2 155 #define DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 156 #endif
wolfSSL 0:1239e9b70ca2 157
wolfSSL 0:1239e9b70ca2 158 #ifdef CYASSL_TYTO
wolfSSL 0:1239e9b70ca2 159 #define FREERTOS
wolfSSL 0:1239e9b70ca2 160 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 161 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 162 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 163 #endif
wolfSSL 0:1239e9b70ca2 164
wolfSSL 0:1239e9b70ca2 165 #ifdef FREERTOS_WINSIM
wolfSSL 0:1239e9b70ca2 166 #define FREERTOS
wolfSSL 0:1239e9b70ca2 167 #define USE_WINDOWS_API
wolfSSL 0:1239e9b70ca2 168 #endif
wolfSSL 0:1239e9b70ca2 169
wolfSSL 0:1239e9b70ca2 170
wolfSSL 0:1239e9b70ca2 171 /* Micrium will use Visual Studio for compilation but not the Win32 API */
wolfSSL 0:1239e9b70ca2 172 #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \
wolfSSL 0:1239e9b70ca2 173 && !defined(EBSNET)
wolfSSL 0:1239e9b70ca2 174 #define USE_WINDOWS_API
wolfSSL 0:1239e9b70ca2 175 #endif
wolfSSL 0:1239e9b70ca2 176
wolfSSL 0:1239e9b70ca2 177
wolfSSL 0:1239e9b70ca2 178 #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER)
wolfSSL 0:1239e9b70ca2 179 #include <stdlib.h>
wolfSSL 0:1239e9b70ca2 180 #define XMALLOC(s, h, type) malloc((s))
wolfSSL 0:1239e9b70ca2 181 #define XFREE(p, h, type) free((p))
wolfSSL 0:1239e9b70ca2 182 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 183 #endif
wolfSSL 0:1239e9b70ca2 184
wolfSSL 0:1239e9b70ca2 185 #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
wolfSSL 0:1239e9b70ca2 186 #undef XMALLOC
wolfSSL 0:1239e9b70ca2 187 #define XMALLOC yaXMALLOC
wolfSSL 0:1239e9b70ca2 188 #undef XFREE
wolfSSL 0:1239e9b70ca2 189 #define XFREE yaXFREE
wolfSSL 0:1239e9b70ca2 190 #undef XREALLOC
wolfSSL 0:1239e9b70ca2 191 #define XREALLOC yaXREALLOC
wolfSSL 0:1239e9b70ca2 192 #endif
wolfSSL 0:1239e9b70ca2 193
wolfSSL 0:1239e9b70ca2 194
wolfSSL 0:1239e9b70ca2 195 #ifdef FREERTOS
wolfSSL 0:1239e9b70ca2 196 #ifndef NO_WRITEV
wolfSSL 0:1239e9b70ca2 197 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 198 #endif
wolfSSL 0:1239e9b70ca2 199 #ifndef NO_SHA512
wolfSSL 0:1239e9b70ca2 200 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 201 #endif
wolfSSL 0:1239e9b70ca2 202 #ifndef NO_DH
wolfSSL 0:1239e9b70ca2 203 #define NO_DH
wolfSSL 0:1239e9b70ca2 204 #endif
wolfSSL 0:1239e9b70ca2 205 #ifndef NO_DSA
wolfSSL 0:1239e9b70ca2 206 #define NO_DSA
wolfSSL 0:1239e9b70ca2 207 #endif
wolfSSL 0:1239e9b70ca2 208 #ifndef NO_HC128
wolfSSL 0:1239e9b70ca2 209 #define NO_HC128
wolfSSL 0:1239e9b70ca2 210 #endif
wolfSSL 0:1239e9b70ca2 211
wolfSSL 0:1239e9b70ca2 212 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 213 #include "FreeRTOS.h"
wolfSSL 0:1239e9b70ca2 214 #include "semphr.h"
wolfSSL 0:1239e9b70ca2 215 #endif
wolfSSL 0:1239e9b70ca2 216 #endif
wolfSSL 0:1239e9b70ca2 217
wolfSSL 0:1239e9b70ca2 218 #ifdef EBSNET
wolfSSL 0:1239e9b70ca2 219 #include "rtip.h"
wolfSSL 0:1239e9b70ca2 220
wolfSSL 0:1239e9b70ca2 221 /* #define DEBUG_CYASSL */
wolfSSL 0:1239e9b70ca2 222 #define NO_CYASSL_DIR /* tbd */
wolfSSL 0:1239e9b70ca2 223
wolfSSL 0:1239e9b70ca2 224 #if (POLLOS)
wolfSSL 0:1239e9b70ca2 225 #define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 226 #endif
wolfSSL 0:1239e9b70ca2 227
wolfSSL 0:1239e9b70ca2 228 #if (RTPLATFORM)
wolfSSL 0:1239e9b70ca2 229 #if (!RTP_LITTLE_ENDIAN)
wolfSSL 0:1239e9b70ca2 230 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 231 #endif
wolfSSL 0:1239e9b70ca2 232 #else
wolfSSL 0:1239e9b70ca2 233 #if (!KS_LITTLE_ENDIAN)
wolfSSL 0:1239e9b70ca2 234 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 235 #endif
wolfSSL 0:1239e9b70ca2 236 #endif
wolfSSL 0:1239e9b70ca2 237
wolfSSL 0:1239e9b70ca2 238 #if (WINMSP3)
wolfSSL 0:1239e9b70ca2 239 #undef SIZEOF_LONG
wolfSSL 0:1239e9b70ca2 240 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 241 #else
wolfSSL 0:1239e9b70ca2 242 #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
wolfSSL 0:1239e9b70ca2 243 #endif
wolfSSL 0:1239e9b70ca2 244
wolfSSL 0:1239e9b70ca2 245 #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
wolfSSL 0:1239e9b70ca2 246 #define XFREE(p, h, type) (rtp_free(p))
wolfSSL 0:1239e9b70ca2 247 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 248
wolfSSL 0:1239e9b70ca2 249 #endif /* EBSNET */
wolfSSL 0:1239e9b70ca2 250
wolfSSL 0:1239e9b70ca2 251 #ifdef CYASSL_GAME_BUILD
wolfSSL 0:1239e9b70ca2 252 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 253 #if defined(__PPU) || defined(__XENON)
wolfSSL 0:1239e9b70ca2 254 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 255 #endif
wolfSSL 0:1239e9b70ca2 256 #endif
wolfSSL 0:1239e9b70ca2 257
wolfSSL 0:1239e9b70ca2 258 #ifdef CYASSL_LSR
wolfSSL 0:1239e9b70ca2 259 #define HAVE_WEBSERVER
wolfSSL 0:1239e9b70ca2 260 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 261 #define CYASSL_LOW_MEMORY
wolfSSL 0:1239e9b70ca2 262 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 263 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 264 #define NO_DH
wolfSSL 0:1239e9b70ca2 265 #define NO_DSA
wolfSSL 0:1239e9b70ca2 266 #define NO_HC128
wolfSSL 0:1239e9b70ca2 267 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 268 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 269 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 270 #ifndef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 271 #define LSR_FS
wolfSSL 0:1239e9b70ca2 272 #include "inc/hw_types.h"
wolfSSL 0:1239e9b70ca2 273 #include "fs.h"
wolfSSL 0:1239e9b70ca2 274 #endif
wolfSSL 0:1239e9b70ca2 275 #define CYASSL_LWIP
wolfSSL 0:1239e9b70ca2 276 #include <errno.h> /* for tcp errno */
wolfSSL 0:1239e9b70ca2 277 #define CYASSL_SAFERTOS
wolfSSL 0:1239e9b70ca2 278 #if defined(__IAR_SYSTEMS_ICC__)
wolfSSL 0:1239e9b70ca2 279 /* enum uses enum */
wolfSSL 0:1239e9b70ca2 280 #pragma diag_suppress=Pa089
wolfSSL 0:1239e9b70ca2 281 #endif
wolfSSL 0:1239e9b70ca2 282 #endif
wolfSSL 0:1239e9b70ca2 283
wolfSSL 0:1239e9b70ca2 284 #ifdef CYASSL_SAFERTOS
wolfSSL 0:1239e9b70ca2 285 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 286 #include "SafeRTOS/semphr.h"
wolfSSL 0:1239e9b70ca2 287 #endif
wolfSSL 0:1239e9b70ca2 288
wolfSSL 0:1239e9b70ca2 289 #include "SafeRTOS/heap.h"
wolfSSL 0:1239e9b70ca2 290 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 0:1239e9b70ca2 291 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 0:1239e9b70ca2 292 #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
wolfSSL 0:1239e9b70ca2 293 #endif
wolfSSL 0:1239e9b70ca2 294
wolfSSL 0:1239e9b70ca2 295 #ifdef CYASSL_LOW_MEMORY
wolfSSL 0:1239e9b70ca2 296 #undef RSA_LOW_MEM
wolfSSL 0:1239e9b70ca2 297 #define RSA_LOW_MEM
wolfSSL 0:1239e9b70ca2 298 #undef CYASSL_SMALL_STACK
wolfSSL 0:1239e9b70ca2 299 #define CYASSL_SMALL_STACK
wolfSSL 0:1239e9b70ca2 300 #undef TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 301 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 302 #endif
wolfSSL 0:1239e9b70ca2 303
wolfSSL 0:1239e9b70ca2 304 #ifdef FREESCALE_MQX
wolfSSL 0:1239e9b70ca2 305 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 306 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 307 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 308 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 309 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 310 #define USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 311 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 312 #define FREESCALE_K70_RNGA
wolfSSL 0:1239e9b70ca2 313 /* #define FREESCALE_K53_RNGB */
wolfSSL 0:1239e9b70ca2 314 #include "mqx.h"
wolfSSL 0:1239e9b70ca2 315 #ifndef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 316 #include "mfs.h"
wolfSSL 0:1239e9b70ca2 317 #include "fio.h"
wolfSSL 0:1239e9b70ca2 318 #endif
wolfSSL 0:1239e9b70ca2 319 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 320 #include "mutex.h"
wolfSSL 0:1239e9b70ca2 321 #endif
wolfSSL 0:1239e9b70ca2 322
wolfSSL 0:1239e9b70ca2 323 #define XMALLOC(s, h, type) (void *)_mem_alloc_system((s))
wolfSSL 0:1239e9b70ca2 324 #define XFREE(p, h, type) _mem_free(p)
wolfSSL 0:1239e9b70ca2 325 /* Note: MQX has no realloc, using fastmath above */
wolfSSL 0:1239e9b70ca2 326 #endif
wolfSSL 0:1239e9b70ca2 327
wolfSSL 0:1239e9b70ca2 328 #ifdef CYASSL_STM32F2
wolfSSL 0:1239e9b70ca2 329 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 330 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 331 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 332 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 333 #define STM32F2_RNG
wolfSSL 0:1239e9b70ca2 334 #define STM32F2_CRYPTO
wolfSSL 0:1239e9b70ca2 335 #define KEIL_INTRINSICS
wolfSSL 0:1239e9b70ca2 336 #endif
wolfSSL 0:1239e9b70ca2 337
wolfSSL 0:1239e9b70ca2 338 #ifdef MICRIUM
wolfSSL 0:1239e9b70ca2 339
wolfSSL 0:1239e9b70ca2 340 #include "stdlib.h"
wolfSSL 0:1239e9b70ca2 341 #include "net_cfg.h"
wolfSSL 0:1239e9b70ca2 342 #include "ssl_cfg.h"
wolfSSL 0:1239e9b70ca2 343 #include "net_secure_os.h"
wolfSSL 0:1239e9b70ca2 344
wolfSSL 0:1239e9b70ca2 345 #define CYASSL_TYPES
wolfSSL 0:1239e9b70ca2 346
wolfSSL 0:1239e9b70ca2 347 typedef CPU_INT08U byte;
wolfSSL 0:1239e9b70ca2 348 typedef CPU_INT16U word16;
wolfSSL 0:1239e9b70ca2 349 typedef CPU_INT32U word32;
wolfSSL 0:1239e9b70ca2 350
wolfSSL 0:1239e9b70ca2 351 #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
wolfSSL 0:1239e9b70ca2 352 #define SIZEOF_LONG 4
wolfSSL 0:1239e9b70ca2 353 #undef SIZEOF_LONG_LONG
wolfSSL 0:1239e9b70ca2 354 #else
wolfSSL 0:1239e9b70ca2 355 #undef SIZEOF_LONG
wolfSSL 0:1239e9b70ca2 356 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 357 #endif
wolfSSL 0:1239e9b70ca2 358
wolfSSL 0:1239e9b70ca2 359 #define STRING_USER
wolfSSL 0:1239e9b70ca2 360
wolfSSL 0:1239e9b70ca2 361 #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
wolfSSL 0:1239e9b70ca2 362 #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
wolfSSL 0:1239e9b70ca2 363 ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
wolfSSL 0:1239e9b70ca2 364 (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
wolfSSL 0:1239e9b70ca2 365 #define XSTRNCMP(pstr_1, pstr_2, len_max) \
wolfSSL 0:1239e9b70ca2 366 ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
wolfSSL 0:1239e9b70ca2 367 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
wolfSSL 0:1239e9b70ca2 368 #define XSTRSTR(pstr, pstr_srch) \
wolfSSL 0:1239e9b70ca2 369 ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
wolfSSL 0:1239e9b70ca2 370 (CPU_CHAR *)(pstr_srch)))
wolfSSL 0:1239e9b70ca2 371 #define XMEMSET(pmem, data_val, size) \
wolfSSL 0:1239e9b70ca2 372 ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
wolfSSL 0:1239e9b70ca2 373 (CPU_SIZE_T)(size)))
wolfSSL 0:1239e9b70ca2 374 #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
wolfSSL 0:1239e9b70ca2 375 (void *)(psrc), (CPU_SIZE_T)(size)))
wolfSSL 0:1239e9b70ca2 376 #define XMEMCMP(pmem_1, pmem_2, size) \
wolfSSL 0:1239e9b70ca2 377 (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
wolfSSL 0:1239e9b70ca2 378 (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
wolfSSL 0:1239e9b70ca2 379 #define XMEMMOVE XMEMCPY
wolfSSL 0:1239e9b70ca2 380
wolfSSL 0:1239e9b70ca2 381 #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 382 #define MICRIUM_MALLOC
wolfSSL 0:1239e9b70ca2 383 #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
wolfSSL 0:1239e9b70ca2 384 (CPU_SIZE_T)(s), (void *)0))
wolfSSL 0:1239e9b70ca2 385 #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
wolfSSL 0:1239e9b70ca2 386 (p), (void *)0))
wolfSSL 0:1239e9b70ca2 387 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 388 #endif
wolfSSL 0:1239e9b70ca2 389
wolfSSL 0:1239e9b70ca2 390 #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 391 #undef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 392 #else
wolfSSL 0:1239e9b70ca2 393 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 394 #endif
wolfSSL 0:1239e9b70ca2 395
wolfSSL 0:1239e9b70ca2 396 #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
wolfSSL 0:1239e9b70ca2 397 #define DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 398 #else
wolfSSL 0:1239e9b70ca2 399 #undef DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 400 #endif
wolfSSL 0:1239e9b70ca2 401
wolfSSL 0:1239e9b70ca2 402 #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 403 #define OPENSSL_EXTRA
wolfSSL 0:1239e9b70ca2 404 #else
wolfSSL 0:1239e9b70ca2 405 #undef OPENSSL_EXTRA
wolfSSL 0:1239e9b70ca2 406 #endif
wolfSSL 0:1239e9b70ca2 407
wolfSSL 0:1239e9b70ca2 408 #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 409 #undef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 410 #else
wolfSSL 0:1239e9b70ca2 411 #define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 412 #endif
wolfSSL 0:1239e9b70ca2 413
wolfSSL 0:1239e9b70ca2 414 #if (SSL_CFG_DH_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 415 #undef NO_DH
wolfSSL 0:1239e9b70ca2 416 #else
wolfSSL 0:1239e9b70ca2 417 #define NO_DH
wolfSSL 0:1239e9b70ca2 418 #endif
wolfSSL 0:1239e9b70ca2 419
wolfSSL 0:1239e9b70ca2 420 #if (SSL_CFG_DSA_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 421 #undef NO_DSA
wolfSSL 0:1239e9b70ca2 422 #else
wolfSSL 0:1239e9b70ca2 423 #define NO_DSA
wolfSSL 0:1239e9b70ca2 424 #endif
wolfSSL 0:1239e9b70ca2 425
wolfSSL 0:1239e9b70ca2 426 #if (SSL_CFG_PSK_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 427 #undef NO_PSK
wolfSSL 0:1239e9b70ca2 428 #else
wolfSSL 0:1239e9b70ca2 429 #define NO_PSK
wolfSSL 0:1239e9b70ca2 430 #endif
wolfSSL 0:1239e9b70ca2 431
wolfSSL 0:1239e9b70ca2 432 #if (SSL_CFG_3DES_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 433 #undef NO_DES
wolfSSL 0:1239e9b70ca2 434 #else
wolfSSL 0:1239e9b70ca2 435 #define NO_DES
wolfSSL 0:1239e9b70ca2 436 #endif
wolfSSL 0:1239e9b70ca2 437
wolfSSL 0:1239e9b70ca2 438 #if (SSL_CFG_AES_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 439 #undef NO_AES
wolfSSL 0:1239e9b70ca2 440 #else
wolfSSL 0:1239e9b70ca2 441 #define NO_AES
wolfSSL 0:1239e9b70ca2 442 #endif
wolfSSL 0:1239e9b70ca2 443
wolfSSL 0:1239e9b70ca2 444 #if (SSL_CFG_RC4_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 445 #undef NO_RC4
wolfSSL 0:1239e9b70ca2 446 #else
wolfSSL 0:1239e9b70ca2 447 #define NO_RC4
wolfSSL 0:1239e9b70ca2 448 #endif
wolfSSL 0:1239e9b70ca2 449
wolfSSL 0:1239e9b70ca2 450 #if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 451 #undef NO_RABBIT
wolfSSL 0:1239e9b70ca2 452 #else
wolfSSL 0:1239e9b70ca2 453 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 454 #endif
wolfSSL 0:1239e9b70ca2 455
wolfSSL 0:1239e9b70ca2 456 #if (SSL_CFG_HC128_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 457 #undef NO_HC128
wolfSSL 0:1239e9b70ca2 458 #else
wolfSSL 0:1239e9b70ca2 459 #define NO_HC128
wolfSSL 0:1239e9b70ca2 460 #endif
wolfSSL 0:1239e9b70ca2 461
wolfSSL 0:1239e9b70ca2 462 #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
wolfSSL 0:1239e9b70ca2 463 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 464 #else
wolfSSL 0:1239e9b70ca2 465 #undef BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 466 #define LITTLE_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 467 #endif
wolfSSL 0:1239e9b70ca2 468
wolfSSL 0:1239e9b70ca2 469 #if (SSL_CFG_MD4_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 470 #undef NO_MD4
wolfSSL 0:1239e9b70ca2 471 #else
wolfSSL 0:1239e9b70ca2 472 #define NO_MD4
wolfSSL 0:1239e9b70ca2 473 #endif
wolfSSL 0:1239e9b70ca2 474
wolfSSL 0:1239e9b70ca2 475 #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 476 #undef NO_WRITEV
wolfSSL 0:1239e9b70ca2 477 #else
wolfSSL 0:1239e9b70ca2 478 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 479 #endif
wolfSSL 0:1239e9b70ca2 480
wolfSSL 0:1239e9b70ca2 481 #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 482 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 483 #else
wolfSSL 0:1239e9b70ca2 484 #undef NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 485 #endif
wolfSSL 0:1239e9b70ca2 486
wolfSSL 0:1239e9b70ca2 487 #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 488 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 489 #else
wolfSSL 0:1239e9b70ca2 490 #undef CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 491 #endif
wolfSSL 0:1239e9b70ca2 492
wolfSSL 0:1239e9b70ca2 493 #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 494 #undef LARGE_STATIC_BUFFERS
wolfSSL 0:1239e9b70ca2 495 #undef STATIC_CHUNKS_ONLY
wolfSSL 0:1239e9b70ca2 496 #else
wolfSSL 0:1239e9b70ca2 497 #define LARGE_STATIC_BUFFERS
wolfSSL 0:1239e9b70ca2 498 #define STATIC_CHUNKS_ONLY
wolfSSL 0:1239e9b70ca2 499 #endif
wolfSSL 0:1239e9b70ca2 500
wolfSSL 0:1239e9b70ca2 501 #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 502 #define CYASSL_DER_LOAD
wolfSSL 0:1239e9b70ca2 503 #else
wolfSSL 0:1239e9b70ca2 504 #undef CYASSL_DER_LOAD
wolfSSL 0:1239e9b70ca2 505 #endif
wolfSSL 0:1239e9b70ca2 506
wolfSSL 0:1239e9b70ca2 507 #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 508 #define CYASSL_DTLS
wolfSSL 0:1239e9b70ca2 509 #else
wolfSSL 0:1239e9b70ca2 510 #undef CYASSL_DTLS
wolfSSL 0:1239e9b70ca2 511 #endif
wolfSSL 0:1239e9b70ca2 512
wolfSSL 0:1239e9b70ca2 513 #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 514 #define CYASSL_CALLBACKS
wolfSSL 0:1239e9b70ca2 515 #else
wolfSSL 0:1239e9b70ca2 516 #undef CYASSL_CALLBACKS
wolfSSL 0:1239e9b70ca2 517 #endif
wolfSSL 0:1239e9b70ca2 518
wolfSSL 0:1239e9b70ca2 519 #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 520 #define USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 521 #else
wolfSSL 0:1239e9b70ca2 522 #undef USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 523 #endif
wolfSSL 0:1239e9b70ca2 524
wolfSSL 0:1239e9b70ca2 525 #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 526 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 527 #else
wolfSSL 0:1239e9b70ca2 528 #undef TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 529 #endif
wolfSSL 0:1239e9b70ca2 530
wolfSSL 0:1239e9b70ca2 531 #endif /* MICRIUM */
wolfSSL 0:1239e9b70ca2 532
wolfSSL 0:1239e9b70ca2 533
wolfSSL 0:1239e9b70ca2 534 #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
wolfSSL 0:1239e9b70ca2 535 !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
wolfSSL 0:1239e9b70ca2 536 #define USE_CYASSL_MEMORY
wolfSSL 0:1239e9b70ca2 537 #endif
wolfSSL 0:1239e9b70ca2 538
wolfSSL 0:1239e9b70ca2 539
wolfSSL 0:1239e9b70ca2 540 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
wolfSSL 0:1239e9b70ca2 541 #undef KEEP_PEER_CERT
wolfSSL 0:1239e9b70ca2 542 #define KEEP_PEER_CERT
wolfSSL 0:1239e9b70ca2 543 #endif
wolfSSL 0:1239e9b70ca2 544
wolfSSL 0:1239e9b70ca2 545
wolfSSL 0:1239e9b70ca2 546 /* stream ciphers except arc4 need 32bit alignment, intel ok without */
wolfSSL 0:1239e9b70ca2 547 #ifndef XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 548 #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
wolfSSL 0:1239e9b70ca2 549 #define NO_XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 550 #else
wolfSSL 0:1239e9b70ca2 551 #define XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 552 #endif
wolfSSL 0:1239e9b70ca2 553 #endif
wolfSSL 0:1239e9b70ca2 554
wolfSSL 0:1239e9b70ca2 555
wolfSSL 0:1239e9b70ca2 556 /* if using hardware crypto and have alignment requirements, specify the
wolfSSL 0:1239e9b70ca2 557 requirement here. The record header of SSL/TLS will prvent easy alignment.
wolfSSL 0:1239e9b70ca2 558 This hint tries to help as much as possible. */
wolfSSL 0:1239e9b70ca2 559 #ifndef CYASSL_GENERAL_ALIGNMENT
wolfSSL 0:1239e9b70ca2 560 #ifdef CYASSL_AESNI
wolfSSL 0:1239e9b70ca2 561 #define CYASSL_GENERAL_ALIGNMENT 16
wolfSSL 0:1239e9b70ca2 562 #elif defined(XSTREAM_ALIGNMENT)
wolfSSL 0:1239e9b70ca2 563 #define CYASSL_GENERAL_ALIGNMENT 4
wolfSSL 0:1239e9b70ca2 564 #else
wolfSSL 0:1239e9b70ca2 565 #define CYASSL_GENERAL_ALIGNMENT 0
wolfSSL 0:1239e9b70ca2 566 #endif
wolfSSL 0:1239e9b70ca2 567 #endif
wolfSSL 0:1239e9b70ca2 568
wolfSSL 0:1239e9b70ca2 569 #ifdef HAVE_CRL
wolfSSL 0:1239e9b70ca2 570 /* not widely supported yet */
wolfSSL 0:1239e9b70ca2 571 #undef NO_SKID
wolfSSL 0:1239e9b70ca2 572 #define NO_SKID
wolfSSL 0:1239e9b70ca2 573 #endif
wolfSSL 0:1239e9b70ca2 574
wolfSSL 0:1239e9b70ca2 575 /* Place any other flags or defines here */
wolfSSL 0:1239e9b70ca2 576
wolfSSL 0:1239e9b70ca2 577
wolfSSL 0:1239e9b70ca2 578 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 579 } /* extern "C" */
wolfSSL 0:1239e9b70ca2 580 #endif
wolfSSL 0:1239e9b70ca2 581
wolfSSL 0:1239e9b70ca2 582
wolfSSL 0:1239e9b70ca2 583 #endif /* CTAO_CRYPT_SETTINGS_H */
wolfSSL 0:1239e9b70ca2 584