1 /* user_settings.h 2 * 3 * Copyright (C) 2006-2021 wolfSSL Inc. 4 * 5 * This file is part of wolfSSL. 6 * 7 * wolfSSL is free software; you can redistribute it and/or modify 8 * it under the terms of the GNU General Public License as published by 9 * the Free Software Foundation; either version 2 of the License, or 10 * (at your option) any later version. 11 * 12 * wolfSSL is distributed in the hope that it will be useful, 13 * but WITHOUT ANY WARRANTY; without even the implied warranty of 14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 15 * GNU General Public License for more details. 16 * 17 * You should have received a copy of the GNU General Public License 18 * along with this program; if not, write to the Free Software 19 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA 20 */ 21 22 #define NO_MAIN_DRIVER 23 #define BENCH_EMBEDDED 24 #define NO_DEV_RANDOM 25 #define WOLFSSL_USER_CURRTIME 26 #define SIZEOF_LONG_LONG 8 27 #define NO_WRITEV 28 #define NO_DEV_RANDOM 29 30 #define TFM_TIMING_RESISTANT 31 #define ECC_TIMING_RESISTANT 32 #define WC_RSA_BLINDING 33 34 #define WOLFSSL_USER_CURRTIME /* for benchmark */ 35 #define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ 36 #define WOLFSSL_GMTIME 37 #define NO_MULTIBYTE_PRINT 38 39 // <<< Use Configuration Wizard in Context Menu >>> 40 41 42 // <h>Common options 43 // <o> MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx 44 #define MDK_CONF_MPU 3 45 #if MDK_CONF_MPU == 0 46 47 #elif MDK_CONF_MPU == 1 48 #define WOLFSSL_STM32_CUBEMX 49 #define STM32F2xx 50 #elif MDK_CONF_MPU == 2 51 #define WOLFSSL_STM32_CUBEMX 52 #define STM32F4xx 53 #elif MDK_CONF_MPU == 3 54 #define WOLFSSL_STM32_CUBEMX 55 #define STM32F7xx 56 #endif 57 58 // <o> Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <3=>SafeRTOS <4=>Windows 59 // <5=>PThread <6=>ThreadX 60 // <7=>Micrium <8=>EBSnet <9=>MQX 61 // <10=>T-RTOS <11=>uITRON4 <12=>uTKERNEL2 62 // <13=>Frosted <14=>CMSIS RTOS <15=>CMSIS RTOSv2 <16=>Others 63 #define MDK_CONF_THREAD 15 64 #if MDK_CONF_THREAD== 0 65 #define SINGLE_THREADED 66 #elif MDK_CONF_THREAD == 1 67 #define FREERTOS 68 #elif MDK_CONF_THREAD == 3 69 #define WOLFSSL_SAFERTOS 70 #elif MDK_CONF_THREAD == 4 71 #define USE_WINDOWS_API 72 #elif MDK_CONF_THREAD == 5 73 #define WOLFSSL_PTHREADS 74 #elif MDK_CONF_THREAD == 6 75 #define THREADX 76 #define NETX 77 #elif MDK_CONF_THREAD == 7 78 #define MICRIUM 79 #elif MDK_CONF_THREAD == 8 80 #define EBSNET 81 #elif MDK_CONF_THREAD == 9 82 #define FREESCALE_MQX 83 #define FREESCALE_KSDK_MQX 84 #elif MDK_CONF_THREAD == 10 85 #define WOLFSSL_TIRTOS 86 #elif MDK_CONF_THREAD == 11 87 #define WOLFSSL_uITRON4 88 #elif MDK_CONF_THREAD == 12 89 #define WOLFSSL_uTKERNEL2 90 #elif MDK_CONF_THREAD == 13 91 #define WOLFSSL_FROSTED 92 #elif MDK_CONF_THREAD == 14 93 #define WOLFSSL_CMSIS_RTOS 94 #elif MDK_CONF_THREAD == 15 95 #define WOLFSSL_CMSIS_RTOSv2 96 #elif MDK_CONF_THREAD == 16 97 #define SINGLE_THREADED 98 #endif 99 100 101 // <e>File System 102 #define MDK_CONF_FILESYSTEM 1 103 #if MDK_CONF_FILESYSTEM == 0 104 #define NO_FILESYSTEM 105 #else 106 #define WOLFSSL_KEIL_FS 107 #define NO_WOLFSSL_DIR 108 #endif 109 // </e> 110 111 // <o> Network<0=>None <1=>RLnet <2=>User I/O 112 #define MDK_CONF_NETWORK 1 113 #if MDK_CONF_NETWORK == 0 114 #elif MDK_CONF_NETWORK == 1 115 #define WOLFSSL_KEIL_TCP_NET 116 #elif MDK_CONF_NETWORK == 2 117 #define WOLFSSL_USER_IO 118 #endif 119 120 // <h>Debug options 121 122 // <e>Debug Message 123 #define MDK_CONF_DebugMessage 0 124 #if MDK_CONF_DebugMessage == 1 125 #define DEBUG_WOLFSSL 126 #endif 127 // </e> 128 // <e>Check malloc 129 #define MDK_CONF_CheckMalloc 1 130 #if MDK_CONF_CheckMalloc == 1 131 #define WOLFSSL_MALLOC_CHECK 132 #define USE_WOLFSSL_MEMORY 133 #endif 134 // </e> 135 // <e>ErrNo.h 136 #define MDK_CONF_ErrNo 1 137 #if MDK_CONF_ErrNo == 1 138 #define HAVE_ERRNO 139 #endif 140 // </e> 141 // <e>Error Strings 142 #define MDK_CONF_ErrorStrings 1 143 #if MDK_CONF_ErrorStrings == 0 144 #define NO_ERROR_STRINGS 145 #endif 146 // </e> 147 148 //</h> 149 //</h> 150 151 // <h> wolfCrypt Configuration 152 153 // <h>Hash/Crypt Algrithm 154 155 // <e>MD2 156 #define MDK_CONF_MD2 0 157 #if MDK_CONF_MD2 == 1 158 #define WOLFSSL_MD2 159 #endif 160 // </e> 161 // <e>MD4 162 #define MDK_CONF_MD4 0 163 #if MDK_CONF_MD4 == 0 164 #define NO_MD4 165 #endif 166 // </e> 167 // <e>MD5 168 #define MDK_CONF_MD5 1 169 #if MDK_CONF_MD5 == 0 170 #define NO_MD5 171 #endif 172 // </e> 173 // <e>SHA 174 #define MDK_CONF_SHA 1 175 #if MDK_CONF_SHA == 0 176 #define NO_SHA 177 #endif 178 // </e> 179 // <e>SHA-256 180 #define MDK_CONF_SHA256 1 181 #if MDK_CONF_SHA256 == 0 182 #define NO_SHA256 183 #endif 184 // </e> 185 // <e>SHA-384 186 #define MDK_CONF_SHA384 1 187 #if MDK_CONF_SHA384 == 1 188 #define WOLFSSL_SHA384 189 #endif 190 // </e> 191 // <e>SHA-512 192 #define MDK_CONF_SHA512 1 193 #if MDK_CONF_SHA512 == 1 194 #define WOLFSSL_SHA512 195 #endif 196 // </e> 197 // <e>Hash DRBG 198 #define MDK_CONF_HASHDRBG 1 199 #if MDK_CONF_HASHDRBG == 1 200 #define HAVE_HASHDRBG 201 #endif 202 // </e> 203 // <e>RIPEMD 204 #define MDK_CONF_RIPEMD 1 205 #if MDK_CONF_RIPEMD == 1 206 #define WOLFSSL_RIPEMD 207 #endif 208 // </e> 209 // <e>BLAKE2 210 #define MDK_CONF_BLAKE2 0 211 #if MDK_CONF_BLAKE2 == 1 212 #define HAVE_BLAKE2 213 #endif 214 // </e> 215 // <e>HMAC 216 #define MDK_CONF_HMAC 1 217 #if MDK_CONF_HMAC == 0 218 #define NO_HMAC 219 #endif 220 // </e> 221 // <e>HMAC KDF 222 #define MDK_CONF_HKDF 1 223 #if MDK_CONF_HKDF == 1 224 #define HAVE_HKDF 225 #endif 226 // </e> 227 228 // <e>AES CCM 229 #define MDK_CONF_AESCCM 1 230 #if MDK_CONF_AESCCM == 1 231 #define HAVE_AESCCM 232 #endif 233 // </e> 234 // <e>AES GCM 235 #define MDK_CONF_AESGCM 1 236 #if MDK_CONF_AESGCM == 1 237 #define HAVE_AESGCM 238 #endif 239 // </e> 240 241 // <e>RC4 242 #define MDK_CONF_RC4 0 243 #if MDK_CONF_RC4 == 0 244 #define NO_RC4 245 #endif 246 // </e> 247 248 // <e>HC128 249 #define MDK_CONF_HC128 1 250 #if MDK_CONF_HC128 == 0 251 #define NO_HC128 252 #endif 253 // </e> 254 255 // <e>RABBIT 256 #define MDK_CONF_RABBIT 1 257 #if MDK_CONF_RABBIT == 0 258 #define NO_RABBIT 259 #endif 260 // </e> 261 262 // <e>CHACHA 263 #define MDK_CONF_CHACHA 1 264 #if MDK_CONF_CHACHA == 1 265 #define HAVE_CHACHA 266 #endif 267 // </e> 268 269 // <e>POLY1305 270 #define MDK_CONF_POLY1305 1 271 #if MDK_CONF_POLY1305 == 1 272 #define HAVE_POLY1305 273 #define HAVE_ONE_TIME_AUTH 274 #endif 275 // </e> 276 277 // <e>DES3 278 #define MDK_CONF_DES3 1 279 #if MDK_CONF_DES3 == 0 280 #define NO_DES3 281 #endif 282 // </e> 283 284 // <e>AES 285 #define MDK_CONF_AES 1 286 #if MDK_CONF_AES == 0 287 #define NO_AES 288 #endif 289 // </e> 290 291 // <e>CAMELLIA 292 #define MDK_CONF_CAMELLIA 1 293 #if MDK_CONF_CAMELLIA == 1 294 #define HAVE_CAMELLIA 295 #endif 296 // </e> 297 298 // <e>DH 299 #define MDK_CONF_DH 1 300 #if MDK_CONF_DH == 0 301 #define NO_DH 302 #endif 303 // </e> 304 // <e>DSA 305 #define MDK_CONF_DSA 1 306 #if MDK_CONF_DSA == 0 307 #define NO_DSA 308 #endif 309 // </e> 310 311 // <e>SRP 312 #define MDK_CONF_SRP 1 313 #if MDK_CONF_SRP == 1 314 #define HAVE_SRP 315 #endif 316 // </e> 317 318 // <e>PWDBASED 319 #define MDK_CONF_PWDBASED 1 320 #if MDK_CONF_PWDBASED == 0 321 #define NO_PWDBASED 322 #endif 323 // </e> 324 325 // <e>ECC 326 #define MDK_CONF_ECC 1 327 #if MDK_CONF_ECC == 1 328 #define HAVE_ECC 329 #endif 330 // </e> 331 332 // <e>CURVE25519 333 #define MDK_CONF_CURVE25519 1 334 #if MDK_CONF_CURVE25519 == 1 335 #define HAVE_CURVE25519 336 #define CURVED25519_SMALL 337 #endif 338 // </e> 339 // <e>CURVE25519 SMALL 340 #define MDK_CONF_CURVE25519_SMALL 0 341 #if MDK_CONF_CURVE25519_SMALL == 1 342 #define CURVED25519_SMALL 343 #endif 344 // </e> 345 // <e>ED25519 346 #define MDK_CONF_ED25519 1 347 #if MDK_CONF_ED25519 == 1 348 #define HAVE_ED25519 349 #endif 350 // </e> 351 // <e>ED25519 SMALL 352 #define MDK_CONF_ED25519_SMALL 0 353 #if MDK_CONF_ED25519_SMALL == 1 354 #define ED25519_SMALL 355 #endif 356 // </e> 357 // <e>PKCS7 358 #define MDK_CONF_PKCS7 0 359 #if MDK_CONF_PKCS7 == 1 360 #define HAVE_PKCS7 361 #endif 362 // </e> 363 // </h> 364 365 // <e>Random Seed, for TEST Only 366 #define MDK_CONF_RNDSEED 1 367 #if MDK_CONF_RNDSEED == 1 368 #define WOLFSSL_GENSEED_FORTEST 369 #endif 370 // </e> 371 372 // <h>Hardware Crypt (See document for usage) 373 // <e>Hardware RNG 374 #define MDK_CONF_STM32F2_RNG 0 375 #if MDK_CONF_STM32F2_RNG == 1 376 #define WOLFSSL_STM32_CUBEMX 377 #define STM32_RNG 378 #define WC_ASYNC_DEV_SIZE 320+24 379 #define STM32_HAL_TIMEOUT 0xFF 380 381 #if defined(STM32F2xx) 382 #define WOLFSSL_STM32F2 383 #elif defined(STM32F4xx) 384 #define WOLFSSL_STM32F4 385 #elif defined(STM32F7xx) 386 #define WOLFSSL_STM32F7 387 #endif 388 389 #endif 390 // </e> 391 // <e>Hardware Crypt 392 #define MDK_CONF_STM32F2_CRYPTO 0 393 #if MDK_CONF_STM32F2_CRYPTO == 1 394 #define WOLFSSL_STM32_CUBEMX 395 #define STM32_CRYPTO 396 #define WC_ASYNC_DEV_SIZE 320+24 397 #define STM32_HAL_TIMEOUT 0xFF 398 399 #if defined(STM32F2xx) 400 #define WOLFSSL_STM32F2 401 #elif defined(STM32F4xx) 402 #define WOLFSSL_STM32F4 403 #elif defined(STM32F7xx) 404 #define WOLFSSL_STM32F7 405 #endif 406 407 #endif 408 // </e> 409 // <e>Hardware Hash 410 #define MDK_CONF_STM32F2_HASH 0 411 #if MDK_CONF_STM32F2_HASH == 1 412 #define WOLFSSL_STM32_CUBEMX 413 #define STM32_HASH 414 #define WC_ASYNC_DEV_SIZE 320+24 415 #define STM32_HAL_TIMEOUT 0xFF 416 417 #if defined(STM32F2xx) 418 #define WOLFSSL_STM32F2 419 #elif defined(STM32F4xx) 420 #define WOLFSSL_STM32F4 421 #elif defined(STM32F7xx) 422 #define WOLFSSL_STM32F7 423 #endif 424 425 #endif 426 // </e> 427 // </h> 428 429 // <h>Cert/Key Strage 430 // <o>Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) 431 #define MDK_CONF_CERT_BUFF 0 432 #if MDK_CONF_CERT_BUFF== 1 433 #define USE_CERT_BUFFERS_1024 434 #elif MDK_CONF_CERT_BUFF == 2 435 #define USE_CERT_BUFFERS_2048 436 #endif 437 //</h> 438 // <h>Cert/Key Generation 439 // <e>CertGen 440 #define MDK_CONF_CERT_GEN 0 441 #if MDK_CONF_CERT_GEN == 1 442 #define WOLFSSL_CERT_GEN 443 #endif 444 // </e> 445 // <e>KeyGen 446 #define MDK_CONF_KEY_GEN 0 447 #if MDK_CONF_KEY_GEN == 1 448 #define WOLFSSL_KEY_GEN 449 #endif 450 // </e> 451 // </h> 452 // <e>Use Fast Math 453 #define MDK_CONF_FASTMATH 1 454 #if MDK_CONF_FASTMATH == 1 455 #define USE_FAST_MATH 456 #define TFM_TIMING_RESISTANT 457 #endif 458 // </e> 459 // <e>Small Stack 460 #define MDK_CONF_SmallStack 1 461 #if MDK_CONF_SmallStack == 0 462 #define NO_WOLFSSL_SMALL_STACK 463 #endif 464 // </e> 465 466 // </h> 467 468 469 /**** wolfSSL Configuration ****/ 470 471 // <h> wolfSSL Configuration 472 473 // <e>TLS 1.3 474 #define MDK_CONF_TLS 1 475 #if MDK_CONF_TLS == 1 476 #define WOLFSSL_TLS13 477 #define HAVE_TLS_EXTENSIONS 478 #define HAVE_SUPPORTED_CURVES 479 #define WC_RSA_PSS 480 #define HAVE_HKDF 481 #define HAVE_FFDHE_2048 482 #endif 483 // </e> 484 485 // <e>Include Old TLS 486 #define MDK_CONF_NO_OLDTLS 0 487 #if MDK_CONF_NO_OLDTLS == 0 488 #define NO_OLD_TLS 489 #endif 490 // </e> 491 // <e>CRL 492 #define MDK_CONF_CRL 0 493 #if MDK_CONF_CRL == 1 494 #define HAVE_CRL 495 #define WOLFSSL_DER_LOAD 496 #endif 497 // </e> 498 // <e>OCSP 499 #define MDK_CONF_OCSP 0 500 #if MDK_CONF_OCSP == 1 501 #define HAVE_OCSP 502 #endif 503 // </e> 504 // <e>OpenSSL Extra 505 #define MDK_CONF_OPENSSL_EXTRA 0 506 #if MDK_CONF_OPENSSL_EXTRA == 1 507 #define OPENSSL_EXTRA 508 #endif 509 // </e> 510 511 //</h> 512