diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt b/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt index d6ab1ff89..f3c95a61c 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt @@ -1,6 +1,7 @@ wolfCrypt Benchmark Use Configuration Wizard tab +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) user_settings.h for wolfCrypt options For further options, details, see wolfSSL User Manual. diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h index b90bf7acd..30bb846d8 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/user_settings.h @@ -59,8 +59,8 @@ // <4=>PThread <5=>ThreadX<6=> ThreadX/NetX // <7=>Micrium <8=>EBSnet<9=>MQX // <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 -// <13=>Frosted <14=>CMSIS RTOS<15=>Others -#define MDK_CONF_THREAD 14 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 15 #if MDK_CONF_THREAD== 0 #define SINGLE_THREADED #elif MDK_CONF_THREAD == 1 @@ -92,6 +92,8 @@ #elif MDK_CONF_THREAD == 14 #define WOLFSSL_CMSIS_RTOS #elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 #define SINGLE_THREADED #endif @@ -151,13 +153,13 @@ // Hash/Crypt Algrithm // MD2 -#define MDK_CONF_MD2 1 +#define MDK_CONF_MD2 0 #if MDK_CONF_MD2 == 1 #define WOLFSSL_MD2 #endif // // MD4 -#define MDK_CONF_MD4 1 +#define MDK_CONF_MD4 0 #if MDK_CONF_MD4 == 0 #define NO_MD4 #endif @@ -237,7 +239,7 @@ // // RC4 -#define MDK_CONF_RC4 1 +#define MDK_CONF_RC4 0 #if MDK_CONF_RC4 == 0 #define NO_RC4 #endif @@ -376,7 +378,7 @@ // Hardware Crypt (See document for usage) // Hardware RNG -#define MDK_CONF_STM32F2_RNG 1 +#define MDK_CONF_STM32F2_RNG 0 #if MDK_CONF_STM32F2_RNG == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_RNG @@ -394,7 +396,7 @@ #endif // // Hardware Crypt -#define MDK_CONF_STM32F2_CRYPTO 1 +#define MDK_CONF_STM32F2_CRYPTO 0 #if MDK_CONF_STM32F2_CRYPTO == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_CRYPTO @@ -412,7 +414,7 @@ #endif // // Hardware Hash -#define MDK_CONF_STM32F2_HASH 1 +#define MDK_CONF_STM32F2_HASH 0 #if MDK_CONF_STM32F2_HASH == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_HASH @@ -462,7 +464,7 @@ #endif // // Small Stack -#define MDK_CONF_SmallStack 0 +#define MDK_CONF_SmallStack 1 #if MDK_CONF_SmallStack == 0 #define NO_WOLFSSL_SMALL_STACK #endif @@ -476,10 +478,11 @@ // wolfSSL Configuration // TLS 1.3 -#define MDK_CONF_TLS 0 +#define MDK_CONF_TLS 1 #if MDK_CONF_TLS == 1 #define WOLFSSL_TLS13 #define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES #define WC_RSA_PSS #define HAVE_HKDF #define HAVE_FFDHE_2048 diff --git a/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt b/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt index 72a0fce0e..808804bfa 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt @@ -1,6 +1,7 @@ wolfCrypt test Use Configuration Wizard tab +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) user_settings.h for wolfCrypt options For further options, details, see wolfSSL User Manual. diff --git a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/user_settings.h index ffce5bd40..286eb78ae 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/user_settings.h +++ b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/user_settings.h @@ -59,8 +59,8 @@ // <4=>PThread <5=>ThreadX<6=> ThreadX/NetX // <7=>Micrium <8=>EBSnet<9=>MQX // <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 -// <13=>Frosted <14=>CMSIS RTOS<15=>Others -#define MDK_CONF_THREAD 14 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 15 #if MDK_CONF_THREAD== 0 #define SINGLE_THREADED #elif MDK_CONF_THREAD == 1 @@ -92,6 +92,8 @@ #elif MDK_CONF_THREAD == 14 #define WOLFSSL_CMSIS_RTOS #elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 #define SINGLE_THREADED #endif @@ -151,13 +153,13 @@ // Hash/Crypt Algrithm // MD2 -#define MDK_CONF_MD2 1 +#define MDK_CONF_MD2 0 #if MDK_CONF_MD2 == 1 #define WOLFSSL_MD2 #endif // // MD4 -#define MDK_CONF_MD4 1 +#define MDK_CONF_MD4 0 #if MDK_CONF_MD4 == 0 #define NO_MD4 #endif @@ -237,7 +239,7 @@ // // RC4 -#define MDK_CONF_RC4 1 +#define MDK_CONF_RC4 0 #if MDK_CONF_RC4 == 0 #define NO_RC4 #endif @@ -376,7 +378,7 @@ // Hardware Crypt (See document for usage) // Hardware RNG -#define MDK_CONF_STM32F2_RNG 1 +#define MDK_CONF_STM32F2_RNG 0 #if MDK_CONF_STM32F2_RNG == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_RNG @@ -394,7 +396,7 @@ #endif // // Hardware Crypt -#define MDK_CONF_STM32F2_CRYPTO 1 +#define MDK_CONF_STM32F2_CRYPTO 0 #if MDK_CONF_STM32F2_CRYPTO == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_CRYPTO @@ -412,7 +414,7 @@ #endif // // Hardware Hash -#define MDK_CONF_STM32F2_HASH 1 +#define MDK_CONF_STM32F2_HASH 0 #if MDK_CONF_STM32F2_HASH == 1 #define WOLFSSL_STM32_CUBEMX #define STM32_HASH @@ -462,7 +464,7 @@ #endif // // Small Stack -#define MDK_CONF_SmallStack 0 +#define MDK_CONF_SmallStack 1 #if MDK_CONF_SmallStack == 0 #define NO_WOLFSSL_SMALL_STACK #endif @@ -476,10 +478,11 @@ // wolfSSL Configuration // TLS 1.3 -#define MDK_CONF_TLS 0 +#define MDK_CONF_TLS 1 #if MDK_CONF_TLS == 1 #define WOLFSSL_TLS13 #define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES #define WC_RSA_PSS #define HAVE_HKDF #define HAVE_FFDHE_2048 diff --git a/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt b/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt index 3586d285d..46913b5e8 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt @@ -1,6 +1,9 @@ wolfSSL example: echo Client Use Configuration Wizard tab + +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) +RTE_Device.h: Check ETH (Ethernet Interface) main.c for remote IP address, port or TLS version user_settings.h for wolfCrypt or wolfSSL options diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/user_settings.h new file mode 100644 index 000000000..30f64ccc3 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/user_settings.h @@ -0,0 +1,517 @@ +/* user_settings.h + * + * Copyright (C) 2006-2017 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED +#define NO_DEV_RANDOM +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV +#define NO_DEV_RANDOM + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +#define WOLFSSL_USER_CURRTIME /* for benchmark */ +#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ +#define WOLFSSL_GMTIME +#define NO_MULTIBYTE_PRINT + +// <<< Use Configuration Wizard in Context Menu >>> + + +// Common options +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx +#define MDK_CONF_MPU 3 +#if MDK_CONF_MPU == 0 + +#elif MDK_CONF_MPU == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32F2xx +#elif MDK_CONF_MPU == 2 +#define WOLFSSL_STM32_CUBEMX +#define STM32F4xx +#elif MDK_CONF_MPU == 3 +#define WOLFSSL_STM32_CUBEMX +#define STM32F7xx +#endif + +// Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows +// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX +// <7=>Micrium <8=>EBSnet<9=>MQX +// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 +// <13=>Frosted <14=>CMSIS RTOS<15=>Others +#define MDK_CONF_THREAD 14 +#if MDK_CONF_THREAD== 0 +#define SINGLE_THREADED +#elif MDK_CONF_THREAD == 1 +#define FREERTOS +#elif MDK_CONF_THREAD == 3 +#define WOLFSSL_SAFERTOS +#elif MDK_CONF_THREAD == 4 +#define USE_WINDOWS_API +#elif MDK_CONF_THREAD == 5 +#define WOLFSSL_PTHREADS +#elif MDK_CONF_THREAD == 6 +#define THREADX +#define NETX +#elif MDK_CONF_THREAD == 7 +#define MICRIUM +#elif MDK_CONF_THREAD == 8 +#define EBSNET +#elif MDK_CONF_THREAD == 9 +#define FREESCALE_MQX +#define FREESCALE_KSDK_MQX +#elif MDK_CONF_THREAD == 10 +#define WOLFSSL_TIRTOS +#elif MDK_CONF_THREAD == 11 +#define WOLFSSL_uITRON4 +#elif MDK_CONF_THREAD == 12 +#define WOLFSSL_uTKERNEL2 +#elif MDK_CONF_THREAD == 13 +#define WOLFSSL_FROSTED +#elif MDK_CONF_THREAD == 14 +#define WOLFSSL_CMSIS_RTOS +#elif MDK_CONF_THREAD == 15 +#define SINGLE_THREADED +#endif + + +// File System +#define MDK_CONF_FILESYSTEM 1 +#if MDK_CONF_FILESYSTEM == 0 +#define NO_FILESYSTEM +#else +#define WOLFSSL_KEIL_FS +#define NO_WOLFSSL_DIR +#endif +// + +// Network<0=>None <1=>RLnet <2=>User I/O +#define MDK_CONF_NETWORK 1 +#if MDK_CONF_NETWORK == 0 +#elif MDK_CONF_NETWORK == 1 +#define WOLFSSL_KEIL_TCP_NET +#elif MDK_CONF_NETWORK == 2 +#define WOLFSSL_USER_IO +#endif + +// Debug options + +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// +// ErrNo.h +#define MDK_CONF_ErrNo 1 +#if MDK_CONF_ErrNo == 1 +#define HAVE_ERRNO +#endif +// +// Error Strings +#define MDK_CONF_ErrorStrings 1 +#if MDK_CONF_ErrorStrings == 0 +#define NO_ERROR_STRINGS +#endif +// + +// +// + +// wolfCrypt Configuration + +// Hash/Crypt Algrithm + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define WOLFSSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 0 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// MD5 +#define MDK_CONF_MD5 1 +#if MDK_CONF_MD5 == 0 +#define NO_MD5 +#endif +// +// SHA +#define MDK_CONF_SHA 1 +#if MDK_CONF_SHA == 0 +#define NO_SHA +#endif +// +// SHA-256 +#define MDK_CONF_SHA256 1 +#if MDK_CONF_SHA256 == 0 +#define NO_SHA256 +#endif +// +// SHA-384 +#define MDK_CONF_SHA384 1 +#if MDK_CONF_SHA384 == 1 +#define WOLFSSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 1 +#if MDK_CONF_SHA512 == 1 +#define WOLFSSL_SHA512 +#endif +// +// Hash DRBG +#define MDK_CONF_HASHDRBG 1 +#if MDK_CONF_HASHDRBG == 1 +#define HAVE_HASHDRBG +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 1 +#if MDK_CONF_RIPEMD == 1 +#define WOLFSSL_RIPEMD +#endif +// +// BLAKE2 +#define MDK_CONF_BLAKE2 0 +#if MDK_CONF_BLAKE2 == 1 +#define HAVE_BLAKE2 +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HMAC KDF +#define MDK_CONF_HKDF 1 +#if MDK_CONF_HKDF == 1 +#define HAVE_HKDF +#endif +// + +// AES CCM +#define MDK_CONF_AESCCM 1 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AES GCM +#define MDK_CONF_AESGCM 1 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#endif +// + +// RC4 +#define MDK_CONF_RC4 0 +#if MDK_CONF_RC4 == 0 +#define NO_RC4 +#endif +// + +// HC128 +#define MDK_CONF_HC128 1 +#if MDK_CONF_AESGCM == 0 +#define NO_HC128 +#endif +// + +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBIT == 0 +#define NO_RABBIT +#endif +// + +// CHACHA +#define MDK_CONF_CHACHA 1 +#if MDK_CONF_CHACHA == 1 +#define HAVE_CHACHA +#endif +// + +// POLY1305 +#define MDK_CONF_POLY1305 1 +#if MDK_CONF_POLY1305 == 1 +#define HAVE_POLY1305 +#define HAVE_ONE_TIME_AUTH +#endif +// + +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// + +// AES +#define MDK_CONF_AES 1 +#if MDK_CONF_AES == 0 +#define NO_AES +#endif +// + +// CAMELLIA +#define MDK_CONF_CAMELLIA 1 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +#define MDK_CONF_DH 1 +#if MDK_CONF_DH == 0 +#define NO_DH +#endif +// +// DSA +#define MDK_CONF_DSA 1 +#if MDK_CONF_DSA == 0 +#define NO_DSA +#endif +// + +// SRP +#define MDK_CONF_SRP 1 +#if MDK_CONF_SRP == 1 +#define HAVE_SRP +#endif +// + +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 1 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// + +// CURVE25519 +#define MDK_CONF_CURVE25519 1 +#if MDK_CONF_CURVE25519 == 1 +#define HAVE_CURVE25519 +#define CURVED25519_SMALL +#endif +// +// CURVE25519 SMALL +#define MDK_CONF_CURVE25519_SMALL 0 +#if MDK_CONF_CURVE25519_SMALL == 1 +#define CURVED25519_SMALL +#endif +// +// ED25519 +#define MDK_CONF_ED25519 1 +#if MDK_CONF_ED25519 == 1 +#define HAVE_ED25519 +#endif +// +// ED25519 SMALL +#define MDK_CONF_ED25519_SMALL 0 +#if MDK_CONF_ED25519_SMALL == 1 +#define ED25519_SMALL +#endif +// +// PKCS7 +#define MDK_CONF_PKCS7 0 +#if MDK_CONF_PKCS7 == 1 +#define HAVE_PKCS7 +#endif +// + +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Random Seed, for TEST Only +#define MDK_CONF_RNDSEED 1 +#if MDK_CONF_RNDSEED == 1 +#define WOLFSSL_GENSEED_FORTEST +#endif +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_RNG +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Hash +#define MDK_CONF_STM32F2_HASH 0 +#if MDK_CONF_STM32F2_HASH == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_HASH +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// + +// Cert/Key Strage +// Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) +#define MDK_CONF_CERT_BUFF 0 +#if MDK_CONF_CERT_BUFF== 1 +#define USE_CERT_BUFFERS_1024 +#elif MDK_CONF_CERT_BUFF == 2 +#define USE_CERT_BUFFERS_2048 +#endif +// +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// +// Use Fast Math +#define MDK_CONF_FASTMATH 1 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#define TFM_TIMING_RESISTANT +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_WOLFSSL_SMALL_STACK +#endif +// + +// + + +/**** wolfSSL Configuration ****/ + +// wolfSSL Configuration + +// TLS 1.3 +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 1 +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES +#define WC_RSA_PSS +#define HAVE_HKDF +#define HAVE_FFDHE_2048 +#endif +// + +// Include Old TLS +#define MDK_CONF_NO_OLDTLS 0 +#if MDK_CONF_NO_OLDTLS == 0 +#define NO_OLD_TLS +#endif +// +// CRL +#define MDK_CONF_CRL 0 +#if MDK_CONF_CRL == 1 +#define HAVE_CRL +#define WOLFSSL_DER_LOAD +#endif +// +// OCSP +#define MDK_CONF_OCSP 0 +#if MDK_CONF_OCSP == 1 +#define HAVE_OCSP +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 0 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// + +// + diff --git a/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt b/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt index f759f31b8..47ed1d9a3 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt @@ -1,6 +1,9 @@ wolfSSL example: echo Server Use Configuration Wizard tab + +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) +RTE_Device.h: Check ETH (Ethernet Interface) main.c for server port or TLS version user_settings.h for wolfCrypt or wolfSSL options diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/user_settings.h new file mode 100644 index 000000000..4c99c520b --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/user_settings.h @@ -0,0 +1,519 @@ +/* user_settings.h + * + * Copyright (C) 2006-2017 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED +#define NO_DEV_RANDOM +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV +#define NO_DEV_RANDOM + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +#define WOLFSSL_USER_CURRTIME /* for benchmark */ +#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ +#define WOLFSSL_GMTIME +#define NO_MULTIBYTE_PRINT + +// <<< Use Configuration Wizard in Context Menu >>> + + +// Common options +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx +#define MDK_CONF_MPU 3 +#if MDK_CONF_MPU == 0 + +#elif MDK_CONF_MPU == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32F2xx +#elif MDK_CONF_MPU == 2 +#define WOLFSSL_STM32_CUBEMX +#define STM32F4xx +#elif MDK_CONF_MPU == 3 +#define WOLFSSL_STM32_CUBEMX +#define STM32F7xx +#endif + +// Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows +// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX +// <7=>Micrium <8=>EBSnet<9=>MQX +// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 14 +#if MDK_CONF_THREAD== 0 +#define SINGLE_THREADED +#elif MDK_CONF_THREAD == 1 +#define FREERTOS +#elif MDK_CONF_THREAD == 3 +#define WOLFSSL_SAFERTOS +#elif MDK_CONF_THREAD == 4 +#define USE_WINDOWS_API +#elif MDK_CONF_THREAD == 5 +#define WOLFSSL_PTHREADS +#elif MDK_CONF_THREAD == 6 +#define THREADX +#define NETX +#elif MDK_CONF_THREAD == 7 +#define MICRIUM +#elif MDK_CONF_THREAD == 8 +#define EBSNET +#elif MDK_CONF_THREAD == 9 +#define FREESCALE_MQX +#define FREESCALE_KSDK_MQX +#elif MDK_CONF_THREAD == 10 +#define WOLFSSL_TIRTOS +#elif MDK_CONF_THREAD == 11 +#define WOLFSSL_uITRON4 +#elif MDK_CONF_THREAD == 12 +#define WOLFSSL_uTKERNEL2 +#elif MDK_CONF_THREAD == 13 +#define WOLFSSL_FROSTED +#elif MDK_CONF_THREAD == 14 +#define WOLFSSL_CMSIS_RTOS +#elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 +#define SINGLE_THREADED +#endif + + +// File System +#define MDK_CONF_FILESYSTEM 1 +#if MDK_CONF_FILESYSTEM == 0 +#define NO_FILESYSTEM +#else +#define WOLFSSL_KEIL_FS +#define NO_WOLFSSL_DIR +#endif +// + +// Network<0=>None <1=>RLnet <2=>User I/O +#define MDK_CONF_NETWORK 1 +#if MDK_CONF_NETWORK == 0 +#elif MDK_CONF_NETWORK == 1 +#define WOLFSSL_KEIL_TCP_NET +#elif MDK_CONF_NETWORK == 2 +#define WOLFSSL_USER_IO +#endif + +// Debug options + +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// +// ErrNo.h +#define MDK_CONF_ErrNo 1 +#if MDK_CONF_ErrNo == 1 +#define HAVE_ERRNO +#endif +// +// Error Strings +#define MDK_CONF_ErrorStrings 1 +#if MDK_CONF_ErrorStrings == 0 +#define NO_ERROR_STRINGS +#endif +// + +// +// + +// wolfCrypt Configuration + +// Hash/Crypt Algrithm + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define WOLFSSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 0 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// MD5 +#define MDK_CONF_MD5 1 +#if MDK_CONF_MD5 == 0 +#define NO_MD5 +#endif +// +// SHA +#define MDK_CONF_SHA 1 +#if MDK_CONF_SHA == 0 +#define NO_SHA +#endif +// +// SHA-256 +#define MDK_CONF_SHA256 1 +#if MDK_CONF_SHA256 == 0 +#define NO_SHA256 +#endif +// +// SHA-384 +#define MDK_CONF_SHA384 1 +#if MDK_CONF_SHA384 == 1 +#define WOLFSSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 1 +#if MDK_CONF_SHA512 == 1 +#define WOLFSSL_SHA512 +#endif +// +// Hash DRBG +#define MDK_CONF_HASHDRBG 1 +#if MDK_CONF_HASHDRBG == 1 +#define HAVE_HASHDRBG +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 1 +#if MDK_CONF_RIPEMD == 1 +#define WOLFSSL_RIPEMD +#endif +// +// BLAKE2 +#define MDK_CONF_BLAKE2 0 +#if MDK_CONF_BLAKE2 == 1 +#define HAVE_BLAKE2 +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HMAC KDF +#define MDK_CONF_HKDF 1 +#if MDK_CONF_HKDF == 1 +#define HAVE_HKDF +#endif +// + +// AES CCM +#define MDK_CONF_AESCCM 1 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AES GCM +#define MDK_CONF_AESGCM 1 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#endif +// + +// RC4 +#define MDK_CONF_RC4 0 +#if MDK_CONF_RC4 == 0 +#define NO_RC4 +#endif +// + +// HC128 +#define MDK_CONF_HC128 1 +#if MDK_CONF_AESGCM == 0 +#define NO_HC128 +#endif +// + +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBIT == 0 +#define NO_RABBIT +#endif +// + +// CHACHA +#define MDK_CONF_CHACHA 1 +#if MDK_CONF_CHACHA == 1 +#define HAVE_CHACHA +#endif +// + +// POLY1305 +#define MDK_CONF_POLY1305 1 +#if MDK_CONF_POLY1305 == 1 +#define HAVE_POLY1305 +#define HAVE_ONE_TIME_AUTH +#endif +// + +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// + +// AES +#define MDK_CONF_AES 1 +#if MDK_CONF_AES == 0 +#define NO_AES +#endif +// + +// CAMELLIA +#define MDK_CONF_CAMELLIA 1 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +#define MDK_CONF_DH 1 +#if MDK_CONF_DH == 0 +#define NO_DH +#endif +// +// DSA +#define MDK_CONF_DSA 1 +#if MDK_CONF_DSA == 0 +#define NO_DSA +#endif +// + +// SRP +#define MDK_CONF_SRP 1 +#if MDK_CONF_SRP == 1 +#define HAVE_SRP +#endif +// + +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 1 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// + +// CURVE25519 +#define MDK_CONF_CURVE25519 1 +#if MDK_CONF_CURVE25519 == 1 +#define HAVE_CURVE25519 +#define CURVED25519_SMALL +#endif +// +// CURVE25519 SMALL +#define MDK_CONF_CURVE25519_SMALL 0 +#if MDK_CONF_CURVE25519_SMALL == 1 +#define CURVED25519_SMALL +#endif +// +// ED25519 +#define MDK_CONF_ED25519 1 +#if MDK_CONF_ED25519 == 1 +#define HAVE_ED25519 +#endif +// +// ED25519 SMALL +#define MDK_CONF_ED25519_SMALL 0 +#if MDK_CONF_ED25519_SMALL == 1 +#define ED25519_SMALL +#endif +// +// PKCS7 +#define MDK_CONF_PKCS7 0 +#if MDK_CONF_PKCS7 == 1 +#define HAVE_PKCS7 +#endif +// + +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Random Seed, for TEST Only +#define MDK_CONF_RNDSEED 1 +#if MDK_CONF_RNDSEED == 1 +#define WOLFSSL_GENSEED_FORTEST +#endif +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_RNG +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Hash +#define MDK_CONF_STM32F2_HASH 0 +#if MDK_CONF_STM32F2_HASH == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_HASH +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// + +// Cert/Key Strage +// Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) +#define MDK_CONF_CERT_BUFF 0 +#if MDK_CONF_CERT_BUFF== 1 +#define USE_CERT_BUFFERS_1024 +#elif MDK_CONF_CERT_BUFF == 2 +#define USE_CERT_BUFFERS_2048 +#endif +// +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// +// Use Fast Math +#define MDK_CONF_FASTMATH 1 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#define TFM_TIMING_RESISTANT +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_WOLFSSL_SMALL_STACK +#endif +// + +// + + +/**** wolfSSL Configuration ****/ + +// wolfSSL Configuration + +// TLS 1.3 +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 1 +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES +#define WC_RSA_PSS +#define HAVE_HKDF +#define HAVE_FFDHE_2048 +#endif +// + +// Include Old TLS +#define MDK_CONF_NO_OLDTLS 0 +#if MDK_CONF_NO_OLDTLS == 0 +#define NO_OLD_TLS +#endif +// +// CRL +#define MDK_CONF_CRL 0 +#if MDK_CONF_CRL == 1 +#define HAVE_CRL +#define WOLFSSL_DER_LOAD +#endif +// +// OCSP +#define MDK_CONF_OCSP 0 +#if MDK_CONF_OCSP == 1 +#define HAVE_OCSP +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 0 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// + +// + diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt index 878057e9b..7392dbf53 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt @@ -1,6 +1,9 @@ wolfSSL example: TLS Client Use Configuration Wizard tab + +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) +RTE_Device.h: Check ETH (Ethernet Interface) main.c for remote IP address, port or TLS version user_settings.h for wolfCrypt or wolfSSL options diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/user_settings.h new file mode 100644 index 000000000..943a46a07 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/user_settings.h @@ -0,0 +1,519 @@ +/* user_settings.h + * + * Copyright (C) 2006-2017 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED +#define NO_DEV_RANDOM +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV +#define NO_DEV_RANDOM + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +#define WOLFSSL_USER_CURRTIME /* for benchmark */ +#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ +#define WOLFSSL_GMTIME +#define NO_MULTIBYTE_PRINT + +// <<< Use Configuration Wizard in Context Menu >>> + + +// Common options +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx +#define MDK_CONF_MPU 3 +#if MDK_CONF_MPU == 0 + +#elif MDK_CONF_MPU == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32F2xx +#elif MDK_CONF_MPU == 2 +#define WOLFSSL_STM32_CUBEMX +#define STM32F4xx +#elif MDK_CONF_MPU == 3 +#define WOLFSSL_STM32_CUBEMX +#define STM32F7xx +#endif + +// Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows +// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX +// <7=>Micrium <8=>EBSnet<9=>MQX +// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 15 +#if MDK_CONF_THREAD== 0 +#define SINGLE_THREADED +#elif MDK_CONF_THREAD == 1 +#define FREERTOS +#elif MDK_CONF_THREAD == 3 +#define WOLFSSL_SAFERTOS +#elif MDK_CONF_THREAD == 4 +#define USE_WINDOWS_API +#elif MDK_CONF_THREAD == 5 +#define WOLFSSL_PTHREADS +#elif MDK_CONF_THREAD == 6 +#define THREADX +#define NETX +#elif MDK_CONF_THREAD == 7 +#define MICRIUM +#elif MDK_CONF_THREAD == 8 +#define EBSNET +#elif MDK_CONF_THREAD == 9 +#define FREESCALE_MQX +#define FREESCALE_KSDK_MQX +#elif MDK_CONF_THREAD == 10 +#define WOLFSSL_TIRTOS +#elif MDK_CONF_THREAD == 11 +#define WOLFSSL_uITRON4 +#elif MDK_CONF_THREAD == 12 +#define WOLFSSL_uTKERNEL2 +#elif MDK_CONF_THREAD == 13 +#define WOLFSSL_FROSTED +#elif MDK_CONF_THREAD == 14 +#define WOLFSSL_CMSIS_RTOS +#elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 +#define SINGLE_THREADED +#endif + + +// File System +#define MDK_CONF_FILESYSTEM 1 +#if MDK_CONF_FILESYSTEM == 0 +#define NO_FILESYSTEM +#else +#define WOLFSSL_KEIL_FS +#define NO_WOLFSSL_DIR +#endif +// + +// Network<0=>None <1=>RLnet <2=>User I/O +#define MDK_CONF_NETWORK 1 +#if MDK_CONF_NETWORK == 0 +#elif MDK_CONF_NETWORK == 1 +#define WOLFSSL_KEIL_TCP_NET +#elif MDK_CONF_NETWORK == 2 +#define WOLFSSL_USER_IO +#endif + +// Debug options + +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// +// ErrNo.h +#define MDK_CONF_ErrNo 1 +#if MDK_CONF_ErrNo == 1 +#define HAVE_ERRNO +#endif +// +// Error Strings +#define MDK_CONF_ErrorStrings 1 +#if MDK_CONF_ErrorStrings == 0 +#define NO_ERROR_STRINGS +#endif +// + +// +// + +// wolfCrypt Configuration + +// Hash/Crypt Algrithm + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define WOLFSSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 0 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// MD5 +#define MDK_CONF_MD5 1 +#if MDK_CONF_MD5 == 0 +#define NO_MD5 +#endif +// +// SHA +#define MDK_CONF_SHA 1 +#if MDK_CONF_SHA == 0 +#define NO_SHA +#endif +// +// SHA-256 +#define MDK_CONF_SHA256 1 +#if MDK_CONF_SHA256 == 0 +#define NO_SHA256 +#endif +// +// SHA-384 +#define MDK_CONF_SHA384 1 +#if MDK_CONF_SHA384 == 1 +#define WOLFSSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 1 +#if MDK_CONF_SHA512 == 1 +#define WOLFSSL_SHA512 +#endif +// +// Hash DRBG +#define MDK_CONF_HASHDRBG 1 +#if MDK_CONF_HASHDRBG == 1 +#define HAVE_HASHDRBG +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 1 +#if MDK_CONF_RIPEMD == 1 +#define WOLFSSL_RIPEMD +#endif +// +// BLAKE2 +#define MDK_CONF_BLAKE2 0 +#if MDK_CONF_BLAKE2 == 1 +#define HAVE_BLAKE2 +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HMAC KDF +#define MDK_CONF_HKDF 1 +#if MDK_CONF_HKDF == 1 +#define HAVE_HKDF +#endif +// + +// AES CCM +#define MDK_CONF_AESCCM 1 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AES GCM +#define MDK_CONF_AESGCM 1 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#endif +// + +// RC4 +#define MDK_CONF_RC4 0 +#if MDK_CONF_RC4 == 0 +#define NO_RC4 +#endif +// + +// HC128 +#define MDK_CONF_HC128 1 +#if MDK_CONF_AESGCM == 0 +#define NO_HC128 +#endif +// + +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBIT == 0 +#define NO_RABBIT +#endif +// + +// CHACHA +#define MDK_CONF_CHACHA 1 +#if MDK_CONF_CHACHA == 1 +#define HAVE_CHACHA +#endif +// + +// POLY1305 +#define MDK_CONF_POLY1305 1 +#if MDK_CONF_POLY1305 == 1 +#define HAVE_POLY1305 +#define HAVE_ONE_TIME_AUTH +#endif +// + +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// + +// AES +#define MDK_CONF_AES 1 +#if MDK_CONF_AES == 0 +#define NO_AES +#endif +// + +// CAMELLIA +#define MDK_CONF_CAMELLIA 1 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +#define MDK_CONF_DH 1 +#if MDK_CONF_DH == 0 +#define NO_DH +#endif +// +// DSA +#define MDK_CONF_DSA 1 +#if MDK_CONF_DSA == 0 +#define NO_DSA +#endif +// + +// SRP +#define MDK_CONF_SRP 1 +#if MDK_CONF_SRP == 1 +#define HAVE_SRP +#endif +// + +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 1 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// + +// CURVE25519 +#define MDK_CONF_CURVE25519 1 +#if MDK_CONF_CURVE25519 == 1 +#define HAVE_CURVE25519 +#define CURVED25519_SMALL +#endif +// +// CURVE25519 SMALL +#define MDK_CONF_CURVE25519_SMALL 0 +#if MDK_CONF_CURVE25519_SMALL == 1 +#define CURVED25519_SMALL +#endif +// +// ED25519 +#define MDK_CONF_ED25519 1 +#if MDK_CONF_ED25519 == 1 +#define HAVE_ED25519 +#endif +// +// ED25519 SMALL +#define MDK_CONF_ED25519_SMALL 0 +#if MDK_CONF_ED25519_SMALL == 1 +#define ED25519_SMALL +#endif +// +// PKCS7 +#define MDK_CONF_PKCS7 0 +#if MDK_CONF_PKCS7 == 1 +#define HAVE_PKCS7 +#endif +// + +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Random Seed, for TEST Only +#define MDK_CONF_RNDSEED 1 +#if MDK_CONF_RNDSEED == 1 +#define WOLFSSL_GENSEED_FORTEST +#endif +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_RNG +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Hash +#define MDK_CONF_STM32F2_HASH 0 +#if MDK_CONF_STM32F2_HASH == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_HASH +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// + +// Cert/Key Strage +// Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) +#define MDK_CONF_CERT_BUFF 0 +#if MDK_CONF_CERT_BUFF== 1 +#define USE_CERT_BUFFERS_1024 +#elif MDK_CONF_CERT_BUFF == 2 +#define USE_CERT_BUFFERS_2048 +#endif +// +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// +// Use Fast Math +#define MDK_CONF_FASTMATH 1 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#define TFM_TIMING_RESISTANT +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_WOLFSSL_SMALL_STACK +#endif +// + +// + + +/**** wolfSSL Configuration ****/ + +// wolfSSL Configuration + +// TLS 1.3 +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 1 +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES +#define WC_RSA_PSS +#define HAVE_HKDF +#define HAVE_FFDHE_2048 +#endif +// + +// Include Old TLS +#define MDK_CONF_NO_OLDTLS 0 +#if MDK_CONF_NO_OLDTLS == 0 +#define NO_OLD_TLS +#endif +// +// CRL +#define MDK_CONF_CRL 0 +#if MDK_CONF_CRL == 1 +#define HAVE_CRL +#define WOLFSSL_DER_LOAD +#endif +// +// OCSP +#define MDK_CONF_OCSP 0 +#if MDK_CONF_OCSP == 1 +#define HAVE_OCSP +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 0 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// + +// + diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt b/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt index 8a152aff0..d27563a87 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt @@ -1,6 +1,9 @@ wolfSSL example: TLS Server Use Configuration Wizard tab + +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) +RTE_Device.h: Check ETH (Ethernet Interface) main.c for server port or TLS version user_settings.h for wolfCrypt or wolfSSL options diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/user_settings.h new file mode 100644 index 000000000..943a46a07 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/user_settings.h @@ -0,0 +1,519 @@ +/* user_settings.h + * + * Copyright (C) 2006-2017 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED +#define NO_DEV_RANDOM +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV +#define NO_DEV_RANDOM + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +#define WOLFSSL_USER_CURRTIME /* for benchmark */ +#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ +#define WOLFSSL_GMTIME +#define NO_MULTIBYTE_PRINT + +// <<< Use Configuration Wizard in Context Menu >>> + + +// Common options +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx +#define MDK_CONF_MPU 3 +#if MDK_CONF_MPU == 0 + +#elif MDK_CONF_MPU == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32F2xx +#elif MDK_CONF_MPU == 2 +#define WOLFSSL_STM32_CUBEMX +#define STM32F4xx +#elif MDK_CONF_MPU == 3 +#define WOLFSSL_STM32_CUBEMX +#define STM32F7xx +#endif + +// Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows +// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX +// <7=>Micrium <8=>EBSnet<9=>MQX +// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 15 +#if MDK_CONF_THREAD== 0 +#define SINGLE_THREADED +#elif MDK_CONF_THREAD == 1 +#define FREERTOS +#elif MDK_CONF_THREAD == 3 +#define WOLFSSL_SAFERTOS +#elif MDK_CONF_THREAD == 4 +#define USE_WINDOWS_API +#elif MDK_CONF_THREAD == 5 +#define WOLFSSL_PTHREADS +#elif MDK_CONF_THREAD == 6 +#define THREADX +#define NETX +#elif MDK_CONF_THREAD == 7 +#define MICRIUM +#elif MDK_CONF_THREAD == 8 +#define EBSNET +#elif MDK_CONF_THREAD == 9 +#define FREESCALE_MQX +#define FREESCALE_KSDK_MQX +#elif MDK_CONF_THREAD == 10 +#define WOLFSSL_TIRTOS +#elif MDK_CONF_THREAD == 11 +#define WOLFSSL_uITRON4 +#elif MDK_CONF_THREAD == 12 +#define WOLFSSL_uTKERNEL2 +#elif MDK_CONF_THREAD == 13 +#define WOLFSSL_FROSTED +#elif MDK_CONF_THREAD == 14 +#define WOLFSSL_CMSIS_RTOS +#elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 +#define SINGLE_THREADED +#endif + + +// File System +#define MDK_CONF_FILESYSTEM 1 +#if MDK_CONF_FILESYSTEM == 0 +#define NO_FILESYSTEM +#else +#define WOLFSSL_KEIL_FS +#define NO_WOLFSSL_DIR +#endif +// + +// Network<0=>None <1=>RLnet <2=>User I/O +#define MDK_CONF_NETWORK 1 +#if MDK_CONF_NETWORK == 0 +#elif MDK_CONF_NETWORK == 1 +#define WOLFSSL_KEIL_TCP_NET +#elif MDK_CONF_NETWORK == 2 +#define WOLFSSL_USER_IO +#endif + +// Debug options + +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// +// ErrNo.h +#define MDK_CONF_ErrNo 1 +#if MDK_CONF_ErrNo == 1 +#define HAVE_ERRNO +#endif +// +// Error Strings +#define MDK_CONF_ErrorStrings 1 +#if MDK_CONF_ErrorStrings == 0 +#define NO_ERROR_STRINGS +#endif +// + +// +// + +// wolfCrypt Configuration + +// Hash/Crypt Algrithm + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define WOLFSSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 0 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// MD5 +#define MDK_CONF_MD5 1 +#if MDK_CONF_MD5 == 0 +#define NO_MD5 +#endif +// +// SHA +#define MDK_CONF_SHA 1 +#if MDK_CONF_SHA == 0 +#define NO_SHA +#endif +// +// SHA-256 +#define MDK_CONF_SHA256 1 +#if MDK_CONF_SHA256 == 0 +#define NO_SHA256 +#endif +// +// SHA-384 +#define MDK_CONF_SHA384 1 +#if MDK_CONF_SHA384 == 1 +#define WOLFSSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 1 +#if MDK_CONF_SHA512 == 1 +#define WOLFSSL_SHA512 +#endif +// +// Hash DRBG +#define MDK_CONF_HASHDRBG 1 +#if MDK_CONF_HASHDRBG == 1 +#define HAVE_HASHDRBG +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 1 +#if MDK_CONF_RIPEMD == 1 +#define WOLFSSL_RIPEMD +#endif +// +// BLAKE2 +#define MDK_CONF_BLAKE2 0 +#if MDK_CONF_BLAKE2 == 1 +#define HAVE_BLAKE2 +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HMAC KDF +#define MDK_CONF_HKDF 1 +#if MDK_CONF_HKDF == 1 +#define HAVE_HKDF +#endif +// + +// AES CCM +#define MDK_CONF_AESCCM 1 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AES GCM +#define MDK_CONF_AESGCM 1 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#endif +// + +// RC4 +#define MDK_CONF_RC4 0 +#if MDK_CONF_RC4 == 0 +#define NO_RC4 +#endif +// + +// HC128 +#define MDK_CONF_HC128 1 +#if MDK_CONF_AESGCM == 0 +#define NO_HC128 +#endif +// + +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBIT == 0 +#define NO_RABBIT +#endif +// + +// CHACHA +#define MDK_CONF_CHACHA 1 +#if MDK_CONF_CHACHA == 1 +#define HAVE_CHACHA +#endif +// + +// POLY1305 +#define MDK_CONF_POLY1305 1 +#if MDK_CONF_POLY1305 == 1 +#define HAVE_POLY1305 +#define HAVE_ONE_TIME_AUTH +#endif +// + +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// + +// AES +#define MDK_CONF_AES 1 +#if MDK_CONF_AES == 0 +#define NO_AES +#endif +// + +// CAMELLIA +#define MDK_CONF_CAMELLIA 1 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +#define MDK_CONF_DH 1 +#if MDK_CONF_DH == 0 +#define NO_DH +#endif +// +// DSA +#define MDK_CONF_DSA 1 +#if MDK_CONF_DSA == 0 +#define NO_DSA +#endif +// + +// SRP +#define MDK_CONF_SRP 1 +#if MDK_CONF_SRP == 1 +#define HAVE_SRP +#endif +// + +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 1 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// + +// CURVE25519 +#define MDK_CONF_CURVE25519 1 +#if MDK_CONF_CURVE25519 == 1 +#define HAVE_CURVE25519 +#define CURVED25519_SMALL +#endif +// +// CURVE25519 SMALL +#define MDK_CONF_CURVE25519_SMALL 0 +#if MDK_CONF_CURVE25519_SMALL == 1 +#define CURVED25519_SMALL +#endif +// +// ED25519 +#define MDK_CONF_ED25519 1 +#if MDK_CONF_ED25519 == 1 +#define HAVE_ED25519 +#endif +// +// ED25519 SMALL +#define MDK_CONF_ED25519_SMALL 0 +#if MDK_CONF_ED25519_SMALL == 1 +#define ED25519_SMALL +#endif +// +// PKCS7 +#define MDK_CONF_PKCS7 0 +#if MDK_CONF_PKCS7 == 1 +#define HAVE_PKCS7 +#endif +// + +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Random Seed, for TEST Only +#define MDK_CONF_RNDSEED 1 +#if MDK_CONF_RNDSEED == 1 +#define WOLFSSL_GENSEED_FORTEST +#endif +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_RNG +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Hash +#define MDK_CONF_STM32F2_HASH 0 +#if MDK_CONF_STM32F2_HASH == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_HASH +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// + +// Cert/Key Strage +// Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) +#define MDK_CONF_CERT_BUFF 0 +#if MDK_CONF_CERT_BUFF== 1 +#define USE_CERT_BUFFERS_1024 +#elif MDK_CONF_CERT_BUFF == 2 +#define USE_CERT_BUFFERS_2048 +#endif +// +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// +// Use Fast Math +#define MDK_CONF_FASTMATH 1 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#define TFM_TIMING_RESISTANT +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_WOLFSSL_SMALL_STACK +#endif +// + +// + + +/**** wolfSSL Configuration ****/ + +// wolfSSL Configuration + +// TLS 1.3 +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 1 +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES +#define WC_RSA_PSS +#define HAVE_HKDF +#define HAVE_FFDHE_2048 +#endif +// + +// Include Old TLS +#define MDK_CONF_NO_OLDTLS 0 +#if MDK_CONF_NO_OLDTLS == 0 +#define NO_OLD_TLS +#endif +// +// CRL +#define MDK_CONF_CRL 0 +#if MDK_CONF_CRL == 1 +#define HAVE_CRL +#define WOLFSSL_DER_LOAD +#endif +// +// OCSP +#define MDK_CONF_OCSP 0 +#if MDK_CONF_OCSP == 1 +#define HAVE_OCSP +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 0 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// + +// + diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Lib/Abstract.txt b/IDE/MDK5-ARM/Projects/wolfSSL-Lib/Abstract.txt new file mode 100644 index 000000000..6a6c9c3c6 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Lib/Abstract.txt @@ -0,0 +1,14 @@ +wolfSSL example: TLS Library + +Use Configuration Wizard tab + +RTE_Device.h: Check SDMMC1 (SD/SDIO/MMC card host interface 1) +RTE_Device.h: Check ETH (Ethernet Interface) +user_settings.h for wolfCrypt or wolfSSL options + +For further options, details, see wolfSSL User Manual. + + +Support +------- +Please send questions or comments to support@wolfssl.com diff --git a/IDE/MDK5-ARM/Projects/wolfSSL-Lib/RTE/wolfSSL/user_settings.h b/IDE/MDK5-ARM/Projects/wolfSSL-Lib/RTE/wolfSSL/user_settings.h new file mode 100644 index 000000000..943a46a07 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/wolfSSL-Lib/RTE/wolfSSL/user_settings.h @@ -0,0 +1,519 @@ +/* user_settings.h + * + * Copyright (C) 2006-2017 wolfSSL Inc. + * + * This file is part of wolfSSL. + * + * wolfSSL is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * wolfSSL is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA + */ + +#define NO_MAIN_DRIVER +#define BENCH_EMBEDDED +#define NO_DEV_RANDOM +#define WOLFSSL_USER_CURRTIME +#define SIZEOF_LONG_LONG 8 +#define NO_WRITEV +#define NO_DEV_RANDOM + +#define TFM_TIMING_RESISTANT +#define ECC_TIMING_RESISTANT +#define WC_RSA_BLINDING + +#define WOLFSSL_USER_CURRTIME /* for benchmark */ +#define WOLFSSL_CURRTIME_OSTICK /* use OS tich for current_time */ +#define WOLFSSL_GMTIME +#define NO_MULTIBYTE_PRINT + +// <<< Use Configuration Wizard in Context Menu >>> + + +// Common options +// MPU<0=>Undefined<1=>STM32F2xx<2=>STM32F4xx<3=>STM32F7xx +#define MDK_CONF_MPU 3 +#if MDK_CONF_MPU == 0 + +#elif MDK_CONF_MPU == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32F2xx +#elif MDK_CONF_MPU == 2 +#define WOLFSSL_STM32_CUBEMX +#define STM32F4xx +#elif MDK_CONF_MPU == 3 +#define WOLFSSL_STM32_CUBEMX +#define STM32F7xx +#endif + +// Thread/RTOS<0=>Single Threaded <1=>FreeRTOS <2=>SafeRTOS<3=>Windows +// <4=>PThread <5=>ThreadX<6=> ThreadX/NetX +// <7=>Micrium <8=>EBSnet<9=>MQX +// <10=>T-RTOS <11=>uITRON4<12=>uTKERNEL2 +// <13=>Frosted <14=>CMSIS RTOS<15=>CMSIS RTOSv2<16=>Others +#define MDK_CONF_THREAD 15 +#if MDK_CONF_THREAD== 0 +#define SINGLE_THREADED +#elif MDK_CONF_THREAD == 1 +#define FREERTOS +#elif MDK_CONF_THREAD == 3 +#define WOLFSSL_SAFERTOS +#elif MDK_CONF_THREAD == 4 +#define USE_WINDOWS_API +#elif MDK_CONF_THREAD == 5 +#define WOLFSSL_PTHREADS +#elif MDK_CONF_THREAD == 6 +#define THREADX +#define NETX +#elif MDK_CONF_THREAD == 7 +#define MICRIUM +#elif MDK_CONF_THREAD == 8 +#define EBSNET +#elif MDK_CONF_THREAD == 9 +#define FREESCALE_MQX +#define FREESCALE_KSDK_MQX +#elif MDK_CONF_THREAD == 10 +#define WOLFSSL_TIRTOS +#elif MDK_CONF_THREAD == 11 +#define WOLFSSL_uITRON4 +#elif MDK_CONF_THREAD == 12 +#define WOLFSSL_uTKERNEL2 +#elif MDK_CONF_THREAD == 13 +#define WOLFSSL_FROSTED +#elif MDK_CONF_THREAD == 14 +#define WOLFSSL_CMSIS_RTOS +#elif MDK_CONF_THREAD == 15 +#define WOLFSSL_CMSIS_RTOSv2 +#elif MDK_CONF_THREAD == 16 +#define SINGLE_THREADED +#endif + + +// File System +#define MDK_CONF_FILESYSTEM 1 +#if MDK_CONF_FILESYSTEM == 0 +#define NO_FILESYSTEM +#else +#define WOLFSSL_KEIL_FS +#define NO_WOLFSSL_DIR +#endif +// + +// Network<0=>None <1=>RLnet <2=>User I/O +#define MDK_CONF_NETWORK 1 +#if MDK_CONF_NETWORK == 0 +#elif MDK_CONF_NETWORK == 1 +#define WOLFSSL_KEIL_TCP_NET +#elif MDK_CONF_NETWORK == 2 +#define WOLFSSL_USER_IO +#endif + +// Debug options + +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_WOLFSSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define WOLFSSL_MALLOC_CHECK +#define USE_WOLFSSL_MEMORY +#endif +// +// ErrNo.h +#define MDK_CONF_ErrNo 1 +#if MDK_CONF_ErrNo == 1 +#define HAVE_ERRNO +#endif +// +// Error Strings +#define MDK_CONF_ErrorStrings 1 +#if MDK_CONF_ErrorStrings == 0 +#define NO_ERROR_STRINGS +#endif +// + +// +// + +// wolfCrypt Configuration + +// Hash/Crypt Algrithm + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define WOLFSSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 0 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// MD5 +#define MDK_CONF_MD5 1 +#if MDK_CONF_MD5 == 0 +#define NO_MD5 +#endif +// +// SHA +#define MDK_CONF_SHA 1 +#if MDK_CONF_SHA == 0 +#define NO_SHA +#endif +// +// SHA-256 +#define MDK_CONF_SHA256 1 +#if MDK_CONF_SHA256 == 0 +#define NO_SHA256 +#endif +// +// SHA-384 +#define MDK_CONF_SHA384 1 +#if MDK_CONF_SHA384 == 1 +#define WOLFSSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 1 +#if MDK_CONF_SHA512 == 1 +#define WOLFSSL_SHA512 +#endif +// +// Hash DRBG +#define MDK_CONF_HASHDRBG 1 +#if MDK_CONF_HASHDRBG == 1 +#define HAVE_HASHDRBG +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 1 +#if MDK_CONF_RIPEMD == 1 +#define WOLFSSL_RIPEMD +#endif +// +// BLAKE2 +#define MDK_CONF_BLAKE2 0 +#if MDK_CONF_BLAKE2 == 1 +#define HAVE_BLAKE2 +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HMAC KDF +#define MDK_CONF_HKDF 1 +#if MDK_CONF_HKDF == 1 +#define HAVE_HKDF +#endif +// + +// AES CCM +#define MDK_CONF_AESCCM 1 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AES GCM +#define MDK_CONF_AESGCM 1 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#endif +// + +// RC4 +#define MDK_CONF_RC4 0 +#if MDK_CONF_RC4 == 0 +#define NO_RC4 +#endif +// + +// HC128 +#define MDK_CONF_HC128 1 +#if MDK_CONF_AESGCM == 0 +#define NO_HC128 +#endif +// + +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBIT == 0 +#define NO_RABBIT +#endif +// + +// CHACHA +#define MDK_CONF_CHACHA 1 +#if MDK_CONF_CHACHA == 1 +#define HAVE_CHACHA +#endif +// + +// POLY1305 +#define MDK_CONF_POLY1305 1 +#if MDK_CONF_POLY1305 == 1 +#define HAVE_POLY1305 +#define HAVE_ONE_TIME_AUTH +#endif +// + +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// + +// AES +#define MDK_CONF_AES 1 +#if MDK_CONF_AES == 0 +#define NO_AES +#endif +// + +// CAMELLIA +#define MDK_CONF_CAMELLIA 1 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +#define MDK_CONF_DH 1 +#if MDK_CONF_DH == 0 +#define NO_DH +#endif +// +// DSA +#define MDK_CONF_DSA 1 +#if MDK_CONF_DSA == 0 +#define NO_DSA +#endif +// + +// SRP +#define MDK_CONF_SRP 1 +#if MDK_CONF_SRP == 1 +#define HAVE_SRP +#endif +// + +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 1 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// + +// CURVE25519 +#define MDK_CONF_CURVE25519 1 +#if MDK_CONF_CURVE25519 == 1 +#define HAVE_CURVE25519 +#define CURVED25519_SMALL +#endif +// +// CURVE25519 SMALL +#define MDK_CONF_CURVE25519_SMALL 0 +#if MDK_CONF_CURVE25519_SMALL == 1 +#define CURVED25519_SMALL +#endif +// +// ED25519 +#define MDK_CONF_ED25519 1 +#if MDK_CONF_ED25519 == 1 +#define HAVE_ED25519 +#endif +// +// ED25519 SMALL +#define MDK_CONF_ED25519_SMALL 0 +#if MDK_CONF_ED25519_SMALL == 1 +#define ED25519_SMALL +#endif +// +// PKCS7 +#define MDK_CONF_PKCS7 0 +#if MDK_CONF_PKCS7 == 1 +#define HAVE_PKCS7 +#endif +// + +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Random Seed, for TEST Only +#define MDK_CONF_RNDSEED 1 +#if MDK_CONF_RNDSEED == 1 +#define WOLFSSL_GENSEED_FORTEST +#endif +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_RNG +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_CRYPTO +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// Hardware Hash +#define MDK_CONF_STM32F2_HASH 0 +#if MDK_CONF_STM32F2_HASH == 1 +#define WOLFSSL_STM32_CUBEMX +#define STM32_HASH +#define WC_ASYNC_DEV_SIZE 320+24 +#define STM32_HAL_TIMEOUT 0xFF + +#if defined(STM32F2xx) +#define WOLFSSL_STM32F2 +#elif defined(STM32F4xx) +#define WOLFSSL_STM32F4 +#elif defined(STM32F7xx) +#define WOLFSSL_STM32F7 +#endif + +#endif +// +// + +// Cert/Key Strage +// Cert Storage <0=> SD Card <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes) +#define MDK_CONF_CERT_BUFF 0 +#if MDK_CONF_CERT_BUFF== 1 +#define USE_CERT_BUFFERS_1024 +#elif MDK_CONF_CERT_BUFF == 2 +#define USE_CERT_BUFFERS_2048 +#endif +// +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define WOLFSSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define WOLFSSL_KEY_GEN +#endif +// +// +// Use Fast Math +#define MDK_CONF_FASTMATH 1 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#define TFM_TIMING_RESISTANT +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_WOLFSSL_SMALL_STACK +#endif +// + +// + + +/**** wolfSSL Configuration ****/ + +// wolfSSL Configuration + +// TLS 1.3 +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 1 +#define WOLFSSL_TLS13 +#define HAVE_TLS_EXTENSIONS +#define HAVE_SUPPORTED_CURVES +#define WC_RSA_PSS +#define HAVE_HKDF +#define HAVE_FFDHE_2048 +#endif +// + +// Include Old TLS +#define MDK_CONF_NO_OLDTLS 0 +#if MDK_CONF_NO_OLDTLS == 0 +#define NO_OLD_TLS +#endif +// +// CRL +#define MDK_CONF_CRL 0 +#if MDK_CONF_CRL == 1 +#define HAVE_CRL +#define WOLFSSL_DER_LOAD +#endif +// +// OCSP +#define MDK_CONF_OCSP 0 +#if MDK_CONF_OCSP == 1 +#define HAVE_OCSP +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 0 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// + +// +