CyaSSL 3.0.0

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

Committer:
wolfSSL
Date:
Wed Dec 03 05:24:18 2014 +0000
Revision:
3:64d4f7cb83d5
Parent:
1:f01293e6e7b8
added IGNORE_KEY_EXTENSIONS

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 1:f01293e6e7b8 155 #define IGNORE_KEY_EXTENSIONS
wolfSSL 0:1239e9b70ca2 156 #define DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 157 #endif
wolfSSL 0:1239e9b70ca2 158
wolfSSL 0:1239e9b70ca2 159 #ifdef CYASSL_TYTO
wolfSSL 0:1239e9b70ca2 160 #define FREERTOS
wolfSSL 0:1239e9b70ca2 161 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 162 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 163 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 164 #endif
wolfSSL 0:1239e9b70ca2 165
wolfSSL 0:1239e9b70ca2 166 #ifdef FREERTOS_WINSIM
wolfSSL 0:1239e9b70ca2 167 #define FREERTOS
wolfSSL 0:1239e9b70ca2 168 #define USE_WINDOWS_API
wolfSSL 0:1239e9b70ca2 169 #endif
wolfSSL 0:1239e9b70ca2 170
wolfSSL 0:1239e9b70ca2 171
wolfSSL 0:1239e9b70ca2 172 /* Micrium will use Visual Studio for compilation but not the Win32 API */
wolfSSL 0:1239e9b70ca2 173 #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \
wolfSSL 0:1239e9b70ca2 174 && !defined(EBSNET)
wolfSSL 0:1239e9b70ca2 175 #define USE_WINDOWS_API
wolfSSL 0:1239e9b70ca2 176 #endif
wolfSSL 0:1239e9b70ca2 177
wolfSSL 0:1239e9b70ca2 178
wolfSSL 0:1239e9b70ca2 179 #if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER)
wolfSSL 0:1239e9b70ca2 180 #include <stdlib.h>
wolfSSL 0:1239e9b70ca2 181 #define XMALLOC(s, h, type) malloc((s))
wolfSSL 0:1239e9b70ca2 182 #define XFREE(p, h, type) free((p))
wolfSSL 0:1239e9b70ca2 183 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 184 #endif
wolfSSL 0:1239e9b70ca2 185
wolfSSL 0:1239e9b70ca2 186 #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
wolfSSL 0:1239e9b70ca2 187 #undef XMALLOC
wolfSSL 0:1239e9b70ca2 188 #define XMALLOC yaXMALLOC
wolfSSL 0:1239e9b70ca2 189 #undef XFREE
wolfSSL 0:1239e9b70ca2 190 #define XFREE yaXFREE
wolfSSL 0:1239e9b70ca2 191 #undef XREALLOC
wolfSSL 0:1239e9b70ca2 192 #define XREALLOC yaXREALLOC
wolfSSL 0:1239e9b70ca2 193 #endif
wolfSSL 0:1239e9b70ca2 194
wolfSSL 0:1239e9b70ca2 195
wolfSSL 0:1239e9b70ca2 196 #ifdef FREERTOS
wolfSSL 0:1239e9b70ca2 197 #ifndef NO_WRITEV
wolfSSL 0:1239e9b70ca2 198 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 199 #endif
wolfSSL 0:1239e9b70ca2 200 #ifndef NO_SHA512
wolfSSL 0:1239e9b70ca2 201 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 202 #endif
wolfSSL 0:1239e9b70ca2 203 #ifndef NO_DH
wolfSSL 0:1239e9b70ca2 204 #define NO_DH
wolfSSL 0:1239e9b70ca2 205 #endif
wolfSSL 0:1239e9b70ca2 206 #ifndef NO_DSA
wolfSSL 0:1239e9b70ca2 207 #define NO_DSA
wolfSSL 0:1239e9b70ca2 208 #endif
wolfSSL 0:1239e9b70ca2 209 #ifndef NO_HC128
wolfSSL 0:1239e9b70ca2 210 #define NO_HC128
wolfSSL 0:1239e9b70ca2 211 #endif
wolfSSL 0:1239e9b70ca2 212
wolfSSL 0:1239e9b70ca2 213 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 214 #include "FreeRTOS.h"
wolfSSL 0:1239e9b70ca2 215 #include "semphr.h"
wolfSSL 0:1239e9b70ca2 216 #endif
wolfSSL 0:1239e9b70ca2 217 #endif
wolfSSL 0:1239e9b70ca2 218
wolfSSL 0:1239e9b70ca2 219 #ifdef EBSNET
wolfSSL 0:1239e9b70ca2 220 #include "rtip.h"
wolfSSL 0:1239e9b70ca2 221
wolfSSL 0:1239e9b70ca2 222 /* #define DEBUG_CYASSL */
wolfSSL 0:1239e9b70ca2 223 #define NO_CYASSL_DIR /* tbd */
wolfSSL 0:1239e9b70ca2 224
wolfSSL 0:1239e9b70ca2 225 #if (POLLOS)
wolfSSL 0:1239e9b70ca2 226 #define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 227 #endif
wolfSSL 0:1239e9b70ca2 228
wolfSSL 0:1239e9b70ca2 229 #if (RTPLATFORM)
wolfSSL 0:1239e9b70ca2 230 #if (!RTP_LITTLE_ENDIAN)
wolfSSL 0:1239e9b70ca2 231 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 232 #endif
wolfSSL 0:1239e9b70ca2 233 #else
wolfSSL 0:1239e9b70ca2 234 #if (!KS_LITTLE_ENDIAN)
wolfSSL 0:1239e9b70ca2 235 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 236 #endif
wolfSSL 0:1239e9b70ca2 237 #endif
wolfSSL 0:1239e9b70ca2 238
wolfSSL 0:1239e9b70ca2 239 #if (WINMSP3)
wolfSSL 0:1239e9b70ca2 240 #undef SIZEOF_LONG
wolfSSL 0:1239e9b70ca2 241 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 242 #else
wolfSSL 0:1239e9b70ca2 243 #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
wolfSSL 0:1239e9b70ca2 244 #endif
wolfSSL 0:1239e9b70ca2 245
wolfSSL 0:1239e9b70ca2 246 #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
wolfSSL 0:1239e9b70ca2 247 #define XFREE(p, h, type) (rtp_free(p))
wolfSSL 0:1239e9b70ca2 248 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 249
wolfSSL 0:1239e9b70ca2 250 #endif /* EBSNET */
wolfSSL 0:1239e9b70ca2 251
wolfSSL 0:1239e9b70ca2 252 #ifdef CYASSL_GAME_BUILD
wolfSSL 0:1239e9b70ca2 253 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 254 #if defined(__PPU) || defined(__XENON)
wolfSSL 0:1239e9b70ca2 255 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 256 #endif
wolfSSL 0:1239e9b70ca2 257 #endif
wolfSSL 0:1239e9b70ca2 258
wolfSSL 0:1239e9b70ca2 259 #ifdef CYASSL_LSR
wolfSSL 0:1239e9b70ca2 260 #define HAVE_WEBSERVER
wolfSSL 0:1239e9b70ca2 261 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 262 #define CYASSL_LOW_MEMORY
wolfSSL 0:1239e9b70ca2 263 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 264 #define NO_SHA512
wolfSSL 0:1239e9b70ca2 265 #define NO_DH
wolfSSL 0:1239e9b70ca2 266 #define NO_DSA
wolfSSL 0:1239e9b70ca2 267 #define NO_HC128
wolfSSL 0:1239e9b70ca2 268 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 269 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 270 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 271 #ifndef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 272 #define LSR_FS
wolfSSL 0:1239e9b70ca2 273 #include "inc/hw_types.h"
wolfSSL 0:1239e9b70ca2 274 #include "fs.h"
wolfSSL 0:1239e9b70ca2 275 #endif
wolfSSL 0:1239e9b70ca2 276 #define CYASSL_LWIP
wolfSSL 0:1239e9b70ca2 277 #include <errno.h> /* for tcp errno */
wolfSSL 0:1239e9b70ca2 278 #define CYASSL_SAFERTOS
wolfSSL 0:1239e9b70ca2 279 #if defined(__IAR_SYSTEMS_ICC__)
wolfSSL 0:1239e9b70ca2 280 /* enum uses enum */
wolfSSL 0:1239e9b70ca2 281 #pragma diag_suppress=Pa089
wolfSSL 0:1239e9b70ca2 282 #endif
wolfSSL 0:1239e9b70ca2 283 #endif
wolfSSL 0:1239e9b70ca2 284
wolfSSL 0:1239e9b70ca2 285 #ifdef CYASSL_SAFERTOS
wolfSSL 0:1239e9b70ca2 286 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 287 #include "SafeRTOS/semphr.h"
wolfSSL 0:1239e9b70ca2 288 #endif
wolfSSL 0:1239e9b70ca2 289
wolfSSL 0:1239e9b70ca2 290 #include "SafeRTOS/heap.h"
wolfSSL 0:1239e9b70ca2 291 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 0:1239e9b70ca2 292 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 0:1239e9b70ca2 293 #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
wolfSSL 0:1239e9b70ca2 294 #endif
wolfSSL 0:1239e9b70ca2 295
wolfSSL 0:1239e9b70ca2 296 #ifdef CYASSL_LOW_MEMORY
wolfSSL 0:1239e9b70ca2 297 #undef RSA_LOW_MEM
wolfSSL 0:1239e9b70ca2 298 #define RSA_LOW_MEM
wolfSSL 0:1239e9b70ca2 299 #undef CYASSL_SMALL_STACK
wolfSSL 0:1239e9b70ca2 300 #define CYASSL_SMALL_STACK
wolfSSL 0:1239e9b70ca2 301 #undef TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 302 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 303 #endif
wolfSSL 0:1239e9b70ca2 304
wolfSSL 0:1239e9b70ca2 305 #ifdef FREESCALE_MQX
wolfSSL 0:1239e9b70ca2 306 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 307 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 308 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 309 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 310 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 311 #define USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 312 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 313 #define FREESCALE_K70_RNGA
wolfSSL 0:1239e9b70ca2 314 /* #define FREESCALE_K53_RNGB */
wolfSSL 0:1239e9b70ca2 315 #include "mqx.h"
wolfSSL 0:1239e9b70ca2 316 #ifndef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 317 #include "mfs.h"
wolfSSL 0:1239e9b70ca2 318 #include "fio.h"
wolfSSL 0:1239e9b70ca2 319 #endif
wolfSSL 0:1239e9b70ca2 320 #ifndef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 321 #include "mutex.h"
wolfSSL 0:1239e9b70ca2 322 #endif
wolfSSL 0:1239e9b70ca2 323
wolfSSL 0:1239e9b70ca2 324 #define XMALLOC(s, h, type) (void *)_mem_alloc_system((s))
wolfSSL 0:1239e9b70ca2 325 #define XFREE(p, h, type) _mem_free(p)
wolfSSL 0:1239e9b70ca2 326 /* Note: MQX has no realloc, using fastmath above */
wolfSSL 0:1239e9b70ca2 327 #endif
wolfSSL 0:1239e9b70ca2 328
wolfSSL 0:1239e9b70ca2 329 #ifdef CYASSL_STM32F2
wolfSSL 0:1239e9b70ca2 330 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 331 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 332 #define NO_CYASSL_DIR
wolfSSL 0:1239e9b70ca2 333 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 334 #define STM32F2_RNG
wolfSSL 0:1239e9b70ca2 335 #define STM32F2_CRYPTO
wolfSSL 0:1239e9b70ca2 336 #define KEIL_INTRINSICS
wolfSSL 0:1239e9b70ca2 337 #endif
wolfSSL 0:1239e9b70ca2 338
wolfSSL 0:1239e9b70ca2 339 #ifdef MICRIUM
wolfSSL 0:1239e9b70ca2 340
wolfSSL 0:1239e9b70ca2 341 #include "stdlib.h"
wolfSSL 0:1239e9b70ca2 342 #include "net_cfg.h"
wolfSSL 0:1239e9b70ca2 343 #include "ssl_cfg.h"
wolfSSL 0:1239e9b70ca2 344 #include "net_secure_os.h"
wolfSSL 0:1239e9b70ca2 345
wolfSSL 0:1239e9b70ca2 346 #define CYASSL_TYPES
wolfSSL 0:1239e9b70ca2 347
wolfSSL 0:1239e9b70ca2 348 typedef CPU_INT08U byte;
wolfSSL 0:1239e9b70ca2 349 typedef CPU_INT16U word16;
wolfSSL 0:1239e9b70ca2 350 typedef CPU_INT32U word32;
wolfSSL 0:1239e9b70ca2 351
wolfSSL 0:1239e9b70ca2 352 #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32)
wolfSSL 0:1239e9b70ca2 353 #define SIZEOF_LONG 4
wolfSSL 0:1239e9b70ca2 354 #undef SIZEOF_LONG_LONG
wolfSSL 0:1239e9b70ca2 355 #else
wolfSSL 0:1239e9b70ca2 356 #undef SIZEOF_LONG
wolfSSL 0:1239e9b70ca2 357 #define SIZEOF_LONG_LONG 8
wolfSSL 0:1239e9b70ca2 358 #endif
wolfSSL 0:1239e9b70ca2 359
wolfSSL 0:1239e9b70ca2 360 #define STRING_USER
wolfSSL 0:1239e9b70ca2 361
wolfSSL 0:1239e9b70ca2 362 #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
wolfSSL 0:1239e9b70ca2 363 #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
wolfSSL 0:1239e9b70ca2 364 ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
wolfSSL 0:1239e9b70ca2 365 (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
wolfSSL 0:1239e9b70ca2 366 #define XSTRNCMP(pstr_1, pstr_2, len_max) \
wolfSSL 0:1239e9b70ca2 367 ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
wolfSSL 0:1239e9b70ca2 368 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
wolfSSL 0:1239e9b70ca2 369 #define XSTRSTR(pstr, pstr_srch) \
wolfSSL 0:1239e9b70ca2 370 ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
wolfSSL 0:1239e9b70ca2 371 (CPU_CHAR *)(pstr_srch)))
wolfSSL 0:1239e9b70ca2 372 #define XMEMSET(pmem, data_val, size) \
wolfSSL 0:1239e9b70ca2 373 ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
wolfSSL 0:1239e9b70ca2 374 (CPU_SIZE_T)(size)))
wolfSSL 0:1239e9b70ca2 375 #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
wolfSSL 0:1239e9b70ca2 376 (void *)(psrc), (CPU_SIZE_T)(size)))
wolfSSL 0:1239e9b70ca2 377 #define XMEMCMP(pmem_1, pmem_2, size) \
wolfSSL 0:1239e9b70ca2 378 (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
wolfSSL 0:1239e9b70ca2 379 (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
wolfSSL 0:1239e9b70ca2 380 #define XMEMMOVE XMEMCPY
wolfSSL 0:1239e9b70ca2 381
wolfSSL 0:1239e9b70ca2 382 #if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 383 #define MICRIUM_MALLOC
wolfSSL 0:1239e9b70ca2 384 #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \
wolfSSL 0:1239e9b70ca2 385 (CPU_SIZE_T)(s), (void *)0))
wolfSSL 0:1239e9b70ca2 386 #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \
wolfSSL 0:1239e9b70ca2 387 (p), (void *)0))
wolfSSL 0:1239e9b70ca2 388 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 0:1239e9b70ca2 389 #endif
wolfSSL 0:1239e9b70ca2 390
wolfSSL 0:1239e9b70ca2 391 #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 392 #undef NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 393 #else
wolfSSL 0:1239e9b70ca2 394 #define NO_FILESYSTEM
wolfSSL 0:1239e9b70ca2 395 #endif
wolfSSL 0:1239e9b70ca2 396
wolfSSL 0:1239e9b70ca2 397 #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG)
wolfSSL 0:1239e9b70ca2 398 #define DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 399 #else
wolfSSL 0:1239e9b70ca2 400 #undef DEBUG_CYASSL
wolfSSL 0:1239e9b70ca2 401 #endif
wolfSSL 0:1239e9b70ca2 402
wolfSSL 0:1239e9b70ca2 403 #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 404 #define OPENSSL_EXTRA
wolfSSL 0:1239e9b70ca2 405 #else
wolfSSL 0:1239e9b70ca2 406 #undef OPENSSL_EXTRA
wolfSSL 0:1239e9b70ca2 407 #endif
wolfSSL 0:1239e9b70ca2 408
wolfSSL 0:1239e9b70ca2 409 #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 410 #undef SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 411 #else
wolfSSL 0:1239e9b70ca2 412 #define SINGLE_THREADED
wolfSSL 0:1239e9b70ca2 413 #endif
wolfSSL 0:1239e9b70ca2 414
wolfSSL 0:1239e9b70ca2 415 #if (SSL_CFG_DH_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 416 #undef NO_DH
wolfSSL 0:1239e9b70ca2 417 #else
wolfSSL 0:1239e9b70ca2 418 #define NO_DH
wolfSSL 0:1239e9b70ca2 419 #endif
wolfSSL 0:1239e9b70ca2 420
wolfSSL 0:1239e9b70ca2 421 #if (SSL_CFG_DSA_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 422 #undef NO_DSA
wolfSSL 0:1239e9b70ca2 423 #else
wolfSSL 0:1239e9b70ca2 424 #define NO_DSA
wolfSSL 0:1239e9b70ca2 425 #endif
wolfSSL 0:1239e9b70ca2 426
wolfSSL 0:1239e9b70ca2 427 #if (SSL_CFG_PSK_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 428 #undef NO_PSK
wolfSSL 0:1239e9b70ca2 429 #else
wolfSSL 0:1239e9b70ca2 430 #define NO_PSK
wolfSSL 0:1239e9b70ca2 431 #endif
wolfSSL 0:1239e9b70ca2 432
wolfSSL 0:1239e9b70ca2 433 #if (SSL_CFG_3DES_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 434 #undef NO_DES
wolfSSL 0:1239e9b70ca2 435 #else
wolfSSL 0:1239e9b70ca2 436 #define NO_DES
wolfSSL 0:1239e9b70ca2 437 #endif
wolfSSL 0:1239e9b70ca2 438
wolfSSL 0:1239e9b70ca2 439 #if (SSL_CFG_AES_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 440 #undef NO_AES
wolfSSL 0:1239e9b70ca2 441 #else
wolfSSL 0:1239e9b70ca2 442 #define NO_AES
wolfSSL 0:1239e9b70ca2 443 #endif
wolfSSL 0:1239e9b70ca2 444
wolfSSL 0:1239e9b70ca2 445 #if (SSL_CFG_RC4_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 446 #undef NO_RC4
wolfSSL 0:1239e9b70ca2 447 #else
wolfSSL 0:1239e9b70ca2 448 #define NO_RC4
wolfSSL 0:1239e9b70ca2 449 #endif
wolfSSL 0:1239e9b70ca2 450
wolfSSL 0:1239e9b70ca2 451 #if (SSL_CFG_RABBIT_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 452 #undef NO_RABBIT
wolfSSL 0:1239e9b70ca2 453 #else
wolfSSL 0:1239e9b70ca2 454 #define NO_RABBIT
wolfSSL 0:1239e9b70ca2 455 #endif
wolfSSL 0:1239e9b70ca2 456
wolfSSL 0:1239e9b70ca2 457 #if (SSL_CFG_HC128_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 458 #undef NO_HC128
wolfSSL 0:1239e9b70ca2 459 #else
wolfSSL 0:1239e9b70ca2 460 #define NO_HC128
wolfSSL 0:1239e9b70ca2 461 #endif
wolfSSL 0:1239e9b70ca2 462
wolfSSL 0:1239e9b70ca2 463 #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
wolfSSL 0:1239e9b70ca2 464 #define BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 465 #else
wolfSSL 0:1239e9b70ca2 466 #undef BIG_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 467 #define LITTLE_ENDIAN_ORDER
wolfSSL 0:1239e9b70ca2 468 #endif
wolfSSL 0:1239e9b70ca2 469
wolfSSL 0:1239e9b70ca2 470 #if (SSL_CFG_MD4_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 471 #undef NO_MD4
wolfSSL 0:1239e9b70ca2 472 #else
wolfSSL 0:1239e9b70ca2 473 #define NO_MD4
wolfSSL 0:1239e9b70ca2 474 #endif
wolfSSL 0:1239e9b70ca2 475
wolfSSL 0:1239e9b70ca2 476 #if (SSL_CFG_WRITEV_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 477 #undef NO_WRITEV
wolfSSL 0:1239e9b70ca2 478 #else
wolfSSL 0:1239e9b70ca2 479 #define NO_WRITEV
wolfSSL 0:1239e9b70ca2 480 #endif
wolfSSL 0:1239e9b70ca2 481
wolfSSL 0:1239e9b70ca2 482 #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 483 #define NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 484 #else
wolfSSL 0:1239e9b70ca2 485 #undef NO_DEV_RANDOM
wolfSSL 0:1239e9b70ca2 486 #endif
wolfSSL 0:1239e9b70ca2 487
wolfSSL 0:1239e9b70ca2 488 #if (SSL_CFG_USER_IO_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 489 #define CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 490 #else
wolfSSL 0:1239e9b70ca2 491 #undef CYASSL_USER_IO
wolfSSL 0:1239e9b70ca2 492 #endif
wolfSSL 0:1239e9b70ca2 493
wolfSSL 0:1239e9b70ca2 494 #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 495 #undef LARGE_STATIC_BUFFERS
wolfSSL 0:1239e9b70ca2 496 #undef STATIC_CHUNKS_ONLY
wolfSSL 0:1239e9b70ca2 497 #else
wolfSSL 0:1239e9b70ca2 498 #define LARGE_STATIC_BUFFERS
wolfSSL 0:1239e9b70ca2 499 #define STATIC_CHUNKS_ONLY
wolfSSL 0:1239e9b70ca2 500 #endif
wolfSSL 0:1239e9b70ca2 501
wolfSSL 0:1239e9b70ca2 502 #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 503 #define CYASSL_DER_LOAD
wolfSSL 0:1239e9b70ca2 504 #else
wolfSSL 0:1239e9b70ca2 505 #undef CYASSL_DER_LOAD
wolfSSL 0:1239e9b70ca2 506 #endif
wolfSSL 0:1239e9b70ca2 507
wolfSSL 0:1239e9b70ca2 508 #if (SSL_CFG_DTLS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 509 #define CYASSL_DTLS
wolfSSL 0:1239e9b70ca2 510 #else
wolfSSL 0:1239e9b70ca2 511 #undef CYASSL_DTLS
wolfSSL 0:1239e9b70ca2 512 #endif
wolfSSL 0:1239e9b70ca2 513
wolfSSL 0:1239e9b70ca2 514 #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 515 #define CYASSL_CALLBACKS
wolfSSL 0:1239e9b70ca2 516 #else
wolfSSL 0:1239e9b70ca2 517 #undef CYASSL_CALLBACKS
wolfSSL 0:1239e9b70ca2 518 #endif
wolfSSL 0:1239e9b70ca2 519
wolfSSL 0:1239e9b70ca2 520 #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 521 #define USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 522 #else
wolfSSL 0:1239e9b70ca2 523 #undef USE_FAST_MATH
wolfSSL 0:1239e9b70ca2 524 #endif
wolfSSL 0:1239e9b70ca2 525
wolfSSL 0:1239e9b70ca2 526 #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED)
wolfSSL 0:1239e9b70ca2 527 #define TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 528 #else
wolfSSL 0:1239e9b70ca2 529 #undef TFM_TIMING_RESISTANT
wolfSSL 0:1239e9b70ca2 530 #endif
wolfSSL 0:1239e9b70ca2 531
wolfSSL 0:1239e9b70ca2 532 #endif /* MICRIUM */
wolfSSL 0:1239e9b70ca2 533
wolfSSL 0:1239e9b70ca2 534
wolfSSL 0:1239e9b70ca2 535 #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
wolfSSL 0:1239e9b70ca2 536 !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY)
wolfSSL 0:1239e9b70ca2 537 #define USE_CYASSL_MEMORY
wolfSSL 0:1239e9b70ca2 538 #endif
wolfSSL 0:1239e9b70ca2 539
wolfSSL 0:1239e9b70ca2 540
wolfSSL 0:1239e9b70ca2 541 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
wolfSSL 0:1239e9b70ca2 542 #undef KEEP_PEER_CERT
wolfSSL 0:1239e9b70ca2 543 #define KEEP_PEER_CERT
wolfSSL 0:1239e9b70ca2 544 #endif
wolfSSL 0:1239e9b70ca2 545
wolfSSL 0:1239e9b70ca2 546
wolfSSL 0:1239e9b70ca2 547 /* stream ciphers except arc4 need 32bit alignment, intel ok without */
wolfSSL 0:1239e9b70ca2 548 #ifndef XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 549 #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
wolfSSL 0:1239e9b70ca2 550 #define NO_XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 551 #else
wolfSSL 0:1239e9b70ca2 552 #define XSTREAM_ALIGNMENT
wolfSSL 0:1239e9b70ca2 553 #endif
wolfSSL 0:1239e9b70ca2 554 #endif
wolfSSL 0:1239e9b70ca2 555
wolfSSL 0:1239e9b70ca2 556
wolfSSL 0:1239e9b70ca2 557 /* if using hardware crypto and have alignment requirements, specify the
wolfSSL 0:1239e9b70ca2 558 requirement here. The record header of SSL/TLS will prvent easy alignment.
wolfSSL 0:1239e9b70ca2 559 This hint tries to help as much as possible. */
wolfSSL 0:1239e9b70ca2 560 #ifndef CYASSL_GENERAL_ALIGNMENT
wolfSSL 0:1239e9b70ca2 561 #ifdef CYASSL_AESNI
wolfSSL 0:1239e9b70ca2 562 #define CYASSL_GENERAL_ALIGNMENT 16
wolfSSL 0:1239e9b70ca2 563 #elif defined(XSTREAM_ALIGNMENT)
wolfSSL 0:1239e9b70ca2 564 #define CYASSL_GENERAL_ALIGNMENT 4
wolfSSL 0:1239e9b70ca2 565 #else
wolfSSL 0:1239e9b70ca2 566 #define CYASSL_GENERAL_ALIGNMENT 0
wolfSSL 0:1239e9b70ca2 567 #endif
wolfSSL 0:1239e9b70ca2 568 #endif
wolfSSL 0:1239e9b70ca2 569
wolfSSL 0:1239e9b70ca2 570 #ifdef HAVE_CRL
wolfSSL 0:1239e9b70ca2 571 /* not widely supported yet */
wolfSSL 0:1239e9b70ca2 572 #undef NO_SKID
wolfSSL 0:1239e9b70ca2 573 #define NO_SKID
wolfSSL 0:1239e9b70ca2 574 #endif
wolfSSL 0:1239e9b70ca2 575
wolfSSL 0:1239e9b70ca2 576 /* Place any other flags or defines here */
wolfSSL 0:1239e9b70ca2 577
wolfSSL 0:1239e9b70ca2 578
wolfSSL 0:1239e9b70ca2 579 #ifdef __cplusplus
wolfSSL 0:1239e9b70ca2 580 } /* extern "C" */
wolfSSL 0:1239e9b70ca2 581 #endif
wolfSSL 0:1239e9b70ca2 582
wolfSSL 0:1239e9b70ca2 583
wolfSSL 0:1239e9b70ca2 584 #endif /* CTAO_CRYPT_SETTINGS_H */
wolfSSL 0:1239e9b70ca2 585