Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
settings.h
00001 /* settings.h 00002 * 00003 * Copyright (C) 2006-2017 wolfSSL Inc. 00004 * 00005 * This file is part of wolfSSL. 00006 * 00007 * wolfSSL is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * wolfSSL is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA 00020 */ 00021 00022 00023 /* Place OS specific preprocessor flags, defines, includes here, will be 00024 included into every file because types.h includes it */ 00025 00026 00027 #ifndef WOLF_CRYPT_SETTINGS_H 00028 #define WOLF_CRYPT_SETTINGS_H 00029 00030 #ifdef __cplusplus 00031 extern "C" { 00032 #endif 00033 00034 /* Uncomment next line if using IPHONE */ 00035 /* #define IPHONE */ 00036 00037 /* Uncomment next line if using ThreadX */ 00038 /* #define THREADX */ 00039 00040 /* Uncomment next line if using Micrium uC/OS-III */ 00041 /* #define MICRIUM */ 00042 00043 /* Uncomment next line if using Mbed */ 00044 /* #define MBED */ 00045 00046 /* Uncomment next line if using Microchip PIC32 ethernet starter kit */ 00047 /* #define MICROCHIP_PIC32 */ 00048 00049 /* Uncomment next line if using Microchip TCP/IP stack, version 5 */ 00050 /* #define MICROCHIP_TCPIP_V5 */ 00051 00052 /* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ 00053 /* #define MICROCHIP_TCPIP */ 00054 00055 /* Uncomment next line if using PIC32MZ Crypto Engine */ 00056 /* #define WOLFSSL_MICROCHIP_PIC32MZ */ 00057 00058 /* Uncomment next line if using FreeRTOS */ 00059 /* #define FREERTOS */ 00060 00061 /* Uncomment next line if using FreeRTOS+ TCP */ 00062 /* #define FREERTOS_TCP */ 00063 00064 /* Uncomment next line if using FreeRTOS Windows Simulator */ 00065 /* #define FREERTOS_WINSIM */ 00066 00067 /* Uncomment next line if using RTIP */ 00068 /* #define EBSNET */ 00069 00070 /* Uncomment next line if using lwip */ 00071 /* #define WOLFSSL_LWIP */ 00072 00073 /* Uncomment next line if building wolfSSL for a game console */ 00074 /* #define WOLFSSL_GAME_BUILD */ 00075 00076 /* Uncomment next line if building wolfSSL for LSR */ 00077 /* #define WOLFSSL_LSR */ 00078 00079 /* Uncomment next line if building for Freescale Classic MQX version 4.0 */ 00080 /* #define FREESCALE_MQX_4_0 */ 00081 00082 /* Uncomment next line if building for Freescale Classic MQX/RTCS/MFS */ 00083 /* #define FREESCALE_MQX */ 00084 00085 /* Uncomment next line if building for Freescale KSDK MQX/RTCS/MFS */ 00086 /* #define FREESCALE_KSDK_MQX */ 00087 00088 /* Uncomment next line if building for Freescale KSDK Bare Metal */ 00089 /* #define FREESCALE_KSDK_BM */ 00090 00091 /* Uncomment next line if building for Freescale KSDK FreeRTOS, */ 00092 /* (old name FREESCALE_FREE_RTOS) */ 00093 /* #define FREESCALE_KSDK_FREERTOS */ 00094 00095 /* Uncomment next line if using STM32F2 */ 00096 /* #define WOLFSSL_STM32F2 */ 00097 00098 /* Uncomment next line if using STM32F4 */ 00099 /* #define WOLFSSL_STM32F4 */ 00100 00101 /* Uncomment next line if using STM32F7 */ 00102 /* #define WOLFSSL_STM32F7 */ 00103 00104 /* Uncomment next line if using QL SEP settings */ 00105 /* #define WOLFSSL_QL */ 00106 00107 /* Uncomment next line if building for EROAD */ 00108 /* #define WOLFSSL_EROAD */ 00109 00110 /* Uncomment next line if building for IAR EWARM */ 00111 /* #define WOLFSSL_IAR_ARM */ 00112 00113 /* Uncomment next line if building for Rowley CrossWorks ARM */ 00114 /* #define WOLFSSL_ROWLEY_ARM */ 00115 00116 /* Uncomment next line if using TI-RTOS settings */ 00117 /* #define WOLFSSL_TIRTOS */ 00118 00119 /* Uncomment next line if building with PicoTCP */ 00120 /* #define WOLFSSL_PICOTCP */ 00121 00122 /* Uncomment next line if building for PicoTCP demo bundle */ 00123 /* #define WOLFSSL_PICOTCP_DEMO */ 00124 00125 /* Uncomment next line if building for uITRON4 */ 00126 /* #define WOLFSSL_uITRON4 */ 00127 00128 /* Uncomment next line if building for uT-Kernel */ 00129 /* #define WOLFSSL_uTKERNEL2 */ 00130 00131 /* Uncomment next line if using Max Strength build */ 00132 /* #define WOLFSSL_MAX_STRENGTH */ 00133 00134 /* Uncomment next line if building for VxWorks */ 00135 /* #define WOLFSSL_VXWORKS */ 00136 00137 /* Uncomment next line if building for Nordic nRF5x platofrm */ 00138 /* #define WOLFSSL_NRF5x */ 00139 00140 /* Uncomment next line to enable deprecated less secure static DH suites */ 00141 /* #define WOLFSSL_STATIC_DH */ 00142 00143 /* Uncomment next line to enable deprecated less secure static RSA suites */ 00144 /* #define WOLFSSL_STATIC_RSA */ 00145 00146 /* Uncomment next line if building for ARDUINO */ 00147 /* Uncomment both lines if building for ARDUINO on INTEL_GALILEO */ 00148 /* #define WOLFSSL_ARDUINO */ 00149 /* #define INTEL_GALILEO */ 00150 00151 /* Uncomment next line to enable asynchronous crypto WC_PENDING_E */ 00152 /* #define WOLFSSL_ASYNC_CRYPT */ 00153 00154 /* Uncomment next line if building for uTasker */ 00155 /* #define WOLFSSL_UTASKER */ 00156 00157 /* Uncomment next line if building for embOS */ 00158 /* #define WOLFSSL_EMBOS */ 00159 00160 /* Uncomment next line if building for RIOT-OS */ 00161 /* #define WOLFSSL_RIOT_OS */ 00162 00163 /* Uncomment next line if building for using XILINX hardened crypto */ 00164 /* #define WOLFSSL_XILINX_CRYPT */ 00165 00166 /* Uncomment next line if building for using XILINX */ 00167 /* #define WOLFSSL_XILINX */ 00168 00169 /* Uncomment next line if building for Nucleus 1.2 */ 00170 /* #define WOLFSSL_NUCLEUS_1_2 */ 00171 00172 #include <wolfcrypt/visibility.h> 00173 #define WOLFSSL_USER_SETTINGS 00174 #ifdef WOLFSSL_USER_SETTINGS 00175 #include "user_settings.h" 00176 #endif 00177 00178 00179 /* make sure old RNG name is used with CTaoCrypt FIPS */ 00180 #ifdef HAVE_FIPS 00181 #define WC_RNG RNG 00182 /* blinding adds API not available yet in FIPS mode */ 00183 #undef WC_RSA_BLINDING 00184 #endif 00185 00186 00187 #if defined(_WIN32) && !defined(_M_X64) && \ 00188 defined(HAVE_AESGCM) && defined(WOLFSSL_AESNI) 00189 00190 /* The _M_X64 macro is what's used in the headers for MSC to tell if it 00191 * has the 64-bit versions of the 128-bit integers available. If one is 00192 * building on 32-bit Windows with AES-NI, turn off the AES-GCMloop 00193 * unrolling. */ 00194 00195 #define AES_GCM_AESNI_NO_UNROLL 00196 #endif 00197 00198 #ifdef IPHONE 00199 #define SIZEOF_LONG_LONG 8 00200 #endif 00201 00202 #ifdef THREADX 00203 #define SIZEOF_LONG_LONG 8 00204 #endif 00205 00206 #ifdef HAVE_NETX 00207 #ifdef NEED_THREADX_TYPES 00208 #include <types.h> 00209 #endif 00210 #include <nx_api.h> 00211 #endif 00212 00213 #if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ 00214 #define WOLFSSL_LWIP 00215 #define NO_WRITEV 00216 #define SINGLE_THREADED 00217 #define WOLFSSL_USER_IO 00218 #define NO_FILESYSTEM 00219 #endif 00220 00221 #if defined(WOLFSSL_IAR_ARM) || defined(WOLFSSL_ROWLEY_ARM) 00222 #define NO_MAIN_DRIVER 00223 #define SINGLE_THREADED 00224 #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096) 00225 #define USE_CERT_BUFFERS_1024 00226 #endif 00227 #define BENCH_EMBEDDED 00228 #define NO_FILESYSTEM 00229 #define NO_WRITEV 00230 #define WOLFSSL_USER_IO 00231 #define BENCH_EMBEDDED 00232 #endif 00233 00234 #ifdef MICROCHIP_PIC32 00235 /* #define WOLFSSL_MICROCHIP_PIC32MZ */ 00236 #define SIZEOF_LONG_LONG 8 00237 #define SINGLE_THREADED 00238 #define WOLFSSL_USER_IO 00239 #define NO_WRITEV 00240 #define NO_DEV_RANDOM 00241 #define NO_FILESYSTEM 00242 #define USE_FAST_MATH 00243 #define TFM_TIMING_RESISTANT 00244 #define WOLFSSL_HAVE_MIN 00245 #define WOLFSSL_HAVE_MAX 00246 #define NO_BIG_INT 00247 #endif 00248 00249 #ifdef WOLFSSL_MICROCHIP_PIC32MZ 00250 #define WOLFSSL_PIC32MZ_CRYPT 00251 #define WOLFSSL_PIC32MZ_RNG 00252 #define WOLFSSL_PIC32MZ_HASH 00253 #endif 00254 00255 #ifdef MICROCHIP_TCPIP_V5 00256 /* include timer functions */ 00257 #include "TCPIP Stack/TCPIP.h" 00258 #endif 00259 00260 #ifdef MICROCHIP_TCPIP 00261 /* include timer, NTP functions */ 00262 #ifdef MICROCHIP_MPLAB_HARMONY 00263 #include "tcpip/tcpip.h" 00264 #else 00265 #include "system/system_services.h" 00266 #include "tcpip/sntp.h" 00267 #endif 00268 #endif 00269 00270 #ifdef MBED 00271 #define WOLFSSL_USER_IO 00272 #define NO_FILESYSTEM 00273 #define NO_CERT 00274 #if !defined(USE_CERT_BUFFERS_2048) && !defined(USE_CERT_BUFFERS_4096) 00275 #define USE_CERT_BUFFERS_1024 00276 #endif 00277 #define NO_WRITEV 00278 #define NO_DEV_RANDOM 00279 #define NO_SHA512 00280 #define NO_DH 00281 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00282 /* WOLFSSL_DH_CONST */ 00283 #define NO_DSA 00284 #define NO_HC128 00285 #define HAVE_ECC 00286 #define NO_SESSION_CACHE 00287 #define WOLFSSL_CMSIS_RTOS 00288 #endif 00289 00290 00291 #ifdef WOLFSSL_EROAD 00292 #define FREESCALE_MQX 00293 #define FREESCALE_MMCAU 00294 #define SINGLE_THREADED 00295 #define NO_STDIO_FILESYSTEM 00296 #define WOLFSSL_LEANPSK 00297 #define HAVE_NULL_CIPHER 00298 #define NO_OLD_TLS 00299 #define NO_ASN 00300 #define NO_BIG_INT 00301 #define NO_RSA 00302 #define NO_DSA 00303 #define NO_DH 00304 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00305 /* WOLFSSL_DH_CONST */ 00306 #define NO_CERTS 00307 #define NO_PWDBASED 00308 #define NO_DES3 00309 #define NO_MD4 00310 #define NO_RC4 00311 #define NO_MD5 00312 #define NO_SESSION_CACHE 00313 #define NO_MAIN_DRIVER 00314 #endif 00315 00316 #ifdef WOLFSSL_PICOTCP 00317 #ifndef errno 00318 #define errno pico_err 00319 #endif 00320 #include "pico_defines.h" 00321 #include "pico_stack.h" 00322 #include "pico_constants.h" 00323 #include "pico_protocol.h" 00324 #define CUSTOM_RAND_GENERATE pico_rand 00325 #endif 00326 00327 #ifdef WOLFSSL_PICOTCP_DEMO 00328 #define WOLFSSL_STM32 00329 #define USE_FAST_MATH 00330 #define TFM_TIMING_RESISTANT 00331 #define XMALLOC(s, h, type) PICO_ZALLOC((s)) 00332 #define XFREE(p, h, type) PICO_FREE((p)) 00333 #define SINGLE_THREADED 00334 #define NO_WRITEV 00335 #define WOLFSSL_USER_IO 00336 #define NO_DEV_RANDOM 00337 #define NO_FILESYSTEM 00338 #endif 00339 00340 #ifdef FREERTOS_WINSIM 00341 #define FREERTOS 00342 #define USE_WINDOWS_API 00343 #endif 00344 00345 00346 #ifdef WOLFSSL_VXWORKS 00347 /* VxWorks simulator incorrectly detects building for i386 */ 00348 #ifdef VXWORKS_SIM 00349 #define TFM_NO_ASM 00350 #endif 00351 #define WOLFSSL_PTHREADS 00352 #define WOLFSSL_HAVE_MIN 00353 #define WOLFSSL_HAVE_MAX 00354 #define USE_FAST_MATH 00355 #define TFM_TIMING_RESISTANT 00356 #define NO_MAIN_DRIVER 00357 #define NO_DEV_RANDOM 00358 #define NO_WRITEV 00359 #endif 00360 00361 00362 #ifdef WOLFSSL_ARDUINO 00363 #define NO_WRITEV 00364 #define NO_WOLFSSL_DIR 00365 #define SINGLE_THREADED 00366 #define NO_DEV_RANDOM 00367 #ifndef INTEL_GALILEO /* Galileo has time.h compatibility */ 00368 #define TIME_OVERRIDES /* must define XTIME and XGMTIME externally */ 00369 #endif 00370 #define WOLFSSL_USER_IO 00371 #define HAVE_ECC 00372 #define NO_DH 00373 #define NO_SESSION_CACHE 00374 #define USE_SLOW_SHA 00375 #define NO_WOLFSSL_SERVER 00376 #define NO_ERROR_STRINGS 00377 #endif 00378 00379 00380 #ifdef WOLFSSL_UTASKER 00381 /* uTasker configuration - used for fnRandom() */ 00382 #include "config.h" 00383 00384 #define SINGLE_THREADED 00385 #define NO_WOLFSSL_DIR 00386 #define WOLFSSL_HAVE_MIN 00387 #define NO_WRITEV 00388 00389 #define HAVE_ECC 00390 #define ALT_ECC_SIZE 00391 #define USE_FAST_MATH 00392 #define TFM_TIMING_RESISTANT 00393 #define ECC_TIMING_RESISTANT 00394 00395 /* used in wolfCrypt test */ 00396 #define NO_MAIN_DRIVER 00397 #define USE_CERT_BUFFERS_2048 00398 00399 /* uTasker port uses RAW sockets, use I/O callbacks 00400 * See wolfSSL uTasker example for sample callbacks */ 00401 #define WOLFSSL_USER_IO 00402 00403 /* uTasker filesystem not ported */ 00404 #define NO_FILESYSTEM 00405 00406 /* uTasker RNG is abstracted, calls HW RNG when available */ 00407 #define CUSTOM_RAND_GENERATE fnRandom 00408 #define CUSTOM_RAND_TYPE unsigned short 00409 00410 /* user needs to define XTIME to function that provides 00411 * seconds since Unix epoch */ 00412 #ifndef XTIME 00413 #error XTIME must be defined in wolfSSL settings.h 00414 /* #define XTIME fnSecondsSinceEpoch */ 00415 #endif 00416 00417 /* use uTasker std library replacements where available */ 00418 #define STRING_USER 00419 #define XMEMCPY(d,s,l) uMemcpy((d),(s),(l)) 00420 #define XMEMSET(b,c,l) uMemset((b),(c),(l)) 00421 #define XMEMCMP(s1,s2,n) uMemcmp((s1),(s2),(n)) 00422 #define XMEMMOVE(d,s,l) memmove((d),(s),(l)) 00423 00424 #define XSTRLEN(s1) uStrlen((s1)) 00425 #define XSTRNCPY(s1,s2,n) strncpy((s1),(s2),(n)) 00426 #define XSTRSTR(s1,s2) strstr((s1),(s2)) 00427 #define XSTRNSTR(s1,s2,n) mystrnstr((s1),(s2),(n)) 00428 #define XSTRNCMP(s1,s2,n) strncmp((s1),(s2),(n)) 00429 #define XSTRNCAT(s1,s2,n) strncat((s1),(s2),(n)) 00430 #define XSTRNCASECMP(s1,s2,n) _strnicmp((s1),(s2),(n)) 00431 #if defined(WOLFSSL_CERT_EXT) || defined(HAVE_ALPN) 00432 #define XSTRTOK strtok_r 00433 #endif 00434 #endif 00435 00436 #ifdef WOLFSSL_EMBOS 00437 #define NO_FILESYSTEM /* Not ported at this time */ 00438 #define USE_CERT_BUFFERS_2048 /* use when NO_FILESYSTEM */ 00439 #define NO_MAIN_DRIVER 00440 #define NO_RC4 00441 #define SINGLE_THREADED /* Not ported at this time */ 00442 #endif 00443 00444 #ifdef WOLFSSL_RIOT_OS 00445 #define NO_WRITEV 00446 #define TFM_NO_ASM 00447 #define USE_FAST_MATH 00448 #define NO_FILESYSTEM 00449 #define USE_CERT_BUFFERS_2048 00450 #endif 00451 00452 #ifdef WOLFSSL_CHIBIOS 00453 /* ChibiOS definitions. This file is distributed with chibiOS. */ 00454 #include "wolfssl_chibios.h" 00455 #endif 00456 00457 #ifdef WOLFSSL_PB 00458 /* PB is using older 1.2 version of Nucleus */ 00459 #undef WOLFSSL_NUCLEUS 00460 #define WOLFSSL_NUCLEUS_1_2 00461 #endif 00462 00463 #ifdef WOLFSSL_NUCLEUS_1_2 00464 #define NO_WRITEV 00465 #define NO_WOLFSSL_DIR 00466 00467 #if !defined(NO_ASN_TIME) && !defined(USER_TIME) 00468 #error User must define XTIME, see manual 00469 #endif 00470 00471 #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER) 00472 extern void* nucleus_malloc(unsigned long size, void* heap, int type); 00473 extern void* nucleus_realloc(void* ptr, unsigned long size, void* heap, 00474 int type); 00475 extern void nucleus_free(void* ptr, void* heap, int type); 00476 00477 #define XMALLOC(s, h, type) nucleus_malloc 00478 #define XREALLOC(p, n, h, t) nucleus_realloc 00479 #define XFREE(p, h, type) nucleus_free 00480 #endif 00481 #endif 00482 00483 #ifdef WOLFSSL_NRF5x 00484 #define SIZEOF_LONG 4 00485 #define SIZEOF_LONG_LONG 8 00486 #define NO_ASN_TIME 00487 #define NO_DEV_RANDOM 00488 #define NO_FILESYSTEM 00489 #define NO_MAIN_DRIVER 00490 #define NO_WRITEV 00491 #define SINGLE_THREADED 00492 #define USE_FAST_MATH 00493 #define TFM_TIMING_RESISTANT 00494 #define USE_WOLFSSL_MEMORY 00495 #define WOLFSSL_NRF51 00496 #define WOLFSSL_USER_IO 00497 #define NO_SESSION_CACHE 00498 #endif 00499 00500 /* Micrium will use Visual Studio for compilation but not the Win32 API */ 00501 #if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) && \ 00502 !defined(FREERTOS_TCP) && !defined(EBSNET) && !defined(WOLFSSL_EROAD) && \ 00503 !defined(WOLFSSL_UTASKER) && !defined(INTIME_RTOS) 00504 #define USE_WINDOWS_API 00505 #endif 00506 00507 #if defined(WOLFSSL_uITRON4) 00508 00509 #define XMALLOC_USER 00510 #include <stddef.h> 00511 #define ITRON_POOL_SIZE 1024*20 00512 extern int uITRON4_minit(size_t poolsz) ; 00513 extern void *uITRON4_malloc(size_t sz) ; 00514 extern void *uITRON4_realloc(void *p, size_t sz) ; 00515 extern void uITRON4_free(void *p) ; 00516 00517 #define XMALLOC(sz, heap, type) uITRON4_malloc(sz) 00518 #define XREALLOC(p, sz, heap, type) uITRON4_realloc(p, sz) 00519 #define XFREE(p, heap, type) uITRON4_free(p) 00520 #endif 00521 00522 #if defined(WOLFSSL_uTKERNEL2) 00523 #ifndef NO_TKERNEL_MEM_POOL 00524 #define XMALLOC_OVERRIDE 00525 int uTKernel_init_mpool(unsigned int sz); /* initializing malloc pool */ 00526 void* uTKernel_malloc(unsigned int sz); 00527 void* uTKernel_realloc(void *p, unsigned int sz); 00528 void uTKernel_free(void *p); 00529 #define XMALLOC(s, h, type) uTKernel_malloc((s)) 00530 #define XREALLOC(p, n, h, t) uTKernel_realloc((p), (n)) 00531 #define XFREE(p, h, type) uTKernel_free((p)) 00532 #endif 00533 00534 #ifndef NO_STDIO_FGETS_REMAP 00535 #include <stdio.h> 00536 #include "tm/tmonitor.h" 00537 00538 /* static char* gets(char *buff); */ 00539 static char* fgets(char *buff, int sz, FILE *fp) { 00540 char * p = buff; 00541 *p = '\0'; 00542 while (1) { 00543 *p = tm_getchar(-1); 00544 tm_putchar(*p); 00545 if (*p == '\r') { 00546 tm_putchar('\n'); 00547 *p = '\0'; 00548 break; 00549 } 00550 p++; 00551 } 00552 return buff; 00553 } 00554 #endif /* !NO_STDIO_FGETS_REMAP */ 00555 #endif 00556 00557 00558 #if defined(WOLFSSL_LEANPSK) && !defined(XMALLOC_USER) 00559 #include <stdlib.h> 00560 #define XMALLOC(s, h, type) malloc((s)) 00561 #define XFREE(p, h, type) free((p)) 00562 #define XREALLOC(p, n, h, t) realloc((p), (n)) 00563 #endif 00564 00565 #if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) 00566 #undef XMALLOC 00567 #define XMALLOC yaXMALLOC 00568 #undef XFREE 00569 #define XFREE yaXFREE 00570 #undef XREALLOC 00571 #define XREALLOC yaXREALLOC 00572 #endif 00573 00574 00575 #ifdef FREERTOS 00576 #include "FreeRTOS.h" 00577 00578 /* FreeRTOS pvPortRealloc() only in AVR32_UC3 port */ 00579 #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) && \ 00580 !defined(WOLFSSL_STATIC_MEMORY) 00581 #define XMALLOC(s, h, type) pvPortMalloc((s)) 00582 #define XFREE(p, h, type) vPortFree((p)) 00583 #endif 00584 00585 #ifndef NO_WRITEV 00586 #define NO_WRITEV 00587 #endif 00588 #ifndef HAVE_SHA512 00589 #ifndef NO_SHA512 00590 #define NO_SHA512 00591 #endif 00592 #endif 00593 #ifndef HAVE_DH 00594 #ifndef NO_DH 00595 #define NO_DH 00596 #endif 00597 #endif 00598 #ifndef NO_DSA 00599 #define NO_DSA 00600 #endif 00601 #ifndef NO_HC128 00602 #define NO_HC128 00603 #endif 00604 00605 #ifndef SINGLE_THREADED 00606 #include "semphr.h" 00607 #endif 00608 #endif 00609 00610 #ifdef FREERTOS_TCP 00611 #if !defined(NO_WOLFSSL_MEMORY) && !defined(XMALLOC_USER) && \ 00612 !defined(WOLFSSL_STATIC_MEMORY) 00613 #define XMALLOC(s, h, type) pvPortMalloc((s)) 00614 #define XFREE(p, h, type) vPortFree((p)) 00615 #endif 00616 00617 #define WOLFSSL_GENSEED_FORTEST 00618 00619 #define NO_WOLFSSL_DIR 00620 #define NO_WRITEV 00621 #define USE_FAST_MATH 00622 #define TFM_TIMING_RESISTANT 00623 #define NO_MAIN_DRIVER 00624 #endif 00625 00626 #ifdef WOLFSSL_TIRTOS 00627 #define SIZEOF_LONG_LONG 8 00628 #define NO_WRITEV 00629 #define NO_WOLFSSL_DIR 00630 #define USE_FAST_MATH 00631 #define TFM_TIMING_RESISTANT 00632 #define ECC_TIMING_RESISTANT 00633 #define WC_RSA_BLINDING 00634 #define NO_DEV_RANDOM 00635 #define NO_FILESYSTEM 00636 #define USE_CERT_BUFFERS_2048 00637 #define NO_ERROR_STRINGS 00638 #define USER_TIME 00639 #define HAVE_ECC 00640 #define HAVE_ALPN 00641 #define USE_WOLF_STRTOK /* use with HAVE_ALPN */ 00642 #define HAVE_TLS_EXTENSIONS 00643 #define HAVE_AESGCM 00644 #define HAVE_SUPPORTED_CURVES 00645 #define ALT_ECC_SIZE 00646 00647 #ifdef __IAR_SYSTEMS_ICC__ 00648 #pragma diag_suppress=Pa089 00649 #elif !defined(__GNUC__) 00650 /* Suppress the sslpro warning */ 00651 #pragma diag_suppress=11 00652 #endif 00653 00654 #include <ti/sysbios/hal/Seconds.h> 00655 #endif 00656 00657 #ifdef EBSNET 00658 #include "rtip.h" 00659 00660 /* #define DEBUG_WOLFSSL */ 00661 #define NO_WOLFSSL_DIR /* tbd */ 00662 00663 #if (POLLOS) 00664 #define SINGLE_THREADED 00665 #endif 00666 00667 #if (RTPLATFORM) 00668 #if (!RTP_LITTLE_ENDIAN) 00669 #define BIG_ENDIAN_ORDER 00670 #endif 00671 #else 00672 #if (!KS_LITTLE_ENDIAN) 00673 #define BIG_ENDIAN_ORDER 00674 #endif 00675 #endif 00676 00677 #if (WINMSP3) 00678 #undef SIZEOF_LONG 00679 #define SIZEOF_LONG_LONG 8 00680 #else 00681 #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG 00682 #endif 00683 00684 #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) 00685 #define XFREE(p, h, type) (rtp_free(p)) 00686 #define XREALLOC(p, n, h, t) realloc((p), (n)) 00687 00688 #endif /* EBSNET */ 00689 00690 #ifdef WOLFSSL_GAME_BUILD 00691 #define SIZEOF_LONG_LONG 8 00692 #if defined(__PPU) || defined(__XENON) 00693 #define BIG_ENDIAN_ORDER 00694 #endif 00695 #endif 00696 00697 #ifdef WOLFSSL_LSR 00698 #define HAVE_WEBSERVER 00699 #define SIZEOF_LONG_LONG 8 00700 #define WOLFSSL_LOW_MEMORY 00701 #define NO_WRITEV 00702 #define NO_SHA512 00703 #define NO_DH 00704 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00705 /* WOLFSSL_DH_CONST */ 00706 #define NO_DSA 00707 #define NO_HC128 00708 #define NO_DEV_RANDOM 00709 #define NO_WOLFSSL_DIR 00710 #define NO_RABBIT 00711 #ifndef NO_FILESYSTEM 00712 #define LSR_FS 00713 #include "inc/hw_types.h" 00714 #include "fs.h" 00715 #endif 00716 #define WOLFSSL_LWIP 00717 #include <errno.h> /* for tcp errno */ 00718 #define WOLFSSL_SAFERTOS 00719 #if defined(__IAR_SYSTEMS_ICC__) 00720 /* enum uses enum */ 00721 #pragma diag_suppress=Pa089 00722 #endif 00723 #endif 00724 00725 #ifdef WOLFSSL_SAFERTOS 00726 #ifndef SINGLE_THREADED 00727 #include "SafeRTOS/semphr.h" 00728 #endif 00729 00730 #include "SafeRTOS/heap.h" 00731 #define XMALLOC(s, h, type) pvPortMalloc((s)) 00732 #define XFREE(p, h, type) vPortFree((p)) 00733 #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) 00734 #endif 00735 00736 #ifdef WOLFSSL_LOW_MEMORY 00737 #undef RSA_LOW_MEM 00738 #define RSA_LOW_MEM 00739 #undef WOLFSSL_SMALL_STACK 00740 #define WOLFSSL_SMALL_STACK 00741 #undef TFM_TIMING_RESISTANT 00742 #define TFM_TIMING_RESISTANT 00743 #endif 00744 00745 #ifdef FREESCALE_MQX_4_0 00746 /* use normal Freescale MQX port, but with minor changes for 4.0 */ 00747 #define FREESCALE_MQX 00748 #endif 00749 00750 #ifdef FREESCALE_MQX 00751 #define FREESCALE_COMMON 00752 #include "mqx.h" 00753 #ifndef NO_FILESYSTEM 00754 #include "mfs.h" 00755 #if MQX_USE_IO_OLD 00756 #include "fio.h" 00757 #define NO_STDIO_FILESYSTEM 00758 #else 00759 #include "nio.h" 00760 #endif 00761 #endif 00762 #ifndef SINGLE_THREADED 00763 #include "mutex.h" 00764 #endif 00765 00766 #if !defined(XMALLOC_OVERRIDE) && !defined(XMALLOC_USER) 00767 #define XMALLOC_OVERRIDE 00768 #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) 00769 #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} 00770 /* Note: MQX has no realloc, using fastmath above */ 00771 #endif 00772 #endif 00773 00774 #ifdef FREESCALE_KSDK_MQX 00775 #define FREESCALE_COMMON 00776 #include <mqx.h> 00777 #ifndef NO_FILESYSTEM 00778 #if MQX_USE_IO_OLD 00779 #include <fio.h> 00780 #else 00781 #include <stdio.h> 00782 #include <nio.h> 00783 #endif 00784 #endif 00785 #ifndef SINGLE_THREADED 00786 #include <mutex.h> 00787 #endif 00788 00789 #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) 00790 #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} 00791 #define XREALLOC(p, n, h, t) _mem_realloc((p), (n)) /* since MQX 4.1.2 */ 00792 00793 #define MQX_FILE_PTR FILE * 00794 #define IO_SEEK_SET SEEK_SET 00795 #define IO_SEEK_END SEEK_END 00796 #endif /* FREESCALE_KSDK_MQX */ 00797 00798 #if defined(FREESCALE_FREE_RTOS) || defined(FREESCALE_KSDK_FREERTOS) 00799 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00800 /* WOLFSSL_DH_CONST */ 00801 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00802 /* WOLFSSL_DH_CONST */ 00803 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00804 /* WOLFSSL_DH_CONST */ 00805 #define NO_FILESYSTEM 00806 #define WOLFSSL_CRYPT_HW_MUTEX 1 00807 00808 #if !defined(XMALLOC_USER) && !defined(NO_WOLFSSL_MEMORY) 00809 #define XMALLOC(s, h, type) pvPortMalloc((s)) 00810 #define XFREE(p, h, type) vPortFree((p)) 00811 #endif 00812 00813 //#define USER_TICKS 00814 /* Allows use of DH with fixed points if uncommented and NO_DH is removed */ 00815 /* WOLFSSL_DH_CONST */ 00816 #define WOLFSSL_LWIP 00817 #define FREERTOS_TCP 00818 00819 #define FREESCALE_FREE_RTOS 00820 #define FREERTOS_SOCKET_ERROR ( -1 ) 00821 #define FREERTOS_EWOULDBLOCK ( -2 ) 00822 #define FREERTOS_EINVAL ( -4 ) 00823 #define FREERTOS_EADDRNOTAVAIL ( -5 ) 00824 #define FREERTOS_EADDRINUSE ( -6 ) 00825 #define FREERTOS_ENOBUFS ( -7 ) 00826 #define FREERTOS_ENOPROTOOPT ( -8 ) 00827 #endif /* FREESCALE_FREE_RTOS || FREESCALE_KSDK_FREERTOS */ 00828 00829 #ifdef FREESCALE_KSDK_BM 00830 #define FREESCALE_COMMON 00831 #define WOLFSSL_USER_IO 00832 #define SINGLE_THREADED 00833 #define NO_FILESYSTEM 00834 #ifndef TIME_OVERRIDES 00835 #define USER_TICKS 00836 #endif 00837 #endif /* FREESCALE_KSDK_BM */ 00838 00839 #ifdef FREESCALE_COMMON 00840 #define SIZEOF_LONG_LONG 8 00841 00842 /* disable features */ 00843 #undef NO_WRITEV 00844 #define NO_WRITEV 00845 #undef NO_DEV_RANDOM 00846 #define NO_DEV_RANDOM 00847 #undef NO_RABBIT 00848 #define NO_RABBIT 00849 #undef NO_WOLFSSL_DIR 00850 #define NO_WOLFSSL_DIR 00851 #undef NO_RC4 00852 #define NO_RC4 00853 00854 /* enable features */ 00855 #undef USE_FAST_MATH 00856 #define USE_FAST_MATH 00857 00858 #define USE_CERT_BUFFERS_2048 00859 #define BENCH_EMBEDDED 00860 00861 #define TFM_TIMING_RESISTANT 00862 #define ECC_TIMING_RESISTANT 00863 00864 #undef HAVE_ECC 00865 #define HAVE_ECC 00866 #ifndef NO_AES 00867 #undef HAVE_AESCCM 00868 #define HAVE_AESCCM 00869 #undef HAVE_AESGCM 00870 #define HAVE_AESGCM 00871 #undef WOLFSSL_AES_COUNTER 00872 #define WOLFSSL_AES_COUNTER 00873 #undef WOLFSSL_AES_DIRECT 00874 #define WOLFSSL_AES_DIRECT 00875 #endif 00876 00877 #ifdef FREESCALE_KSDK_1_3 00878 #include "fsl_device_registers.h" 00879 #elif !defined(FREESCALE_MQX) 00880 /* Classic MQX does not have fsl_common.h */ 00881 #include "fsl_common.h" 00882 #endif 00883 00884 /* random seed */ 00885 #define NO_OLD_RNGNAME 00886 #if defined(FSL_FEATURE_SOC_TRNG_COUNT) && (FSL_FEATURE_SOC_TRNG_COUNT > 0) 00887 #define FREESCALE_KSDK_2_0_TRNG 00888 #elif defined(FSL_FEATURE_SOC_RNG_COUNT) && (FSL_FEATURE_SOC_RNG_COUNT > 0) 00889 #ifdef FREESCALE_KSDK_1_3 00890 #include "fsl_rnga_driver.h" 00891 #define FREESCALE_RNGA 00892 #define RNGA_INSTANCE (0) 00893 #else 00894 #define FREESCALE_KSDK_2_0_RNGA 00895 #endif 00896 #elif !defined(FREESCALE_KSDK_BM) && !defined(FREESCALE_FREE_RTOS) && !defined(FREESCALE_KSDK_FREERTOS) 00897 #define FREESCALE_RNGA 00898 #define RNGA_INSTANCE (0) 00899 /* defaulting to K70 RNGA, user should change if different */ 00900 /* #define FREESCALE_K53_RNGB */ 00901 #define FREESCALE_K70_RNGA 00902 #endif 00903 00904 /* HW crypto */ 00905 /* automatic enable based on Kinetis feature */ 00906 /* if case manual selection is required, for example for benchmarking purposes, 00907 * just define FREESCALE_USE_MMCAU or FREESCALE_USE_LTC or none of these two macros (for software only) 00908 * both can be enabled simultaneously as LTC has priority over MMCAU in source code. 00909 */ 00910 /* #define FSL_HW_CRYPTO_MANUAL_SELECTION */ 00911 #ifndef FSL_HW_CRYPTO_MANUAL_SELECTION 00912 #if defined(FSL_FEATURE_SOC_MMCAU_COUNT) && FSL_FEATURE_SOC_MMCAU_COUNT 00913 #define FREESCALE_USE_MMCAU 00914 #endif 00915 00916 #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT 00917 #define FREESCALE_USE_LTC 00918 #endif 00919 #else 00920 /* #define FREESCALE_USE_MMCAU */ 00921 /* #define FREESCALE_USE_LTC */ 00922 #endif 00923 #endif /* FREESCALE_COMMON */ 00924 00925 /* Classic pre-KSDK mmCAU library */ 00926 #ifdef FREESCALE_USE_MMCAU_CLASSIC 00927 #define FREESCALE_USE_MMCAU 00928 #define FREESCALE_MMCAU_CLASSIC 00929 #define FREESCALE_MMCAU_CLASSIC_SHA 00930 #endif 00931 00932 /* KSDK mmCAU library */ 00933 #ifdef FREESCALE_USE_MMCAU 00934 /* AES and DES */ 00935 #define FREESCALE_MMCAU 00936 /* MD5, SHA-1 and SHA-256 */ 00937 #define FREESCALE_MMCAU_SHA 00938 #endif /* FREESCALE_USE_MMCAU */ 00939 00940 #ifdef FREESCALE_USE_LTC 00941 #if defined(FSL_FEATURE_SOC_LTC_COUNT) && FSL_FEATURE_SOC_LTC_COUNT 00942 #define FREESCALE_LTC 00943 #define LTC_BASE LTC0 00944 00945 #if defined(FSL_FEATURE_LTC_HAS_DES) && FSL_FEATURE_LTC_HAS_DES 00946 #define FREESCALE_LTC_DES 00947 #endif 00948 00949 #if defined(FSL_FEATURE_LTC_HAS_GCM) && FSL_FEATURE_LTC_HAS_GCM 00950 #define FREESCALE_LTC_AES_GCM 00951 #endif 00952 00953 #if defined(FSL_FEATURE_LTC_HAS_SHA) && FSL_FEATURE_LTC_HAS_SHA 00954 #define FREESCALE_LTC_SHA 00955 #endif 00956 00957 #if defined(FSL_FEATURE_LTC_HAS_PKHA) && FSL_FEATURE_LTC_HAS_PKHA 00958 #define FREESCALE_LTC_ECC 00959 #define FREESCALE_LTC_TFM 00960 00961 /* the LTC PKHA hardware limit is 2048 bits (256 bytes) for integer arithmetic. 00962 the LTC_MAX_INT_BYTES defines the size of local variables that hold big integers. */ 00963 #ifndef LTC_MAX_INT_BYTES 00964 #define LTC_MAX_INT_BYTES (256) 00965 #endif 00966 00967 /* This FREESCALE_LTC_TFM_RSA_4096_ENABLE macro can be defined. 00968 * In such a case both software and hardware algorithm 00969 * for TFM is linked in. The decision for which algorithm is used is determined at runtime 00970 * from size of inputs. If inputs and result can fit into LTC (see LTC_MAX_INT_BYTES) 00971 * then we call hardware algorithm, otherwise we call software algorithm. 00972 * 00973 * Chinese reminder theorem is used to break RSA 4096 exponentiations (both public and private key) 00974 * into several computations with 2048-bit modulus and exponents. 00975 */ 00976 /* #define FREESCALE_LTC_TFM_RSA_4096_ENABLE */ 00977 00978 /* ECC-384, ECC-256, ECC-224 and ECC-192 have been enabled with LTC PKHA acceleration */ 00979 #ifdef HAVE_ECC 00980 #undef ECC_TIMING_RESISTANT 00981 #define ECC_TIMING_RESISTANT 00982 00983 /* the LTC PKHA hardware limit is 512 bits (64 bytes) for ECC. 00984 the LTC_MAX_ECC_BITS defines the size of local variables that hold ECC parameters 00985 and point coordinates */ 00986 #ifndef LTC_MAX_ECC_BITS 00987 #define LTC_MAX_ECC_BITS (384) 00988 #endif 00989 00990 /* Enable curves up to 384 bits */ 00991 #if !defined(ECC_USER_CURVES) && !defined(HAVE_ALL_CURVES) 00992 #define ECC_USER_CURVES 00993 #define HAVE_ECC192 00994 #define HAVE_ECC224 00995 #undef NO_ECC256 00996 #define HAVE_ECC384 00997 #endif 00998 00999 /* enable features */ 01000 #undef HAVE_CURVE25519 01001 #define HAVE_CURVE25519 01002 #undef HAVE_ED25519 01003 #define HAVE_ED25519 01004 #undef WOLFSSL_SHA512 01005 #define WOLFSSL_SHA512 01006 #endif 01007 #endif 01008 #endif 01009 #endif /* FREESCALE_USE_LTC */ 01010 01011 #ifdef FREESCALE_LTC_TFM_RSA_4096_ENABLE 01012 #undef USE_CERT_BUFFERS_4096 01013 #define USE_CERT_BUFFERS_4096 01014 #undef FP_MAX_BITS 01015 #define FP_MAX_BITS (8192) 01016 01017 #undef NO_DH 01018 #define NO_DH 01019 #undef NO_DSA 01020 #define NO_DSA 01021 #endif /* FREESCALE_LTC_TFM_RSA_4096_ENABLE */ 01022 01023 /* if LTC has AES engine but doesn't have GCM, use software with LTC AES ECB mode */ 01024 #if defined(FREESCALE_USE_LTC) && !defined(FREESCALE_LTC_AES_GCM) 01025 #define GCM_TABLE 01026 #endif 01027 01028 #if defined(WOLFSSL_STM32F2) || defined(WOLFSSL_STM32F4) || \ 01029 defined(WOLFSSL_STM32F7) || defined(WOLFSSL_STM32F1) || \ 01030 defined(WOLFSSL_STM32L4) 01031 01032 #define SIZEOF_LONG_LONG 8 01033 #define NO_DEV_RANDOM 01034 #define NO_WOLFSSL_DIR 01035 #undef NO_RABBIT 01036 #define NO_RABBIT 01037 #ifndef NO_STM32_RNG 01038 #undef STM32_RNG 01039 #define STM32_RNG 01040 #ifdef WOLFSSL_STM32F427_RNG 01041 #include "stm32f427xx.h" 01042 #endif 01043 #endif 01044 #ifndef NO_STM32_CRYPTO 01045 #undef STM32_CRYPTO 01046 #define STM32_CRYPTO 01047 #endif 01048 #ifndef NO_STM32_HASH 01049 #undef STM32_HASH 01050 #define STM32_HASH 01051 #endif 01052 #if !defined(__GNUC__) && !defined(__ICCARM__) 01053 #define KEIL_INTRINSICS 01054 #endif 01055 #define NO_OLD_RNGNAME 01056 #ifdef WOLFSSL_STM32_CUBEMX 01057 #if defined(WOLFSSL_STM32F2) 01058 #include "stm32f2xx_hal.h" 01059 #elif defined(WOLFSSL_STM32L4) 01060 #include "stm32l4xx_hal.h" 01061 #elif defined(WOLFSSL_STM32F4) 01062 #include "stm32f4xx_hal.h" 01063 #elif defined(WOLFSSL_STM32F7) 01064 #include "stm32f7xx_hal.h" 01065 #elif defined(WOLFSSL_STM32F1) 01066 #include "stm32f1xx_hal.h" 01067 #endif 01068 01069 #ifndef STM32_HAL_TIMEOUT 01070 #define STM32_HAL_TIMEOUT 0xFF 01071 #endif 01072 #else 01073 #if defined(WOLFSSL_STM32F2) 01074 #include "stm32f2xx.h" 01075 #ifdef STM32_CRYPTO 01076 #include "stm32f2xx_cryp.h" 01077 #endif 01078 #ifdef STM32_HASH 01079 #include "stm32f2xx_hash.h" 01080 #endif 01081 #elif defined(WOLFSSL_STM32F4) 01082 #include "stm32f4xx.h" 01083 #ifdef STM32_CRYPTO 01084 #include "stm32f4xx_cryp.h" 01085 #endif 01086 #ifdef STM32_HASH 01087 #include "stm32f4xx_hash.h" 01088 #endif 01089 #elif defined(WOLFSSL_STM32L4) 01090 #include "stm32l4xx.h" 01091 #ifdef STM32_CRYPTO 01092 #include "stm32l4xx_cryp.h" 01093 #endif 01094 #ifdef STM32_HASH 01095 #include "stm32l4xx_hash.h" 01096 #endif 01097 #elif defined(WOLFSSL_STM32F7) 01098 #include "stm32f7xx.h" 01099 #elif defined(WOLFSSL_STM32F1) 01100 #include "stm32f1xx.h" 01101 #endif 01102 #endif /* WOLFSSL_STM32_CUBEMX */ 01103 #endif /* WOLFSSL_STM32F2 || WOLFSSL_STM32F4 || WOLFSSL_STM32F7 */ 01104 01105 #ifdef MICRIUM 01106 #include <stdlib.h> 01107 #include <os.h> 01108 #include <net_cfg.h> 01109 #include <net_sock.h> 01110 #include <net_err.h> 01111 #include <lib_mem.h> 01112 #include <lib_math.h> 01113 01114 #define USE_FAST_MATH 01115 #define TFM_TIMING_RESISTANT 01116 #define ECC_TIMING_RESISTANT 01117 #define WC_RSA_BLINDING 01118 #define HAVE_HASHDRBG 01119 01120 #define HAVE_ECC 01121 #define ALT_ECC_SIZE 01122 #define TFM_ECC192 01123 #define TFM_ECC224 01124 #define TFM_ECC256 01125 #define TFM_ECC384 01126 #define TFM_ECC521 01127 01128 #define NO_RC4 01129 #define HAVE_TLS_EXTENSIONS 01130 #define HAVE_SUPPORTED_CURVES 01131 #define HAVE_EXTENDED_MASTER 01132 01133 #define NO_WOLFSSL_DIR 01134 #define NO_WRITEV 01135 01136 #ifndef CUSTOM_RAND_GENERATE 01137 #define CUSTOM_RAND_TYPE RAND_NBR 01138 #define CUSTOM_RAND_GENERATE Math_Rand 01139 #endif 01140 01141 #define WOLFSSL_TYPES 01142 typedef CPU_INT08U byte; 01143 typedef CPU_INT16U word16; 01144 typedef CPU_INT32U word32; 01145 01146 #define STRING_USER 01147 #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) 01148 #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ 01149 ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ 01150 (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) 01151 #define XSTRNCMP(pstr_1, pstr_2, len_max) \ 01152 ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ 01153 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) 01154 #define XSTRNCASECMP(pstr_1, pstr_2, len_max) \ 01155 ((CPU_INT16S)Str_CmpIgnoreCase_N((CPU_CHAR *)(pstr_1), \ 01156 (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) 01157 #define XSTRSTR(pstr, pstr_srch) \ 01158 ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ 01159 (CPU_CHAR *)(pstr_srch))) 01160 #define XSTRNSTR(pstr, pstr_srch, len_max) \ 01161 ((CPU_CHAR *)Str_Str_N((CPU_CHAR *)(pstr), \ 01162 (CPU_CHAR *)(pstr_srch),(CPU_SIZE_T)(len_max))) 01163 #define XSTRNCAT(pstr_dest, pstr_cat, len_max) \ 01164 ((CPU_CHAR *)Str_Cat_N((CPU_CHAR *)(pstr_dest), \ 01165 (const CPU_CHAR *)(pstr_cat),(CPU_SIZE_T)(len_max))) 01166 #define XMEMSET(pmem, data_val, size) \ 01167 ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ 01168 (CPU_SIZE_T)(size))) 01169 #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ 01170 (void *)(psrc), (CPU_SIZE_T)(size))) 01171 #define XMEMCMP(pmem_1, pmem_2, size) \ 01172 (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ 01173 (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) 01174 #define XMEMMOVE XMEMCPY 01175 01176 #if (OS_CFG_MUTEX_EN == DEF_DISABLED) 01177 #define SINGLE_THREADED 01178 #endif 01179 01180 #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) 01181 #define BIG_ENDIAN_ORDER 01182 #else 01183 #undef BIG_ENDIAN_ORDER 01184 #define LITTLE_ENDIAN_ORDER 01185 #endif 01186 #endif /* MICRIUM */ 01187 01188 01189 #ifdef WOLFSSL_QL 01190 #ifndef WOLFSSL_SEP 01191 #define WOLFSSL_SEP 01192 #endif 01193 #ifndef OPENSSL_EXTRA 01194 #define OPENSSL_EXTRA 01195 #endif 01196 #ifndef SESSION_CERTS 01197 #define SESSION_CERTS 01198 #endif 01199 #ifndef HAVE_AESCCM 01200 #define HAVE_AESCCM 01201 #endif 01202 #ifndef ATOMIC_USER 01203 #define ATOMIC_USER 01204 #endif 01205 #ifndef WOLFSSL_DER_LOAD 01206 #define WOLFSSL_DER_LOAD 01207 #endif 01208 #ifndef KEEP_PEER_CERT 01209 #define KEEP_PEER_CERT 01210 #endif 01211 #ifndef HAVE_ECC 01212 #define HAVE_ECC 01213 #endif 01214 #ifndef SESSION_INDEX 01215 #define SESSION_INDEX 01216 #endif 01217 #endif /* WOLFSSL_QL */ 01218 01219 01220 #if defined(WOLFSSL_XILINX) 01221 #define USER_TIME /* XTIME in asn.c */ 01222 #define NO_WOLFSSL_DIR 01223 #define NO_DEV_RANDOM 01224 #define HAVE_AESGCM 01225 #endif 01226 01227 #if defined(WOLFSSL_XILINX_CRYPT) 01228 #if defined(WOLFSSL_ARMASM) 01229 #error can not use both ARMv8 instructions and XILINX hardened crypto 01230 #endif 01231 #if defined(WOLFSSL_SHA3) 01232 /* only SHA3-384 is supported */ 01233 #undef WOLFSSL_NOSHA3_224 01234 #undef WOLFSSL_NOSHA3_256 01235 #undef WOLFSSL_NOSHA3_512 01236 #define WOLFSSL_NOSHA3_224 01237 #define WOLFSSL_NOSHA3_256 01238 #define WOLFSSL_NOSHA3_512 01239 #endif 01240 #endif /*(WOLFSSL_XILINX_CRYPT)*/ 01241 01242 #ifdef WOLFSSL_IMX6 01243 #ifndef SIZEOF_LONG_LONG 01244 #define SIZEOF_LONG_LONG 8 01245 #endif 01246 #endif 01247 01248 /* if defined turn on all CAAM support */ 01249 #ifdef WOLFSSL_IMX6_CAAM 01250 #undef WOLFSSL_IMX6_CAAM_RNG 01251 #define WOLFSSL_IMX6_CAAM_RNG 01252 01253 #undef WOLFSSL_IMX6_CAAM_BLOB 01254 #define WOLFSSL_IMX6_CAAM_BLOB 01255 01256 #if defined(HAVE_AESGCM) || defined(WOLFSSL_AES_XTS) 01257 /* large performance gain with HAVE_AES_ECB defined */ 01258 #undef HAVE_AES_ECB 01259 #define HAVE_AES_ECB 01260 #endif 01261 #endif 01262 01263 #if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ 01264 !defined(WOLFSSL_LEANPSK) && !defined(NO_WOLFSSL_MEMORY) && \ 01265 !defined(XMALLOC_OVERRIDE) 01266 #define USE_WOLFSSL_MEMORY 01267 #endif 01268 01269 01270 #if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) 01271 #undef KEEP_PEER_CERT 01272 #define KEEP_PEER_CERT 01273 #endif 01274 01275 01276 /* stream ciphers except arc4 need 32bit alignment, intel ok without */ 01277 #ifndef XSTREAM_ALIGN 01278 #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) 01279 #define NO_XSTREAM_ALIGN 01280 #else 01281 #define XSTREAM_ALIGN 01282 #endif 01283 #endif 01284 01285 /* write dup cannot be used with secure renegotiation because write dup 01286 * make write side write only and read side read only */ 01287 #if defined(HAVE_WRITE_DUP) && defined(HAVE_SECURE_RENEGOTIATION) 01288 #error "WRITE DUP and SECURE RENEGOTIATION cannot both be on" 01289 #endif 01290 01291 #ifdef WOLFSSL_SGX 01292 #ifdef _MSC_VER 01293 #define NO_RC4 01294 #ifndef HAVE_FIPS 01295 #define WOLFCRYPT_ONLY 01296 #define NO_DES3 01297 #define NO_SHA 01298 #define NO_MD5 01299 #else 01300 #define TFM_TIMING_RESISTANT 01301 #define NO_WOLFSSL_DIR 01302 #define NO_WRITEV 01303 #define NO_MAIN_DRIVER 01304 #define WOLFSSL_LOG_PRINTF 01305 #define WOLFSSL_DH_CONST 01306 #endif 01307 #else 01308 #define HAVE_ECC 01309 #define NO_WRITEV 01310 #define NO_MAIN_DRIVER 01311 #define USER_TICKS 01312 #define WOLFSSL_LOG_PRINTF 01313 #define WOLFSSL_DH_CONST 01314 #endif /* _MSC_VER */ 01315 #if !defined(HAVE_FIPS) && !defined(NO_RSA) 01316 #define WC_RSA_BLINDING 01317 #endif 01318 01319 #define NO_FILESYSTEM 01320 #define ECC_TIMING_RESISTANT 01321 #define TFM_TIMING_RESISTANT 01322 #define SINGLE_THREADED 01323 #define NO_ASN_TIME /* can not use headers such as windows.h */ 01324 #define HAVE_AESGCM 01325 #define USE_CERT_BUFFERS_2048 01326 #define USE_FAST_MATH 01327 #endif /* WOLFSSL_SGX */ 01328 01329 /* FreeScale MMCAU hardware crypto has 4 byte alignment. 01330 However, KSDK fsl_mmcau.h gives API with no alignment 01331 requirements (4 byte alignment is managed internally by fsl_mmcau.c) */ 01332 #ifdef FREESCALE_MMCAU 01333 #ifdef FREESCALE_MMCAU_CLASSIC 01334 #define WOLFSSL_MMCAU_ALIGNMENT 4 01335 #else 01336 #define WOLFSSL_MMCAU_ALIGNMENT 0 01337 #endif 01338 #endif 01339 01340 /* if using hardware crypto and have alignment requirements, specify the 01341 requirement here. The record header of SSL/TLS will prevent easy alignment. 01342 This hint tries to help as much as possible. */ 01343 #ifndef WOLFSSL_GENERAL_ALIGNMENT 01344 #ifdef WOLFSSL_AESNI 01345 #define WOLFSSL_GENERAL_ALIGNMENT 16 01346 #elif defined(XSTREAM_ALIGN) 01347 #define WOLFSSL_GENERAL_ALIGNMENT 4 01348 #elif defined(FREESCALE_MMCAU) || defined(FREESCALE_MMCAU_CLASSIC) 01349 #define WOLFSSL_GENERAL_ALIGNMENT WOLFSSL_MMCAU_ALIGNMENT 01350 #else 01351 #define WOLFSSL_GENERAL_ALIGNMENT 0 01352 #endif 01353 #endif 01354 01355 #if defined(WOLFSSL_GENERAL_ALIGNMENT) && (WOLFSSL_GENERAL_ALIGNMENT > 0) 01356 #if defined(_MSC_VER) 01357 #define XGEN_ALIGN __declspec(align(WOLFSSL_GENERAL_ALIGNMENT)) 01358 #elif defined(__GNUC__) 01359 #define XGEN_ALIGN __attribute__((aligned(WOLFSSL_GENERAL_ALIGNMENT))) 01360 #else 01361 #define XGEN_ALIGN 01362 #endif 01363 #else 01364 #define XGEN_ALIGN 01365 #endif 01366 01367 #ifdef HAVE_CRL 01368 /* not widely supported yet */ 01369 #undef NO_SKID 01370 #define NO_SKID 01371 #endif 01372 01373 01374 #ifdef __INTEL_COMPILER 01375 #pragma warning(disable:2259) /* explicit casts to smaller sizes, disable */ 01376 #endif 01377 01378 /* user can specify what curves they want with ECC_USER_CURVES otherwise 01379 * all curves are on by default for now */ 01380 #ifndef ECC_USER_CURVES 01381 #if !defined(WOLFSSL_SP_MATH) && !defined(HAVE_ALL_CURVES) 01382 #define HAVE_ALL_CURVES 01383 #endif 01384 #endif 01385 01386 /* ECC Configs */ 01387 #ifdef HAVE_ECC 01388 /* By default enable Sign, Verify, DHE, Key Import and Key Export unless explicitly disabled */ 01389 #ifndef NO_ECC_SIGN 01390 #undef HAVE_ECC_SIGN 01391 #define HAVE_ECC_SIGN 01392 #endif 01393 #ifndef NO_ECC_VERIFY 01394 #undef HAVE_ECC_VERIFY 01395 #define HAVE_ECC_VERIFY 01396 #endif 01397 #ifndef NO_ECC_CHECK_KEY 01398 #undef HAVE_ECC_CHECK_KEY 01399 #define HAVE_ECC_CHECK_KEY 01400 #endif 01401 #ifndef NO_ECC_DHE 01402 #undef HAVE_ECC_DHE 01403 #define HAVE_ECC_DHE 01404 #endif 01405 #ifndef NO_ECC_KEY_IMPORT 01406 #undef HAVE_ECC_KEY_IMPORT 01407 #define HAVE_ECC_KEY_IMPORT 01408 #endif 01409 #ifndef NO_ECC_KEY_EXPORT 01410 #undef HAVE_ECC_KEY_EXPORT 01411 #define HAVE_ECC_KEY_EXPORT 01412 #endif 01413 #endif /* HAVE_ECC */ 01414 01415 /* Curve255519 Configs */ 01416 #ifdef HAVE_CURVE25519 01417 /* By default enable shared secret, key export and import */ 01418 #ifndef NO_CURVE25519_SHARED_SECRET 01419 #undef HAVE_CURVE25519_SHARED_SECRET 01420 #define HAVE_CURVE25519_SHARED_SECRET 01421 #endif 01422 #ifndef NO_CURVE25519_KEY_EXPORT 01423 #undef HAVE_CURVE25519_KEY_EXPORT 01424 #define HAVE_CURVE25519_KEY_EXPORT 01425 #endif 01426 #ifndef NO_CURVE25519_KEY_IMPORT 01427 #undef HAVE_CURVE25519_KEY_IMPORT 01428 #define HAVE_CURVE25519_KEY_IMPORT 01429 #endif 01430 #endif /* HAVE_CURVE25519 */ 01431 01432 /* Ed255519 Configs */ 01433 #ifdef HAVE_ED25519 01434 /* By default enable sign, verify, key export and import */ 01435 #ifndef NO_ED25519_SIGN 01436 #undef HAVE_ED25519_SIGN 01437 #define HAVE_ED25519_SIGN 01438 #endif 01439 #ifndef NO_ED25519_VERIFY 01440 #undef HAVE_ED25519_VERIFY 01441 #define HAVE_ED25519_VERIFY 01442 #endif 01443 #ifndef NO_ED25519_KEY_EXPORT 01444 #undef HAVE_ED25519_KEY_EXPORT 01445 #define HAVE_ED25519_KEY_EXPORT 01446 #endif 01447 #ifndef NO_ED25519_KEY_IMPORT 01448 #undef HAVE_ED25519_KEY_IMPORT 01449 #define HAVE_ED25519_KEY_IMPORT 01450 #endif 01451 #endif /* HAVE_ED25519 */ 01452 01453 /* AES Config */ 01454 #ifndef NO_AES 01455 /* By default enable all AES key sizes, decryption and CBC */ 01456 #ifndef AES_MAX_KEY_SIZE 01457 #undef AES_MAX_KEY_SIZE 01458 #define AES_MAX_KEY_SIZE 256 01459 #endif 01460 01461 #ifndef NO_AES_128 01462 #undef WOLFSSL_AES_128 01463 #define WOLFSSL_AES_128 01464 #endif 01465 #if !defined(NO_AES_192) && AES_MAX_KEY_SIZE >= 192 01466 #undef WOLFSSL_AES_192 01467 #define WOLFSSL_AES_192 01468 #endif 01469 #if !defined(NO_AES_256) && AES_MAX_KEY_SIZE >= 256 01470 #undef WOLFSSL_AES_256 01471 #define WOLFSSL_AES_256 01472 #endif 01473 #if !defined(WOLFSSL_AES_128) && defined(HAVE_ECC_ENCRYPT) 01474 #warning HAVE_ECC_ENCRYPT uses AES 128 bit keys 01475 #endif 01476 01477 #ifndef NO_AES_DECRYPT 01478 #undef HAVE_AES_DECRYPT 01479 #define HAVE_AES_DECRYPT 01480 #endif 01481 #ifndef NO_AES_CBC 01482 #undef HAVE_AES_CBC 01483 #define HAVE_AES_CBC 01484 #else 01485 #ifndef WOLFCRYPT_ONLY 01486 #error "AES CBC is required for TLS and can only be disabled for WOLFCRYPT_ONLY builds" 01487 #endif 01488 #endif 01489 #ifdef WOLFSSL_AES_XTS 01490 /* AES-XTS makes calls to AES direct functions */ 01491 #ifndef WOLFSSL_AES_DIRECT 01492 #define WOLFSSL_AES_DIRECT 01493 #endif 01494 #endif 01495 #ifdef WOLFSSL_AES_CFB 01496 /* AES-CFB makes calls to AES direct functions */ 01497 #ifndef WOLFSSL_AES_DIRECT 01498 #define WOLFSSL_AES_DIRECT 01499 #endif 01500 #endif 01501 #endif 01502 01503 /* if desktop type system and fastmath increase default max bits */ 01504 #ifdef WOLFSSL_X86_64_BUILD 01505 #ifdef USE_FAST_MATH 01506 #ifndef FP_MAX_BITS 01507 #define FP_MAX_BITS 8192 01508 #endif 01509 #endif 01510 #endif 01511 01512 /* If using the max strength build, ensure OLD TLS is disabled. */ 01513 #ifdef WOLFSSL_MAX_STRENGTH 01514 #undef NO_OLD_TLS 01515 #define NO_OLD_TLS 01516 #endif 01517 01518 01519 /* Default AES minimum auth tag sz, allow user to override */ 01520 #ifndef WOLFSSL_MIN_AUTH_TAG_SZ 01521 #define WOLFSSL_MIN_AUTH_TAG_SZ 12 01522 #endif 01523 01524 01525 /* sniffer requires: 01526 * static RSA cipher suites 01527 * session stats and peak stats 01528 */ 01529 #ifdef WOLFSSL_SNIFFER 01530 #ifndef WOLFSSL_STATIC_RSA 01531 #define WOLFSSL_STATIC_RSA 01532 #endif 01533 #ifndef WOLFSSL_SESSION_STATS 01534 #define WOLFSSL_SESSION_STATS 01535 #endif 01536 #ifndef WOLFSSL_PEAK_SESSIONS 01537 #define WOLFSSL_PEAK_SESSIONS 01538 #endif 01539 #endif 01540 01541 /* Decode Public Key extras on by default, user can turn off with 01542 * WOLFSSL_NO_DECODE_EXTRA */ 01543 #ifndef WOLFSSL_NO_DECODE_EXTRA 01544 #ifndef RSA_DECODE_EXTRA 01545 #define RSA_DECODE_EXTRA 01546 #endif 01547 #ifndef ECC_DECODE_EXTRA 01548 #define ECC_DECODE_EXTRA 01549 #endif 01550 #endif 01551 01552 /* C Sharp wrapper defines */ 01553 #ifdef HAVE_CSHARP 01554 #ifndef WOLFSSL_DTLS 01555 #define WOLFSSL_DTLS 01556 #endif 01557 #undef NO_PSK 01558 #undef NO_SHA256 01559 #undef NO_DH 01560 #endif 01561 01562 /* Asynchronous Crypto */ 01563 #ifdef WOLFSSL_ASYNC_CRYPT 01564 /* Make sure wolf events are enabled */ 01565 #undef HAVE_WOLF_EVENT 01566 #define HAVE_WOLF_EVENT 01567 01568 #ifdef WOLFSSL_ASYNC_CRYPT_TEST 01569 #define WC_ASYNC_DEV_SIZE 320+24 01570 #else 01571 #define WC_ASYNC_DEV_SIZE 320 01572 #endif 01573 01574 #if !defined(HAVE_CAVIUM) && !defined(HAVE_INTEL_QA) && \ 01575 !defined(WOLFSSL_ASYNC_CRYPT_TEST) 01576 #error No async hardware defined with WOLFSSL_ASYNC_CRYPT! 01577 #endif 01578 01579 /* Enable ECC_CACHE_CURVE for ASYNC */ 01580 #if !defined(ECC_CACHE_CURVE) 01581 #define ECC_CACHE_CURVE 01582 #endif 01583 #endif /* WOLFSSL_ASYNC_CRYPT */ 01584 #ifndef WC_ASYNC_DEV_SIZE 01585 #define WC_ASYNC_DEV_SIZE 0 01586 #endif 01587 01588 /* leantls checks */ 01589 #ifdef WOLFSSL_LEANTLS 01590 #ifndef HAVE_ECC 01591 #error leantls build needs ECC 01592 #endif 01593 #endif /* WOLFSSL_LEANTLS*/ 01594 01595 /* restriction with static memory */ 01596 #ifdef WOLFSSL_STATIC_MEMORY 01597 #if defined(HAVE_IO_POOL) || defined(XMALLOC_USER) || defined(NO_WOLFSSL_MEMORY) 01598 #error static memory cannot be used with HAVE_IO_POOL, XMALLOC_USER or NO_WOLFSSL_MEMORY 01599 #endif 01600 #if !defined(USE_FAST_MATH) && !defined(NO_BIG_INT) 01601 #error static memory requires fast math please define USE_FAST_MATH 01602 #endif 01603 #ifdef WOLFSSL_SMALL_STACK 01604 #error static memory does not support small stack please undefine 01605 #endif 01606 #endif /* WOLFSSL_STATIC_MEMORY */ 01607 01608 #ifdef HAVE_AES_KEYWRAP 01609 #ifndef WOLFSSL_AES_DIRECT 01610 #error AES key wrap requires AES direct please define WOLFSSL_AES_DIRECT 01611 #endif 01612 #endif 01613 01614 #ifdef HAVE_PKCS7 01615 #if defined(NO_AES) && defined(NO_DES3) 01616 #error PKCS7 needs either AES or 3DES enabled, please enable one 01617 #endif 01618 #ifndef HAVE_AES_KEYWRAP 01619 #error PKCS7 requires AES key wrap please define HAVE_AES_KEYWRAP 01620 #endif 01621 #if defined(HAVE_ECC) && !defined(HAVE_X963_KDF) 01622 #error PKCS7 requires X963 KDF please define HAVE_X963_KDF 01623 #endif 01624 #endif 01625 01626 #if !defined(WOLFCRYPT_ONLY) && !defined(NO_OLD_TLS) && \ 01627 (defined(NO_SHA) || defined(NO_MD5)) 01628 #error old TLS requires MD5 and SHA 01629 #endif 01630 01631 /* for backwards compatibility */ 01632 #if defined(TEST_IPV6) && !defined(WOLFSSL_IPV6) 01633 #define WOLFSSL_IPV6 01634 #endif 01635 01636 01637 /* Place any other flags or defines here */ 01638 01639 #if defined(WOLFSSL_MYSQL_COMPATIBLE) && defined(_WIN32) \ 01640 && defined(HAVE_GMTIME_R) 01641 #undef HAVE_GMTIME_R /* don't trust macro with windows */ 01642 #endif /* WOLFSSL_MYSQL_COMPATIBLE */ 01643 01644 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) 01645 #define SSL_OP_NO_COMPRESSION SSL_OP_NO_COMPRESSION 01646 #define OPENSSL_NO_ENGINE 01647 #define X509_CHECK_FLAG_ALWAYS_CHECK_SUBJECT 01648 #ifndef OPENSSL_EXTRA 01649 #define OPENSSL_EXTRA 01650 #endif 01651 #ifndef HAVE_SESSION_TICKET 01652 #define HAVE_SESSION_TICKET 01653 #endif 01654 #ifndef HAVE_OCSP 01655 #define HAVE_OCSP 01656 #endif 01657 #ifndef KEEP_OUR_CERT 01658 #define KEEP_OUR_CERT 01659 #endif 01660 #ifndef HAVE_SNI 01661 #define HAVE_SNI 01662 #endif 01663 #endif 01664 01665 #if defined(WOLFSSL_NGINX) 01666 #define SSL_CTRL_SET_TLSEXT_HOSTNAME 01667 #endif 01668 01669 /* both CURVE and ED small math should be enabled */ 01670 #ifdef CURVED25519_SMALL 01671 #define CURVE25519_SMALL 01672 #define ED25519_SMALL 01673 #endif 01674 01675 01676 #ifndef WOLFSSL_ALERT_COUNT_MAX 01677 #define WOLFSSL_ALERT_COUNT_MAX 5 01678 #endif 01679 01680 /* warning for not using harden build options (default with ./configure) */ 01681 #ifndef WC_NO_HARDEN 01682 #if (defined(USE_FAST_MATH) && !defined(TFM_TIMING_RESISTANT)) || \ 01683 (defined(HAVE_ECC) && !defined(ECC_TIMING_RESISTANT)) || \ 01684 (!defined(NO_RSA) && !defined(WC_RSA_BLINDING) && !defined(HAVE_FIPS)) 01685 01686 #ifndef _MSC_VER 01687 #warning "For timing resistance / side-channel attack prevention consider using harden options" 01688 #else 01689 #pragma message("Warning: For timing resistance / side-channel attack prevention consider using harden options") 01690 #endif 01691 #endif 01692 #endif 01693 01694 #if defined(NO_OLD_WC_NAMES) || defined(OPENSSL_EXTRA) 01695 /* added to have compatibility with SHA256() */ 01696 #if !defined(NO_OLD_SHA_NAMES) && !defined(HAVE_FIPS) 01697 #define NO_OLD_SHA_NAMES 01698 #endif 01699 #endif 01700 01701 /* switch for compatibility layer functionality. Has subparts i.e. BIO/X509 01702 * When opensslextra is enabled all subparts should be turned on. */ 01703 #ifdef OPENSSL_EXTRA 01704 #undef OPENSSL_EXTRA_X509_SMALL 01705 #define OPENSSL_EXTRA_X509_SMALL 01706 #endif /* OPENSSL_EXTRA */ 01707 01708 /* support for converting DER to PEM */ 01709 #if defined(WOLFSSL_KEY_GEN) || defined(WOLFSSL_CERT_GEN) || \ 01710 defined(OPENSSL_EXTRA) 01711 #undef WOLFSSL_DER_TO_PEM 01712 #define WOLFSSL_DER_TO_PEM 01713 #endif 01714 01715 /* keep backwards compatibility enabling encrypted private key */ 01716 #ifndef WOLFSSL_ENCRYPTED_KEYS 01717 #if defined(OPENSSL_EXTRA) || defined(OPENSSL_EXTRA_X509_SMALL) || \ 01718 defined(HAVE_WEBSERVER) 01719 #define WOLFSSL_ENCRYPTED_KEYS 01720 #endif 01721 #endif 01722 01723 /* support for disabling PEM to DER */ 01724 #if !defined(WOLFSSL_NO_PEM) 01725 #undef WOLFSSL_PEM_TO_DER 01726 #define WOLFSSL_PEM_TO_DER 01727 #endif 01728 01729 /* Parts of the openssl compatibility layer require peer certs */ 01730 #if defined(OPENSSL_ALL) || defined(WOLFSSL_NGINX) || defined(WOLFSSL_HAPROXY) 01731 #undef KEEP_PEER_CERT 01732 #define KEEP_PEER_CERT 01733 #endif 01734 01735 /* RAW hash function APIs are not implemented with ARMv8 hardware acceleration*/ 01736 #ifdef WOLFSSL_ARMASM 01737 #undef WOLFSSL_NO_HASH_RAW 01738 #define WOLFSSL_NO_HASH_RAW 01739 #endif 01740 01741 #ifdef __cplusplus 01742 } /* extern "C" */ 01743 #endif 01744 01745 #endif 01746
Generated on Tue Jul 12 2022 16:58:07 by
1.7.2