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