Xuyi Wang / wolfSSL

Dependents:   OS

Committer:
sPymbed
Date:
Tue Nov 19 14:32:16 2019 +0000
Revision:
16:048e5e270a58
Parent:
14:167253f4e170
working ssl

Who changed what in which revision?

UserRevisionLine numberNew contents of line
wolfSSL 9:52ec7c02b1e1 1 /* settings.h
wolfSSL 9:52ec7c02b1e1 2 *
wolfSSL 14:167253f4e170 3 * Copyright (C) 2006-2017 wolfSSL Inc.
wolfSSL 9:52ec7c02b1e1 4 *
wolfSSL 9:52ec7c02b1e1 5 * This file is part of wolfSSL.
wolfSSL 9:52ec7c02b1e1 6 *
wolfSSL 9:52ec7c02b1e1 7 * wolfSSL is free software; you can redistribute it and/or modify
wolfSSL 9:52ec7c02b1e1 8 * it under the terms of the GNU General Public License as published by
wolfSSL 9:52ec7c02b1e1 9 * the Free Software Foundation; either version 2 of the License, or
wolfSSL 9:52ec7c02b1e1 10 * (at your option) any later version.
wolfSSL 9:52ec7c02b1e1 11 *
wolfSSL 9:52ec7c02b1e1 12 * wolfSSL is distributed in the hope that it will be useful,
wolfSSL 9:52ec7c02b1e1 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
wolfSSL 9:52ec7c02b1e1 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
wolfSSL 9:52ec7c02b1e1 15 * GNU General Public License for more details.
wolfSSL 9:52ec7c02b1e1 16 *
wolfSSL 9:52ec7c02b1e1 17 * You should have received a copy of the GNU General Public License
wolfSSL 9:52ec7c02b1e1 18 * along with this program; if not, write to the Free Software
wolfSSL 9:52ec7c02b1e1 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
wolfSSL 9:52ec7c02b1e1 20 */
wolfSSL 9:52ec7c02b1e1 21
wolfSSL 9:52ec7c02b1e1 22
wolfSSL 9:52ec7c02b1e1 23 /* Place OS specific preprocessor flags, defines, includes here, will be
wolfSSL 9:52ec7c02b1e1 24 included into every file because types.h includes it */
wolfSSL 9:52ec7c02b1e1 25
wolfSSL 9:52ec7c02b1e1 26
wolfSSL 9:52ec7c02b1e1 27 #ifndef WOLF_CRYPT_SETTINGS_H
wolfSSL 9:52ec7c02b1e1 28 #define WOLF_CRYPT_SETTINGS_H
wolfSSL 9:52ec7c02b1e1 29
wolfSSL 9:52ec7c02b1e1 30 #ifdef __cplusplus
wolfSSL 9:52ec7c02b1e1 31 extern "C" {
wolfSSL 9:52ec7c02b1e1 32 #endif
wolfSSL 9:52ec7c02b1e1 33
wolfSSL 9:52ec7c02b1e1 34 /* Uncomment next line if using IPHONE */
wolfSSL 9:52ec7c02b1e1 35 /* #define IPHONE */
wolfSSL 9:52ec7c02b1e1 36
wolfSSL 9:52ec7c02b1e1 37 /* Uncomment next line if using ThreadX */
wolfSSL 9:52ec7c02b1e1 38 /* #define THREADX */
wolfSSL 9:52ec7c02b1e1 39
wolfSSL 14:167253f4e170 40 /* Uncomment next line if using Micrium uC/OS-III */
wolfSSL 9:52ec7c02b1e1 41 /* #define MICRIUM */
wolfSSL 9:52ec7c02b1e1 42
wolfSSL 9:52ec7c02b1e1 43 /* Uncomment next line if using Mbed */
wolfSSL 9:52ec7c02b1e1 44 /* #define MBED */
wolfSSL 9:52ec7c02b1e1 45
wolfSSL 9:52ec7c02b1e1 46 /* Uncomment next line if using Microchip PIC32 ethernet starter kit */
wolfSSL 9:52ec7c02b1e1 47 /* #define MICROCHIP_PIC32 */
wolfSSL 9:52ec7c02b1e1 48
wolfSSL 9:52ec7c02b1e1 49 /* Uncomment next line if using Microchip TCP/IP stack, version 5 */
wolfSSL 9:52ec7c02b1e1 50 /* #define MICROCHIP_TCPIP_V5 */
wolfSSL 9:52ec7c02b1e1 51
wolfSSL 9:52ec7c02b1e1 52 /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */
wolfSSL 9:52ec7c02b1e1 53 /* #define MICROCHIP_TCPIP */
wolfSSL 9:52ec7c02b1e1 54
wolfSSL 9:52ec7c02b1e1 55 /* Uncomment next line if using PIC32MZ Crypto Engine */
wolfSSL 9:52ec7c02b1e1 56 /* #define WOLFSSL_MICROCHIP_PIC32MZ */
wolfSSL 9:52ec7c02b1e1 57
wolfSSL 9:52ec7c02b1e1 58 /* Uncomment next line if using FreeRTOS */
wolfSSL 9:52ec7c02b1e1 59 /* #define FREERTOS */
wolfSSL 9:52ec7c02b1e1 60
wolfSSL 9:52ec7c02b1e1 61 /* Uncomment next line if using FreeRTOS+ TCP */
wolfSSL 9:52ec7c02b1e1 62 /* #define FREERTOS_TCP */
wolfSSL 9:52ec7c02b1e1 63
wolfSSL 9:52ec7c02b1e1 64 /* Uncomment next line if using FreeRTOS Windows Simulator */
wolfSSL 9:52ec7c02b1e1 65 /* #define FREERTOS_WINSIM */
wolfSSL 9:52ec7c02b1e1 66
wolfSSL 9:52ec7c02b1e1 67 /* Uncomment next line if using RTIP */
wolfSSL 9:52ec7c02b1e1 68 /* #define EBSNET */
wolfSSL 9:52ec7c02b1e1 69
wolfSSL 9:52ec7c02b1e1 70 /* Uncomment next line if using lwip */
wolfSSL 9:52ec7c02b1e1 71 /* #define WOLFSSL_LWIP */
wolfSSL 9:52ec7c02b1e1 72
wolfSSL 9:52ec7c02b1e1 73 /* Uncomment next line if building wolfSSL for a game console */
wolfSSL 9:52ec7c02b1e1 74 /* #define WOLFSSL_GAME_BUILD */
wolfSSL 9:52ec7c02b1e1 75
wolfSSL 9:52ec7c02b1e1 76 /* Uncomment next line if building wolfSSL for LSR */
wolfSSL 9:52ec7c02b1e1 77 /* #define WOLFSSL_LSR */
wolfSSL 9:52ec7c02b1e1 78
wolfSSL 14:167253f4e170 79 /* Uncomment next line if building for Freescale Classic MQX version 4.0 */
wolfSSL 14:167253f4e170 80 /* #define FREESCALE_MQX_4_0 */
wolfSSL 14:167253f4e170 81
wolfSSL 9:52ec7c02b1e1 82 /* Uncomment next line if building for Freescale Classic MQX/RTCS/MFS */
wolfSSL 9:52ec7c02b1e1 83 /* #define FREESCALE_MQX */
wolfSSL 9:52ec7c02b1e1 84
wolfSSL 9:52ec7c02b1e1 85 /* Uncomment next line if building for Freescale KSDK MQX/RTCS/MFS */
wolfSSL 9:52ec7c02b1e1 86 /* #define FREESCALE_KSDK_MQX */
wolfSSL 9:52ec7c02b1e1 87
wolfSSL 9:52ec7c02b1e1 88 /* Uncomment next line if building for Freescale KSDK Bare Metal */
wolfSSL 9:52ec7c02b1e1 89 /* #define FREESCALE_KSDK_BM */
wolfSSL 9:52ec7c02b1e1 90
wolfSSL 14:167253f4e170 91 /* Uncomment next line if building for Freescale KSDK FreeRTOS, */
wolfSSL 14:167253f4e170 92 /* (old name FREESCALE_FREE_RTOS) */
wolfSSL 9:52ec7c02b1e1 93 /* #define FREESCALE_KSDK_FREERTOS */
wolfSSL 9:52ec7c02b1e1 94
wolfSSL 9:52ec7c02b1e1 95 /* Uncomment next line if using STM32F2 */
wolfSSL 9:52ec7c02b1e1 96 /* #define WOLFSSL_STM32F2 */
wolfSSL 9:52ec7c02b1e1 97
wolfSSL 14:167253f4e170 98 /* Uncomment next line if using STM32F4 */
wolfSSL 14:167253f4e170 99 /* #define WOLFSSL_STM32F4 */
wolfSSL 14:167253f4e170 100
wolfSSL 14:167253f4e170 101 /* Uncomment next line if using STM32F7 */
wolfSSL 14:167253f4e170 102 /* #define WOLFSSL_STM32F7 */
wolfSSL 14:167253f4e170 103
wolfSSL 9:52ec7c02b1e1 104 /* Uncomment next line if using QL SEP settings */
wolfSSL 9:52ec7c02b1e1 105 /* #define WOLFSSL_QL */
wolfSSL 9:52ec7c02b1e1 106
wolfSSL 9:52ec7c02b1e1 107 /* Uncomment next line if building for EROAD */
wolfSSL 9:52ec7c02b1e1 108 /* #define WOLFSSL_EROAD */
wolfSSL 9:52ec7c02b1e1 109
wolfSSL 9:52ec7c02b1e1 110 /* Uncomment next line if building for IAR EWARM */
wolfSSL 9:52ec7c02b1e1 111 /* #define WOLFSSL_IAR_ARM */
wolfSSL 9:52ec7c02b1e1 112
wolfSSL 9:52ec7c02b1e1 113 /* Uncomment next line if building for Rowley CrossWorks ARM */
wolfSSL 9:52ec7c02b1e1 114 /* #define WOLFSSL_ROWLEY_ARM */
wolfSSL 9:52ec7c02b1e1 115
wolfSSL 9:52ec7c02b1e1 116 /* Uncomment next line if using TI-RTOS settings */
wolfSSL 9:52ec7c02b1e1 117 /* #define WOLFSSL_TIRTOS */
wolfSSL 9:52ec7c02b1e1 118
wolfSSL 9:52ec7c02b1e1 119 /* Uncomment next line if building with PicoTCP */
wolfSSL 9:52ec7c02b1e1 120 /* #define WOLFSSL_PICOTCP */
wolfSSL 9:52ec7c02b1e1 121
wolfSSL 9:52ec7c02b1e1 122 /* Uncomment next line if building for PicoTCP demo bundle */
wolfSSL 9:52ec7c02b1e1 123 /* #define WOLFSSL_PICOTCP_DEMO */
wolfSSL 9:52ec7c02b1e1 124
wolfSSL 9:52ec7c02b1e1 125 /* Uncomment next line if building for uITRON4 */
wolfSSL 9:52ec7c02b1e1 126 /* #define WOLFSSL_uITRON4 */
wolfSSL 9:52ec7c02b1e1 127
wolfSSL 9:52ec7c02b1e1 128 /* Uncomment next line if building for uT-Kernel */
wolfSSL 9:52ec7c02b1e1 129 /* #define WOLFSSL_uTKERNEL2 */
wolfSSL 9:52ec7c02b1e1 130
wolfSSL 9:52ec7c02b1e1 131 /* Uncomment next line if using Max Strength build */
wolfSSL 9:52ec7c02b1e1 132 /* #define WOLFSSL_MAX_STRENGTH */
wolfSSL 9:52ec7c02b1e1 133
wolfSSL 9:52ec7c02b1e1 134 /* Uncomment next line if building for VxWorks */
wolfSSL 9:52ec7c02b1e1 135 /* #define WOLFSSL_VXWORKS */
wolfSSL 9:52ec7c02b1e1 136
wolfSSL 9:52ec7c02b1e1 137 /* Uncomment next line if building for Nordic nRF5x platofrm */
wolfSSL 9:52ec7c02b1e1 138 /* #define WOLFSSL_NRF5x */
wolfSSL 9:52ec7c02b1e1 139
wolfSSL 9:52ec7c02b1e1 140 /* Uncomment next line to enable deprecated less secure static DH suites */
wolfSSL 9:52ec7c02b1e1 141 /* #define WOLFSSL_STATIC_DH */
wolfSSL 9:52ec7c02b1e1 142
wolfSSL 9:52ec7c02b1e1 143 /* Uncomment next line to enable deprecated less secure static RSA suites */
wolfSSL 9:52ec7c02b1e1 144 /* #define WOLFSSL_STATIC_RSA */
wolfSSL 9:52ec7c02b1e1 145
wolfSSL 9:52ec7c02b1e1 146 /* Uncomment next line if building for ARDUINO */
wolfSSL 9:52ec7c02b1e1 147 /* Uncomment both lines if building for ARDUINO on INTEL_GALILEO */
wolfSSL 9:52ec7c02b1e1 148 /* #define WOLFSSL_ARDUINO */
wolfSSL 9:52ec7c02b1e1 149 /* #define INTEL_GALILEO */
wolfSSL 9:52ec7c02b1e1 150
wolfSSL 9:52ec7c02b1e1 151 /* Uncomment next line to enable asynchronous crypto WC_PENDING_E */
wolfSSL 9:52ec7c02b1e1 152 /* #define WOLFSSL_ASYNC_CRYPT */
wolfSSL 9:52ec7c02b1e1 153
wolfSSL 9:52ec7c02b1e1 154 /* Uncomment next line if building for uTasker */
wolfSSL 9:52ec7c02b1e1 155 /* #define WOLFSSL_UTASKER */
wolfSSL 9:52ec7c02b1e1 156
wolfSSL 9:52ec7c02b1e1 157 /* Uncomment next line if building for embOS */
wolfSSL 9:52ec7c02b1e1 158 /* #define WOLFSSL_EMBOS */
wolfSSL 9:52ec7c02b1e1 159
wolfSSL 9:52ec7c02b1e1 160 /* Uncomment next line if building for RIOT-OS */
wolfSSL 9:52ec7c02b1e1 161 /* #define WOLFSSL_RIOT_OS */
wolfSSL 9:52ec7c02b1e1 162
wolfSSL 12:1a06964c2adb 163 /* Uncomment next line if building for using XILINX hardened crypto */
wolfSSL 12:1a06964c2adb 164 /* #define WOLFSSL_XILINX_CRYPT */
wolfSSL 12:1a06964c2adb 165
wolfSSL 12:1a06964c2adb 166 /* Uncomment next line if building for using XILINX */
wolfSSL 12:1a06964c2adb 167 /* #define WOLFSSL_XILINX */
wolfSSL 12:1a06964c2adb 168
wolfSSL 14:167253f4e170 169 /* Uncomment next line if building for Nucleus 1.2 */
wolfSSL 14:167253f4e170 170 /* #define WOLFSSL_NUCLEUS_1_2 */
wolfSSL 14:167253f4e170 171
wolfSSL 9:52ec7c02b1e1 172 #include <wolfssl/wolfcrypt/visibility.h>
wolfSSL 9:52ec7c02b1e1 173 #define WOLFSSL_USER_SETTINGS
wolfSSL 9:52ec7c02b1e1 174 #ifdef WOLFSSL_USER_SETTINGS
wolfSSL 12:1a06964c2adb 175 #include "user_settings.h"
wolfSSL 9:52ec7c02b1e1 176 #endif
wolfSSL 9:52ec7c02b1e1 177
wolfSSL 9:52ec7c02b1e1 178
wolfSSL 9:52ec7c02b1e1 179 /* make sure old RNG name is used with CTaoCrypt FIPS */
wolfSSL 9:52ec7c02b1e1 180 #ifdef HAVE_FIPS
wolfSSL 9:52ec7c02b1e1 181 #define WC_RNG RNG
wolfSSL 9:52ec7c02b1e1 182 /* blinding adds API not available yet in FIPS mode */
wolfSSL 9:52ec7c02b1e1 183 #undef WC_RSA_BLINDING
wolfSSL 9:52ec7c02b1e1 184 #endif
wolfSSL 9:52ec7c02b1e1 185
wolfSSL 9:52ec7c02b1e1 186
wolfSSL 14:167253f4e170 187 #if defined(_WIN32) && !defined(_M_X64) && \
wolfSSL 14:167253f4e170 188 defined(HAVE_AESGCM) && defined(WOLFSSL_AESNI)
wolfSSL 14:167253f4e170 189
wolfSSL 14:167253f4e170 190 /* The _M_X64 macro is what's used in the headers for MSC to tell if it
wolfSSL 14:167253f4e170 191 * has the 64-bit versions of the 128-bit integers available. If one is
wolfSSL 14:167253f4e170 192 * building on 32-bit Windows with AES-NI, turn off the AES-GCMloop
wolfSSL 14:167253f4e170 193 * unrolling. */
wolfSSL 14:167253f4e170 194
wolfSSL 14:167253f4e170 195 #define AES_GCM_AESNI_NO_UNROLL
wolfSSL 14:167253f4e170 196 #endif
wolfSSL 14:167253f4e170 197
wolfSSL 9:52ec7c02b1e1 198 #ifdef IPHONE
wolfSSL 9:52ec7c02b1e1 199 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 200 #endif
wolfSSL 9:52ec7c02b1e1 201
wolfSSL 9:52ec7c02b1e1 202 #ifdef THREADX
wolfSSL 9:52ec7c02b1e1 203 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 204 #endif
wolfSSL 9:52ec7c02b1e1 205
wolfSSL 9:52ec7c02b1e1 206 #ifdef HAVE_NETX
wolfSSL 12:1a06964c2adb 207 #ifdef NEED_THREADX_TYPES
wolfSSL 12:1a06964c2adb 208 #include <types.h>
wolfSSL 12:1a06964c2adb 209 #endif
wolfSSL 12:1a06964c2adb 210 #include <nx_api.h>
wolfSSL 9:52ec7c02b1e1 211 #endif
wolfSSL 9:52ec7c02b1e1 212
wolfSSL 9:52ec7c02b1e1 213 #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */
wolfSSL 9:52ec7c02b1e1 214 #define WOLFSSL_LWIP
wolfSSL 9:52ec7c02b1e1 215 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 216 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 217 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 218 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 219 #endif
wolfSSL 9:52ec7c02b1e1 220
wolfSSL 9:52ec7c02b1e1 221 #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM)
wolfSSL 9:52ec7c02b1e1 222 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 223 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 224 #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096)
wolfSSL 9:52ec7c02b1e1 225 #define USE_CERT_BUFFERS_1024
wolfSSL 9:52ec7c02b1e1 226 #endif
wolfSSL 9:52ec7c02b1e1 227 #define BENCH_EMBEDDED
wolfSSL 9:52ec7c02b1e1 228 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 229 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 230 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 231 #define BENCH_EMBEDDED
wolfSSL 9:52ec7c02b1e1 232 #endif
wolfSSL 9:52ec7c02b1e1 233
wolfSSL 9:52ec7c02b1e1 234 #ifdef MICROCHIP_PIC32
wolfSSL 9:52ec7c02b1e1 235 /* #define WOLFSSL_MICROCHIP_PIC32MZ */
wolfSSL 9:52ec7c02b1e1 236 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 237 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 238 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 239 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 240 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 241 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 242 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 243 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 244 #define WOLFSSL_HAVE_MIN
wolfSSL 12:1a06964c2adb 245 #define WOLFSSL_HAVE_MAX
wolfSSL 12:1a06964c2adb 246 #define NO_BIG_INT
wolfSSL 9:52ec7c02b1e1 247 #endif
wolfSSL 9:52ec7c02b1e1 248
wolfSSL 9:52ec7c02b1e1 249 #ifdef WOLFSSL_MICROCHIP_PIC32MZ
wolfSSL 9:52ec7c02b1e1 250 #define WOLFSSL_PIC32MZ_CRYPT
wolfSSL 9:52ec7c02b1e1 251 #define WOLFSSL_PIC32MZ_RNG
wolfSSL 12:1a06964c2adb 252 #define WOLFSSL_PIC32MZ_HASH
wolfSSL 9:52ec7c02b1e1 253 #endif
wolfSSL 9:52ec7c02b1e1 254
wolfSSL 9:52ec7c02b1e1 255 #ifdef MICROCHIP_TCPIP_V5
wolfSSL 9:52ec7c02b1e1 256 /* include timer functions */
wolfSSL 9:52ec7c02b1e1 257 #include "TCPIP Stack/TCPIP.h"
wolfSSL 9:52ec7c02b1e1 258 #endif
wolfSSL 9:52ec7c02b1e1 259
wolfSSL 9:52ec7c02b1e1 260 #ifdef MICROCHIP_TCPIP
wolfSSL 9:52ec7c02b1e1 261 /* include timer, NTP functions */
wolfSSL 9:52ec7c02b1e1 262 #ifdef MICROCHIP_MPLAB_HARMONY
wolfSSL 9:52ec7c02b1e1 263 #include "tcpip/tcpip.h"
wolfSSL 9:52ec7c02b1e1 264 #else
wolfSSL 9:52ec7c02b1e1 265 #include "system/system_services.h"
wolfSSL 9:52ec7c02b1e1 266 #include "tcpip/sntp.h"
wolfSSL 9:52ec7c02b1e1 267 #endif
wolfSSL 9:52ec7c02b1e1 268 #endif
wolfSSL 9:52ec7c02b1e1 269
wolfSSL 9:52ec7c02b1e1 270 #ifdef MBED
wolfSSL 9:52ec7c02b1e1 271 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 272 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 273 #define NO_CERT
wolfSSL 9:52ec7c02b1e1 274 #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096)
wolfSSL 9:52ec7c02b1e1 275 #define USE_CERT_BUFFERS_1024
wolfSSL 9:52ec7c02b1e1 276 #endif
wolfSSL 9:52ec7c02b1e1 277 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 278 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 279 #define NO_SHA512
wolfSSL 9:52ec7c02b1e1 280 #define NO_DH
wolfSSL 9:52ec7c02b1e1 281 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 282 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 283 #define NO_DSA
wolfSSL 9:52ec7c02b1e1 284 #define NO_HC128
wolfSSL 9:52ec7c02b1e1 285 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 286 #define NO_SESSION_CACHE
wolfSSL 9:52ec7c02b1e1 287 #define WOLFSSL_CMSIS_RTOS
wolfSSL 9:52ec7c02b1e1 288 #endif
wolfSSL 9:52ec7c02b1e1 289
wolfSSL 9:52ec7c02b1e1 290
wolfSSL 9:52ec7c02b1e1 291 #ifdef WOLFSSL_EROAD
wolfSSL 9:52ec7c02b1e1 292 #define FREESCALE_MQX
wolfSSL 9:52ec7c02b1e1 293 #define FREESCALE_MMCAU
wolfSSL 9:52ec7c02b1e1 294 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 295 #define NO_STDIO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 296 #define WOLFSSL_LEANPSK
wolfSSL 9:52ec7c02b1e1 297 #define HAVE_NULL_CIPHER
wolfSSL 9:52ec7c02b1e1 298 #define NO_OLD_TLS
wolfSSL 9:52ec7c02b1e1 299 #define NO_ASN
wolfSSL 9:52ec7c02b1e1 300 #define NO_BIG_INT
wolfSSL 9:52ec7c02b1e1 301 #define NO_RSA
wolfSSL 9:52ec7c02b1e1 302 #define NO_DSA
wolfSSL 9:52ec7c02b1e1 303 #define NO_DH
wolfSSL 9:52ec7c02b1e1 304 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 305 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 306 #define NO_CERTS
wolfSSL 9:52ec7c02b1e1 307 #define NO_PWDBASED
wolfSSL 9:52ec7c02b1e1 308 #define NO_DES3
wolfSSL 9:52ec7c02b1e1 309 #define NO_MD4
wolfSSL 9:52ec7c02b1e1 310 #define NO_RC4
wolfSSL 9:52ec7c02b1e1 311 #define NO_MD5
wolfSSL 9:52ec7c02b1e1 312 #define NO_SESSION_CACHE
wolfSSL 9:52ec7c02b1e1 313 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 314 #endif
wolfSSL 9:52ec7c02b1e1 315
wolfSSL 9:52ec7c02b1e1 316 #ifdef WOLFSSL_PICOTCP
wolfSSL 9:52ec7c02b1e1 317 #ifndef errno
wolfSSL 9:52ec7c02b1e1 318 #define errno pico_err
wolfSSL 9:52ec7c02b1e1 319 #endif
wolfSSL 9:52ec7c02b1e1 320 #include "pico_defines.h"
wolfSSL 9:52ec7c02b1e1 321 #include "pico_stack.h"
wolfSSL 9:52ec7c02b1e1 322 #include "pico_constants.h"
wolfSSL 9:52ec7c02b1e1 323 #include "pico_protocol.h"
wolfSSL 9:52ec7c02b1e1 324 #define CUSTOM_RAND_GENERATE pico_rand
wolfSSL 9:52ec7c02b1e1 325 #endif
wolfSSL 9:52ec7c02b1e1 326
wolfSSL 9:52ec7c02b1e1 327 #ifdef WOLFSSL_PICOTCP_DEMO
wolfSSL 9:52ec7c02b1e1 328 #define WOLFSSL_STM32
wolfSSL 9:52ec7c02b1e1 329 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 330 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 331 #define XMALLOC(s, h, type) PICO_ZALLOC((s))
wolfSSL 9:52ec7c02b1e1 332 #define XFREE(p, h, type) PICO_FREE((p))
wolfSSL 9:52ec7c02b1e1 333 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 334 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 335 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 336 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 337 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 338 #endif
wolfSSL 9:52ec7c02b1e1 339
wolfSSL 9:52ec7c02b1e1 340 #ifdef FREERTOS_WINSIM
wolfSSL 9:52ec7c02b1e1 341 #define FREERTOS
wolfSSL 9:52ec7c02b1e1 342 #define USE_WINDOWS_API
wolfSSL 9:52ec7c02b1e1 343 #endif
wolfSSL 9:52ec7c02b1e1 344
wolfSSL 9:52ec7c02b1e1 345
wolfSSL 9:52ec7c02b1e1 346 #ifdef WOLFSSL_VXWORKS
wolfSSL 9:52ec7c02b1e1 347 /* VxWorks simulator incorrectly detects building for i386 */
wolfSSL 9:52ec7c02b1e1 348 #ifdef VXWORKS_SIM
wolfSSL 9:52ec7c02b1e1 349 #define TFM_NO_ASM
wolfSSL 9:52ec7c02b1e1 350 #endif
wolfSSL 9:52ec7c02b1e1 351 #define WOLFSSL_PTHREADS
wolfSSL 9:52ec7c02b1e1 352 #define WOLFSSL_HAVE_MIN
wolfSSL 12:1a06964c2adb 353 #define WOLFSSL_HAVE_MAX
wolfSSL 9:52ec7c02b1e1 354 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 355 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 356 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 357 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 358 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 359 #endif
wolfSSL 9:52ec7c02b1e1 360
wolfSSL 9:52ec7c02b1e1 361
wolfSSL 9:52ec7c02b1e1 362 #ifdef WOLFSSL_ARDUINO
wolfSSL 9:52ec7c02b1e1 363 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 364 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 365 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 366 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 367 #ifndef INTEL_GALILEO /* Galileo has time.h compatibility */
wolfSSL 9:52ec7c02b1e1 368 #define TIME_OVERRIDES /* must define XTIME and XGMTIME externally */
wolfSSL 9:52ec7c02b1e1 369 #endif
wolfSSL 9:52ec7c02b1e1 370 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 371 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 372 #define NO_DH
wolfSSL 9:52ec7c02b1e1 373 #define NO_SESSION_CACHE
wolfSSL 9:52ec7c02b1e1 374 #define USE_SLOW_SHA
wolfSSL 9:52ec7c02b1e1 375 #define NO_WOLFSSL_SERVER
wolfSSL 9:52ec7c02b1e1 376 #define NO_ERROR_STRINGS
wolfSSL 9:52ec7c02b1e1 377 #endif
wolfSSL 9:52ec7c02b1e1 378
wolfSSL 9:52ec7c02b1e1 379
wolfSSL 9:52ec7c02b1e1 380 #ifdef WOLFSSL_UTASKER
wolfSSL 9:52ec7c02b1e1 381 /* uTasker configuration - used for fnRandom() */
wolfSSL 9:52ec7c02b1e1 382 #include "config.h"
wolfSSL 9:52ec7c02b1e1 383
wolfSSL 9:52ec7c02b1e1 384 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 385 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 386 #define WOLFSSL_HAVE_MIN
wolfSSL 9:52ec7c02b1e1 387 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 388
wolfSSL 9:52ec7c02b1e1 389 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 390 #define ALT_ECC_SIZE
wolfSSL 9:52ec7c02b1e1 391 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 392 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 393 #define ECC_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 394
wolfSSL 9:52ec7c02b1e1 395 /* used in wolfCrypt test */
wolfSSL 9:52ec7c02b1e1 396 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 397 #define USE_CERT_BUFFERS_2048
wolfSSL 9:52ec7c02b1e1 398
wolfSSL 9:52ec7c02b1e1 399 /* uTasker port uses RAW sockets, use I/O callbacks
wolfSSL 10:6c2db0c97d5a 400 * See wolfSSL uTasker example for sample callbacks */
wolfSSL 9:52ec7c02b1e1 401 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 402
wolfSSL 9:52ec7c02b1e1 403 /* uTasker filesystem not ported */
wolfSSL 9:52ec7c02b1e1 404 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 405
wolfSSL 9:52ec7c02b1e1 406 /* uTasker RNG is abstracted, calls HW RNG when available */
wolfSSL 9:52ec7c02b1e1 407 #define CUSTOM_RAND_GENERATE fnRandom
wolfSSL 9:52ec7c02b1e1 408 #define CUSTOM_RAND_TYPE unsigned short
wolfSSL 9:52ec7c02b1e1 409
wolfSSL 9:52ec7c02b1e1 410 /* user needs to define XTIME to function that provides
wolfSSL 9:52ec7c02b1e1 411 * seconds since Unix epoch */
wolfSSL 9:52ec7c02b1e1 412 #ifndef XTIME
wolfSSL 9:52ec7c02b1e1 413 #error XTIME must be defined in wolfSSL settings.h
wolfSSL 9:52ec7c02b1e1 414 /* #define XTIME fnSecondsSinceEpoch */
wolfSSL 9:52ec7c02b1e1 415 #endif
wolfSSL 9:52ec7c02b1e1 416
wolfSSL 9:52ec7c02b1e1 417 /* use uTasker std library replacements where available */
wolfSSL 9:52ec7c02b1e1 418 #define STRING_USER
wolfSSL 9:52ec7c02b1e1 419 #define XMEMCPY(d,s,l) uMemcpy((d),(s),(l))
wolfSSL 9:52ec7c02b1e1 420 #define XMEMSET(b,c,l) uMemset((b),(c),(l))
wolfSSL 9:52ec7c02b1e1 421 #define XMEMCMP(s1,s2,n) uMemcmp((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 422 #define XMEMMOVE(d,s,l) memmove((d),(s),(l))
wolfSSL 9:52ec7c02b1e1 423
wolfSSL 9:52ec7c02b1e1 424 #define XSTRLEN(s1) uStrlen((s1))
wolfSSL 9:52ec7c02b1e1 425 #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 426 #define XSTRSTR(s1,s2) strstr((s1),(s2))
wolfSSL 9:52ec7c02b1e1 427 #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 428 #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 429 #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 430 #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n))
wolfSSL 9:52ec7c02b1e1 431 #if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN)
wolfSSL 9:52ec7c02b1e1 432 #define XSTRTOK strtok_r
wolfSSL 9:52ec7c02b1e1 433 #endif
wolfSSL 9:52ec7c02b1e1 434 #endif
wolfSSL 9:52ec7c02b1e1 435
wolfSSL 9:52ec7c02b1e1 436 #ifdef WOLFSSL_EMBOS
wolfSSL 9:52ec7c02b1e1 437 #define NO_FILESYSTEM /* Not ported at this time */
wolfSSL 9:52ec7c02b1e1 438 #define USE_CERT_BUFFERS_2048 /* use when NO_FILESYSTEM */
wolfSSL 9:52ec7c02b1e1 439 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 440 #define NO_RC4
wolfSSL 9:52ec7c02b1e1 441 #define SINGLE_THREADED /* Not ported at this time */
wolfSSL 9:52ec7c02b1e1 442 #endif
wolfSSL 9:52ec7c02b1e1 443
wolfSSL 9:52ec7c02b1e1 444 #ifdef WOLFSSL_RIOT_OS
wolfSSL 9:52ec7c02b1e1 445 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 446 #define TFM_NO_ASM
wolfSSL 9:52ec7c02b1e1 447 #define USE_FAST_MATH
wolfSSL 12:1a06964c2adb 448 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 449 #define USE_CERT_BUFFERS_2048
wolfSSL 9:52ec7c02b1e1 450 #endif
wolfSSL 9:52ec7c02b1e1 451
wolfSSL 14:167253f4e170 452 #ifdef WOLFSSL_CHIBIOS
wolfSSL 14:167253f4e170 453 /* ChibiOS definitions. This file is distributed with chibiOS. */
wolfSSL 14:167253f4e170 454 #include "wolfssl_chibios.h"
wolfSSL 14:167253f4e170 455 #endif
wolfSSL 14:167253f4e170 456
wolfSSL 14:167253f4e170 457 #ifdef WOLFSSL_PB
wolfSSL 14:167253f4e170 458 /* PB is using older 1.2 version of Nucleus */
wolfSSL 14:167253f4e170 459 #undef WOLFSSL_NUCLEUS
wolfSSL 14:167253f4e170 460 #define WOLFSSL_NUCLEUS_1_2
wolfSSL 14:167253f4e170 461 #endif
wolfSSL 14:167253f4e170 462
wolfSSL 14:167253f4e170 463 #ifdef WOLFSSL_NUCLEUS_1_2
wolfSSL 14:167253f4e170 464 #define NO_WRITEV
wolfSSL 14:167253f4e170 465 #define NO_WOLFSSL_DIR
wolfSSL 14:167253f4e170 466
wolfSSL 14:167253f4e170 467 #if !defined(NO_ASN_TIME) && !defined(USER_TIME)
wolfSSL 14:167253f4e170 468 #error User must define XTIME, see manual
wolfSSL 14:167253f4e170 469 #endif
wolfSSL 14:167253f4e170 470
wolfSSL 14:167253f4e170 471 #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER)
wolfSSL 14:167253f4e170 472 extern void* nucleus_malloc(unsigned long size, void* heap, int type);
wolfSSL 14:167253f4e170 473 extern void* nucleus_realloc(void* ptr, unsigned long size, void* heap,
wolfSSL 14:167253f4e170 474 int type);
wolfSSL 14:167253f4e170 475 extern void nucleus_free(void* ptr, void* heap, int type);
wolfSSL 14:167253f4e170 476
wolfSSL 14:167253f4e170 477 #define XMALLOC(s, h, type) nucleus_malloc
wolfSSL 14:167253f4e170 478 #define XREALLOC(p, n, h, t) nucleus_realloc
wolfSSL 14:167253f4e170 479 #define XFREE(p, h, type) nucleus_free
wolfSSL 14:167253f4e170 480 #endif
wolfSSL 14:167253f4e170 481 #endif
wolfSSL 14:167253f4e170 482
wolfSSL 9:52ec7c02b1e1 483 #ifdef WOLFSSL_NRF5x
wolfSSL 10:6c2db0c97d5a 484 #define SIZEOF_LONG 4
wolfSSL 10:6c2db0c97d5a 485 #define SIZEOF_LONG_LONG 8
wolfSSL 10:6c2db0c97d5a 486 #define NO_ASN_TIME
wolfSSL 10:6c2db0c97d5a 487 #define NO_DEV_RANDOM
wolfSSL 10:6c2db0c97d5a 488 #define NO_FILESYSTEM
wolfSSL 10:6c2db0c97d5a 489 #define NO_MAIN_DRIVER
wolfSSL 10:6c2db0c97d5a 490 #define NO_WRITEV
wolfSSL 10:6c2db0c97d5a 491 #define SINGLE_THREADED
wolfSSL 10:6c2db0c97d5a 492 #define USE_FAST_MATH
wolfSSL 10:6c2db0c97d5a 493 #define TFM_TIMING_RESISTANT
wolfSSL 10:6c2db0c97d5a 494 #define USE_WOLFSSL_MEMORY
wolfSSL 10:6c2db0c97d5a 495 #define WOLFSSL_NRF51
wolfSSL 10:6c2db0c97d5a 496 #define WOLFSSL_USER_IO
wolfSSL 10:6c2db0c97d5a 497 #define NO_SESSION_CACHE
wolfSSL 9:52ec7c02b1e1 498 #endif
wolfSSL 9:52ec7c02b1e1 499
wolfSSL 9:52ec7c02b1e1 500 /* Micrium will use Visual Studio for compilation but not the Win32 API */
wolfSSL 9:52ec7c02b1e1 501 #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \
wolfSSL 10:6c2db0c97d5a 502 !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \
wolfSSL 10:6c2db0c97d5a 503 !defined(WOLFSSL_UTASKER) && !defined(INTIME_RTOS)
wolfSSL 9:52ec7c02b1e1 504 #define USE_WINDOWS_API
wolfSSL 9:52ec7c02b1e1 505 #endif
wolfSSL 9:52ec7c02b1e1 506
wolfSSL 9:52ec7c02b1e1 507 #if defined(WOLFSSL_uITRON4)
wolfSSL 9:52ec7c02b1e1 508
wolfSSL 9:52ec7c02b1e1 509 #define XMALLOC_USER
wolfSSL 9:52ec7c02b1e1 510 #include <stddef.h>
wolfSSL 9:52ec7c02b1e1 511 #define ITRON_POOL_SIZE 1024*20
wolfSSL 9:52ec7c02b1e1 512 extern int uITRON4_minit(size_t poolsz) ;
wolfSSL 9:52ec7c02b1e1 513 extern void *uITRON4_malloc(size_t sz) ;
wolfSSL 9:52ec7c02b1e1 514 extern void *uITRON4_realloc(void *p, size_t sz) ;
wolfSSL 9:52ec7c02b1e1 515 extern void uITRON4_free(void *p) ;
wolfSSL 9:52ec7c02b1e1 516
wolfSSL 9:52ec7c02b1e1 517 #define XMALLOC(sz, heap, type) uITRON4_malloc(sz)
wolfSSL 9:52ec7c02b1e1 518 #define XREALLOC(p, sz, heap, type) uITRON4_realloc(p, sz)
wolfSSL 9:52ec7c02b1e1 519 #define XFREE(p, heap, type) uITRON4_free(p)
wolfSSL 9:52ec7c02b1e1 520 #endif
wolfSSL 9:52ec7c02b1e1 521
wolfSSL 9:52ec7c02b1e1 522 #if defined(WOLFSSL_uTKERNEL2)
wolfSSL 10:6c2db0c97d5a 523 #ifndef NO_TKERNEL_MEM_POOL
wolfSSL 10:6c2db0c97d5a 524 #define XMALLOC_OVERRIDE
wolfSSL 10:6c2db0c97d5a 525 int uTKernel_init_mpool(unsigned int sz); /* initializing malloc pool */
wolfSSL 10:6c2db0c97d5a 526 void* uTKernel_malloc(unsigned int sz);
wolfSSL 10:6c2db0c97d5a 527 void* uTKernel_realloc(void *p, unsigned int sz);
wolfSSL 10:6c2db0c97d5a 528 void uTKernel_free(void *p);
wolfSSL 10:6c2db0c97d5a 529 #define XMALLOC(s, h, type) uTKernel_malloc((s))
wolfSSL 10:6c2db0c97d5a 530 #define XREALLOC(p, n, h, t) uTKernel_realloc((p), (n))
wolfSSL 10:6c2db0c97d5a 531 #define XFREE(p, h, type) uTKernel_free((p))
wolfSSL 10:6c2db0c97d5a 532 #endif
wolfSSL 10:6c2db0c97d5a 533
wolfSSL 10:6c2db0c97d5a 534 #ifndef NO_STDIO_FGETS_REMAP
wolfSSL 10:6c2db0c97d5a 535 #include <stdio.h>
wolfSSL 10:6c2db0c97d5a 536 #include "tm/tmonitor.h"
wolfSSL 9:52ec7c02b1e1 537
wolfSSL 10:6c2db0c97d5a 538 /* static char* gets(char *buff); */
wolfSSL 10:6c2db0c97d5a 539 static char* fgets(char *buff, int sz, FILE *fp) {
wolfSSL 10:6c2db0c97d5a 540 char * p = buff;
wolfSSL 10:6c2db0c97d5a 541 *p = '\0';
wolfSSL 10:6c2db0c97d5a 542 while (1) {
wolfSSL 10:6c2db0c97d5a 543 *p = tm_getchar(-1);
wolfSSL 10:6c2db0c97d5a 544 tm_putchar(*p);
wolfSSL 10:6c2db0c97d5a 545 if (*p == '\r') {
wolfSSL 10:6c2db0c97d5a 546 tm_putchar('\n');
wolfSSL 10:6c2db0c97d5a 547 *p = '\0';
wolfSSL 10:6c2db0c97d5a 548 break;
wolfSSL 10:6c2db0c97d5a 549 }
wolfSSL 10:6c2db0c97d5a 550 p++;
wolfSSL 9:52ec7c02b1e1 551 }
wolfSSL 10:6c2db0c97d5a 552 return buff;
wolfSSL 9:52ec7c02b1e1 553 }
wolfSSL 10:6c2db0c97d5a 554 #endif /* !NO_STDIO_FGETS_REMAP */
wolfSSL 9:52ec7c02b1e1 555 #endif
wolfSSL 9:52ec7c02b1e1 556
wolfSSL 9:52ec7c02b1e1 557
wolfSSL 9:52ec7c02b1e1 558 #if defined(WOLFSSL_LEANPSK) && !defined(XMALLOC_USER)
wolfSSL 9:52ec7c02b1e1 559 #include <stdlib.h>
wolfSSL 9:52ec7c02b1e1 560 #define XMALLOC(s, h, type) malloc((s))
wolfSSL 9:52ec7c02b1e1 561 #define XFREE(p, h, type) free((p))
wolfSSL 9:52ec7c02b1e1 562 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 9:52ec7c02b1e1 563 #endif
wolfSSL 9:52ec7c02b1e1 564
wolfSSL 9:52ec7c02b1e1 565 #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL)
wolfSSL 9:52ec7c02b1e1 566 #undef XMALLOC
wolfSSL 9:52ec7c02b1e1 567 #define XMALLOC yaXMALLOC
wolfSSL 9:52ec7c02b1e1 568 #undef XFREE
wolfSSL 9:52ec7c02b1e1 569 #define XFREE yaXFREE
wolfSSL 9:52ec7c02b1e1 570 #undef XREALLOC
wolfSSL 9:52ec7c02b1e1 571 #define XREALLOC yaXREALLOC
wolfSSL 9:52ec7c02b1e1 572 #endif
wolfSSL 9:52ec7c02b1e1 573
wolfSSL 9:52ec7c02b1e1 574
wolfSSL 9:52ec7c02b1e1 575 #ifdef FREERTOS
wolfSSL 9:52ec7c02b1e1 576 #include "FreeRTOS.h"
wolfSSL 9:52ec7c02b1e1 577
wolfSSL 9:52ec7c02b1e1 578 /* FreeRTOS pvPortRealloc() only in AVR32_UC3 port */
wolfSSL 14:167253f4e170 579 #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \
wolfSSL 14:167253f4e170 580 !defined(WOLFSSL_STATIC_MEMORY)
wolfSSL 9:52ec7c02b1e1 581 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 9:52ec7c02b1e1 582 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 9:52ec7c02b1e1 583 #endif
wolfSSL 9:52ec7c02b1e1 584
wolfSSL 9:52ec7c02b1e1 585 #ifndef NO_WRITEV
wolfSSL 9:52ec7c02b1e1 586 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 587 #endif
wolfSSL 9:52ec7c02b1e1 588 #ifndef HAVE_SHA512
wolfSSL 9:52ec7c02b1e1 589 #ifndef NO_SHA512
wolfSSL 9:52ec7c02b1e1 590 #define NO_SHA512
wolfSSL 9:52ec7c02b1e1 591 #endif
wolfSSL 9:52ec7c02b1e1 592 #endif
wolfSSL 9:52ec7c02b1e1 593 #ifndef HAVE_DH
wolfSSL 9:52ec7c02b1e1 594 #ifndef NO_DH
wolfSSL 9:52ec7c02b1e1 595 #define NO_DH
wolfSSL 9:52ec7c02b1e1 596 #endif
wolfSSL 9:52ec7c02b1e1 597 #endif
wolfSSL 9:52ec7c02b1e1 598 #ifndef NO_DSA
wolfSSL 9:52ec7c02b1e1 599 #define NO_DSA
wolfSSL 9:52ec7c02b1e1 600 #endif
wolfSSL 9:52ec7c02b1e1 601 #ifndef NO_HC128
wolfSSL 9:52ec7c02b1e1 602 #define NO_HC128
wolfSSL 9:52ec7c02b1e1 603 #endif
wolfSSL 9:52ec7c02b1e1 604
wolfSSL 9:52ec7c02b1e1 605 #ifndef SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 606 #include "semphr.h"
wolfSSL 9:52ec7c02b1e1 607 #endif
wolfSSL 9:52ec7c02b1e1 608 #endif
wolfSSL 9:52ec7c02b1e1 609
wolfSSL 9:52ec7c02b1e1 610 #ifdef FREERTOS_TCP
wolfSSL 14:167253f4e170 611 #if !defined(NO_WOLFSSL_MEMORY) && !defined(XMALLOC_USER) && \
wolfSSL 14:167253f4e170 612 !defined(WOLFSSL_STATIC_MEMORY)
wolfSSL 14:167253f4e170 613 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 14:167253f4e170 614 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 14:167253f4e170 615 #endif
wolfSSL 9:52ec7c02b1e1 616
wolfSSL 14:167253f4e170 617 #define WOLFSSL_GENSEED_FORTEST
wolfSSL 9:52ec7c02b1e1 618
wolfSSL 14:167253f4e170 619 #define NO_WOLFSSL_DIR
wolfSSL 14:167253f4e170 620 #define NO_WRITEV
wolfSSL 14:167253f4e170 621 #define USE_FAST_MATH
wolfSSL 14:167253f4e170 622 #define TFM_TIMING_RESISTANT
wolfSSL 14:167253f4e170 623 #define NO_MAIN_DRIVER
wolfSSL 9:52ec7c02b1e1 624 #endif
wolfSSL 9:52ec7c02b1e1 625
wolfSSL 9:52ec7c02b1e1 626 #ifdef WOLFSSL_TIRTOS
wolfSSL 9:52ec7c02b1e1 627 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 628 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 629 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 630 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 631 #define TFM_TIMING_RESISTANT
wolfSSL 14:167253f4e170 632 #define ECC_TIMING_RESISTANT
wolfSSL 14:167253f4e170 633 #define WC_RSA_BLINDING
wolfSSL 9:52ec7c02b1e1 634 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 635 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 636 #define USE_CERT_BUFFERS_2048
wolfSSL 9:52ec7c02b1e1 637 #define NO_ERROR_STRINGS
wolfSSL 9:52ec7c02b1e1 638 #define USER_TIME
wolfSSL 9:52ec7c02b1e1 639 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 640 #define HAVE_ALPN
wolfSSL 14:167253f4e170 641 #define USE_WOLF_STRTOK /* use with HAVE_ALPN */
wolfSSL 9:52ec7c02b1e1 642 #define HAVE_TLS_EXTENSIONS
wolfSSL 9:52ec7c02b1e1 643 #define HAVE_AESGCM
wolfSSL 9:52ec7c02b1e1 644 #define HAVE_SUPPORTED_CURVES
wolfSSL 9:52ec7c02b1e1 645 #define ALT_ECC_SIZE
wolfSSL 9:52ec7c02b1e1 646
wolfSSL 9:52ec7c02b1e1 647 #ifdef __IAR_SYSTEMS_ICC__
wolfSSL 9:52ec7c02b1e1 648 #pragma diag_suppress=Pa089
wolfSSL 9:52ec7c02b1e1 649 #elif !defined(__GNUC__)
wolfSSL 9:52ec7c02b1e1 650 /* Suppress the sslpro warning */
wolfSSL 9:52ec7c02b1e1 651 #pragma diag_suppress=11
wolfSSL 9:52ec7c02b1e1 652 #endif
wolfSSL 9:52ec7c02b1e1 653
wolfSSL 9:52ec7c02b1e1 654 #include <ti/sysbios/hal/Seconds.h>
wolfSSL 9:52ec7c02b1e1 655 #endif
wolfSSL 9:52ec7c02b1e1 656
wolfSSL 9:52ec7c02b1e1 657 #ifdef EBSNET
wolfSSL 9:52ec7c02b1e1 658 #include "rtip.h"
wolfSSL 9:52ec7c02b1e1 659
wolfSSL 9:52ec7c02b1e1 660 /* #define DEBUG_WOLFSSL */
wolfSSL 9:52ec7c02b1e1 661 #define NO_WOLFSSL_DIR /* tbd */
wolfSSL 9:52ec7c02b1e1 662
wolfSSL 9:52ec7c02b1e1 663 #if (POLLOS)
wolfSSL 9:52ec7c02b1e1 664 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 665 #endif
wolfSSL 9:52ec7c02b1e1 666
wolfSSL 9:52ec7c02b1e1 667 #if (RTPLATFORM)
wolfSSL 9:52ec7c02b1e1 668 #if (!RTP_LITTLE_ENDIAN)
wolfSSL 9:52ec7c02b1e1 669 #define BIG_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 670 #endif
wolfSSL 9:52ec7c02b1e1 671 #else
wolfSSL 9:52ec7c02b1e1 672 #if (!KS_LITTLE_ENDIAN)
wolfSSL 9:52ec7c02b1e1 673 #define BIG_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 674 #endif
wolfSSL 9:52ec7c02b1e1 675 #endif
wolfSSL 9:52ec7c02b1e1 676
wolfSSL 9:52ec7c02b1e1 677 #if (WINMSP3)
wolfSSL 9:52ec7c02b1e1 678 #undef SIZEOF_LONG
wolfSSL 9:52ec7c02b1e1 679 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 680 #else
wolfSSL 9:52ec7c02b1e1 681 #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG
wolfSSL 9:52ec7c02b1e1 682 #endif
wolfSSL 9:52ec7c02b1e1 683
wolfSSL 9:52ec7c02b1e1 684 #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC))
wolfSSL 9:52ec7c02b1e1 685 #define XFREE(p, h, type) (rtp_free(p))
wolfSSL 9:52ec7c02b1e1 686 #define XREALLOC(p, n, h, t) realloc((p), (n))
wolfSSL 9:52ec7c02b1e1 687
wolfSSL 9:52ec7c02b1e1 688 #endif /* EBSNET */
wolfSSL 9:52ec7c02b1e1 689
wolfSSL 9:52ec7c02b1e1 690 #ifdef WOLFSSL_GAME_BUILD
wolfSSL 9:52ec7c02b1e1 691 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 692 #if defined(__PPU) || defined(__XENON)
wolfSSL 9:52ec7c02b1e1 693 #define BIG_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 694 #endif
wolfSSL 9:52ec7c02b1e1 695 #endif
wolfSSL 9:52ec7c02b1e1 696
wolfSSL 9:52ec7c02b1e1 697 #ifdef WOLFSSL_LSR
wolfSSL 9:52ec7c02b1e1 698 #define HAVE_WEBSERVER
wolfSSL 9:52ec7c02b1e1 699 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 700 #define WOLFSSL_LOW_MEMORY
wolfSSL 9:52ec7c02b1e1 701 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 702 #define NO_SHA512
wolfSSL 9:52ec7c02b1e1 703 #define NO_DH
wolfSSL 9:52ec7c02b1e1 704 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 705 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 706 #define NO_DSA
wolfSSL 9:52ec7c02b1e1 707 #define NO_HC128
wolfSSL 9:52ec7c02b1e1 708 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 709 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 710 #define NO_RABBIT
wolfSSL 9:52ec7c02b1e1 711 #ifndef NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 712 #define LSR_FS
wolfSSL 9:52ec7c02b1e1 713 #include "inc/hw_types.h"
wolfSSL 9:52ec7c02b1e1 714 #include "fs.h"
wolfSSL 9:52ec7c02b1e1 715 #endif
wolfSSL 9:52ec7c02b1e1 716 #define WOLFSSL_LWIP
wolfSSL 9:52ec7c02b1e1 717 #include <errno.h> /* for tcp errno */
wolfSSL 9:52ec7c02b1e1 718 #define WOLFSSL_SAFERTOS
wolfSSL 9:52ec7c02b1e1 719 #if defined(__IAR_SYSTEMS_ICC__)
wolfSSL 9:52ec7c02b1e1 720 /* enum uses enum */
wolfSSL 9:52ec7c02b1e1 721 #pragma diag_suppress=Pa089
wolfSSL 9:52ec7c02b1e1 722 #endif
wolfSSL 9:52ec7c02b1e1 723 #endif
wolfSSL 9:52ec7c02b1e1 724
wolfSSL 9:52ec7c02b1e1 725 #ifdef WOLFSSL_SAFERTOS
wolfSSL 9:52ec7c02b1e1 726 #ifndef SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 727 #include "SafeRTOS/semphr.h"
wolfSSL 9:52ec7c02b1e1 728 #endif
wolfSSL 9:52ec7c02b1e1 729
wolfSSL 9:52ec7c02b1e1 730 #include "SafeRTOS/heap.h"
wolfSSL 9:52ec7c02b1e1 731 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 9:52ec7c02b1e1 732 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 9:52ec7c02b1e1 733 #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n))
wolfSSL 9:52ec7c02b1e1 734 #endif
wolfSSL 9:52ec7c02b1e1 735
wolfSSL 9:52ec7c02b1e1 736 #ifdef WOLFSSL_LOW_MEMORY
wolfSSL 9:52ec7c02b1e1 737 #undef RSA_LOW_MEM
wolfSSL 9:52ec7c02b1e1 738 #define RSA_LOW_MEM
wolfSSL 9:52ec7c02b1e1 739 #undef WOLFSSL_SMALL_STACK
wolfSSL 9:52ec7c02b1e1 740 #define WOLFSSL_SMALL_STACK
wolfSSL 9:52ec7c02b1e1 741 #undef TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 742 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 743 #endif
wolfSSL 9:52ec7c02b1e1 744
wolfSSL 14:167253f4e170 745 #ifdef FREESCALE_MQX_4_0
wolfSSL 14:167253f4e170 746 /* use normal Freescale MQX port, but with minor changes for 4.0 */
wolfSSL 14:167253f4e170 747 #define FREESCALE_MQX
wolfSSL 14:167253f4e170 748 #endif
wolfSSL 14:167253f4e170 749
wolfSSL 9:52ec7c02b1e1 750 #ifdef FREESCALE_MQX
wolfSSL 9:52ec7c02b1e1 751 #define FREESCALE_COMMON
wolfSSL 9:52ec7c02b1e1 752 #include "mqx.h"
wolfSSL 9:52ec7c02b1e1 753 #ifndef NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 754 #include "mfs.h"
wolfSSL 9:52ec7c02b1e1 755 #if MQX_USE_IO_OLD
wolfSSL 9:52ec7c02b1e1 756 #include "fio.h"
wolfSSL 12:1a06964c2adb 757 #define NO_STDIO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 758 #else
wolfSSL 9:52ec7c02b1e1 759 #include "nio.h"
wolfSSL 9:52ec7c02b1e1 760 #endif
wolfSSL 9:52ec7c02b1e1 761 #endif
wolfSSL 9:52ec7c02b1e1 762 #ifndef SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 763 #include "mutex.h"
wolfSSL 9:52ec7c02b1e1 764 #endif
wolfSSL 9:52ec7c02b1e1 765
wolfSSL 14:167253f4e170 766 #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER)
wolfSSL 14:167253f4e170 767 #define XMALLOC_OVERRIDE
wolfSSL 14:167253f4e170 768 #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s))
wolfSSL 14:167253f4e170 769 #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));}
wolfSSL 14:167253f4e170 770 /* Note: MQX has no realloc, using fastmath above */
wolfSSL 14:167253f4e170 771 #endif
wolfSSL 9:52ec7c02b1e1 772 #endif
wolfSSL 9:52ec7c02b1e1 773
wolfSSL 9:52ec7c02b1e1 774 #ifdef FREESCALE_KSDK_MQX
wolfSSL 9:52ec7c02b1e1 775 #define FREESCALE_COMMON
wolfSSL 9:52ec7c02b1e1 776 #include <mqx.h>
wolfSSL 9:52ec7c02b1e1 777 #ifndef NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 778 #if MQX_USE_IO_OLD
wolfSSL 9:52ec7c02b1e1 779 #include <fio.h>
wolfSSL 9:52ec7c02b1e1 780 #else
wolfSSL 9:52ec7c02b1e1 781 #include <stdio.h>
wolfSSL 9:52ec7c02b1e1 782 #include <nio.h>
wolfSSL 9:52ec7c02b1e1 783 #endif
wolfSSL 9:52ec7c02b1e1 784 #endif
wolfSSL 9:52ec7c02b1e1 785 #ifndef SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 786 #include <mutex.h>
wolfSSL 9:52ec7c02b1e1 787 #endif
wolfSSL 9:52ec7c02b1e1 788
wolfSSL 9:52ec7c02b1e1 789 #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s))
wolfSSL 9:52ec7c02b1e1 790 #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));}
wolfSSL 9:52ec7c02b1e1 791 #define XREALLOC(p, n, h, t) _mem_realloc((p), (n)) /* since MQX 4.1.2 */
wolfSSL 9:52ec7c02b1e1 792
wolfSSL 9:52ec7c02b1e1 793 #define MQX_FILE_PTR FILE *
wolfSSL 9:52ec7c02b1e1 794 #define IO_SEEK_SET SEEK_SET
wolfSSL 9:52ec7c02b1e1 795 #define IO_SEEK_END SEEK_END
wolfSSL 9:52ec7c02b1e1 796 #endif /* FREESCALE_KSDK_MQX */
wolfSSL 9:52ec7c02b1e1 797
wolfSSL 9:52ec7c02b1e1 798 #if defined(FREESCALE_FREE_RTOS) || defined(FREESCALE_KSDK_FREERTOS)
wolfSSL 9:52ec7c02b1e1 799 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 800 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 801 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 802 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 803 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 804 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 805 #define NO_FILESYSTEM
wolfSSL 9:52ec7c02b1e1 806 #define WOLFSSL_CRYPT_HW_MUTEX 1
wolfSSL 10:6c2db0c97d5a 807
wolfSSL 9:52ec7c02b1e1 808 #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY)
wolfSSL 9:52ec7c02b1e1 809 #define XMALLOC(s, h, type) pvPortMalloc((s))
wolfSSL 9:52ec7c02b1e1 810 #define XFREE(p, h, type) vPortFree((p))
wolfSSL 9:52ec7c02b1e1 811 #endif
wolfSSL 10:6c2db0c97d5a 812
wolfSSL 9:52ec7c02b1e1 813 //#define USER_TICKS
wolfSSL 9:52ec7c02b1e1 814 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */
wolfSSL 9:52ec7c02b1e1 815 /* WOLFSSL_DH_CONST */
wolfSSL 9:52ec7c02b1e1 816 #define WOLFSSL_LWIP
wolfSSL 9:52ec7c02b1e1 817 #define FREERTOS_TCP
wolfSSL 9:52ec7c02b1e1 818
wolfSSL 9:52ec7c02b1e1 819 #define FREESCALE_FREE_RTOS
wolfSSL 9:52ec7c02b1e1 820 #define FREERTOS_SOCKET_ERROR ( -1 )
wolfSSL 9:52ec7c02b1e1 821 #define FREERTOS_EWOULDBLOCK ( -2 )
wolfSSL 9:52ec7c02b1e1 822 #define FREERTOS_EINVAL ( -4 )
wolfSSL 9:52ec7c02b1e1 823 #define FREERTOS_EADDRNOTAVAIL ( -5 )
wolfSSL 9:52ec7c02b1e1 824 #define FREERTOS_EADDRINUSE ( -6 )
wolfSSL 9:52ec7c02b1e1 825 #define FREERTOS_ENOBUFS ( -7 )
wolfSSL 9:52ec7c02b1e1 826 #define FREERTOS_ENOPROTOOPT ( -8 )
wolfSSL 9:52ec7c02b1e1 827 #endif /* FREESCALE_FREE_RTOS || FREESCALE_KSDK_FREERTOS */
wolfSSL 9:52ec7c02b1e1 828
wolfSSL 9:52ec7c02b1e1 829 #ifdef FREESCALE_KSDK_BM
wolfSSL 9:52ec7c02b1e1 830 #define FREESCALE_COMMON
wolfSSL 9:52ec7c02b1e1 831 #define WOLFSSL_USER_IO
wolfSSL 9:52ec7c02b1e1 832 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 833 #define NO_FILESYSTEM
wolfSSL 10:6c2db0c97d5a 834 #ifndef TIME_OVERRIDES
wolfSSL 10:6c2db0c97d5a 835 #define USER_TICKS
wolfSSL 10:6c2db0c97d5a 836 #endif
wolfSSL 9:52ec7c02b1e1 837 #endif /* FREESCALE_KSDK_BM */
wolfSSL 9:52ec7c02b1e1 838
wolfSSL 9:52ec7c02b1e1 839 #ifdef FREESCALE_COMMON
wolfSSL 9:52ec7c02b1e1 840 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 841
wolfSSL 9:52ec7c02b1e1 842 /* disable features */
wolfSSL 9:52ec7c02b1e1 843 #undef NO_WRITEV
wolfSSL 9:52ec7c02b1e1 844 #define NO_WRITEV
wolfSSL 9:52ec7c02b1e1 845 #undef NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 846 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 847 #undef NO_RABBIT
wolfSSL 9:52ec7c02b1e1 848 #define NO_RABBIT
wolfSSL 9:52ec7c02b1e1 849 #undef NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 850 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 851 #undef NO_RC4
wolfSSL 9:52ec7c02b1e1 852 #define NO_RC4
wolfSSL 9:52ec7c02b1e1 853
wolfSSL 9:52ec7c02b1e1 854 /* enable features */
wolfSSL 9:52ec7c02b1e1 855 #undef USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 856 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 857
wolfSSL 9:52ec7c02b1e1 858 #define USE_CERT_BUFFERS_2048
wolfSSL 9:52ec7c02b1e1 859 #define BENCH_EMBEDDED
wolfSSL 9:52ec7c02b1e1 860
wolfSSL 9:52ec7c02b1e1 861 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 862 #define ECC_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 863
wolfSSL 9:52ec7c02b1e1 864 #undef HAVE_ECC
wolfSSL 9:52ec7c02b1e1 865 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 866 #ifndef NO_AES
wolfSSL 9:52ec7c02b1e1 867 #undef HAVE_AESCCM
wolfSSL 9:52ec7c02b1e1 868 #define HAVE_AESCCM
wolfSSL 9:52ec7c02b1e1 869 #undef HAVE_AESGCM
wolfSSL 9:52ec7c02b1e1 870 #define HAVE_AESGCM
wolfSSL 9:52ec7c02b1e1 871 #undef WOLFSSL_AES_COUNTER
wolfSSL 9:52ec7c02b1e1 872 #define WOLFSSL_AES_COUNTER
wolfSSL 9:52ec7c02b1e1 873 #undef WOLFSSL_AES_DIRECT
wolfSSL 9:52ec7c02b1e1 874 #define WOLFSSL_AES_DIRECT
wolfSSL 9:52ec7c02b1e1 875 #endif
wolfSSL 9:52ec7c02b1e1 876
wolfSSL 10:6c2db0c97d5a 877 #ifdef FREESCALE_KSDK_1_3
wolfSSL 10:6c2db0c97d5a 878 #include "fsl_device_registers.h"
wolfSSL 12:1a06964c2adb 879 #elif !defined(FREESCALE_MQX)
wolfSSL 12:1a06964c2adb 880 /* Classic MQX does not have fsl_common.h */
wolfSSL 10:6c2db0c97d5a 881 #include "fsl_common.h"
wolfSSL 10:6c2db0c97d5a 882 #endif
wolfSSL 9:52ec7c02b1e1 883
wolfSSL 9:52ec7c02b1e1 884 /* random seed */
wolfSSL 9:52ec7c02b1e1 885 #define NO_OLD_RNGNAME
wolfSSL 9:52ec7c02b1e1 886 #if defined(FSL_FEATURE_SOC_TRNG_COUNT) && (FSL_FEATURE_SOC_TRNG_COUNT > 0)
wolfSSL 9:52ec7c02b1e1 887 #define FREESCALE_KSDK_2_0_TRNG
wolfSSL 9:52ec7c02b1e1 888 #elif defined(FSL_FEATURE_SOC_RNG_COUNT) && (FSL_FEATURE_SOC_RNG_COUNT > 0)
wolfSSL 10:6c2db0c97d5a 889 #ifdef FREESCALE_KSDK_1_3
wolfSSL 10:6c2db0c97d5a 890 #include "fsl_rnga_driver.h"
wolfSSL 10:6c2db0c97d5a 891 #define FREESCALE_RNGA
wolfSSL 10:6c2db0c97d5a 892 #define RNGA_INSTANCE (0)
wolfSSL 10:6c2db0c97d5a 893 #else
wolfSSL 10:6c2db0c97d5a 894 #define FREESCALE_KSDK_2_0_RNGA
wolfSSL 10:6c2db0c97d5a 895 #endif
wolfSSL 9:52ec7c02b1e1 896 #elif !defined(FREESCALE_KSDK_BM) && !defined(FREESCALE_FREE_RTOS) && !defined(FREESCALE_KSDK_FREERTOS)
wolfSSL 9:52ec7c02b1e1 897 #define FREESCALE_RNGA
wolfSSL 9:52ec7c02b1e1 898 #define RNGA_INSTANCE (0)
wolfSSL 9:52ec7c02b1e1 899 /* defaulting to K70 RNGA, user should change if different */
wolfSSL 9:52ec7c02b1e1 900 /* #define FREESCALE_K53_RNGB */
wolfSSL 9:52ec7c02b1e1 901 #define FREESCALE_K70_RNGA
wolfSSL 9:52ec7c02b1e1 902 #endif
wolfSSL 9:52ec7c02b1e1 903
wolfSSL 9:52ec7c02b1e1 904 /* HW crypto */
wolfSSL 9:52ec7c02b1e1 905 /* automatic enable based on Kinetis feature */
wolfSSL 9:52ec7c02b1e1 906 /* if case manual selection is required, for example for benchmarking purposes,
wolfSSL 9:52ec7c02b1e1 907 * just define FREESCALE_USE_MMCAU or FREESCALE_USE_LTC or none of these two macros (for software only)
wolfSSL 9:52ec7c02b1e1 908 * both can be enabled simultaneously as LTC has priority over MMCAU in source code.
wolfSSL 9:52ec7c02b1e1 909 */
wolfSSL 9:52ec7c02b1e1 910 /* #define FSL_HW_CRYPTO_MANUAL_SELECTION */
wolfSSL 9:52ec7c02b1e1 911 #ifndef FSL_HW_CRYPTO_MANUAL_SELECTION
wolfSSL 9:52ec7c02b1e1 912 #if defined(FSL_FEATURE_SOC_MMCAU_COUNT) && FSL_FEATURE_SOC_MMCAU_COUNT
wolfSSL 9:52ec7c02b1e1 913 #define FREESCALE_USE_MMCAU
wolfSSL 9:52ec7c02b1e1 914 #endif
wolfSSL 9:52ec7c02b1e1 915
wolfSSL 9:52ec7c02b1e1 916 #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT
wolfSSL 9:52ec7c02b1e1 917 #define FREESCALE_USE_LTC
wolfSSL 9:52ec7c02b1e1 918 #endif
wolfSSL 9:52ec7c02b1e1 919 #else
wolfSSL 9:52ec7c02b1e1 920 /* #define FREESCALE_USE_MMCAU */
wolfSSL 9:52ec7c02b1e1 921 /* #define FREESCALE_USE_LTC */
wolfSSL 9:52ec7c02b1e1 922 #endif
wolfSSL 9:52ec7c02b1e1 923 #endif /* FREESCALE_COMMON */
wolfSSL 9:52ec7c02b1e1 924
wolfSSL 12:1a06964c2adb 925 /* Classic pre-KSDK mmCAU library */
wolfSSL 12:1a06964c2adb 926 #ifdef FREESCALE_USE_MMCAU_CLASSIC
wolfSSL 12:1a06964c2adb 927 #define FREESCALE_USE_MMCAU
wolfSSL 12:1a06964c2adb 928 #define FREESCALE_MMCAU_CLASSIC
wolfSSL 12:1a06964c2adb 929 #define FREESCALE_MMCAU_CLASSIC_SHA
wolfSSL 12:1a06964c2adb 930 #endif
wolfSSL 12:1a06964c2adb 931
wolfSSL 12:1a06964c2adb 932 /* KSDK mmCAU library */
wolfSSL 9:52ec7c02b1e1 933 #ifdef FREESCALE_USE_MMCAU
wolfSSL 9:52ec7c02b1e1 934 /* AES and DES */
wolfSSL 9:52ec7c02b1e1 935 #define FREESCALE_MMCAU
wolfSSL 9:52ec7c02b1e1 936 /* MD5, SHA-1 and SHA-256 */
wolfSSL 9:52ec7c02b1e1 937 #define FREESCALE_MMCAU_SHA
wolfSSL 9:52ec7c02b1e1 938 #endif /* FREESCALE_USE_MMCAU */
wolfSSL 9:52ec7c02b1e1 939
wolfSSL 9:52ec7c02b1e1 940 #ifdef FREESCALE_USE_LTC
wolfSSL 9:52ec7c02b1e1 941 #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT
wolfSSL 9:52ec7c02b1e1 942 #define FREESCALE_LTC
wolfSSL 9:52ec7c02b1e1 943 #define LTC_BASE LTC0
wolfSSL 9:52ec7c02b1e1 944
wolfSSL 9:52ec7c02b1e1 945 #if defined(FSL_FEATURE_LTC_HAS_DES) && FSL_FEATURE_LTC_HAS_DES
wolfSSL 9:52ec7c02b1e1 946 #define FREESCALE_LTC_DES
wolfSSL 9:52ec7c02b1e1 947 #endif
wolfSSL 9:52ec7c02b1e1 948
wolfSSL 9:52ec7c02b1e1 949 #if defined(FSL_FEATURE_LTC_HAS_GCM) && FSL_FEATURE_LTC_HAS_GCM
wolfSSL 9:52ec7c02b1e1 950 #define FREESCALE_LTC_AES_GCM
wolfSSL 9:52ec7c02b1e1 951 #endif
wolfSSL 10:6c2db0c97d5a 952
wolfSSL 9:52ec7c02b1e1 953 #if defined(FSL_FEATURE_LTC_HAS_SHA) && FSL_FEATURE_LTC_HAS_SHA
wolfSSL 9:52ec7c02b1e1 954 #define FREESCALE_LTC_SHA
wolfSSL 9:52ec7c02b1e1 955 #endif
wolfSSL 9:52ec7c02b1e1 956
wolfSSL 9:52ec7c02b1e1 957 #if defined(FSL_FEATURE_LTC_HAS_PKHA) && FSL_FEATURE_LTC_HAS_PKHA
wolfSSL 9:52ec7c02b1e1 958 #define FREESCALE_LTC_ECC
wolfSSL 9:52ec7c02b1e1 959 #define FREESCALE_LTC_TFM
wolfSSL 9:52ec7c02b1e1 960
wolfSSL 9:52ec7c02b1e1 961 /* the LTC PKHA hardware limit is 2048 bits (256 bytes) for integer arithmetic.
wolfSSL 9:52ec7c02b1e1 962 the LTC_MAX_INT_BYTES defines the size of local variables that hold big integers. */
wolfSSL 9:52ec7c02b1e1 963 #ifndef LTC_MAX_INT_BYTES
wolfSSL 9:52ec7c02b1e1 964 #define LTC_MAX_INT_BYTES (256)
wolfSSL 9:52ec7c02b1e1 965 #endif
wolfSSL 9:52ec7c02b1e1 966
wolfSSL 10:6c2db0c97d5a 967 /* This FREESCALE_LTC_TFM_RSA_4096_ENABLE macro can be defined.
wolfSSL 9:52ec7c02b1e1 968 * In such a case both software and hardware algorithm
wolfSSL 9:52ec7c02b1e1 969 * for TFM is linked in. The decision for which algorithm is used is determined at runtime
wolfSSL 9:52ec7c02b1e1 970 * from size of inputs. If inputs and result can fit into LTC (see LTC_MAX_INT_BYTES)
wolfSSL 9:52ec7c02b1e1 971 * then we call hardware algorithm, otherwise we call software algorithm.
wolfSSL 10:6c2db0c97d5a 972 *
wolfSSL 9:52ec7c02b1e1 973 * Chinese reminder theorem is used to break RSA 4096 exponentiations (both public and private key)
wolfSSL 9:52ec7c02b1e1 974 * into several computations with 2048-bit modulus and exponents.
wolfSSL 9:52ec7c02b1e1 975 */
wolfSSL 9:52ec7c02b1e1 976 /* #define FREESCALE_LTC_TFM_RSA_4096_ENABLE */
wolfSSL 9:52ec7c02b1e1 977
wolfSSL 9:52ec7c02b1e1 978 /* ECC-384, ECC-256, ECC-224 and ECC-192 have been enabled with LTC PKHA acceleration */
wolfSSL 9:52ec7c02b1e1 979 #ifdef HAVE_ECC
wolfSSL 9:52ec7c02b1e1 980 #undef ECC_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 981 #define ECC_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 982
wolfSSL 9:52ec7c02b1e1 983 /* the LTC PKHA hardware limit is 512 bits (64 bytes) for ECC.
wolfSSL 10:6c2db0c97d5a 984 the LTC_MAX_ECC_BITS defines the size of local variables that hold ECC parameters
wolfSSL 9:52ec7c02b1e1 985 and point coordinates */
wolfSSL 9:52ec7c02b1e1 986 #ifndef LTC_MAX_ECC_BITS
wolfSSL 9:52ec7c02b1e1 987 #define LTC_MAX_ECC_BITS (384)
wolfSSL 9:52ec7c02b1e1 988 #endif
wolfSSL 9:52ec7c02b1e1 989
wolfSSL 9:52ec7c02b1e1 990 /* Enable curves up to 384 bits */
wolfSSL 9:52ec7c02b1e1 991 #if !defined(ECC_USER_CURVES) && !defined(HAVE_ALL_CURVES)
wolfSSL 9:52ec7c02b1e1 992 #define ECC_USER_CURVES
wolfSSL 9:52ec7c02b1e1 993 #define HAVE_ECC192
wolfSSL 9:52ec7c02b1e1 994 #define HAVE_ECC224
wolfSSL 9:52ec7c02b1e1 995 #undef NO_ECC256
wolfSSL 9:52ec7c02b1e1 996 #define HAVE_ECC384
wolfSSL 9:52ec7c02b1e1 997 #endif
wolfSSL 9:52ec7c02b1e1 998
wolfSSL 9:52ec7c02b1e1 999 /* enable features */
wolfSSL 9:52ec7c02b1e1 1000 #undef HAVE_CURVE25519
wolfSSL 9:52ec7c02b1e1 1001 #define HAVE_CURVE25519
wolfSSL 9:52ec7c02b1e1 1002 #undef HAVE_ED25519
wolfSSL 9:52ec7c02b1e1 1003 #define HAVE_ED25519
wolfSSL 9:52ec7c02b1e1 1004 #undef WOLFSSL_SHA512
wolfSSL 9:52ec7c02b1e1 1005 #define WOLFSSL_SHA512
wolfSSL 9:52ec7c02b1e1 1006 #endif
wolfSSL 9:52ec7c02b1e1 1007 #endif
wolfSSL 9:52ec7c02b1e1 1008 #endif
wolfSSL 9:52ec7c02b1e1 1009 #endif /* FREESCALE_USE_LTC */
wolfSSL 9:52ec7c02b1e1 1010
wolfSSL 9:52ec7c02b1e1 1011 #ifdef FREESCALE_LTC_TFM_RSA_4096_ENABLE
wolfSSL 9:52ec7c02b1e1 1012 #undef USE_CERT_BUFFERS_4096
wolfSSL 9:52ec7c02b1e1 1013 #define USE_CERT_BUFFERS_4096
wolfSSL 9:52ec7c02b1e1 1014 #undef FP_MAX_BITS
wolfSSL 9:52ec7c02b1e1 1015 #define FP_MAX_BITS (8192)
wolfSSL 9:52ec7c02b1e1 1016
wolfSSL 9:52ec7c02b1e1 1017 #undef NO_DH
wolfSSL 9:52ec7c02b1e1 1018 #define NO_DH
wolfSSL 9:52ec7c02b1e1 1019 #undef NO_DSA
wolfSSL 9:52ec7c02b1e1 1020 #define NO_DSA
wolfSSL 9:52ec7c02b1e1 1021 #endif /* FREESCALE_LTC_TFM_RSA_4096_ENABLE */
wolfSSL 9:52ec7c02b1e1 1022
wolfSSL 9:52ec7c02b1e1 1023 /* if LTC has AES engine but doesn't have GCM, use software with LTC AES ECB mode */
wolfSSL 9:52ec7c02b1e1 1024 #if defined(FREESCALE_USE_LTC) && !defined(FREESCALE_LTC_AES_GCM)
wolfSSL 9:52ec7c02b1e1 1025 #define GCM_TABLE
wolfSSL 9:52ec7c02b1e1 1026 #endif
wolfSSL 9:52ec7c02b1e1 1027
wolfSSL 14:167253f4e170 1028 #if defined(WOLFSSL_STM32F2) || defined(WOLFSSL_STM32F4) || \
wolfSSL 14:167253f4e170 1029 defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32F1) || \
wolfSSL 14:167253f4e170 1030 defined(WOLFSSL_STM32L4)
wolfSSL 9:52ec7c02b1e1 1031
wolfSSL 9:52ec7c02b1e1 1032 #define SIZEOF_LONG_LONG 8
wolfSSL 9:52ec7c02b1e1 1033 #define NO_DEV_RANDOM
wolfSSL 9:52ec7c02b1e1 1034 #define NO_WOLFSSL_DIR
wolfSSL 9:52ec7c02b1e1 1035 #undef NO_RABBIT
wolfSSL 9:52ec7c02b1e1 1036 #define NO_RABBIT
wolfSSL 14:167253f4e170 1037 #ifndef NO_STM32_RNG
wolfSSL 14:167253f4e170 1038 #undef STM32_RNG
wolfSSL 14:167253f4e170 1039 #define STM32_RNG
wolfSSL 14:167253f4e170 1040 #ifdef WOLFSSL_STM32F427_RNG
wolfSSL 14:167253f4e170 1041 #include "stm32f427xx.h"
wolfSSL 14:167253f4e170 1042 #endif
wolfSSL 14:167253f4e170 1043 #endif
wolfSSL 14:167253f4e170 1044 #ifndef NO_STM32_CRYPTO
wolfSSL 14:167253f4e170 1045 #undef STM32_CRYPTO
wolfSSL 14:167253f4e170 1046 #define STM32_CRYPTO
wolfSSL 14:167253f4e170 1047 #endif
wolfSSL 14:167253f4e170 1048 #ifndef NO_STM32_HASH
wolfSSL 14:167253f4e170 1049 #undef STM32_HASH
wolfSSL 14:167253f4e170 1050 #define STM32_HASH
wolfSSL 14:167253f4e170 1051 #endif
wolfSSL 9:52ec7c02b1e1 1052 #if !defined(__GNUC__) && !defined(__ICCARM__)
wolfSSL 9:52ec7c02b1e1 1053 #define KEIL_INTRINSICS
wolfSSL 9:52ec7c02b1e1 1054 #endif
wolfSSL 14:167253f4e170 1055 #define NO_OLD_RNGNAME
wolfSSL 9:52ec7c02b1e1 1056 #ifdef WOLFSSL_STM32_CUBEMX
wolfSSL 14:167253f4e170 1057 #if defined(WOLFSSL_STM32F2)
wolfSSL 14:167253f4e170 1058 #include "stm32f2xx_hal.h"
wolfSSL 14:167253f4e170 1059 #elif defined(WOLFSSL_STM32L4)
wolfSSL 14:167253f4e170 1060 #include "stm32l4xx_hal.h"
wolfSSL 14:167253f4e170 1061 #elif defined(WOLFSSL_STM32F4)
wolfSSL 14:167253f4e170 1062 #include "stm32f4xx_hal.h"
wolfSSL 14:167253f4e170 1063 #elif defined(WOLFSSL_STM32F7)
wolfSSL 14:167253f4e170 1064 #include "stm32f7xx_hal.h"
wolfSSL 14:167253f4e170 1065 #elif defined(WOLFSSL_STM32F1)
wolfSSL 14:167253f4e170 1066 #include "stm32f1xx_hal.h"
wolfSSL 14:167253f4e170 1067 #endif
wolfSSL 14:167253f4e170 1068
wolfSSL 10:6c2db0c97d5a 1069 #ifndef STM32_HAL_TIMEOUT
wolfSSL 10:6c2db0c97d5a 1070 #define STM32_HAL_TIMEOUT 0xFF
wolfSSL 10:6c2db0c97d5a 1071 #endif
wolfSSL 9:52ec7c02b1e1 1072 #else
wolfSSL 14:167253f4e170 1073 #if defined(WOLFSSL_STM32F2)
wolfSSL 14:167253f4e170 1074 #include "stm32f2xx.h"
wolfSSL 14:167253f4e170 1075 #ifdef STM32_CRYPTO
wolfSSL 14:167253f4e170 1076 #include "stm32f2xx_cryp.h"
wolfSSL 14:167253f4e170 1077 #endif
wolfSSL 14:167253f4e170 1078 #ifdef STM32_HASH
wolfSSL 14:167253f4e170 1079 #include "stm32f2xx_hash.h"
wolfSSL 14:167253f4e170 1080 #endif
wolfSSL 14:167253f4e170 1081 #elif defined(WOLFSSL_STM32F4)
wolfSSL 14:167253f4e170 1082 #include "stm32f4xx.h"
wolfSSL 14:167253f4e170 1083 #ifdef STM32_CRYPTO
wolfSSL 14:167253f4e170 1084 #include "stm32f4xx_cryp.h"
wolfSSL 14:167253f4e170 1085 #endif
wolfSSL 14:167253f4e170 1086 #ifdef STM32_HASH
wolfSSL 14:167253f4e170 1087 #include "stm32f4xx_hash.h"
wolfSSL 14:167253f4e170 1088 #endif
wolfSSL 14:167253f4e170 1089 #elif defined(WOLFSSL_STM32L4)
wolfSSL 14:167253f4e170 1090 #include "stm32l4xx.h"
wolfSSL 14:167253f4e170 1091 #ifdef STM32_CRYPTO
wolfSSL 14:167253f4e170 1092 #include "stm32l4xx_cryp.h"
wolfSSL 14:167253f4e170 1093 #endif
wolfSSL 14:167253f4e170 1094 #ifdef STM32_HASH
wolfSSL 14:167253f4e170 1095 #include "stm32l4xx_hash.h"
wolfSSL 14:167253f4e170 1096 #endif
wolfSSL 14:167253f4e170 1097 #elif defined(WOLFSSL_STM32F7)
wolfSSL 14:167253f4e170 1098 #include "stm32f7xx.h"
wolfSSL 14:167253f4e170 1099 #elif defined(WOLFSSL_STM32F1)
wolfSSL 14:167253f4e170 1100 #include "stm32f1xx.h"
wolfSSL 14:167253f4e170 1101 #endif
wolfSSL 9:52ec7c02b1e1 1102 #endif /* WOLFSSL_STM32_CUBEMX */
wolfSSL 14:167253f4e170 1103 #endif /* WOLFSSL_STM32F2 || WOLFSSL_STM32F4 || WOLFSSL_STM32F7 */
wolfSSL 9:52ec7c02b1e1 1104
wolfSSL 9:52ec7c02b1e1 1105 #ifdef MICRIUM
wolfSSL 14:167253f4e170 1106 #include <stdlib.h>
wolfSSL 14:167253f4e170 1107 #include <os.h>
wolfSSL 14:167253f4e170 1108 #include <net_cfg.h>
wolfSSL 14:167253f4e170 1109 #include <net_sock.h>
wolfSSL 14:167253f4e170 1110 #include <net_err.h>
wolfSSL 14:167253f4e170 1111 #include <lib_mem.h>
wolfSSL 14:167253f4e170 1112 #include <lib_math.h>
wolfSSL 9:52ec7c02b1e1 1113
wolfSSL 14:167253f4e170 1114 #define USE_FAST_MATH
wolfSSL 14:167253f4e170 1115 #define TFM_TIMING_RESISTANT
wolfSSL 14:167253f4e170 1116 #define ECC_TIMING_RESISTANT
wolfSSL 14:167253f4e170 1117 #define WC_RSA_BLINDING
wolfSSL 14:167253f4e170 1118 #define HAVE_HASHDRBG
wolfSSL 14:167253f4e170 1119
wolfSSL 14:167253f4e170 1120 #define HAVE_ECC
wolfSSL 14:167253f4e170 1121 #define ALT_ECC_SIZE
wolfSSL 14:167253f4e170 1122 #define TFM_ECC192
wolfSSL 14:167253f4e170 1123 #define TFM_ECC224
wolfSSL 14:167253f4e170 1124 #define TFM_ECC256
wolfSSL 14:167253f4e170 1125 #define TFM_ECC384
wolfSSL 14:167253f4e170 1126 #define TFM_ECC521
wolfSSL 14:167253f4e170 1127
wolfSSL 14:167253f4e170 1128 #define NO_RC4
wolfSSL 14:167253f4e170 1129 #define HAVE_TLS_EXTENSIONS
wolfSSL 14:167253f4e170 1130 #define HAVE_SUPPORTED_CURVES
wolfSSL 14:167253f4e170 1131 #define HAVE_EXTENDED_MASTER
wolfSSL 14:167253f4e170 1132
wolfSSL 14:167253f4e170 1133 #define NO_WOLFSSL_DIR
wolfSSL 14:167253f4e170 1134 #define NO_WRITEV
wolfSSL 14:167253f4e170 1135
wolfSSL 14:167253f4e170 1136 #ifndef CUSTOM_RAND_GENERATE
wolfSSL 14:167253f4e170 1137 #define CUSTOM_RAND_TYPE RAND_NBR
wolfSSL 14:167253f4e170 1138 #define CUSTOM_RAND_GENERATE Math_Rand
wolfSSL 14:167253f4e170 1139 #endif
wolfSSL 9:52ec7c02b1e1 1140
wolfSSL 9:52ec7c02b1e1 1141 #define WOLFSSL_TYPES
wolfSSL 9:52ec7c02b1e1 1142 typedef CPU_INT08U byte;
wolfSSL 9:52ec7c02b1e1 1143 typedef CPU_INT16U word16;
wolfSSL 9:52ec7c02b1e1 1144 typedef CPU_INT32U word32;
wolfSSL 9:52ec7c02b1e1 1145
wolfSSL 9:52ec7c02b1e1 1146 #define STRING_USER
wolfSSL 9:52ec7c02b1e1 1147 #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr)))
wolfSSL 9:52ec7c02b1e1 1148 #define XSTRNCPY(pstr_dest, pstr_src, len_max) \
wolfSSL 9:52ec7c02b1e1 1149 ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \
wolfSSL 9:52ec7c02b1e1 1150 (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max)))
wolfSSL 9:52ec7c02b1e1 1151 #define XSTRNCMP(pstr_1, pstr_2, len_max) \
wolfSSL 9:52ec7c02b1e1 1152 ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \
wolfSSL 9:52ec7c02b1e1 1153 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
wolfSSL 14:167253f4e170 1154 #define XSTRNCASECMP(pstr_1, pstr_2, len_max) \
wolfSSL 14:167253f4e170 1155 ((CPU_INT16S)Str_CmpIgnoreCase_N((CPU_CHAR *)(pstr_1), \
wolfSSL 14:167253f4e170 1156 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max)))
wolfSSL 9:52ec7c02b1e1 1157 #define XSTRSTR(pstr, pstr_srch) \
wolfSSL 9:52ec7c02b1e1 1158 ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \
wolfSSL 9:52ec7c02b1e1 1159 (CPU_CHAR *)(pstr_srch)))
wolfSSL 14:167253f4e170 1160 #define XSTRNSTR(pstr, pstr_srch, len_max) \
wolfSSL 14:167253f4e170 1161 ((CPU_CHAR *)Str_Str_N((CPU_CHAR *)(pstr), \
wolfSSL 14:167253f4e170 1162 (CPU_CHAR *)(pstr_srch),(CPU_SIZE_T)(len_max)))
wolfSSL 14:167253f4e170 1163 #define XSTRNCAT(pstr_dest, pstr_cat, len_max) \
wolfSSL 14:167253f4e170 1164 ((CPU_CHAR *)Str_Cat_N((CPU_CHAR *)(pstr_dest), \
wolfSSL 14:167253f4e170 1165 (const CPU_CHAR *)(pstr_cat),(CPU_SIZE_T)(len_max)))
wolfSSL 9:52ec7c02b1e1 1166 #define XMEMSET(pmem, data_val, size) \
wolfSSL 9:52ec7c02b1e1 1167 ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \
wolfSSL 9:52ec7c02b1e1 1168 (CPU_SIZE_T)(size)))
wolfSSL 9:52ec7c02b1e1 1169 #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \
wolfSSL 9:52ec7c02b1e1 1170 (void *)(psrc), (CPU_SIZE_T)(size)))
wolfSSL 9:52ec7c02b1e1 1171 #define XMEMCMP(pmem_1, pmem_2, size) \
wolfSSL 9:52ec7c02b1e1 1172 (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \
wolfSSL 9:52ec7c02b1e1 1173 (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES)
wolfSSL 9:52ec7c02b1e1 1174 #define XMEMMOVE XMEMCPY
wolfSSL 9:52ec7c02b1e1 1175
wolfSSL 14:167253f4e170 1176 #if (OS_CFG_MUTEX_EN == DEF_DISABLED)
wolfSSL 9:52ec7c02b1e1 1177 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 1178 #endif
wolfSSL 9:52ec7c02b1e1 1179
wolfSSL 9:52ec7c02b1e1 1180 #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG)
wolfSSL 9:52ec7c02b1e1 1181 #define BIG_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 1182 #else
wolfSSL 9:52ec7c02b1e1 1183 #undef BIG_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 1184 #define LITTLE_ENDIAN_ORDER
wolfSSL 9:52ec7c02b1e1 1185 #endif
wolfSSL 9:52ec7c02b1e1 1186 #endif /* MICRIUM */
wolfSSL 9:52ec7c02b1e1 1187
wolfSSL 9:52ec7c02b1e1 1188
wolfSSL 9:52ec7c02b1e1 1189 #ifdef WOLFSSL_QL
wolfSSL 9:52ec7c02b1e1 1190 #ifndef WOLFSSL_SEP
wolfSSL 9:52ec7c02b1e1 1191 #define WOLFSSL_SEP
wolfSSL 9:52ec7c02b1e1 1192 #endif
wolfSSL 9:52ec7c02b1e1 1193 #ifndef OPENSSL_EXTRA
wolfSSL 9:52ec7c02b1e1 1194 #define OPENSSL_EXTRA
wolfSSL 9:52ec7c02b1e1 1195 #endif
wolfSSL 9:52ec7c02b1e1 1196 #ifndef SESSION_CERTS
wolfSSL 9:52ec7c02b1e1 1197 #define SESSION_CERTS
wolfSSL 9:52ec7c02b1e1 1198 #endif
wolfSSL 9:52ec7c02b1e1 1199 #ifndef HAVE_AESCCM
wolfSSL 9:52ec7c02b1e1 1200 #define HAVE_AESCCM
wolfSSL 9:52ec7c02b1e1 1201 #endif
wolfSSL 9:52ec7c02b1e1 1202 #ifndef ATOMIC_USER
wolfSSL 9:52ec7c02b1e1 1203 #define ATOMIC_USER
wolfSSL 9:52ec7c02b1e1 1204 #endif
wolfSSL 9:52ec7c02b1e1 1205 #ifndef WOLFSSL_DER_LOAD
wolfSSL 9:52ec7c02b1e1 1206 #define WOLFSSL_DER_LOAD
wolfSSL 9:52ec7c02b1e1 1207 #endif
wolfSSL 9:52ec7c02b1e1 1208 #ifndef KEEP_PEER_CERT
wolfSSL 9:52ec7c02b1e1 1209 #define KEEP_PEER_CERT
wolfSSL 9:52ec7c02b1e1 1210 #endif
wolfSSL 9:52ec7c02b1e1 1211 #ifndef HAVE_ECC
wolfSSL 9:52ec7c02b1e1 1212 #define HAVE_ECC
wolfSSL 9:52ec7c02b1e1 1213 #endif
wolfSSL 9:52ec7c02b1e1 1214 #ifndef SESSION_INDEX
wolfSSL 9:52ec7c02b1e1 1215 #define SESSION_INDEX
wolfSSL 9:52ec7c02b1e1 1216 #endif
wolfSSL 9:52ec7c02b1e1 1217 #endif /* WOLFSSL_QL */
wolfSSL 9:52ec7c02b1e1 1218
wolfSSL 9:52ec7c02b1e1 1219
wolfSSL 12:1a06964c2adb 1220 #if defined(WOLFSSL_XILINX)
wolfSSL 12:1a06964c2adb 1221 #define USER_TIME /* XTIME in asn.c */
wolfSSL 12:1a06964c2adb 1222 #define NO_WOLFSSL_DIR
wolfSSL 12:1a06964c2adb 1223 #define NO_DEV_RANDOM
wolfSSL 12:1a06964c2adb 1224 #define HAVE_AESGCM
wolfSSL 12:1a06964c2adb 1225 #endif
wolfSSL 12:1a06964c2adb 1226
wolfSSL 12:1a06964c2adb 1227 #if defined(WOLFSSL_XILINX_CRYPT)
wolfSSL 12:1a06964c2adb 1228 #if defined(WOLFSSL_ARMASM)
wolfSSL 12:1a06964c2adb 1229 #error can not use both ARMv8 instructions and XILINX hardened crypto
wolfSSL 12:1a06964c2adb 1230 #endif
wolfSSL 12:1a06964c2adb 1231 #if defined(WOLFSSL_SHA3)
wolfSSL 12:1a06964c2adb 1232 /* only SHA3-384 is supported */
wolfSSL 12:1a06964c2adb 1233 #undef WOLFSSL_NOSHA3_224
wolfSSL 12:1a06964c2adb 1234 #undef WOLFSSL_NOSHA3_256
wolfSSL 12:1a06964c2adb 1235 #undef WOLFSSL_NOSHA3_512
wolfSSL 12:1a06964c2adb 1236 #define WOLFSSL_NOSHA3_224
wolfSSL 12:1a06964c2adb 1237 #define WOLFSSL_NOSHA3_256
wolfSSL 12:1a06964c2adb 1238 #define WOLFSSL_NOSHA3_512
wolfSSL 12:1a06964c2adb 1239 #endif
wolfSSL 12:1a06964c2adb 1240 #endif /*(WOLFSSL_XILINX_CRYPT)*/
wolfSSL 12:1a06964c2adb 1241
wolfSSL 14:167253f4e170 1242 #ifdef WOLFSSL_IMX6
wolfSSL 14:167253f4e170 1243 #ifndef SIZEOF_LONG_LONG
wolfSSL 14:167253f4e170 1244 #define SIZEOF_LONG_LONG 8
wolfSSL 14:167253f4e170 1245 #endif
wolfSSL 14:167253f4e170 1246 #endif
wolfSSL 14:167253f4e170 1247
wolfSSL 14:167253f4e170 1248 /* if defined turn on all CAAM support */
wolfSSL 14:167253f4e170 1249 #ifdef WOLFSSL_IMX6_CAAM
wolfSSL 14:167253f4e170 1250 #undef WOLFSSL_IMX6_CAAM_RNG
wolfSSL 14:167253f4e170 1251 #define WOLFSSL_IMX6_CAAM_RNG
wolfSSL 14:167253f4e170 1252
wolfSSL 14:167253f4e170 1253 #undef WOLFSSL_IMX6_CAAM_BLOB
wolfSSL 14:167253f4e170 1254 #define WOLFSSL_IMX6_CAAM_BLOB
wolfSSL 14:167253f4e170 1255
wolfSSL 14:167253f4e170 1256 #if defined(HAVE_AESGCM) || defined(WOLFSSL_AES_XTS)
wolfSSL 14:167253f4e170 1257 /* large performance gain with HAVE_AES_ECB defined */
wolfSSL 14:167253f4e170 1258 #undef HAVE_AES_ECB
wolfSSL 14:167253f4e170 1259 #define HAVE_AES_ECB
wolfSSL 14:167253f4e170 1260 #endif
wolfSSL 14:167253f4e170 1261 #endif
wolfSSL 14:167253f4e170 1262
wolfSSL 9:52ec7c02b1e1 1263 #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \
wolfSSL 10:6c2db0c97d5a 1264 !defined(WOLFSSL_LEANPSK) && !defined(NO_WOLFSSL_MEMORY) && \
wolfSSL 10:6c2db0c97d5a 1265 !defined(XMALLOC_OVERRIDE)
wolfSSL 9:52ec7c02b1e1 1266 #define USE_WOLFSSL_MEMORY
wolfSSL 9:52ec7c02b1e1 1267 #endif
wolfSSL 9:52ec7c02b1e1 1268
wolfSSL 9:52ec7c02b1e1 1269
wolfSSL 9:52ec7c02b1e1 1270 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS)
wolfSSL 9:52ec7c02b1e1 1271 #undef KEEP_PEER_CERT
wolfSSL 9:52ec7c02b1e1 1272 #define KEEP_PEER_CERT
wolfSSL 9:52ec7c02b1e1 1273 #endif
wolfSSL 9:52ec7c02b1e1 1274
wolfSSL 9:52ec7c02b1e1 1275
wolfSSL 9:52ec7c02b1e1 1276 /* stream ciphers except arc4 need 32bit alignment, intel ok without */
wolfSSL 9:52ec7c02b1e1 1277 #ifndef XSTREAM_ALIGN
wolfSSL 9:52ec7c02b1e1 1278 #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__)
wolfSSL 9:52ec7c02b1e1 1279 #define NO_XSTREAM_ALIGN
wolfSSL 9:52ec7c02b1e1 1280 #else
wolfSSL 9:52ec7c02b1e1 1281 #define XSTREAM_ALIGN
wolfSSL 9:52ec7c02b1e1 1282 #endif
wolfSSL 9:52ec7c02b1e1 1283 #endif
wolfSSL 9:52ec7c02b1e1 1284
wolfSSL 10:6c2db0c97d5a 1285 /* write dup cannot be used with secure renegotiation because write dup
wolfSSL 10:6c2db0c97d5a 1286 * make write side write only and read side read only */
wolfSSL 10:6c2db0c97d5a 1287 #if defined(HAVE_WRITE_DUP) && defined(HAVE_SECURE_RENEGOTIATION)
wolfSSL 10:6c2db0c97d5a 1288 #error "WRITE DUP and SECURE RENEGOTIATION cannot both be on"
wolfSSL 10:6c2db0c97d5a 1289 #endif
wolfSSL 10:6c2db0c97d5a 1290
wolfSSL 9:52ec7c02b1e1 1291 #ifdef WOLFSSL_SGX
wolfSSL 12:1a06964c2adb 1292 #ifdef _MSC_VER
wolfSSL 12:1a06964c2adb 1293 #define NO_RC4
wolfSSL 14:167253f4e170 1294 #ifndef HAVE_FIPS
wolfSSL 14:167253f4e170 1295 #define WOLFCRYPT_ONLY
wolfSSL 14:167253f4e170 1296 #define NO_DES3
wolfSSL 14:167253f4e170 1297 #define NO_SHA
wolfSSL 14:167253f4e170 1298 #define NO_MD5
wolfSSL 14:167253f4e170 1299 #else
wolfSSL 14:167253f4e170 1300 #define TFM_TIMING_RESISTANT
wolfSSL 14:167253f4e170 1301 #define NO_WOLFSSL_DIR
wolfSSL 14:167253f4e170 1302 #define NO_WRITEV
wolfSSL 14:167253f4e170 1303 #define NO_MAIN_DRIVER
wolfSSL 14:167253f4e170 1304 #define WOLFSSL_LOG_PRINTF
wolfSSL 14:167253f4e170 1305 #define WOLFSSL_DH_CONST
wolfSSL 14:167253f4e170 1306 #endif
wolfSSL 12:1a06964c2adb 1307 #else
wolfSSL 12:1a06964c2adb 1308 #define HAVE_ECC
wolfSSL 12:1a06964c2adb 1309 #define NO_WRITEV
wolfSSL 12:1a06964c2adb 1310 #define NO_MAIN_DRIVER
wolfSSL 12:1a06964c2adb 1311 #define USER_TICKS
wolfSSL 12:1a06964c2adb 1312 #define WOLFSSL_LOG_PRINTF
wolfSSL 12:1a06964c2adb 1313 #define WOLFSSL_DH_CONST
wolfSSL 12:1a06964c2adb 1314 #endif /* _MSC_VER */
wolfSSL 14:167253f4e170 1315 #if !defined(HAVE_FIPS) && !defined(NO_RSA)
wolfSSL 12:1a06964c2adb 1316 #define WC_RSA_BLINDING
wolfSSL 12:1a06964c2adb 1317 #endif
wolfSSL 14:167253f4e170 1318
wolfSSL 14:167253f4e170 1319 #define NO_FILESYSTEM
wolfSSL 14:167253f4e170 1320 #define ECC_TIMING_RESISTANT
wolfSSL 14:167253f4e170 1321 #define TFM_TIMING_RESISTANT
wolfSSL 9:52ec7c02b1e1 1322 #define SINGLE_THREADED
wolfSSL 9:52ec7c02b1e1 1323 #define NO_ASN_TIME /* can not use headers such as windows.h */
wolfSSL 9:52ec7c02b1e1 1324 #define HAVE_AESGCM
wolfSSL 9:52ec7c02b1e1 1325 #define USE_CERT_BUFFERS_2048
wolfSSL 9:52ec7c02b1e1 1326 #define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 1327 #endif /* WOLFSSL_SGX */
wolfSSL 9:52ec7c02b1e1 1328
wolfSSL 9:52ec7c02b1e1 1329 /* FreeScale MMCAU hardware crypto has 4 byte alignment.
wolfSSL 12:1a06964c2adb 1330 However, KSDK fsl_mmcau.h gives API with no alignment
wolfSSL 12:1a06964c2adb 1331 requirements (4 byte alignment is managed internally by fsl_mmcau.c) */
wolfSSL 9:52ec7c02b1e1 1332 #ifdef FREESCALE_MMCAU
wolfSSL 12:1a06964c2adb 1333 #ifdef FREESCALE_MMCAU_CLASSIC
wolfSSL 12:1a06964c2adb 1334 #define WOLFSSL_MMCAU_ALIGNMENT 4
wolfSSL 12:1a06964c2adb 1335 #else
wolfSSL 12:1a06964c2adb 1336 #define WOLFSSL_MMCAU_ALIGNMENT 0
wolfSSL 12:1a06964c2adb 1337 #endif
wolfSSL 9:52ec7c02b1e1 1338 #endif
wolfSSL 9:52ec7c02b1e1 1339
wolfSSL 9:52ec7c02b1e1 1340 /* if using hardware crypto and have alignment requirements, specify the
wolfSSL 9:52ec7c02b1e1 1341 requirement here. The record header of SSL/TLS will prevent easy alignment.
wolfSSL 9:52ec7c02b1e1 1342 This hint tries to help as much as possible. */
wolfSSL 9:52ec7c02b1e1 1343 #ifndef WOLFSSL_GENERAL_ALIGNMENT
wolfSSL 9:52ec7c02b1e1 1344 #ifdef WOLFSSL_AESNI
wolfSSL 9:52ec7c02b1e1 1345 #define WOLFSSL_GENERAL_ALIGNMENT 16
wolfSSL 9:52ec7c02b1e1 1346 #elif defined(XSTREAM_ALIGN)
wolfSSL 9:52ec7c02b1e1 1347 #define WOLFSSL_GENERAL_ALIGNMENT 4
wolfSSL 12:1a06964c2adb 1348 #elif defined(FREESCALE_MMCAU) || defined(FREESCALE_MMCAU_CLASSIC)
wolfSSL 9:52ec7c02b1e1 1349 #define WOLFSSL_GENERAL_ALIGNMENT WOLFSSL_MMCAU_ALIGNMENT
wolfSSL 9:52ec7c02b1e1 1350 #else
wolfSSL 9:52ec7c02b1e1 1351 #define WOLFSSL_GENERAL_ALIGNMENT 0
wolfSSL 9:52ec7c02b1e1 1352 #endif
wolfSSL 9:52ec7c02b1e1 1353 #endif
wolfSSL 9:52ec7c02b1e1 1354
wolfSSL 9:52ec7c02b1e1 1355 #if defined(WOLFSSL_GENERAL_ALIGNMENT) && (WOLFSSL_GENERAL_ALIGNMENT > 0)
wolfSSL 9:52ec7c02b1e1 1356 #if defined(_MSC_VER)
wolfSSL 9:52ec7c02b1e1 1357 #define XGEN_ALIGN __declspec(align(WOLFSSL_GENERAL_ALIGNMENT))
wolfSSL 9:52ec7c02b1e1 1358 #elif defined(__GNUC__)
wolfSSL 9:52ec7c02b1e1 1359 #define XGEN_ALIGN __attribute__((aligned(WOLFSSL_GENERAL_ALIGNMENT)))
wolfSSL 9:52ec7c02b1e1 1360 #else
wolfSSL 9:52ec7c02b1e1 1361 #define XGEN_ALIGN
wolfSSL 9:52ec7c02b1e1 1362 #endif
wolfSSL 9:52ec7c02b1e1 1363 #else
wolfSSL 9:52ec7c02b1e1 1364 #define XGEN_ALIGN
wolfSSL 9:52ec7c02b1e1 1365 #endif
wolfSSL 9:52ec7c02b1e1 1366
wolfSSL 9:52ec7c02b1e1 1367 #ifdef HAVE_CRL
wolfSSL 9:52ec7c02b1e1 1368 /* not widely supported yet */
wolfSSL 9:52ec7c02b1e1 1369 #undef NO_SKID
wolfSSL 9:52ec7c02b1e1 1370 #define NO_SKID
wolfSSL 9:52ec7c02b1e1 1371 #endif
wolfSSL 9:52ec7c02b1e1 1372
wolfSSL 9:52ec7c02b1e1 1373
wolfSSL 9:52ec7c02b1e1 1374 #ifdef __INTEL_COMPILER
wolfSSL 9:52ec7c02b1e1 1375 #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */
wolfSSL 9:52ec7c02b1e1 1376 #endif
wolfSSL 9:52ec7c02b1e1 1377
wolfSSL 9:52ec7c02b1e1 1378 /* user can specify what curves they want with ECC_USER_CURVES otherwise
wolfSSL 9:52ec7c02b1e1 1379 * all curves are on by default for now */
wolfSSL 9:52ec7c02b1e1 1380 #ifndef ECC_USER_CURVES
wolfSSL 14:167253f4e170 1381 #if !defined(WOLFSSL_SP_MATH) && !defined(HAVE_ALL_CURVES)
wolfSSL 9:52ec7c02b1e1 1382 #define HAVE_ALL_CURVES
wolfSSL 9:52ec7c02b1e1 1383 #endif
wolfSSL 9:52ec7c02b1e1 1384 #endif
wolfSSL 9:52ec7c02b1e1 1385
wolfSSL 9:52ec7c02b1e1 1386 /* ECC Configs */
wolfSSL 9:52ec7c02b1e1 1387 #ifdef HAVE_ECC
wolfSSL 9:52ec7c02b1e1 1388 /* By default enable Sign, Verify, DHE, Key Import and Key Export unless explicitly disabled */
wolfSSL 9:52ec7c02b1e1 1389 #ifndef NO_ECC_SIGN
wolfSSL 9:52ec7c02b1e1 1390 #undef HAVE_ECC_SIGN
wolfSSL 9:52ec7c02b1e1 1391 #define HAVE_ECC_SIGN
wolfSSL 9:52ec7c02b1e1 1392 #endif
wolfSSL 9:52ec7c02b1e1 1393 #ifndef NO_ECC_VERIFY
wolfSSL 9:52ec7c02b1e1 1394 #undef HAVE_ECC_VERIFY
wolfSSL 9:52ec7c02b1e1 1395 #define HAVE_ECC_VERIFY
wolfSSL 9:52ec7c02b1e1 1396 #endif
wolfSSL 14:167253f4e170 1397 #ifndef NO_ECC_CHECK_KEY
wolfSSL 14:167253f4e170 1398 #undef HAVE_ECC_CHECK_KEY
wolfSSL 14:167253f4e170 1399 #define HAVE_ECC_CHECK_KEY
wolfSSL 14:167253f4e170 1400 #endif
wolfSSL 9:52ec7c02b1e1 1401 #ifndef NO_ECC_DHE
wolfSSL 9:52ec7c02b1e1 1402 #undef HAVE_ECC_DHE
wolfSSL 9:52ec7c02b1e1 1403 #define HAVE_ECC_DHE
wolfSSL 9:52ec7c02b1e1 1404 #endif
wolfSSL 9:52ec7c02b1e1 1405 #ifndef NO_ECC_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1406 #undef HAVE_ECC_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1407 #define HAVE_ECC_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1408 #endif
wolfSSL 9:52ec7c02b1e1 1409 #ifndef NO_ECC_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1410 #undef HAVE_ECC_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1411 #define HAVE_ECC_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1412 #endif
wolfSSL 9:52ec7c02b1e1 1413 #endif /* HAVE_ECC */
wolfSSL 9:52ec7c02b1e1 1414
wolfSSL 9:52ec7c02b1e1 1415 /* Curve255519 Configs */
wolfSSL 9:52ec7c02b1e1 1416 #ifdef HAVE_CURVE25519
wolfSSL 9:52ec7c02b1e1 1417 /* By default enable shared secret, key export and import */
wolfSSL 9:52ec7c02b1e1 1418 #ifndef NO_CURVE25519_SHARED_SECRET
wolfSSL 9:52ec7c02b1e1 1419 #undef HAVE_CURVE25519_SHARED_SECRET
wolfSSL 9:52ec7c02b1e1 1420 #define HAVE_CURVE25519_SHARED_SECRET
wolfSSL 9:52ec7c02b1e1 1421 #endif
wolfSSL 9:52ec7c02b1e1 1422 #ifndef NO_CURVE25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1423 #undef HAVE_CURVE25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1424 #define HAVE_CURVE25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1425 #endif
wolfSSL 9:52ec7c02b1e1 1426 #ifndef NO_CURVE25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1427 #undef HAVE_CURVE25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1428 #define HAVE_CURVE25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1429 #endif
wolfSSL 9:52ec7c02b1e1 1430 #endif /* HAVE_CURVE25519 */
wolfSSL 9:52ec7c02b1e1 1431
wolfSSL 9:52ec7c02b1e1 1432 /* Ed255519 Configs */
wolfSSL 9:52ec7c02b1e1 1433 #ifdef HAVE_ED25519
wolfSSL 9:52ec7c02b1e1 1434 /* By default enable sign, verify, key export and import */
wolfSSL 9:52ec7c02b1e1 1435 #ifndef NO_ED25519_SIGN
wolfSSL 9:52ec7c02b1e1 1436 #undef HAVE_ED25519_SIGN
wolfSSL 9:52ec7c02b1e1 1437 #define HAVE_ED25519_SIGN
wolfSSL 9:52ec7c02b1e1 1438 #endif
wolfSSL 9:52ec7c02b1e1 1439 #ifndef NO_ED25519_VERIFY
wolfSSL 9:52ec7c02b1e1 1440 #undef HAVE_ED25519_VERIFY
wolfSSL 9:52ec7c02b1e1 1441 #define HAVE_ED25519_VERIFY
wolfSSL 9:52ec7c02b1e1 1442 #endif
wolfSSL 9:52ec7c02b1e1 1443 #ifndef NO_ED25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1444 #undef HAVE_ED25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1445 #define HAVE_ED25519_KEY_EXPORT
wolfSSL 9:52ec7c02b1e1 1446 #endif
wolfSSL 9:52ec7c02b1e1 1447 #ifndef NO_ED25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1448 #undef HAVE_ED25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1449 #define HAVE_ED25519_KEY_IMPORT
wolfSSL 9:52ec7c02b1e1 1450 #endif
wolfSSL 9:52ec7c02b1e1 1451 #endif /* HAVE_ED25519 */
wolfSSL 9:52ec7c02b1e1 1452
wolfSSL 9:52ec7c02b1e1 1453 /* AES Config */
wolfSSL 9:52ec7c02b1e1 1454 #ifndef NO_AES
wolfSSL 9:52ec7c02b1e1 1455 /* By default enable all AES key sizes, decryption and CBC */
wolfSSL 9:52ec7c02b1e1 1456 #ifndef AES_MAX_KEY_SIZE
wolfSSL 9:52ec7c02b1e1 1457 #undef AES_MAX_KEY_SIZE
wolfSSL 9:52ec7c02b1e1 1458 #define AES_MAX_KEY_SIZE 256
wolfSSL 9:52ec7c02b1e1 1459 #endif
wolfSSL 14:167253f4e170 1460
wolfSSL 14:167253f4e170 1461 #ifndef NO_AES_128
wolfSSL 14:167253f4e170 1462 #undef WOLFSSL_AES_128
wolfSSL 14:167253f4e170 1463 #define WOLFSSL_AES_128
wolfSSL 14:167253f4e170 1464 #endif
wolfSSL 14:167253f4e170 1465 #if !defined(NO_AES_192) && AES_MAX_KEY_SIZE >= 192
wolfSSL 14:167253f4e170 1466 #undef WOLFSSL_AES_192
wolfSSL 14:167253f4e170 1467 #define WOLFSSL_AES_192
wolfSSL 14:167253f4e170 1468 #endif
wolfSSL 14:167253f4e170 1469 #if !defined(NO_AES_256) && AES_MAX_KEY_SIZE >= 256
wolfSSL 14:167253f4e170 1470 #undef WOLFSSL_AES_256
wolfSSL 14:167253f4e170 1471 #define WOLFSSL_AES_256
wolfSSL 14:167253f4e170 1472 #endif
wolfSSL 14:167253f4e170 1473 #if !defined(WOLFSSL_AES_128) && defined(HAVE_ECC_ENCRYPT)
wolfSSL 14:167253f4e170 1474 #warning HAVE_ECC_ENCRYPT uses AES 128 bit keys
wolfSSL 14:167253f4e170 1475 #endif
wolfSSL 14:167253f4e170 1476
wolfSSL 9:52ec7c02b1e1 1477 #ifndef NO_AES_DECRYPT
wolfSSL 9:52ec7c02b1e1 1478 #undef HAVE_AES_DECRYPT
wolfSSL 9:52ec7c02b1e1 1479 #define HAVE_AES_DECRYPT
wolfSSL 9:52ec7c02b1e1 1480 #endif
wolfSSL 9:52ec7c02b1e1 1481 #ifndef NO_AES_CBC
wolfSSL 9:52ec7c02b1e1 1482 #undef HAVE_AES_CBC
wolfSSL 9:52ec7c02b1e1 1483 #define HAVE_AES_CBC
wolfSSL 9:52ec7c02b1e1 1484 #else
wolfSSL 9:52ec7c02b1e1 1485 #ifndef WOLFCRYPT_ONLY
wolfSSL 9:52ec7c02b1e1 1486 #error "AES CBC is required for TLS and can only be disabled for WOLFCRYPT_ONLY builds"
wolfSSL 9:52ec7c02b1e1 1487 #endif
wolfSSL 9:52ec7c02b1e1 1488 #endif
wolfSSL 14:167253f4e170 1489 #ifdef WOLFSSL_AES_XTS
wolfSSL 14:167253f4e170 1490 /* AES-XTS makes calls to AES direct functions */
wolfSSL 14:167253f4e170 1491 #ifndef WOLFSSL_AES_DIRECT
wolfSSL 14:167253f4e170 1492 #define WOLFSSL_AES_DIRECT
wolfSSL 14:167253f4e170 1493 #endif
wolfSSL 14:167253f4e170 1494 #endif
wolfSSL 14:167253f4e170 1495 #ifdef WOLFSSL_AES_CFB
wolfSSL 14:167253f4e170 1496 /* AES-CFB makes calls to AES direct functions */
wolfSSL 14:167253f4e170 1497 #ifndef WOLFSSL_AES_DIRECT
wolfSSL 14:167253f4e170 1498 #define WOLFSSL_AES_DIRECT
wolfSSL 14:167253f4e170 1499 #endif
wolfSSL 14:167253f4e170 1500 #endif
wolfSSL 9:52ec7c02b1e1 1501 #endif
wolfSSL 9:52ec7c02b1e1 1502
wolfSSL 9:52ec7c02b1e1 1503 /* if desktop type system and fastmath increase default max bits */
wolfSSL 9:52ec7c02b1e1 1504 #ifdef WOLFSSL_X86_64_BUILD
wolfSSL 9:52ec7c02b1e1 1505 #ifdef USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 1506 #ifndef FP_MAX_BITS
wolfSSL 9:52ec7c02b1e1 1507 #define FP_MAX_BITS 8192
wolfSSL 9:52ec7c02b1e1 1508 #endif
wolfSSL 9:52ec7c02b1e1 1509 #endif
wolfSSL 9:52ec7c02b1e1 1510 #endif
wolfSSL 9:52ec7c02b1e1 1511
wolfSSL 9:52ec7c02b1e1 1512 /* If using the max strength build, ensure OLD TLS is disabled. */
wolfSSL 9:52ec7c02b1e1 1513 #ifdef WOLFSSL_MAX_STRENGTH
wolfSSL 9:52ec7c02b1e1 1514 #undef NO_OLD_TLS
wolfSSL 9:52ec7c02b1e1 1515 #define NO_OLD_TLS
wolfSSL 9:52ec7c02b1e1 1516 #endif
wolfSSL 9:52ec7c02b1e1 1517
wolfSSL 9:52ec7c02b1e1 1518
wolfSSL 9:52ec7c02b1e1 1519 /* Default AES minimum auth tag sz, allow user to override */
wolfSSL 9:52ec7c02b1e1 1520 #ifndef WOLFSSL_MIN_AUTH_TAG_SZ
wolfSSL 9:52ec7c02b1e1 1521 #define WOLFSSL_MIN_AUTH_TAG_SZ 12
wolfSSL 9:52ec7c02b1e1 1522 #endif
wolfSSL 9:52ec7c02b1e1 1523
wolfSSL 9:52ec7c02b1e1 1524
wolfSSL 9:52ec7c02b1e1 1525 /* sniffer requires:
wolfSSL 9:52ec7c02b1e1 1526 * static RSA cipher suites
wolfSSL 9:52ec7c02b1e1 1527 * session stats and peak stats
wolfSSL 9:52ec7c02b1e1 1528 */
wolfSSL 9:52ec7c02b1e1 1529 #ifdef WOLFSSL_SNIFFER
wolfSSL 9:52ec7c02b1e1 1530 #ifndef WOLFSSL_STATIC_RSA
wolfSSL 9:52ec7c02b1e1 1531 #define WOLFSSL_STATIC_RSA
wolfSSL 9:52ec7c02b1e1 1532 #endif
wolfSSL 9:52ec7c02b1e1 1533 #ifndef WOLFSSL_SESSION_STATS
wolfSSL 9:52ec7c02b1e1 1534 #define WOLFSSL_SESSION_STATS
wolfSSL 9:52ec7c02b1e1 1535 #endif
wolfSSL 9:52ec7c02b1e1 1536 #ifndef WOLFSSL_PEAK_SESSIONS
wolfSSL 9:52ec7c02b1e1 1537 #define WOLFSSL_PEAK_SESSIONS
wolfSSL 9:52ec7c02b1e1 1538 #endif
wolfSSL 9:52ec7c02b1e1 1539 #endif
wolfSSL 9:52ec7c02b1e1 1540
wolfSSL 9:52ec7c02b1e1 1541 /* Decode Public Key extras on by default, user can turn off with
wolfSSL 9:52ec7c02b1e1 1542 * WOLFSSL_NO_DECODE_EXTRA */
wolfSSL 9:52ec7c02b1e1 1543 #ifndef WOLFSSL_NO_DECODE_EXTRA
wolfSSL 9:52ec7c02b1e1 1544 #ifndef RSA_DECODE_EXTRA
wolfSSL 9:52ec7c02b1e1 1545 #define RSA_DECODE_EXTRA
wolfSSL 9:52ec7c02b1e1 1546 #endif
wolfSSL 9:52ec7c02b1e1 1547 #ifndef ECC_DECODE_EXTRA
wolfSSL 9:52ec7c02b1e1 1548 #define ECC_DECODE_EXTRA
wolfSSL 9:52ec7c02b1e1 1549 #endif
wolfSSL 9:52ec7c02b1e1 1550 #endif
wolfSSL 9:52ec7c02b1e1 1551
wolfSSL 9:52ec7c02b1e1 1552 /* C Sharp wrapper defines */
wolfSSL 9:52ec7c02b1e1 1553 #ifdef HAVE_CSHARP
wolfSSL 9:52ec7c02b1e1 1554 #ifndef WOLFSSL_DTLS
wolfSSL 9:52ec7c02b1e1 1555 #define WOLFSSL_DTLS
wolfSSL 9:52ec7c02b1e1 1556 #endif
wolfSSL 9:52ec7c02b1e1 1557 #undef NO_PSK
wolfSSL 9:52ec7c02b1e1 1558 #undef NO_SHA256
wolfSSL 9:52ec7c02b1e1 1559 #undef NO_DH
wolfSSL 9:52ec7c02b1e1 1560 #endif
wolfSSL 9:52ec7c02b1e1 1561
wolfSSL 9:52ec7c02b1e1 1562 /* Asynchronous Crypto */
wolfSSL 9:52ec7c02b1e1 1563 #ifdef WOLFSSL_ASYNC_CRYPT
wolfSSL 9:52ec7c02b1e1 1564 /* Make sure wolf events are enabled */
wolfSSL 9:52ec7c02b1e1 1565 #undef HAVE_WOLF_EVENT
wolfSSL 9:52ec7c02b1e1 1566 #define HAVE_WOLF_EVENT
wolfSSL 9:52ec7c02b1e1 1567
wolfSSL 10:6c2db0c97d5a 1568 #ifdef WOLFSSL_ASYNC_CRYPT_TEST
wolfSSL 10:6c2db0c97d5a 1569 #define WC_ASYNC_DEV_SIZE 320+24
wolfSSL 10:6c2db0c97d5a 1570 #else
wolfSSL 10:6c2db0c97d5a 1571 #define WC_ASYNC_DEV_SIZE 320
wolfSSL 10:6c2db0c97d5a 1572 #endif
wolfSSL 10:6c2db0c97d5a 1573
wolfSSL 9:52ec7c02b1e1 1574 #if !defined(HAVE_CAVIUM) && !defined(HAVE_INTEL_QA) && \
wolfSSL 9:52ec7c02b1e1 1575 !defined(WOLFSSL_ASYNC_CRYPT_TEST)
wolfSSL 9:52ec7c02b1e1 1576 #error No async hardware defined with WOLFSSL_ASYNC_CRYPT!
wolfSSL 9:52ec7c02b1e1 1577 #endif
wolfSSL 10:6c2db0c97d5a 1578
wolfSSL 10:6c2db0c97d5a 1579 /* Enable ECC_CACHE_CURVE for ASYNC */
wolfSSL 10:6c2db0c97d5a 1580 #if !defined(ECC_CACHE_CURVE)
wolfSSL 10:6c2db0c97d5a 1581 #define ECC_CACHE_CURVE
wolfSSL 10:6c2db0c97d5a 1582 #endif
wolfSSL 9:52ec7c02b1e1 1583 #endif /* WOLFSSL_ASYNC_CRYPT */
wolfSSL 10:6c2db0c97d5a 1584 #ifndef WC_ASYNC_DEV_SIZE
wolfSSL 10:6c2db0c97d5a 1585 #define WC_ASYNC_DEV_SIZE 0
wolfSSL 10:6c2db0c97d5a 1586 #endif
wolfSSL 9:52ec7c02b1e1 1587
wolfSSL 9:52ec7c02b1e1 1588 /* leantls checks */
wolfSSL 9:52ec7c02b1e1 1589 #ifdef WOLFSSL_LEANTLS
wolfSSL 9:52ec7c02b1e1 1590 #ifndef HAVE_ECC
wolfSSL 9:52ec7c02b1e1 1591 #error leantls build needs ECC
wolfSSL 9:52ec7c02b1e1 1592 #endif
wolfSSL 9:52ec7c02b1e1 1593 #endif /* WOLFSSL_LEANTLS*/
wolfSSL 9:52ec7c02b1e1 1594
wolfSSL 9:52ec7c02b1e1 1595 /* restriction with static memory */
wolfSSL 9:52ec7c02b1e1 1596 #ifdef WOLFSSL_STATIC_MEMORY
wolfSSL 9:52ec7c02b1e1 1597 #if defined(HAVE_IO_POOL) || defined(XMALLOC_USER) || defined(NO_WOLFSSL_MEMORY)
wolfSSL 9:52ec7c02b1e1 1598 #error static memory cannot be used with HAVE_IO_POOL, XMALLOC_USER or NO_WOLFSSL_MEMORY
wolfSSL 9:52ec7c02b1e1 1599 #endif
wolfSSL 9:52ec7c02b1e1 1600 #if !defined(USE_FAST_MATH) && !defined(NO_BIG_INT)
wolfSSL 9:52ec7c02b1e1 1601 #error static memory requires fast math please define USE_FAST_MATH
wolfSSL 9:52ec7c02b1e1 1602 #endif
wolfSSL 9:52ec7c02b1e1 1603 #ifdef WOLFSSL_SMALL_STACK
wolfSSL 9:52ec7c02b1e1 1604 #error static memory does not support small stack please undefine
wolfSSL 9:52ec7c02b1e1 1605 #endif
wolfSSL 9:52ec7c02b1e1 1606 #endif /* WOLFSSL_STATIC_MEMORY */
wolfSSL 9:52ec7c02b1e1 1607
wolfSSL 9:52ec7c02b1e1 1608 #ifdef HAVE_AES_KEYWRAP
wolfSSL 9:52ec7c02b1e1 1609 #ifndef WOLFSSL_AES_DIRECT
wolfSSL 9:52ec7c02b1e1 1610 #error AES key wrap requires AES direct please define WOLFSSL_AES_DIRECT
wolfSSL 9:52ec7c02b1e1 1611 #endif
wolfSSL 9:52ec7c02b1e1 1612 #endif
wolfSSL 9:52ec7c02b1e1 1613
wolfSSL 9:52ec7c02b1e1 1614 #ifdef HAVE_PKCS7
wolfSSL 14:167253f4e170 1615 #if defined(NO_AES) && defined(NO_DES3)
wolfSSL 14:167253f4e170 1616 #error PKCS7 needs either AES or 3DES enabled, please enable one
wolfSSL 14:167253f4e170 1617 #endif
wolfSSL 9:52ec7c02b1e1 1618 #ifndef HAVE_AES_KEYWRAP
wolfSSL 9:52ec7c02b1e1 1619 #error PKCS7 requires AES key wrap please define HAVE_AES_KEYWRAP
wolfSSL 9:52ec7c02b1e1 1620 #endif
wolfSSL 14:167253f4e170 1621 #if defined(HAVE_ECC) && !defined(HAVE_X963_KDF)
wolfSSL 9:52ec7c02b1e1 1622 #error PKCS7 requires X963 KDF please define HAVE_X963_KDF
wolfSSL 9:52ec7c02b1e1 1623 #endif
wolfSSL 9:52ec7c02b1e1 1624 #endif
wolfSSL 9:52ec7c02b1e1 1625
wolfSSL 10:6c2db0c97d5a 1626 #if !defined(WOLFCRYPT_ONLY) && !defined(NO_OLD_TLS) && \
wolfSSL 10:6c2db0c97d5a 1627 (defined(NO_SHA) || defined(NO_MD5))
wolfSSL 10:6c2db0c97d5a 1628 #error old TLS requires MD5 and SHA
wolfSSL 10:6c2db0c97d5a 1629 #endif
wolfSSL 10:6c2db0c97d5a 1630
wolfSSL 10:6c2db0c97d5a 1631 /* for backwards compatibility */
wolfSSL 10:6c2db0c97d5a 1632 #if defined(TEST_IPV6) && !defined(WOLFSSL_IPV6)
wolfSSL 10:6c2db0c97d5a 1633 #define WOLFSSL_IPV6
wolfSSL 10:6c2db0c97d5a 1634 #endif
wolfSSL 10:6c2db0c97d5a 1635
wolfSSL 9:52ec7c02b1e1 1636
wolfSSL 9:52ec7c02b1e1 1637 /* Place any other flags or defines here */
wolfSSL 9:52ec7c02b1e1 1638
wolfSSL 9:52ec7c02b1e1 1639 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && defined(_WIN32) \
wolfSSL 9:52ec7c02b1e1 1640 && defined(HAVE_GMTIME_R)
wolfSSL 9:52ec7c02b1e1 1641 #undef HAVE_GMTIME_R /* don't trust macro with windows */
wolfSSL 9:52ec7c02b1e1 1642 #endif /* WOLFSSL_MYSQL_COMPATIBLE */
wolfSSL 9:52ec7c02b1e1 1643
wolfSSL 14:167253f4e170 1644 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
wolfSSL 10:6c2db0c97d5a 1645 #define SSL_OP_NO_COMPRESSION SSL_OP_NO_COMPRESSION
wolfSSL 10:6c2db0c97d5a 1646 #define OPENSSL_NO_ENGINE
wolfSSL 10:6c2db0c97d5a 1647 #define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT
wolfSSL 10:6c2db0c97d5a 1648 #ifndef OPENSSL_EXTRA
wolfSSL 10:6c2db0c97d5a 1649 #define OPENSSL_EXTRA
wolfSSL 10:6c2db0c97d5a 1650 #endif
wolfSSL 10:6c2db0c97d5a 1651 #ifndef HAVE_SESSION_TICKET
wolfSSL 10:6c2db0c97d5a 1652 #define HAVE_SESSION_TICKET
wolfSSL 10:6c2db0c97d5a 1653 #endif
wolfSSL 10:6c2db0c97d5a 1654 #ifndef HAVE_OCSP
wolfSSL 10:6c2db0c97d5a 1655 #define HAVE_OCSP
wolfSSL 10:6c2db0c97d5a 1656 #endif
wolfSSL 10:6c2db0c97d5a 1657 #ifndef KEEP_OUR_CERT
wolfSSL 10:6c2db0c97d5a 1658 #define KEEP_OUR_CERT
wolfSSL 10:6c2db0c97d5a 1659 #endif
wolfSSL 10:6c2db0c97d5a 1660 #ifndef HAVE_SNI
wolfSSL 10:6c2db0c97d5a 1661 #define HAVE_SNI
wolfSSL 10:6c2db0c97d5a 1662 #endif
wolfSSL 10:6c2db0c97d5a 1663 #endif
wolfSSL 10:6c2db0c97d5a 1664
wolfSSL 10:6c2db0c97d5a 1665 #if defined(WOLFSSL_NGINX)
wolfSSL 10:6c2db0c97d5a 1666 #define SSL_CTRL_SET_TLSEXT_HOSTNAME
wolfSSL 10:6c2db0c97d5a 1667 #endif
wolfSSL 9:52ec7c02b1e1 1668
wolfSSL 12:1a06964c2adb 1669 /* both CURVE and ED small math should be enabled */
wolfSSL 12:1a06964c2adb 1670 #ifdef CURVED25519_SMALL
wolfSSL 12:1a06964c2adb 1671 #define CURVE25519_SMALL
wolfSSL 12:1a06964c2adb 1672 #define ED25519_SMALL
wolfSSL 12:1a06964c2adb 1673 #endif
wolfSSL 12:1a06964c2adb 1674
wolfSSL 12:1a06964c2adb 1675
wolfSSL 12:1a06964c2adb 1676 #ifndef WOLFSSL_ALERT_COUNT_MAX
wolfSSL 12:1a06964c2adb 1677 #define WOLFSSL_ALERT_COUNT_MAX 5
wolfSSL 12:1a06964c2adb 1678 #endif
wolfSSL 12:1a06964c2adb 1679
wolfSSL 12:1a06964c2adb 1680 /* warning for not using harden build options (default with ./configure) */
wolfSSL 12:1a06964c2adb 1681 #ifndef WC_NO_HARDEN
wolfSSL 12:1a06964c2adb 1682 #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \
wolfSSL 12:1a06964c2adb 1683 (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \
wolfSSL 12:1a06964c2adb 1684 (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS))
wolfSSL 12:1a06964c2adb 1685
wolfSSL 12:1a06964c2adb 1686 #ifndef _MSC_VER
wolfSSL 12:1a06964c2adb 1687 #warning "For timing resistance / side-channel attack prevention consider using harden options"
wolfSSL 12:1a06964c2adb 1688 #else
wolfSSL 12:1a06964c2adb 1689 #pragma message("Warning: For timing resistance / side-channel attack prevention consider using harden options")
wolfSSL 12:1a06964c2adb 1690 #endif
wolfSSL 12:1a06964c2adb 1691 #endif
wolfSSL 12:1a06964c2adb 1692 #endif
wolfSSL 12:1a06964c2adb 1693
wolfSSL 14:167253f4e170 1694 #if defined(NO_OLD_WC_NAMES) || defined(OPENSSL_EXTRA)
wolfSSL 14:167253f4e170 1695 /* added to have compatibility with SHA256() */
wolfSSL 14:167253f4e170 1696 #if !defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS)
wolfSSL 14:167253f4e170 1697 #define NO_OLD_SHA_NAMES
wolfSSL 14:167253f4e170 1698 #endif
wolfSSL 14:167253f4e170 1699 #endif
wolfSSL 14:167253f4e170 1700
wolfSSL 14:167253f4e170 1701 /* switch for compatibility layer functionality. Has subparts i.e. BIO/X509
wolfSSL 14:167253f4e170 1702 * When opensslextra is enabled all subparts should be turned on. */
wolfSSL 14:167253f4e170 1703 #ifdef OPENSSL_EXTRA
wolfSSL 14:167253f4e170 1704 #undef OPENSSL_EXTRA_X509_SMALL
wolfSSL 14:167253f4e170 1705 #define OPENSSL_EXTRA_X509_SMALL
wolfSSL 14:167253f4e170 1706 #endif /* OPENSSL_EXTRA */
wolfSSL 14:167253f4e170 1707
wolfSSL 14:167253f4e170 1708 /* support for converting DER to PEM */
wolfSSL 14:167253f4e170 1709 #if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || \
wolfSSL 14:167253f4e170 1710 defined(OPENSSL_EXTRA)
wolfSSL 14:167253f4e170 1711 #undef WOLFSSL_DER_TO_PEM
wolfSSL 14:167253f4e170 1712 #define WOLFSSL_DER_TO_PEM
wolfSSL 14:167253f4e170 1713 #endif
wolfSSL 14:167253f4e170 1714
wolfSSL 14:167253f4e170 1715 /* keep backwards compatibility enabling encrypted private key */
wolfSSL 14:167253f4e170 1716 #ifndef WOLFSSL_ENCRYPTED_KEYS
wolfSSL 14:167253f4e170 1717 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \
wolfSSL 14:167253f4e170 1718 defined(HAVE_WEBSERVER)
wolfSSL 14:167253f4e170 1719 #define WOLFSSL_ENCRYPTED_KEYS
wolfSSL 14:167253f4e170 1720 #endif
wolfSSL 14:167253f4e170 1721 #endif
wolfSSL 14:167253f4e170 1722
wolfSSL 14:167253f4e170 1723 /* support for disabling PEM to DER */
wolfSSL 14:167253f4e170 1724 #if !defined(WOLFSSL_NO_PEM)
wolfSSL 14:167253f4e170 1725 #undef WOLFSSL_PEM_TO_DER
wolfSSL 14:167253f4e170 1726 #define WOLFSSL_PEM_TO_DER
wolfSSL 14:167253f4e170 1727 #endif
wolfSSL 14:167253f4e170 1728
wolfSSL 14:167253f4e170 1729 /* Parts of the openssl compatibility layer require peer certs */
wolfSSL 14:167253f4e170 1730 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY)
wolfSSL 14:167253f4e170 1731 #undef KEEP_PEER_CERT
wolfSSL 14:167253f4e170 1732 #define KEEP_PEER_CERT
wolfSSL 14:167253f4e170 1733 #endif
wolfSSL 14:167253f4e170 1734
wolfSSL 14:167253f4e170 1735 /* RAW hash function APIs are not implemented with ARMv8 hardware acceleration*/
wolfSSL 14:167253f4e170 1736 #ifdef WOLFSSL_ARMASM
wolfSSL 14:167253f4e170 1737 #undef WOLFSSL_NO_HASH_RAW
wolfSSL 14:167253f4e170 1738 #define WOLFSSL_NO_HASH_RAW
wolfSSL 14:167253f4e170 1739 #endif
wolfSSL 14:167253f4e170 1740
wolfSSL 9:52ec7c02b1e1 1741 #ifdef __cplusplus
wolfSSL 9:52ec7c02b1e1 1742 } /* extern "C" */
wolfSSL 9:52ec7c02b1e1 1743 #endif
wolfSSL 9:52ec7c02b1e1 1744
wolfSSL 9:52ec7c02b1e1 1745 #endif
wolfSSL 9:52ec7c02b1e1 1746