Fork of CyaSSL for my specific settings

Dependents:   CyaSSL_Example

Fork of CyaSSL by wolf SSL

Committer:
d0773d
Date:
Tue Mar 03 22:52:52 2015 +0000
Revision:
4:28ac50e1d49c
Parent:
1:f01293e6e7b8
CyaSSL example

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