diff --git a/IDE/MDK5-ARM/Conf/config-Crypt.h b/IDE/MDK5-ARM/Conf/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Conf/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Conf/config-CyaSSL.h b/IDE/MDK5-ARM/Conf/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Conf/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/MDK-ARM/CyaSSL/cert_data.h b/IDE/MDK5-ARM/Inc/cert_data.h similarity index 100% rename from IDE/MDK5-ARM/MDK-ARM/CyaSSL/cert_data.h rename to IDE/MDK5-ARM/Inc/cert_data.h diff --git a/IDE/MDK5-ARM/Inc/config.h b/IDE/MDK5-ARM/Inc/config.h new file mode 100644 index 000000000..8cf08b1b4 --- /dev/null +++ b/IDE/MDK5-ARM/Inc/config.h @@ -0,0 +1,62 @@ +/* config.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define CYASSL_MDK5 +#define CYASSL_CMSIS_RTOS + +#define NO_WRITEV +#define NO_CYASSL_DIR +#define BENCH_EMBEDDED + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER +#define NO_MAIN_DRIVER + +#if defined(MDK_CONF_CYASSL) +#define CYASSL_MDK_SHELL +#include "config-Crypt.h" +#include "config-CyaSSL.h" +#elif defined(MDK_CONF_SimpleClient) +#include "config-Crypt.h" +#include "config-CyaSSL.h" +#elif defined(MDK_CONF_SimpleServer) +#include "config-Crypt.h" +#include "config-CyaSSL.h" +#elif defined(MDK_CONF_EchoClient) +#include "config-Crypt.h" +#include "config-CyaSSL.h" +#elif defined(MDK_CONF_EchoServer) +#include "config-Crypt.h" +#include "config-CyaSSL.h" +#elif defined(MDK_CONF_Benchmark) +#define SINGLE_THREADED +#define NO_INLINE +#include "config-Crypt.h" +#elif defined(MDK_CONF_CryptTest) +#define SINGLE_THREADED +#define NO_INLINE +#include "config-Crypt.h" + +#endif + + diff --git a/IDE/MDK5-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h b/IDE/MDK5-ARM/Inc/cyassl_MDK_ARM.h similarity index 100% rename from IDE/MDK5-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.h rename to IDE/MDK5-ARM/Inc/cyassl_MDK_ARM.h diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt b/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt index e19c56403..b929f9bc9 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/Abstract.txt @@ -1,7 +1,7 @@ This program is a simple benchmark of wolfCrypt library. In order to run this benchmark, copy -{PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +{PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. For benchmark configuration, refer config-Crypt.h. diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvoptx b/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvoptx index 888271586..68784e45e 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvoptx +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -169,7 +171,7 @@ 0 1 0 - 1 + 0 0 0 1 @@ -223,7 +225,7 @@ 1 0 0 - 32 + 0 0 0 0 @@ -257,6 +259,22 @@ 0 0 + + 2 + 4 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\RTE\wolfSSL\settings.h + settings.h + 0 + 0 + @@ -267,14 +285,14 @@ 0 3 - 4 + 5 5 0 0 0 0 - 1 - 1 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -284,15 +302,15 @@ - ::CMSIS - 0 + Devices + 1 0 0 - 1 + 0 4 - 5 - 4 + 6 + 1 0 0 0 @@ -300,14 +318,38 @@ 0 0 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 + .\time-STM32F2xx.c + time-STM32F2xx.c + 0 0 4 - 6 + 7 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\time-dummy.c + time-dummy.c + 0 + 0 + + + + + ::CMSIS + 1 + 0 + 0 + 1 + + 5 + 8 1 0 0 @@ -321,17 +363,33 @@ 1 0 + + 5 + 9 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + ::Device - 0 + 1 0 0 1 - 5 - 7 + 6 + 10 1 0 0 @@ -346,8 +404,8 @@ 0 - 5 - 8 + 6 + 11 1 0 0 @@ -362,8 +420,8 @@ 0 - 5 - 9 + 6 + 12 5 0 0 @@ -378,8 +436,8 @@ 0 - 5 - 10 + 6 + 13 2 0 0 @@ -394,8 +452,8 @@ 0 - 5 - 11 + 6 + 14 1 0 0 @@ -413,13 +471,13 @@ ::Drivers - 0 + 1 0 0 1 - 6 - 12 + 7 + 15 1 0 0 @@ -437,29 +495,13 @@ ::File System - 0 + 1 0 0 1 - 7 - 13 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - - - 7 - 14 + 8 + 16 1 0 0 @@ -474,8 +516,8 @@ 0 - 7 - 15 + 8 + 17 5 0 0 @@ -489,17 +531,33 @@ 1 0 + + 8 + 18 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib + 1 + 0 + ::wolfSSL - 0 + 1 0 0 1 - 8 - 16 + 9 + 19 5 0 0 @@ -514,57 +572,9 @@ 0 - 8 - 17 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 8 - 18 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\ssl-dummy.c - ssl-dummy.c - 1 - 0 - - - 8 - 19 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 8 + 9 20 - 1 + 5 0 0 0 @@ -572,13 +582,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\aes.c - aes.c + RTE\wolfSSL\settings.h + settings.h 1 0 - 8 + 9 21 1 0 @@ -588,13 +598,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\arc4.c - arc4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c 1 0 - 8 + 9 22 1 0 @@ -604,13 +614,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asm.c - asm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\ssl-dummy.c + ssl-dummy.c 1 0 - 8 + 9 23 1 0 @@ -620,13 +630,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asn.c - asn.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + aes.c 1 0 - 8 + 9 24 1 0 @@ -636,13 +646,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\blake2b.c - blake2b.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + arc4.c 1 0 - 8 + 9 25 1 0 @@ -652,13 +662,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\camellia.c - camellia.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + asm.c 1 0 - 8 + 9 26 1 0 @@ -668,13 +678,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\coding.c - coding.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + asn.c 1 0 - 8 + 9 27 1 0 @@ -684,13 +694,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\compress.c - compress.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + blake2b.c 1 0 - 8 + 9 28 1 0 @@ -700,13 +710,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\des3.c - des3.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + camellia.c 1 0 - 8 + 9 29 1 0 @@ -716,13 +726,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dh.c - dh.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + coding.c 1 0 - 8 + 9 30 1 0 @@ -732,13 +742,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dsa.c - dsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + compress.c 1 0 - 8 + 9 31 1 0 @@ -748,13 +758,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc.c - ecc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + des3.c 1 0 - 8 + 9 32 1 0 @@ -764,13 +774,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + dh.c 1 0 - 8 + 9 33 1 0 @@ -780,13 +790,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\error.c - error.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + dsa.c 1 0 - 8 + 9 34 1 0 @@ -796,13 +806,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hc128.c - hc128.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + ecc.c 1 0 - 8 + 9 35 1 0 @@ -812,13 +822,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hmac.c - hmac.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c 1 0 - 8 + 9 36 1 0 @@ -828,13 +838,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\integer.c - integer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + error.c 1 0 - 8 + 9 37 1 0 @@ -844,13 +854,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\logging.c - logging.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + hc128.c 1 0 - 8 + 9 38 1 0 @@ -860,13 +870,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md2.c - md2.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + hmac.c 1 0 - 8 + 9 39 1 0 @@ -876,13 +886,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md4.c - md4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + integer.c 1 0 - 8 + 9 40 1 0 @@ -892,13 +902,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md5.c - md5.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + logging.c 1 0 - 8 + 9 41 1 0 @@ -908,13 +918,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\memory.c - memory.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + md2.c 1 0 - 8 + 9 42 1 0 @@ -924,13 +934,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\misc.c - misc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + md4.c 1 0 - 8 + 9 43 1 0 @@ -940,13 +950,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\port.c - port.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + md5.c 1 0 - 8 + 9 44 1 0 @@ -956,13 +966,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + memory.c 1 0 - 8 + 9 45 1 0 @@ -972,13 +982,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rabbit.c - rabbit.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + misc.c 1 0 - 8 + 9 46 1 0 @@ -988,13 +998,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\random.c - random.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + port.c 1 0 - 8 + 9 47 1 0 @@ -1004,13 +1014,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ripemd.c - ripemd.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c 1 0 - 8 + 9 48 1 0 @@ -1020,13 +1030,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rsa.c - rsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + rabbit.c 1 0 - 8 + 9 49 1 0 @@ -1036,13 +1046,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha.c - sha.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + random.c 1 0 - 8 + 9 50 1 0 @@ -1052,13 +1062,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha256.c - sha256.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + ripemd.c 1 0 - 8 + 9 51 1 0 @@ -1068,13 +1078,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha512.c - sha512.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + rsa.c 1 0 - 8 + 9 52 1 0 @@ -1084,7 +1094,55 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\tfm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 9 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 9 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 9 + 55 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c tfm.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvprojx b/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvprojx index 1c54758bc..df87fe069 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvprojx +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/CryptBenchmark.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_Benchmark CYASSL_STM32F2xx + HAVE_CONFIG_H MDK_CONF_Benchmark @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -418,6 +424,11 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + settings.h + 5 + .\RTE\wolfSSL\settings.h + @@ -431,18 +442,33 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-STM32F2xx.c + 1 + .\time-STM32F2xx.c + + time-dummy.c + 1 + .\time-dummy.c + + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -488,11 +514,6 @@ ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -503,6 +524,11 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + @@ -513,185 +539,185 @@ 5 RTE\wolfSSL\config-Crypt.h + + settings.h + 5 + RTE\wolfSSL\settings.h + cyassl_MDK_ARM.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c ssl-dummy.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\ssl-dummy.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\ssl-dummy.c aes.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\aes.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c arc4.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\arc4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c asm.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c asn.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asn.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c blake2b.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\blake2b.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c camellia.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\camellia.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c coding.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\coding.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c compress.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\compress.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c des3.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\des3.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c dh.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dh.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c dsa.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c ecc.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c ecc_fp.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc_fp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c error.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\error.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c hc128.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hc128.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c hmac.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hmac.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c integer.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\integer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c logging.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\logging.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c md2.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md2.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c md4.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c md5.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md5.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c memory.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\memory.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c misc.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\misc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c port.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\port.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c pwdbased.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\pwdbased.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c rabbit.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rabbit.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c random.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\random.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c ripemd.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ripemd.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c rsa.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c sha.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c sha256.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha256.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c sha512.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha512.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c tfm.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\tfm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c @@ -701,13 +727,13 @@ - + - + @@ -721,20 +747,20 @@ - - + + - - + + - - + + @@ -763,20 +789,14 @@ - - + + - - - - - - - - + + @@ -785,8 +805,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -897,20 +917,28 @@ - + RTE\wolfSSL\config-Crypt.h - - + + RTE\wolfSSL\config.h - - + + + + RTE\wolfSSL\settings.h + + + + + + diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/CMSIS/RTX_Conf_CM.c index af8fdc4d5..a13ecc5b6 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -58,11 +58,11 @@ #define OS_STKSIZE 50 #endif -// Main Thread stack size [bytes] <64-10000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE - #define OS_MAINSTKSIZE 1500 + #define OS_MAINSTKSIZE 2000 #endif // Number of threads with user-provided stack size <0-250> @@ -72,7 +72,7 @@ #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-4096:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..33d41cfdb --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/RTE/wolfSSL/settings.h @@ -0,0 +1,667 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using PIC32MZ Crypto Engine */ +/* #define CYASSL_MICROCHIP_PIC32MZ */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + +/* Uncomment next line if using LwIP native TCP socket settings */ +/* #define HAVE_LWIP_NATIVE */ + +/* Uncomment next line if building for EROAD */ +/* #define CYASSL_EROAD */ + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef CYASSL_USER_SETTINGS + #include +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ + #define CYASSL_LWIP + #define NO_WRITEV + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_FILESYSTEM +#endif + +#ifdef MICROCHIP_PIC32 + /* #define CYASSL_MICROCHIP_PIC32MZ */ + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef CYASSL_MICROCHIP_PIC32MZ + #define CYASSL_PIC32MZ_CE + #define CYASSL_PIC32MZ_CRYPT + #define HAVE_AES_ENGINE + #define CYASSL_PIC32MZ_RNG + /* #define CYASSL_PIC32MZ_HASH */ + #define CYASSL_AES_COUNTER + #define HAVE_AESGCM + #define NO_BIG_INT + +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "system/system_services.h" + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define CYASSL_USER_IO + #define NO_FILESYSTEM + #define NO_CERT + #define USE_CERT_BUFFERS_1024 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define HAVE_ECC + #define NO_SESSION_CACHE + #define CYASSL_CMSIS_RTOS +#endif + + +#ifdef CYASSL_EROAD + #define FREESCALE_MQX + #define FREESCALE_MMCAU + #define SINGLE_THREADED + #define NO_STDIO_FILESYSTEM + #define CYASSL_LEANPSK + #define HAVE_NULL_CIPHER + #define NO_OLD_TLS + #define NO_ASN + #define NO_BIG_INT + #define NO_RSA + #define NO_DSA + #define NO_DH + #define NO_CERTS + #define NO_PWDBASED + #define NO_DES3 + #define NO_MD4 + #define NO_RC4 + #define NO_MD5 + #define NO_SESSION_CACHE + #define NO_MAIN_DRIVER +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) && !defined(CYASSL_EROAD) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/benchmark.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/benchmark.c index d0f9fbd38..817d9b7c6 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/benchmark.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/benchmark.c @@ -85,6 +85,7 @@ void bench_rabbit(void); void bench_aes(int); void bench_aesgcm(void); void bench_aesccm(void); +void bench_aesctr(void); void bench_camellia(void); void bench_md5(void); @@ -155,6 +156,11 @@ int benchmark_test(void *args) #ifdef HAVE_AESGCM bench_aesgcm(); #endif + +#ifdef CYASSL_AES_COUNTER + bench_aesctr(); +#endif + #ifdef HAVE_AESCCM bench_aesccm(); #endif @@ -219,23 +225,31 @@ int benchmark_test(void *args) #ifdef BENCH_EMBEDDED -const int numBlocks = 25; /* how many kB/megs to test (en/de)cryption */ -const char blockType[] = "kB"; /* used in printf output */ -const int times = 1; /* public key iterations */ +enum BenchmarkBounds { + numBlocks = 25, /* how many kB to test (en/de)cryption */ + ntimes = 1, + genTimes = 5, /* public key iterations */ + agreeTimes = 5 +}; +static const char blockType[] = "kB"; /* used in printf output */ #else -const int numBlocks = 5; -const char blockType[] = "megs"; -const int times = 100; +enum BenchmarkBounds { + numBlocks = 5, /* how many megs to test (en/de)cryption */ + ntimes = 100, + genTimes = 100, + agreeTimes = 100 +}; +static const char blockType[] = "megs"; /* used in printf output */ #endif -const byte key[] = +static const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 }; -const byte iv[] = +static const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, @@ -246,11 +260,11 @@ const byte iv[] = /* use kB instead of mB for embedded benchmarking */ #ifdef BENCH_EMBEDDED -byte plain [1024]; -byte cipher[1024]; +static byte plain [1024]; +static byte cipher[1024]; #else -byte plain [1024*1024]; -byte cipher[1024*1024]; +static byte plain [1024*1024]; +static byte cipher[1024*1024]; #endif @@ -260,13 +274,20 @@ void bench_aes(int show) Aes enc; double start, total, persec; int i; + int ret; #ifdef HAVE_CAVIUM - if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) + if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) { printf("aes init cavium failed\n"); + return; + } #endif - AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION); + ret = AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION); + if (ret != 0) { + printf("AesSetKey failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -281,7 +302,7 @@ void bench_aes(int show) #endif if (show) - printf("AES %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM AesFreeCavium(&enc); @@ -290,8 +311,10 @@ void bench_aes(int show) #endif -byte additional[13]; -byte tag[16]; +#if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) + static byte additional[13]; + static byte tag[16]; +#endif #ifdef HAVE_AESGCM @@ -316,11 +339,38 @@ void bench_aesgcm(void) persec = persec / 1024; #endif - printf("AES-GCM %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES-GCM %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif +#ifdef CYASSL_AES_COUNTER +void bench_aesctr(void) +{ + Aes enc; + double start, total, persec; + int i; + + AesSetKeyDirect(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + start = current_time(1); + + for(i = 0; i < numBlocks; i++) + AesCtrEncrypt(&enc, plain, cipher, sizeof(plain)); + + total = current_time(0) - start; + + persec = 1 / total * numBlocks; +#ifdef BENCH_EMBEDDED + /* since using kB, convert to MB/s */ + persec = persec / 1024; +#endif + + printf("AES-CTR %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, + blockType, total, persec); +} +#endif + + #ifdef HAVE_AESCCM void bench_aesccm(void) @@ -344,7 +394,7 @@ void bench_aesccm(void) persec = persec / 1024; #endif - printf("AES-CCM %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES-CCM %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -371,7 +421,7 @@ void bench_camellia(void) persec = persec / 1024; #endif - printf("Camellia %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("Camellia %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -382,13 +432,17 @@ void bench_des(void) { Des3 enc; double start, total, persec; - int i; + int i, ret; #ifdef HAVE_CAVIUM if (Des3_InitCavium(&enc, CAVIUM_DEV_ID) != 0) printf("des3 init cavium failed\n"); #endif - Des3_SetKey(&enc, key, iv, DES_ENCRYPTION); + ret = Des3_SetKey(&enc, key, iv, DES_ENCRYPTION); + if (ret != 0) { + printf("Des3_SetKey failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -402,7 +456,7 @@ void bench_des(void) persec = persec / 1024; #endif - printf("3DES %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("3DES %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM Des3_FreeCavium(&enc); @@ -436,7 +490,7 @@ void bench_arc4(void) persec = persec / 1024; #endif - printf("ARC4 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("ARC4 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM Arc4FreeCavium(&enc); @@ -465,7 +519,7 @@ void bench_hc128(void) persec = persec / 1024; #endif - printf("HC128 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("HC128 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* HAVE_HC128 */ @@ -491,7 +545,7 @@ void bench_rabbit(void) persec = persec / 1024; #endif - printf("RABBIT %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("RABBIT %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_RABBIT */ @@ -520,7 +574,7 @@ void bench_md5(void) persec = persec / 1024; #endif - printf("MD5 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("MD5 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_MD5 */ @@ -532,9 +586,13 @@ void bench_sha(void) Sha hash; byte digest[SHA_DIGEST_SIZE]; double start, total, persec; - int i; + int i, ret; - InitSha(&hash); + ret = InitSha(&hash); + if (ret != 0) { + printf("InitSha failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -549,7 +607,7 @@ void bench_sha(void) persec = persec / 1024; #endif - printf("SHA %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_SHA */ @@ -562,8 +620,13 @@ void bench_sha256(void) byte digest[SHA256_DIGEST_SIZE]; double start, total, persec; int i; + int ret; - InitSha256(&hash); + ret = InitSha256(&hash); + if (ret != 0) { + printf("InitSha256 failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -578,7 +641,7 @@ void bench_sha256(void) persec = persec / 1024; #endif - printf("SHA-256 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA-256 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -589,9 +652,13 @@ void bench_sha512(void) Sha512 hash; byte digest[SHA512_DIGEST_SIZE]; double start, total, persec; - int i; + int i, ret; - InitSha512(&hash); + ret = InitSha512(&hash); + if (ret != 0) { + printf("InitSha512 failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -606,7 +673,7 @@ void bench_sha512(void) persec = persec / 1024; #endif - printf("SHA-512 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA-512 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -634,7 +701,7 @@ void bench_ripemd(void) persec = persec / 1024; #endif - printf("RIPEMD %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("RIPEMD %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -663,7 +730,7 @@ void bench_blake2(void) persec = persec / 1024; #endif - printf("BLAKE2b %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("BLAKE2b %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -671,7 +738,7 @@ void bench_blake2(void) #if !defined(NO_RSA) || !defined(NO_DH) \ || defined(CYASSL_KEYGEN) || defined(HAVE_ECC) -RNG rng; +static RNG rng; #endif #ifndef NO_RSA @@ -680,7 +747,7 @@ RNG rng; #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && \ defined(CYASSL_MDK_SHELL) static char *certRSAname = "certs/rsa2048.der" ; -void set_Bench_RSA_File(char * cert) { certRSAname = cert ; } +static void set_Bench_RSA_File(char * cert) { certRSAname = cert ; } /* set by shell command */ #elif defined(CYASSL_MDK_SHELL) /* nothing */ @@ -733,20 +800,24 @@ void bench_rsa(void) printf("InitRNG failed\n"); return; } - InitRsaKey(&rsaKey, 0); + ret = InitRsaKey(&rsaKey, 0); + if (ret < 0) { + printf("InitRsaKey failed\n"); + return; + } ret = RsaPrivateKeyDecode(tmp, &idx, &rsaKey, (word32)bytes); start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) ret = RsaPublicEncrypt(message,len,enc,sizeof(enc), &rsaKey, &rng); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("RSA %d encryption took %6.2f milliseconds, avg over %d" - " iterations\n", rsaKeySz, milliEach, times); + printf("RSA %d encryption took %6.3f milliseconds, avg over %d" + " iterations\n", rsaKeySz, milliEach, ntimes); if (ret < 0) { printf("Rsa Public Encrypt failed\n"); @@ -755,17 +826,17 @@ void bench_rsa(void) start = current_time(1); - for (i = 0; i < times; i++) { + for (i = 0; i < ntimes; i++) { byte out[512]; /* for up to 4096 bit */ RsaPrivateDecrypt(enc, (word32)ret, out, sizeof(out), &rsaKey); } total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("RSA %d decryption took %6.2f milliseconds, avg over %d" - " iterations\n", rsaKeySz, milliEach, times); + printf("RSA %d decryption took %6.3f milliseconds, avg over %d" + " iterations\n", rsaKeySz, milliEach, ntimes); FreeRsaKey(&rsaKey); #ifdef HAVE_CAVIUM @@ -794,7 +865,7 @@ void bench_dh(void) int i, ret; byte tmp[1024]; size_t bytes; - word32 idx = 0, pubSz, privSz, pubSz2, privSz2, agreeSz; + word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz; byte pub[256]; /* for 2048 bit */ byte priv[256]; /* for 2048 bit */ @@ -843,28 +914,28 @@ void bench_dh(void) start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) DhGenerateKeyPair(&dhKey, &rng, priv, &privSz, pub, &pubSz); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("DH %d key generation %6.2f milliseconds, avg over %d" - " iterations\n", dhKeySz, milliEach, times); + printf("DH %d key generation %6.3f milliseconds, avg over %d" + " iterations\n", dhKeySz, milliEach, ntimes); DhGenerateKeyPair(&dhKey, &rng, priv2, &privSz2, pub2, &pubSz2); start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) DhAgree(&dhKey, agree, &agreeSz, priv, privSz, pub2, pubSz2); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("DH %d key agreement %6.2f milliseconds, avg over %d" - " iterations\n", dhKeySz, milliEach, times); + printf("DH %d key agreement %6.3f milliseconds, avg over %d" + " iterations\n", dhKeySz, milliEach, ntimes); #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) fclose(file); @@ -879,7 +950,6 @@ void bench_rsaKeyGen(void) RsaKey genKey; double start, total, each, milliEach; int i; - const int genTimes = 5; /* 1024 bit */ start = current_time(1); @@ -894,7 +964,7 @@ void bench_rsaKeyGen(void) each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ printf("\n"); - printf("RSA 1024 key generation %6.2f milliseconds, avg over %d" + printf("RSA 1024 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); /* 2048 bit */ @@ -909,7 +979,7 @@ void bench_rsaKeyGen(void) total = current_time(0) - start; each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("RSA 2048 key generation %6.2f milliseconds, avg over %d" + printf("RSA 2048 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); } #endif /* CYASSL_KEY_GEN */ @@ -920,7 +990,6 @@ void bench_eccKeyGen(void) ecc_key genKey; double start, total, each, milliEach; int i, ret; - const int genTimes = 5; ret = InitRng(&rng); if (ret < 0) { @@ -939,7 +1008,7 @@ void bench_eccKeyGen(void) each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ printf("\n"); - printf("ECC 256 key generation %6.2f milliseconds, avg over %d" + printf("ECC 256 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); } @@ -949,11 +1018,10 @@ void bench_eccKeyAgree(void) ecc_key genKey, genKey2; double start, total, each, milliEach; int i, ret; - const int agreeTimes = 5; byte shared[1024]; byte sig[1024]; byte digest[32]; - word32 x; + word32 x = 0; ecc_init(&genKey); ecc_init(&genKey2); @@ -990,12 +1058,12 @@ void bench_eccKeyAgree(void) total = current_time(0) - start; each = total / agreeTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("EC-DHE key agreement %6.2f milliseconds, avg over %d" + printf("EC-DHE key agreement %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); /* make dummy digest */ for (i = 0; i < (int)sizeof(digest); i++) - digest[i] = i; + digest[i] = (byte)i; start = current_time(1); @@ -1012,7 +1080,7 @@ void bench_eccKeyAgree(void) total = current_time(0) - start; each = total / agreeTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("EC-DSA sign time %6.2f milliseconds, avg over %d" + printf("EC-DSA sign time %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); start = current_time(1); @@ -1029,7 +1097,7 @@ void bench_eccKeyAgree(void) total = current_time(0) - start; each = total / agreeTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("EC-DSA verify time %6.2f milliseconds, avg over %d" + printf("EC-DSA verify time %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); ecc_free(&genKey2); @@ -1045,13 +1113,13 @@ void bench_eccKeyAgree(void) double current_time(int reset) { - (void)reset; - static int init = 0; static LARGE_INTEGER freq; LARGE_INTEGER count; + (void)reset; + if (!init) { QueryPerformanceFrequency(&freq); init = 1; @@ -1063,44 +1131,58 @@ void bench_eccKeyAgree(void) } #elif defined MICROCHIP_PIC32 - - #include + #if defined(CYASSL_MICROCHIP_PIC32MZ) + #define CLOCK 8000000.0 + #else + #include + #define CLOCK 4000000.0 + #endif double current_time(int reset) { - /* NOTE: core timer tick rate = 40 Mhz, 1 tick = 25 ns */ - unsigned int ns; - /* should we reset our timer back to zero? Helps prevent timer - rollover */ - if (reset) { WriteCoreTimer(0); } /* get timer in ns */ - ns = ReadCoreTimer() * 25; + ns = ReadCoreTimer(); /* return seconds as a double */ - return ( ns / 1000000000.0 ); + return ( ns / CLOCK * 2.0); } - + #elif defined CYASSL_MDK_ARM + extern double current_time(int reset) ; + +#elif defined FREERTOS + + double current_time(int reset) + { + (void) reset; + + portTickType tickCount; + + /* tick count == ms, if configTICK_RATE_HZ is set to 1000 */ + tickCount = xTaskGetTickCount(); + return (double)tickCount / 1000; + } + #else #include double current_time(int reset) { - (void) reset; - struct timeval tv; + + (void)reset; + gettimeofday(&tv, 0); return (double)tv.tv_sec + (double)tv.tv_usec / 1000000; } #endif /* _WIN32 */ - diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c index 4bc12cbd0..5a6248704 100644 --- a/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/main.c @@ -62,8 +62,9 @@ int main() { void * arg = NULL ; - init_time() ; init_filesystem (); + init_time() ; + printf("=== Start: Crypt Benchmark ===\n") ; benchmark_test(arg) ; printf("=== End: Crypt Benchmark ===\n") ; diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-STM32F2xx.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-STM32F2xx.c new file mode 100644 index 000000000..3a26db7dc --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-STM32F2xx.c @@ -0,0 +1,82 @@ +/* time-STM32F2.c + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +#define PERIPH_BASE ((uint32_t)0x40000000) +/*----------------------------------------------------------------------------- + * initialize RTC + *----------------------------------------------------------------------------*/ +#include "stm32f2xx.h" + +#define assert_param(a) + +#if 0 +#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) +#define SYNCHRO_TIMEOUT ((uint32_t) 0x00008000) +#define Bcd2ToByte(v) \ + ((((uint8_t)(v & (uint8_t)0xF0) >> (uint8_t)0x4) * 10) + (v & (uint8_t)0x0F)) +#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) +#define RTC_TR_MNT ((uint32_t)0x00007000) +#define RTC_TR_MNU ((uint32_t)0x00000F00) + +#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) +#define CR_OFFSET (PWR_OFFSET + 0x00) +#define DBP_BitNumber 0x08 +#define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4)) +#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) +#define INITMODE_TIMEOUT ((uint32_t) 0x00010000) +#endif + +/*----------------------------------------------------------------------------- + * initialize TIM + *----------------------------------------------------------------------------*/ +#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) + +void init_time(void) +{ + uint16_t tmpcr1 = 0; + + ((uint32_t *)RCC)[0x10] |= RCC_APB1Periph_TIM2 ; + + tmpcr1 = TIM2->CR1 ; + tmpcr1 &= (uint16_t) (~(((uint16_t)0x0010) | ((uint16_t)0x0060) )); + /* CR1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS) */ + tmpcr1 |= (uint16_t)0x0000 ; /* CR1 |= TIM_CounterMode_Up */ + TIM2->CR1= tmpcr1 ; + + TIM2->ARR = 0xffffffff ; /* ARR= TIM_Period */ + TIM2->PSC = 60 ; /* PSC = TIM_Prescaler */ + TIM2->EGR = ((uint16_t)0x0001) ; /* EGR = TIM_PSCReloadMode_Immediate */ + + *(uint16_t *)(PERIPH_BASE+0x0) |=((uint16_t)0x0001) ; + /* TIM_Cmd(TIM2, ENABLE) ; */ +} + +double current_time() +{ + return ((double)TIM2->CNT/1000000.0) ; +} + diff --git a/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptBenchmark/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt b/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt index 5d4a8312e..886be85b8 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/CryptTest/Abstract.txt @@ -1,9 +1,9 @@ This program is a simple test suite of wolfCrypt library. In order to run this test suite, copy -{PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +{PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. -For test configuration, refer config-Crypt.h. +For selecting test crypt algorism options, refer config-Crypt.h. For the hardware crypt on config-Crypt.h, download STSW-STM32062: STM32F2xx standard peripherals library at diff --git a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx index a7474ba71..cce81092f 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx +++ b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -120,25 +122,10 @@ BIN\ULP2CM3.DLL - - 0 - DLGTARM - (1010=-1,-1,-1,-1,0)(1007=-1,-1,-1,-1,0)(1008=-1,-1,-1,-1,0)(1009=-1,-1,-1,-1,0)(1012=-1,-1,-1,-1,0) - - - 0 - ARMDBGFLAGS - - 0 ULP2CM3 - -UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC120000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.flm -FS08000000 -FL0100000 -FP0($$Device:STM32F207IG$Flash\STM32F2xx_1024.flm) - - - 0 - DLGUARM - + -UP1135060 -O206 -S8 -C0 -P00 -N00("ARM CoreSight SW-DP") -D00(2BA01477) -L00(0) -TO19 -TC10000000 -TP18 -TDX0 -TDD0 -TDS8000 -TDT0 -TDC1F -TIE1 -TIP1 -FO7 -FD20000000 -FC1000 -FN1 -FF0STM32F2xx_1024.flm -FS08000000 -FL0100000 -FP0($$Device:STM32F207IG$Flash\STM32F2xx_1024.flm) 0 @@ -147,32 +134,18 @@ - - - 1 - 8 - tmp - - - - - 2 - 8 - 0x8004dc8 - - 0 0 0 - 1 + 0 0 0 0 0 - 1 + 0 0 0 0 @@ -184,8 +157,8 @@ 0 0 0 - 1 - 1 + 0 + 0 0 0 0 @@ -237,7 +210,7 @@ Configuration - 1 + 0 0 0 0 @@ -257,24 +230,40 @@ 0 0 - - - - Documentation - 1 - 0 - 0 - 0 - 3 + 2 4 5 0 0 0 0 - 1 - 1 + 0 + 0 + 0 + .\RTE\wolfSSL\settings.h + settings.h + 0 + 0 + + + + + Documentation + 0 + 0 + 0 + 0 + + 3 + 5 + 5 + 0 + 0 + 0 + 0 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -289,22 +278,6 @@ 0 0 1 - - 4 - 5 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 - 0 - 4 6 @@ -321,6 +294,22 @@ 1 0 + + 4 + 7 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + @@ -331,7 +320,7 @@ 1 5 - 7 + 8 1 0 0 @@ -347,7 +336,7 @@ 5 - 8 + 9 1 0 0 @@ -363,7 +352,7 @@ 5 - 9 + 10 5 0 0 @@ -379,7 +368,7 @@ 5 - 10 + 11 2 0 0 @@ -395,7 +384,7 @@ 5 - 11 + 12 1 0 0 @@ -419,7 +408,7 @@ 1 6 - 12 + 13 1 0 0 @@ -441,22 +430,6 @@ 0 0 1 - - 7 - 13 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - 7 14 @@ -489,6 +462,22 @@ 1 0 + + 7 + 16 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib + 1 + 0 + @@ -497,569 +486,9 @@ 0 0 1 - - 8 - 16 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - 8 17 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\ssl-dummy.c - ssl-dummy.c - 1 - 0 - - - 8 - 18 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 8 - 19 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 8 - 20 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 8 - 21 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - asm.c - 1 - 0 - - - 8 - 22 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - asn.c - 1 - 0 - - - 8 - 23 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - blake2b.c - 1 - 0 - - - 8 - 24 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - camellia.c - 1 - 0 - - - 8 - 25 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - coding.c - 1 - 0 - - - 8 - 26 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - compress.c - 1 - 0 - - - 8 - 27 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - des3.c - 1 - 0 - - - 8 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - dh.c - 1 - 0 - - - 8 - 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - dsa.c - 1 - 0 - - - 8 - 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - ecc.c - 1 - 0 - - - 8 - 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c - 1 - 0 - - - 8 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - error.c - 1 - 0 - - - 8 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - hc128.c - 1 - 0 - - - 8 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - hmac.c - 1 - 0 - - - 8 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - integer.c - 1 - 0 - - - 8 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - logging.c - 1 - 0 - - - 8 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - md2.c - 1 - 0 - - - 8 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - md4.c - 1 - 0 - - - 8 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - md5.c - 1 - 0 - - - 8 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - memory.c - 1 - 0 - - - 8 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - misc.c - 1 - 0 - - - 8 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c - 1 - 0 - - - 8 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - rabbit.c - 1 - 0 - - - 8 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - random.c - 1 - 0 - - - 8 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - ripemd.c - 1 - 0 - - - 8 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - rsa.c - 1 - 0 - - - 8 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - sha.c - 1 - 0 - - - 8 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - sha256.c - 1 - 0 - - - 8 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - sha512.c - 1 - 0 - - - 8 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - tfm.c - 1 - 0 - - - 8 - 51 5 0 0 @@ -1075,7 +504,7 @@ 8 - 52 + 18 5 0 0 @@ -1084,8 +513,584 @@ 0 0 0 - RTE\wolfSSL\config.h - config.h + RTE\wolfSSL\settings.h + settings.h + 1 + 0 + + + 8 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.2\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c + time-STM32F2xx.c + 1 + 0 + + + 8 + 20 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c + 1 + 0 + + + 8 + 21 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\ssl-dummy.c + ssl-dummy.c + 1 + 0 + + + 8 + 22 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + aes.c + 1 + 0 + + + 8 + 23 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + arc4.c + 1 + 0 + + + 8 + 24 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + asm.c + 1 + 0 + + + 8 + 25 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + asn.c + 1 + 0 + + + 8 + 26 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + blake2b.c + 1 + 0 + + + 8 + 27 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + camellia.c + 1 + 0 + + + 8 + 28 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + coding.c + 1 + 0 + + + 8 + 29 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + compress.c + 1 + 0 + + + 8 + 30 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + des3.c + 1 + 0 + + + 8 + 31 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + dh.c + 1 + 0 + + + 8 + 32 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + dsa.c + 1 + 0 + + + 8 + 33 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + ecc.c + 1 + 0 + + + 8 + 34 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c + 1 + 0 + + + 8 + 35 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + error.c + 1 + 0 + + + 8 + 36 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + hc128.c + 1 + 0 + + + 8 + 37 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + hmac.c + 1 + 0 + + + 8 + 38 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + integer.c + 1 + 0 + + + 8 + 39 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + logging.c + 1 + 0 + + + 8 + 40 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + md2.c + 1 + 0 + + + 8 + 41 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + md4.c + 1 + 0 + + + 8 + 42 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + md5.c + 1 + 0 + + + 8 + 43 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + memory.c + 1 + 0 + + + 8 + 44 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + misc.c + 1 + 0 + + + 8 + 45 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + port.c + 1 + 0 + + + 8 + 46 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c + 1 + 0 + + + 8 + 47 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + rabbit.c + 1 + 0 + + + 8 + 48 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + random.c + 1 + 0 + + + 8 + 49 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + ripemd.c + 1 + 0 + + + 8 + 50 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + rsa.c + 1 + 0 + + + 8 + 51 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 8 + 52 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 8 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 8 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c + tfm.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx index 6db3f16fa..943c8676d 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx +++ b/IDE/MDK5-ARM/Projects/CryptTest/CryptTest.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_CryptTest CYASSL_STM32F2xx __DBG_ITM + HAVE_CONFIG_H MDK_CONF_CryptTest @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -418,6 +424,11 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + settings.h + 5 + .\RTE\wolfSSL\settings.h + @@ -433,16 +444,16 @@ ::CMSIS - - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -488,11 +499,6 @@ ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -503,195 +509,205 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::wolfSSL - - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - - - ssl-dummy.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\ssl-dummy.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - - - aes.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - - - arc4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - - - asm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - - - asn.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - - - blake2b.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - - - camellia.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - - - coding.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - - - compress.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - - - des3.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - - - dh.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - - - dsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - - - ecc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - - - ecc_fp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - - - error.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - - - hc128.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - - - hmac.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - - - integer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - - - logging.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - - - md2.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - - - md4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - - - md5.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - - - memory.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - - - misc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - - - pwdbased.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - - - rabbit.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - - - random.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - - - ripemd.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - - - rsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - - - sha.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - - - sha256.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - - - sha512.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - - - tfm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - config-Crypt.h 5 RTE\wolfSSL\config-Crypt.h - config.h + settings.h 5 - RTE\wolfSSL\config.h + RTE\wolfSSL\settings.h + + + time-STM32F2xx.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.2\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c + + + cyassl_MDK_ARM.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + + + ssl-dummy.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\ssl-dummy.c + + + aes.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + + + arc4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + + + asm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + + + asn.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + + + blake2b.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + + + camellia.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + + + coding.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + + + compress.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + + + des3.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + + + dh.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + + + dsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + + + ecc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + + + ecc_fp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + + + error.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + + + hc128.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + + + hmac.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + + + integer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + + + logging.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + + + md2.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + + + md4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + + + md5.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + + + memory.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + + + misc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + + + port.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + + + pwdbased.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + + + rabbit.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + + + random.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + + + ripemd.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + + + rsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + + + sha.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + + + sha256.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + + + sha512.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + + + tfm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c @@ -701,13 +717,13 @@ - + - + @@ -785,8 +801,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -897,18 +913,24 @@ - + RTE\wolfSSL\config-Crypt.h - - + + - RTE\wolfSSL\config.h + RTE\wolfSSL\config.h + + + + RTE\wolfSSL\settings.h + + diff --git a/IDE/MDK5-ARM/Projects/CryptTest/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/CryptTest/RTE/CMSIS/RTX_Conf_CM.c index 31dd53c78..a13ecc5b6 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -58,7 +58,7 @@ #define OS_STKSIZE 50 #endif -// Main Thread stack size [bytes] <64-10000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE @@ -72,7 +72,7 @@ #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-4096:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..33d41cfdb --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CryptTest/RTE/wolfSSL/settings.h @@ -0,0 +1,667 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using PIC32MZ Crypto Engine */ +/* #define CYASSL_MICROCHIP_PIC32MZ */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + +/* Uncomment next line if using LwIP native TCP socket settings */ +/* #define HAVE_LWIP_NATIVE */ + +/* Uncomment next line if building for EROAD */ +/* #define CYASSL_EROAD */ + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef CYASSL_USER_SETTINGS + #include +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ + #define CYASSL_LWIP + #define NO_WRITEV + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_FILESYSTEM +#endif + +#ifdef MICROCHIP_PIC32 + /* #define CYASSL_MICROCHIP_PIC32MZ */ + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef CYASSL_MICROCHIP_PIC32MZ + #define CYASSL_PIC32MZ_CE + #define CYASSL_PIC32MZ_CRYPT + #define HAVE_AES_ENGINE + #define CYASSL_PIC32MZ_RNG + /* #define CYASSL_PIC32MZ_HASH */ + #define CYASSL_AES_COUNTER + #define HAVE_AESGCM + #define NO_BIG_INT + +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "system/system_services.h" + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define CYASSL_USER_IO + #define NO_FILESYSTEM + #define NO_CERT + #define USE_CERT_BUFFERS_1024 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define HAVE_ECC + #define NO_SESSION_CACHE + #define CYASSL_CMSIS_RTOS +#endif + + +#ifdef CYASSL_EROAD + #define FREESCALE_MQX + #define FREESCALE_MMCAU + #define SINGLE_THREADED + #define NO_STDIO_FILESYSTEM + #define CYASSL_LEANPSK + #define HAVE_NULL_CIPHER + #define NO_OLD_TLS + #define NO_ASN + #define NO_BIG_INT + #define NO_RSA + #define NO_DSA + #define NO_DH + #define NO_CERTS + #define NO_PWDBASED + #define NO_DES3 + #define NO_MD4 + #define NO_RC4 + #define NO_MD5 + #define NO_SESSION_CACHE + #define NO_MAIN_DRIVER +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) && !defined(CYASSL_EROAD) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/CryptTest/main.c b/IDE/MDK5-ARM/Projects/CryptTest/main.c index a0dd1aa3f..86a9f0ec5 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/main.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/main.c @@ -62,7 +62,6 @@ int main() { void * arg = NULL ; - init_time() ; init_filesystem (); printf("=== Start: Crypt test ===\n") ; ctaocrypt_test(arg) ; diff --git a/IDE/MDK5-ARM/Projects/CryptTest/test.c b/IDE/MDK5-ARM/Projects/CryptTest/test.c index 086032ab7..57419e11f 100644 --- a/IDE/MDK5-ARM/Projects/CryptTest/test.c +++ b/IDE/MDK5-ARM/Projects/CryptTest/test.c @@ -25,6 +25,10 @@ #include +#ifdef XMALLOC_USER + #include /* we're using malloc / free direct here */ +#endif + #ifndef NO_CRYPT_TEST #ifdef CYASSL_TEST_CERT @@ -54,13 +58,16 @@ #include #ifdef HAVE_ECC #include -#endif +#endif #ifdef HAVE_BLAKE2 #include -#endif +#endif #ifdef HAVE_LIBZ #include #endif +#ifdef HAVE_PKCS7 + #include +#endif #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */ @@ -78,8 +85,8 @@ #if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) /* include test cert and key buffers for use with NO_FILESYSTEM */ #if defined(CYASSL_MDK_ARM) - #include "cert_data.h" - /* use certs_test.c for initial data, so other + #include "cert_data.h" + /* use certs_test.c for initial data, so other commands can share the data. */ #else #include @@ -123,7 +130,7 @@ typedef struct testVector { const char* input; - const char* output; + const char* output; size_t inLen; size_t outLen; } testVector; @@ -164,6 +171,9 @@ int pkcs12_test(void); int pbkdf2_test(void); #ifdef HAVE_ECC int ecc_test(void); + #ifdef HAVE_ECC_ENCRYPT + int ecc_encrypt_test(void); + #endif #endif #ifdef HAVE_BLAKE2 int blake2b_test(void); @@ -171,6 +181,10 @@ int pbkdf2_test(void); #ifdef HAVE_LIBZ int compress_test(void); #endif +#ifdef HAVE_PKCS7 + int pkcs7enveloped_test(void); + int pkcs7signed_test(void); +#endif @@ -211,63 +225,63 @@ void ctaocrypt_test(void* args) #ifndef NO_MD5 - if ( (ret = md5_test()) != 0) + if ( (ret = md5_test()) != 0) err_sys("MD5 test failed!\n", ret); else printf( "MD5 test passed!\n"); #endif #ifdef CYASSL_MD2 - if ( (ret = md2_test()) != 0) + if ( (ret = md2_test()) != 0) err_sys("MD2 test failed!\n", ret); else printf( "MD2 test passed!\n"); #endif #ifndef NO_MD4 - if ( (ret = md4_test()) != 0) + if ( (ret = md4_test()) != 0) err_sys("MD4 test failed!\n", ret); else printf( "MD4 test passed!\n"); #endif #ifndef NO_SHA - if ( (ret = sha_test()) != 0) + if ( (ret = sha_test()) != 0) err_sys("SHA test failed!\n", ret); else printf( "SHA test passed!\n"); #endif #ifndef NO_SHA256 - if ( (ret = sha256_test()) != 0) + if ( (ret = sha256_test()) != 0) err_sys("SHA-256 test failed!\n", ret); else printf( "SHA-256 test passed!\n"); #endif #ifdef CYASSL_SHA384 - if ( (ret = sha384_test()) != 0) + if ( (ret = sha384_test()) != 0) err_sys("SHA-384 test failed!\n", ret); else printf( "SHA-384 test passed!\n"); #endif #ifdef CYASSL_SHA512 - if ( (ret = sha512_test()) != 0) + if ( (ret = sha512_test()) != 0) err_sys("SHA-512 test failed!\n", ret); else printf( "SHA-512 test passed!\n"); #endif #ifdef CYASSL_RIPEMD - if ( (ret = ripemd_test()) != 0) + if ( (ret = ripemd_test()) != 0) err_sys("RIPEMD test failed!\n", ret); else printf( "RIPEMD test passed!\n"); #endif -#ifdef HAVE_BLAKE2 - if ( (ret = blake2b_test()) != 0) +#ifdef HAVE_BLAKE2 + if ( (ret = blake2b_test()) != 0) err_sys("BLAKE2b test failed!\n", ret); else printf( "BLAKE2b test passed!\n"); @@ -275,49 +289,49 @@ void ctaocrypt_test(void* args) #ifndef NO_HMAC #ifndef NO_MD5 - if ( (ret = hmac_md5_test()) != 0) + if ( (ret = hmac_md5_test()) != 0) err_sys("HMAC-MD5 test failed!\n", ret); else printf( "HMAC-MD5 test passed!\n"); #endif #ifndef NO_SHA - if ( (ret = hmac_sha_test()) != 0) + if ( (ret = hmac_sha_test()) != 0) err_sys("HMAC-SHA test failed!\n", ret); else printf( "HMAC-SHA test passed!\n"); #endif #ifndef NO_SHA256 - if ( (ret = hmac_sha256_test()) != 0) + if ( (ret = hmac_sha256_test()) != 0) err_sys("HMAC-SHA256 test failed!\n", ret); else printf( "HMAC-SHA256 test passed!\n"); #endif #ifdef CYASSL_SHA384 - if ( (ret = hmac_sha384_test()) != 0) + if ( (ret = hmac_sha384_test()) != 0) err_sys("HMAC-SHA384 test failed!\n", ret); else printf( "HMAC-SHA384 test passed!\n"); #endif #ifdef CYASSL_SHA512 - if ( (ret = hmac_sha512_test()) != 0) + if ( (ret = hmac_sha512_test()) != 0) err_sys("HMAC-SHA512 test failed!\n", ret); else printf( "HMAC-SHA512 test passed!\n"); #endif - #ifdef HAVE_BLAKE2 - if ( (ret = hmac_blake2b_test()) != 0) + #ifdef HAVE_BLAKE2 + if ( (ret = hmac_blake2b_test()) != 0) err_sys("HMAC-BLAKE2 test failed!\n", ret); else printf( "HMAC-BLAKE2 test passed!\n"); #endif #ifdef HAVE_HKDF - if ( (ret = hkdf_test()) != 0) + if ( (ret = hkdf_test()) != 0) err_sys("HMAC-KDF test failed!\n", ret); else printf( "HMAC-KDF test passed!\n"); @@ -401,54 +415,72 @@ void ctaocrypt_test(void* args) printf( "RANDOM test passed!\n"); #ifndef NO_RSA - if ( (ret = rsa_test()) != 0) + if ( (ret = rsa_test()) != 0) err_sys("RSA test failed!\n", ret); else printf( "RSA test passed!\n"); #endif #ifndef NO_DH - if ( (ret = dh_test()) != 0) + if ( (ret = dh_test()) != 0) err_sys("DH test failed!\n", ret); else printf( "DH test passed!\n"); #endif #ifndef NO_DSA - if ( (ret = dsa_test()) != 0) + if ( (ret = dsa_test()) != 0) err_sys("DSA test failed!\n", ret); else printf( "DSA test passed!\n"); #endif - + #ifndef NO_PWDBASED - if ( (ret = pwdbased_test()) != 0) + if ( (ret = pwdbased_test()) != 0) err_sys("PWDBASED test failed!\n", ret); else printf( "PWDBASED test passed!\n"); #endif - + #ifdef OPENSSL_EXTRA - if ( (ret = openssl_test()) != 0) + if ( (ret = openssl_test()) != 0) err_sys("OPENSSL test failed!\n", ret); else printf( "OPENSSL test passed!\n"); #endif #ifdef HAVE_ECC - if ( (ret = ecc_test()) != 0) + if ( (ret = ecc_test()) != 0) err_sys("ECC test failed!\n", ret); else printf( "ECC test passed!\n"); + #ifdef HAVE_ECC_ENCRYPT + if ( (ret = ecc_encrypt_test()) != 0) + err_sys("ECC Enc test failed!\n", ret); + else + printf( "ECC Enc test passed!\n"); + #endif #endif #ifdef HAVE_LIBZ - if ( (ret = compress_test()) != 0) + if ( (ret = compress_test()) != 0) err_sys("COMPRESS test failed!\n", ret); else printf( "COMPRESS test passed!\n"); #endif +#ifdef HAVE_PKCS7 + if ( (ret = pkcs7enveloped_test()) != 0) + err_sys("PKCS7enveloped test failed!\n", ret); + else + printf( "PKCS7enveloped test passed!\n"); + + if ( (ret = pkcs7signed_test()) != 0) + err_sys("PKCS7signed test failed!\n", ret); + else + printf( "PKCS7signed test passed!\n"); +#endif + ((func_args*)args)->return_code = ret; } @@ -485,7 +517,7 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) func_args args; - + #ifdef HAVE_CAVIUM int ret = OpenNitroxDevice(CAVIUM_DIRECT, CAVIUM_DEV_ID); if (ret != 0) @@ -500,7 +532,7 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) #ifdef HAVE_CAVIUM CspShutdown(CAVIUM_DEV_ID); #endif - + return args.return_code; } @@ -581,7 +613,7 @@ int md2_test() return 0; } -#endif +#endif #ifndef NO_MD5 int md5_test(void) @@ -609,21 +641,21 @@ int md5_test(void) c.output = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1" "\x3b"; c.inLen = strlen(c.input); - c.outLen = MD5_DIGEST_SIZE; + c.outLen = MD5_DIGEST_SIZE; d.input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345" "6789"; d.output = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d" "\x9f"; d.inLen = strlen(d.input); - d.outLen = MD5_DIGEST_SIZE; + d.outLen = MD5_DIGEST_SIZE; e.input = "1234567890123456789012345678901234567890123456789012345678" "9012345678901234567890"; e.output = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6" "\x7a"; e.inLen = strlen(e.input); - e.outLen = MD5_DIGEST_SIZE; + e.outLen = MD5_DIGEST_SIZE; test_md5[0] = a; test_md5[1] = b; @@ -658,45 +690,45 @@ int md4_test(void) int times = sizeof(test_md4) / sizeof(testVector), i; a.input = ""; - a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" + a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" "\xc0"; a.inLen = strlen(a.input); a.outLen = MD4_DIGEST_SIZE; b.input = "a"; - b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" + b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" "\x24"; b.inLen = strlen(b.input); - b.outLen = MD4_DIGEST_SIZE; + b.outLen = MD4_DIGEST_SIZE; c.input = "abc"; - c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" + c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" "\x9d"; c.inLen = strlen(c.input); c.outLen = MD4_DIGEST_SIZE; d.input = "message digest"; - d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" + d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" "\x4b"; d.inLen = strlen(d.input); d.outLen = MD4_DIGEST_SIZE; e.input = "abcdefghijklmnopqrstuvwxyz"; - e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" + e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" "\xa9"; e.inLen = strlen(e.input); e.outLen = MD4_DIGEST_SIZE; f.input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345" "6789"; - f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" + f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" "\xe4"; f.inLen = strlen(f.input); f.outLen = MD4_DIGEST_SIZE; g.input = "1234567890123456789012345678901234567890123456789012345678" "9012345678901234567890"; - g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" + g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" "\x36"; g.inLen = strlen(g.input); g.outLen = MD4_DIGEST_SIZE; @@ -733,6 +765,7 @@ int sha_test(void) testVector a, b, c, d; testVector test_sha[4]; + int ret; int times = sizeof(test_sha) / sizeof(struct testVector), i; a.input = "abc"; @@ -752,7 +785,7 @@ int sha_test(void) c.output = "\x00\x98\xBA\x82\x4B\x5C\x16\x42\x7B\xD7\xA1\x12\x2A\x5A\x44" "\x2A\x25\xEC\x64\x4D"; c.inLen = strlen(c.input); - c.outLen = SHA_DIGEST_SIZE; + c.outLen = SHA_DIGEST_SIZE; d.input = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -767,7 +800,9 @@ int sha_test(void) test_sha[2] = c; test_sha[3] = d; - InitSha(&sha); + ret = InitSha(&sha); + if (ret != 0) + return -4001; for (i = 0; i < times; ++i) { ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen); @@ -804,7 +839,7 @@ int ripemd_test(void) b.inLen = strlen(b.input); b.outLen = RIPEMD_DIGEST_SIZE; - c.input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; + c.input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; c.output = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05\xa0\x6c\x27\xdc" "\xf4\x9a\xda\x62\xeb\x2b"; c.inLen = strlen(c.input); @@ -813,7 +848,7 @@ int ripemd_test(void) d.input = "12345678901234567890123456789012345678901234567890123456" "789012345678901234567890"; d.output = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb\xd3\x32\x3c\xab" - "\x82\xbf\x63\x32\x6b\xfb"; + "\x82\xbf\x63\x32\x6b\xfb"; d.inLen = strlen(d.input); d.outLen = RIPEMD_DIGEST_SIZE; @@ -912,6 +947,7 @@ int sha256_test(void) testVector a, b; testVector test_sha[2]; + int ret; int times = sizeof(test_sha) / sizeof(struct testVector), i; a.input = "abc"; @@ -931,7 +967,9 @@ int sha256_test(void) test_sha[0] = a; test_sha[1] = b; - InitSha256(&sha); + ret = InitSha256(&sha); + if (ret != 0) + return -4003; for (i = 0; i < times; ++i) { Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -951,6 +989,7 @@ int sha512_test(void) { Sha512 sha; byte hash[SHA512_DIGEST_SIZE]; + int ret; testVector a, b; testVector test_sha[2]; @@ -971,14 +1010,16 @@ int sha512_test(void) "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88" "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4" "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b" - "\x87\x4b\xe9\x09"; + "\x87\x4b\xe9\x09"; b.inLen = strlen(b.input); b.outLen = SHA512_DIGEST_SIZE; test_sha[0] = a; test_sha[1] = b; - InitSha512(&sha); + ret = InitSha512(&sha); + if (ret != 0) + return -4009; for (i = 0; i < times; ++i) { Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -998,6 +1039,7 @@ int sha384_test(void) { Sha384 sha; byte hash[SHA384_DIGEST_SIZE]; + int ret; testVector a, b; testVector test_sha[2]; @@ -1018,12 +1060,14 @@ int sha384_test(void) "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91" "\x74\x60\x39"; b.inLen = strlen(b.input); - b.outLen = SHA384_DIGEST_SIZE; + b.outLen = SHA384_DIGEST_SIZE; test_sha[0] = a; test_sha[1] = b; - InitSha384(&sha); + ret = InitSha384(&sha); + if (ret != 0) + return -4010; for (i = 0; i < times; ++i) { Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -1054,6 +1098,7 @@ int hmac_md5_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1086,9 +1131,11 @@ int hmac_md5_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20009; + return -20009; #endif - HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i])); + if (ret != 0) + return -4011; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1122,6 +1169,7 @@ int hmac_sha_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1154,9 +1202,11 @@ int hmac_sha_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20010; + return -20010; #endif - HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i])); + if (ret != 0) + return -4012; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1191,6 +1241,7 @@ int hmac_sha256_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1226,9 +1277,11 @@ int hmac_sha256_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20011; + return -20011; #endif - HmacSetKey(&hmac, SHA256, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA256, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4013; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1263,6 +1316,7 @@ int hmac_blake2b_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1298,9 +1352,12 @@ int hmac_blake2b_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20011; + return -20011; #endif - HmacSetKey(&hmac, BLAKE2B_ID, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, BLAKE2B_ID, (byte*)keys[i], + (word32)strlen(keys[i])); + if (ret != 0) + return -4014; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1335,6 +1392,7 @@ int hmac_sha384_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1369,7 +1427,9 @@ int hmac_sha384_test(void) test_hmac[2] = c; for (i = 0; i < times; ++i) { - HmacSetKey(&hmac, SHA384, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA384, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4015; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1401,6 +1461,7 @@ int hmac_sha512_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1438,7 +1499,9 @@ int hmac_sha512_test(void) test_hmac[2] = c; for (i = 0; i < times; ++i) { - HmacSetKey(&hmac, SHA512, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA512, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4016; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1458,8 +1521,8 @@ int arc4_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x01\x23\x45\x67\x89\xab\xcd\xef", "\x01\x23\x45\x67\x89\xab\xcd\xef", "\x00\x00\x00\x00\x00\x00\x00\x00", @@ -1505,9 +1568,9 @@ int arc4_test(void) #ifdef HAVE_CAVIUM if (Arc4InitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20001; + return -20001; if (Arc4InitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20002; + return -20002; #endif Arc4SetKey(&enc, (byte*)keys[i], keylen); @@ -1540,8 +1603,8 @@ int hc128_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD", @@ -1592,8 +1655,8 @@ int hc128_test(void) HC128 dec; /* align keys/ivs in plain/cipher buffers */ - memcpy(plain, keys[i], 16); - memcpy(cipher, ivs[i], 16); + memcpy(plain, keys[i], 16); + memcpy(cipher, ivs[i], 16); Hc128_SetKey(&enc, plain, cipher); Hc128_SetKey(&dec, plain, cipher); @@ -1621,8 +1684,8 @@ int rabbit_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\xAC\xC3\x51\xDC\xF1\x62\xFC\x3B\xFE\x36\x3D\x2E\x29\x13\x28\x91" @@ -1706,34 +1769,40 @@ int des_test(void) Des enc; Des dec; - const byte key[] = + const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - const byte iv[] = + const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; - const byte verify[] = + const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, 0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b }; + int ret; + + ret = Des_SetKey(&enc, key, iv, DES_ENCRYPTION); + if (ret != 0) + return -31; - Des_SetKey(&enc, key, iv, DES_ENCRYPTION); Des_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); - Des_SetKey(&dec, key, iv, DES_DECRYPTION); + ret = Des_SetKey(&dec, key, iv, DES_DECRYPTION); + if (ret != 0) + return -32; Des_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); if (memcmp(plain, vector, sizeof(plain))) - return -31; + return -33; if (memcmp(cipher, verify, sizeof(cipher))) - return -32; + return -34; return 0; } @@ -1755,44 +1824,54 @@ int des3_test(void) Des3 enc; Des3 dec; - const byte key3[] = + const byte key3[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 }; - const byte iv3[] = + const byte iv3[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81 - + }; - const byte verify3[] = + const byte verify3[] = { 0x43,0xa0,0x29,0x7e,0xd1,0x84,0xf8,0x0e, 0x89,0x64,0x84,0x32,0x12,0xd5,0x08,0x98, 0x18,0x94,0x15,0x74,0x87,0x12,0x7d,0xb0 }; + int ret; + #ifdef HAVE_CAVIUM if (Des3_InitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20005; + return -20005; if (Des3_InitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20006; + return -20006; #endif - Des3_SetKey(&enc, key3, iv3, DES_ENCRYPTION); - Des3_SetKey(&dec, key3, iv3, DES_DECRYPTION); - Des3_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); - Des3_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); + ret = Des3_SetKey(&enc, key3, iv3, DES_ENCRYPTION); + if (ret != 0) + return -31; + ret = Des3_SetKey(&dec, key3, iv3, DES_DECRYPTION); + if (ret != 0) + return -32; + ret = Des3_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); + if (ret != 0) + return -33; + ret = Des3_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); + if (ret != 0) + return -34; if (memcmp(plain, vector, sizeof(plain))) - return -33; + return -35; if (memcmp(cipher, verify3, sizeof(cipher))) - return -34; + return -36; #ifdef HAVE_CAVIUM Des3_FreeCavium(&enc); @@ -1815,7 +1894,7 @@ int aes_test(void) 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - const byte verify[] = + const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb @@ -1826,18 +1905,27 @@ int aes_test(void) byte cipher[AES_BLOCK_SIZE * 4]; byte plain [AES_BLOCK_SIZE * 4]; + int ret; #ifdef HAVE_CAVIUM if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20003; + return -20003; if (AesInitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20004; + return -20004; #endif - AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); - AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + ret = AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + if (ret != 0) + return -1001; + ret = AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + if (ret != 0) + return -1002; - AesCbcEncrypt(&enc, cipher, msg, AES_BLOCK_SIZE); - AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE); + ret = AesCbcEncrypt(&enc, cipher, msg, AES_BLOCK_SIZE); + if (ret != 0) + return -1005; + ret = AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE); + if (ret != 0) + return -1006; if (memcmp(plain, msg, AES_BLOCK_SIZE)) return -60; @@ -1851,7 +1939,7 @@ int aes_test(void) #endif #ifdef CYASSL_AES_COUNTER { - const byte ctrKey[] = + const byte ctrKey[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c @@ -1888,6 +1976,12 @@ int aes_test(void) 0x79,0x21,0x70,0xa0,0xf3,0x00,0x9c,0xee }; + const byte oddCipher[] = + { + 0xb9,0xd7,0xcb,0x08,0xb0,0xe1,0x7b,0xa0, + 0xc2 + }; + AesSetKeyDirect(&enc, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); /* Ctr only uses encrypt, even on key setup */ AesSetKeyDirect(&dec, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); @@ -1900,6 +1994,30 @@ int aes_test(void) if (memcmp(cipher, ctrCipher, AES_BLOCK_SIZE*4)) return -67; + + /* let's try with just 9 bytes, non block size test */ + AesSetKeyDirect(&enc, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); + /* Ctr only uses encrypt, even on key setup */ + AesSetKeyDirect(&dec, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); + + AesCtrEncrypt(&enc, cipher, ctrPlain, 9); + AesCtrEncrypt(&dec, plain, cipher, 9); + + if (memcmp(plain, ctrPlain, 9)) + return -68; + + if (memcmp(cipher, ctrCipher, 9)) + return -69; + + /* and an additional 9 bytes to reuse tmp left buffer */ + AesCtrEncrypt(&enc, cipher, ctrPlain, 9); + AesCtrEncrypt(&dec, plain, cipher, 9); + + if (memcmp(plain, ctrPlain, 9)) + return -70; + + if (memcmp(cipher, oddCipher, 9)) + return -71; } #endif /* CYASSL_AES_COUNTER */ @@ -1914,7 +2032,7 @@ int aes_test(void) const byte niCipher[] = { 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, - 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 + 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 }; const byte niKey[] = @@ -1922,17 +2040,21 @@ int aes_test(void) 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, 0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7, - 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 + 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 }; XMEMSET(cipher, 0, AES_BLOCK_SIZE); - AesSetKey(&enc, niKey, sizeof(niKey), cipher, AES_ENCRYPTION); + ret = AesSetKey(&enc, niKey, sizeof(niKey), cipher, AES_ENCRYPTION); + if (ret != 0) + return -1003; AesEncryptDirect(&enc, cipher, niPlain); if (XMEMCMP(cipher, niCipher, AES_BLOCK_SIZE) != 0) return -20006; XMEMSET(plain, 0, AES_BLOCK_SIZE); - AesSetKey(&dec, niKey, sizeof(niKey), plain, AES_DECRYPTION); + ret = AesSetKey(&dec, niKey, sizeof(niKey), plain, AES_DECRYPTION); + if (ret != 0) + return -1004; AesDecryptDirect(&dec, plain, niCipher); if (XMEMCMP(plain, niPlain, AES_BLOCK_SIZE) != 0) return -20007; @@ -1965,7 +2087,7 @@ int aesgcm_test(void) 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 }; - + const byte p[] = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, @@ -1977,14 +2099,14 @@ int aesgcm_test(void) 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39 }; - + const byte a[] = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2 }; - + const byte c[] = { 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, @@ -2163,7 +2285,7 @@ int aesccm_test(void) const byte t[] = { - 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 + 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 }; byte t2[sizeof(t)]; @@ -2232,7 +2354,7 @@ typedef struct { int camellia_test(void) { /* Camellia ECB Test Plaintext */ - static const byte pte[] = + static const byte pte[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 @@ -2284,26 +2406,26 @@ int camellia_test(void) static const byte ptc[] = { 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, - 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A + 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A }; /* Camellia CBC Test Initialization Vector */ static const byte ivc[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; /* Test 4: Camellia-CBC 128-bit key */ static const byte k4[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; static const byte c4[] = { 0x16, 0x07, 0xCF, 0x49, 0x4B, 0x36, 0xBB, 0xF0, - 0x0D, 0xAE, 0xB0, 0xB5, 0x03, 0xC8, 0x31, 0xAB + 0x0D, 0xAE, 0xB0, 0xB5, 0x03, 0xC8, 0x31, 0xAB }; /* Test 5: Camellia-CBC 192-bit key */ @@ -2311,12 +2433,12 @@ int camellia_test(void) { 0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52, 0xC8, 0x10, 0xF3, 0x2B, 0x80, 0x90, 0x79, 0xE5, - 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B + 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B }; static const byte c5[] = { 0x2A, 0x48, 0x30, 0xAB, 0x5A, 0xC4, 0xA1, 0xA2, - 0x40, 0x59, 0x55, 0xFD, 0x21, 0x95, 0xCF, 0x93 + 0x40, 0x59, 0x55, 0xFD, 0x21, 0x95, 0xCF, 0x93 }; /* Test 6: CBC 256-bit key */ @@ -2325,12 +2447,12 @@ int camellia_test(void) 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, - 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 + 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }; static const byte c6[] = { 0xE6, 0xCF, 0xA3, 0x5F, 0xC0, 0x2B, 0x13, 0x4A, - 0x4D, 0x2C, 0x0B, 0x67, 0x37, 0xAC, 0x3E, 0xDA + 0x4D, 0x2C, 0x0B, 0x67, 0x37, 0xAC, 0x3E, 0xDA }; byte out[CAMELLIA_BLOCK_SIZE]; @@ -2352,10 +2474,6 @@ int camellia_test(void) {CAM_CBC_DEC, ptc, ivc, c6, k6, sizeof(k6), -125} }; - if ((sizeof(pte) != CAMELLIA_BLOCK_SIZE) || - (sizeof(ptc) != CAMELLIA_BLOCK_SIZE)) - return -113; - testsSz = sizeof(testVectors)/sizeof(test_vector_t); for (i = 0; i < testsSz; i++) { CamelliaSetKey(&cam, testVectors[i].key, testVectors[i].keySz, @@ -2398,7 +2516,7 @@ int camellia_test(void) if (CamelliaSetIV(&cam, NULL) != 0 || XMEMCMP(cam.reg, ive, CAMELLIA_BLOCK_SIZE)) return -1; - + /* First parameter should never be null */ if (CamelliaSetIV(NULL, NULL) == 0) return -1; @@ -2478,17 +2596,27 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifdef CYASSL_CERT_GEN static const char* caKeyFile = "a:\\certs\\ca-key.der"; static const char* caCertFile = "a:\\certs\\ca-cert.pem"; + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "a:\\certs\\ecc-key.der"; + static const char* eccCaCertFile = "a:\\certs\\server-ecc.pem"; + #endif #endif #elif defined(CYASSL_MKD_SHELL) static char* clientKey = "certs/client-key.der"; static char* clientCert = "certs/client-cert.der"; - void set_clientKey(char *key) { clientKey = key ; } /* set by shell command */ - void set_clientCert(char *cert) { clientCert = cert ; } /* set by shell command */ + void set_clientKey(char *key) { clientKey = key ; } + void set_clientCert(char *cert) { clientCert = cert ; } #ifdef CYASSL_CERT_GEN static char* caKeyFile = "certs/ca-key.der"; static char* caCertFile = "certs/ca-cert.pem"; - void set_caKeyFile (char * key) { caKeyFile = key ; } /* set by shell command */ - void set_caCertFile(char * cert) { caCertFile = cert ; } /* set by shell command */ + void set_caKeyFile (char * key) { caKeyFile = key ; } + void set_caCertFile(char * cert) { caCertFile = cert ; } + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "certs/ecc-key.der"; + static const char* eccCaCertFile = "certs/server-ecc.pem"; + void set_eccCaKeyFile (char * key) { eccCaKeyFile = key ; } + void set_eccCaCertFile(char * cert) { eccCaCertFile = cert ; } + #endif #endif #else static const char* clientKey = "./certs/client-key.der"; @@ -2496,6 +2624,10 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifdef CYASSL_CERT_GEN static const char* caKeyFile = "./certs/ca-key.der"; static const char* caCertFile = "./certs/ca-cert.pem"; + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "./certs/ecc-key.der"; + static const char* eccCaCertFile = "./certs/server-ecc.pem"; + #endif #endif #endif #endif @@ -2543,11 +2675,12 @@ int rsa_test(void) bytes = fread(tmp, 1, FOURK_BUF, file); fclose(file); #endif /* USE_CERT_BUFFERS */ - + #ifdef HAVE_CAVIUM RsaInitCavium(&key, CAVIUM_DEV_ID); -#endif - InitRsaKey(&key, 0); +#endif + ret = InitRsaKey(&key, 0); + if (ret != 0) return -39; ret = RsaPrivateKeyDecode(tmp, &idx, &key, (word32)bytes); if (ret != 0) return -41; @@ -2592,7 +2725,7 @@ int rsa_test(void) #ifdef sizeof #undef sizeof -#endif +#endif #ifdef CYASSL_TEST_CERT InitDecodedCert(&cert, tmp, (word32)bytes, 0); @@ -2617,7 +2750,8 @@ int rsa_test(void) FILE* keyFile; FILE* pemFile; - InitRsaKey(&genKey, 0); + ret = InitRsaKey(&genKey, 0); + if (ret != 0) return -300; ret = MakeRsaKey(&genKey, 1024, 65537, &rng); if (ret != 0) return -301; @@ -2644,12 +2778,13 @@ int rsa_test(void) return -304; pemFile = fopen("./key.pem", "wb"); - if (!pemFile) + if (!pemFile) return -305; ret = (int)fwrite(pem, pemSz, 1, pemFile); fclose(pemFile); - InitRsaKey(&derIn, 0); + ret = InitRsaKey(&derIn, 0); + if (ret != 0) return -3060; idx = 0; ret = RsaPrivateKeyDecode(der, &idx, &derIn, derSz); if (ret != 0) @@ -2696,7 +2831,7 @@ int rsa_test(void) myCert.isCA = 1; myCert.sigType = CTC_SHA256wRSA; - certSz = MakeSelfCert(&myCert, derCert, FOURK_BUF, &key, &rng); + certSz = MakeSelfCert(&myCert, derCert, FOURK_BUF, &key, &rng); if (certSz < 0) return -401; @@ -2756,8 +2891,9 @@ int rsa_test(void) bytes3 = fread(tmp, 1, FOURK_BUF, file3); fclose(file3); - - InitRsaKey(&caKey, 0); + + ret = InitRsaKey(&caKey, 0); + if (ret != 0) return -411; ret = RsaPrivateKeyDecode(tmp, &idx3, &caKey, (word32)bytes3); if (ret != 0) return -413; @@ -2775,12 +2911,12 @@ int rsa_test(void) if (ret < 0) return -405; - certSz = MakeCert(&myCert, derCert, FOURK_BUF, &key, &rng); + certSz = MakeCert(&myCert, derCert, FOURK_BUF, &key, NULL, &rng); if (certSz < 0) return -407; certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, - &caKey, &rng); + &caKey, NULL, &rng); if (certSz < 0) return -408; @@ -2812,6 +2948,95 @@ int rsa_test(void) free(derCert); FreeRsaKey(&caKey); } +#ifdef HAVE_ECC + /* ECC CA style */ + { + ecc_key caKey; + Cert myCert; + byte* derCert; + byte* pem; + FILE* derFile; + FILE* pemFile; + int certSz; + int pemSz; + size_t bytes3; + word32 idx3 = 0; + FILE* file3 ; +#ifdef CYASSL_TEST_CERT + DecodedCert decode; +#endif + + derCert = (byte*)malloc(FOURK_BUF); + if (derCert == NULL) + return -5311; + pem = (byte*)malloc(FOURK_BUF); + if (pem == NULL) + return -5312; + + file3 = fopen(eccCaKeyFile, "rb"); + + if (!file3) + return -5412; + + bytes3 = fread(tmp, 1, FOURK_BUF, file3); + fclose(file3); + + ecc_init(&caKey); + ret = EccPrivateKeyDecode(tmp, &idx3, &caKey, (word32)bytes3); + if (ret != 0) return -5413; + + InitCert(&myCert); + myCert.sigType = CTC_SHA256wECDSA; + + strncpy(myCert.subject.country, "US", CTC_NAME_SIZE); + strncpy(myCert.subject.state, "OR", CTC_NAME_SIZE); + strncpy(myCert.subject.locality, "Portland", CTC_NAME_SIZE); + strncpy(myCert.subject.org, "wolfSSL", CTC_NAME_SIZE); + strncpy(myCert.subject.unit, "Development", CTC_NAME_SIZE); + strncpy(myCert.subject.commonName, "www.wolfssl.com", CTC_NAME_SIZE); + strncpy(myCert.subject.email, "info@wolfssl.com", CTC_NAME_SIZE); + + ret = SetIssuer(&myCert, eccCaCertFile); + if (ret < 0) + return -5405; + + certSz = MakeCert(&myCert, derCert, FOURK_BUF, NULL, &caKey, &rng); + if (certSz < 0) + return -5407; + + certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, + NULL, &caKey, &rng); + if (certSz < 0) + return -5408; + +#ifdef CYASSL_TEST_CERT + InitDecodedCert(&decode, derCert, certSz, 0); + ret = ParseCert(&decode, CERT_TYPE, NO_VERIFY, 0); + if (ret != 0) + return -5409; + FreeDecodedCert(&decode); +#endif + + derFile = fopen("./certecc.der", "wb"); + if (!derFile) + return -5410; + ret = (int)fwrite(derCert, certSz, 1, derFile); + fclose(derFile); + + pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE); + if (pemSz < 0) + return -5411; + + pemFile = fopen("./certecc.pem", "wb"); + if (!pemFile) + return -5412; + ret = (int)fwrite(pem, pemSz, 1, pemFile); + fclose(pemFile); + free(pem); + free(derCert); + ecc_free(&caKey); + } +#endif /* HAVE_ECC */ #ifdef HAVE_NTRU { RsaKey caKey; @@ -2868,8 +3093,9 @@ int rsa_test(void) bytes = fread(tmp, 1, FOURK_BUF, caFile); fclose(caFile); - - InitRsaKey(&caKey, 0); + + ret = InitRsaKey(&caKey, 0); + if (ret != 0) return -459; ret = RsaPrivateKeyDecode(tmp, &idx, &caKey, (word32)bytes); if (ret != 0) return -454; @@ -2888,12 +3114,12 @@ int rsa_test(void) return -455; certSz = MakeNtruCert(&myCert, derCert, FOURK_BUF, public_key, - public_key_len, &rng); + public_key_len, &rng); if (certSz < 0) return -456; certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, - &caKey, &rng); + &caKey, NULL, &rng); if (certSz < 0) return -457; @@ -2931,12 +3157,72 @@ int rsa_test(void) FreeRsaKey(&caKey); } #endif /* HAVE_NTRU */ +#ifdef CYASSL_CERT_REQ + { + Cert req; + byte* der; + byte* pem; + int derSz; + int pemSz; + FILE* reqFile; + + der = (byte*)malloc(FOURK_BUF); + if (der == NULL) + return -463; + pem = (byte*)malloc(FOURK_BUF); + if (pem == NULL) + return -464; + + InitCert(&req); + + req.version = 0; + req.isCA = 1; + strncpy(req.challengePw, "yassl123", CTC_NAME_SIZE); + strncpy(req.subject.country, "US", CTC_NAME_SIZE); + strncpy(req.subject.state, "OR", CTC_NAME_SIZE); + strncpy(req.subject.locality, "Portland", CTC_NAME_SIZE); + strncpy(req.subject.org, "yaSSL", CTC_NAME_SIZE); + strncpy(req.subject.unit, "Development", CTC_NAME_SIZE); + strncpy(req.subject.commonName, "www.yassl.com", CTC_NAME_SIZE); + strncpy(req.subject.email, "info@yassl.com", CTC_NAME_SIZE); + req.sigType = CTC_SHA256wRSA; + + derSz = MakeCertReq(&req, der, FOURK_BUF, &key, NULL); + if (derSz < 0) + return -465; + + derSz = SignCert(req.bodySz, req.sigType, der, FOURK_BUF, + &key, NULL, &rng); + if (derSz < 0) + return -466; + + pemSz = DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE); + if (pemSz < 0) + return -467; + + reqFile = fopen("./certreq.der", "wb"); + if (!reqFile) + return -468; + + ret = (int)fwrite(der, derSz, 1, reqFile); + fclose(reqFile); + + reqFile = fopen("./certreq.pem", "wb"); + if (!reqFile) + return -469; + ret = (int)fwrite(pem, pemSz, 1, reqFile); + fclose(reqFile); + + free(pem); + free(der); + } +#endif /* CYASSL_CERT_REQ */ #endif /* CYASSL_CERT_GEN */ FreeRsaKey(&key); #ifdef HAVE_CAVIUM RsaFreeCavium(&key); -#endif +#endif free(tmp); return 0; @@ -2970,8 +3256,8 @@ int dh_test(void) DhKey key; DhKey key2; RNG rng; - - + + #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dh_key_der_1024, sizeof_dh_key_der_1024); bytes = sizeof_dh_key_der_1024; @@ -2988,8 +3274,8 @@ int dh_test(void) fclose(file); #endif /* USE_CERT_BUFFERS */ - InitDhKey(&key); - InitDhKey(&key2); + InitDhKey(&key); + InitDhKey(&key2); ret = DhKeyDecode(tmp, &idx, &key, bytes); if (ret != 0) return -51; @@ -3002,7 +3288,7 @@ int dh_test(void) ret = InitRng(&rng); if (ret != 0) return -53; - + ret = DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz); ret += DhGenerateKeyPair(&key2, &rng, priv2, &privSz2, pub2, &pubSz2); if (ret != 0) @@ -3047,7 +3333,7 @@ int dsa_test(void) byte hash[SHA_DIGEST_SIZE]; byte signature[40]; - + #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dsa_key_der_1024, sizeof_dsa_key_der_1024); bytes = sizeof_dsa_key_der_1024; @@ -3063,8 +3349,10 @@ int dsa_test(void) bytes = (word32) fread(tmp, 1, sizeof(tmp), file); fclose(file); #endif /* USE_CERT_BUFFERS */ - - InitSha(&sha); + + ret = InitSha(&sha); + if (ret != 0) + return -4002; ShaUpdate(&sha, tmp, bytes); ShaFinal(&sha, hash); @@ -3081,9 +3369,9 @@ int dsa_test(void) ret = DsaVerify(hash, signature, &key, &answer); if (ret != 0) return -64; if (answer != 1) return -65; - + FreeDsaKey(&key); - + return 0; } @@ -3158,7 +3446,7 @@ int openssl_test(void) e.output = "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b" "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0" "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91" - "\x74\x60\x39"; + "\x74\x60\x39"; e.inLen = strlen(e.input); e.outLen = SHA384_DIGEST_SIZE; @@ -3182,9 +3470,9 @@ int openssl_test(void) "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88" "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4" "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b" - "\x87\x4b\xe9\x09"; + "\x87\x4b\xe9\x09"; f.inLen = strlen(f.input); - f.outLen = SHA512_DIGEST_SIZE; + f.outLen = SHA512_DIGEST_SIZE; EVP_MD_CTX_init(&md_ctx); EVP_DigestInit(&md_ctx, EVP_sha512()); @@ -3200,7 +3488,7 @@ int openssl_test(void) if (RAND_bytes(hash, sizeof(hash)) != 1) return -73; - + c.input = "what do ya want for nothing?"; c.output = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7" "\x38"; @@ -3222,19 +3510,19 @@ int openssl_test(void) byte plain[24]; byte cipher[24]; - const_DES_cblock key = + const_DES_cblock key = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - DES_cblock iv = + DES_cblock iv = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; DES_key_schedule sched; - const byte verify[] = + const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, @@ -3271,7 +3559,7 @@ int openssl_test(void) 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - const byte verify[] = + const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb @@ -3317,11 +3605,11 @@ int openssl_test(void) int pkcs12_test(void) { const byte passwd[] = { 0x00, 0x73, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x67, - 0x00, 0x00 }; + 0x00, 0x00 }; const byte salt[] = { 0x0a, 0x58, 0xCF, 0x64, 0x53, 0x0d, 0x82, 0x3f }; const byte passwd2[] = { 0x00, 0x71, 0x00, 0x75, 0x00, 0x65, 0x00, 0x65, - 0x00, 0x67, 0x00, 0x00 }; + 0x00, 0x67, 0x00, 0x00 }; const byte salt2[] = { 0x16, 0x82, 0xC0, 0xfC, 0x5b, 0x3f, 0x7e, 0xc5 }; byte derived[64]; @@ -3350,7 +3638,7 @@ int pkcs12_test(void) return -104; iterations = 1000; - ret = PKCS12_PBKDF(derived, passwd2, sizeof(passwd2), salt2, 8, iterations, + ret = PKCS12_PBKDF(derived, passwd2, sizeof(passwd2), salt2, 8, iterations, kLen, SHA, id); if (ret < 0) return -105; @@ -3470,7 +3758,7 @@ int hkdf_test(void) if (memcmp(okm1, res1, L) != 0) return -2002; - + ret = HKDF(SHA, ikm1, 11, salt1, 13, info1, 10, okm1, L); if (ret != 0) return -2003; @@ -3531,10 +3819,10 @@ int ecc_test(void) x = sizeof(sharedA); ret = ecc_shared_secret(&userA, &userB, sharedA, &x); - + y = sizeof(sharedB); ret = ecc_shared_secret(&userB, &userA, sharedB, &y); - + if (ret != 0) return -1003; @@ -3551,12 +3839,12 @@ int ecc_test(void) ret = ecc_import_x963(exportBuf, x, &pubKey); - if (ret != 0) + if (ret != 0) return -1007; y = sizeof(sharedB); ret = ecc_shared_secret(&userB, &pubKey, sharedB, &y); - + if (ret != 0) return -1008; @@ -3565,11 +3853,11 @@ int ecc_test(void) /* test DSA sign hash */ for (i = 0; i < (int)sizeof(digest); i++) - digest[i] = i; + digest[i] = (byte)i; x = sizeof(sig); ret = ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA); - + verify = 0; ret = ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &userA); @@ -3591,6 +3879,134 @@ int ecc_test(void) return 0; } +#ifdef HAVE_ECC_ENCRYPT + +int ecc_encrypt_test(void) +{ + RNG rng; + int ret; + ecc_key userA, userB; + byte msg[48]; + byte plain[48]; + byte out[80]; + word32 outSz = sizeof(out); + word32 plainSz = sizeof(plain); + int i; + + ret = InitRng(&rng); + if (ret != 0) + return -3001; + + ecc_init(&userA); + ecc_init(&userB); + + ret = ecc_make_key(&rng, 32, &userA); + ret += ecc_make_key(&rng, 32, &userB); + + if (ret != 0) + return -3002; + + for (i = 0; i < 48; i++) + msg[i] = i; + + /* encrypt msg to B */ + ret = ecc_encrypt(&userA, &userB, msg, sizeof(msg), out, &outSz, NULL); + if (ret != 0) + return -3003; + + /* decrypt msg from A */ + ret = ecc_decrypt(&userB, &userA, out, outSz, plain, &plainSz, NULL); + if (ret != 0) + return -3004; + + if (memcmp(plain, msg, sizeof(msg)) != 0) + return -3005; + + + { /* let's verify message exchange works, A is client, B is server */ + ecEncCtx* cliCtx = ecc_ctx_new(REQ_RESP_CLIENT, &rng); + ecEncCtx* srvCtx = ecc_ctx_new(REQ_RESP_SERVER, &rng); + + byte cliSalt[EXCHANGE_SALT_SZ]; + byte srvSalt[EXCHANGE_SALT_SZ]; + const byte* tmpSalt; + + if (cliCtx == NULL || srvCtx == NULL) + return -3006; + + /* get salt to send to peer */ + tmpSalt = ecc_ctx_get_own_salt(cliCtx); + if (tmpSalt == NULL) + return -3007; + memcpy(cliSalt, tmpSalt, EXCHANGE_SALT_SZ); + + tmpSalt = ecc_ctx_get_own_salt(srvCtx); + if (tmpSalt == NULL) + return -3007; + memcpy(srvSalt, tmpSalt, EXCHANGE_SALT_SZ); + + /* in actual use, we'd get the peer's salt over the transport */ + ret = ecc_ctx_set_peer_salt(cliCtx, srvSalt); + ret += ecc_ctx_set_peer_salt(srvCtx, cliSalt); + + if (ret != 0) + return -3008; + + /* get encrypted msg (request) to send to B */ + outSz = sizeof(out); + ret = ecc_encrypt(&userA, &userB, msg, sizeof(msg), out, &outSz,cliCtx); + if (ret != 0) + return -3009; + + /* B decrypts msg (request) from A */ + plainSz = sizeof(plain); + ret = ecc_decrypt(&userB, &userA, out, outSz, plain, &plainSz, srvCtx); + if (ret != 0) + return -3010; + + if (memcmp(plain, msg, sizeof(msg)) != 0) + return -3011; + + { + /* msg2 (response) from B to A */ + byte msg2[48]; + byte plain2[48]; + byte out2[80]; + word32 outSz2 = sizeof(out2); + word32 plainSz2 = sizeof(plain2); + + for (i = 0; i < 48; i++) + msg2[i] = i+48; + + /* get encrypted msg (response) to send to B */ + ret = ecc_encrypt(&userB, &userA, msg2, sizeof(msg2), out2, + &outSz2, srvCtx); + if (ret != 0) + return -3012; + + /* A decrypts msg (response) from B */ + ret = ecc_decrypt(&userA, &userB, out2, outSz2, plain2, &plainSz2, + cliCtx); + if (ret != 0) + return -3013; + + if (memcmp(plain2, msg2, sizeof(msg2)) != 0) + return -3014; + } + + /* cleanup */ + ecc_ctx_free(srvCtx); + ecc_ctx_free(cliCtx); + } + + /* cleanup */ + ecc_free(&userB); + ecc_free(&userA); + + return 0; +} + +#endif /* HAVE_ECC_ENCRYPT */ #endif /* HAVE_ECC */ #ifdef HAVE_LIBZ @@ -3700,7 +4116,7 @@ int compress_test(void) if (ret == 0 && memcmp(d, sample_text, dSz)) ret = -303; - + if (c) free(c); if (d) free(d); @@ -3709,4 +4125,271 @@ int compress_test(void) #endif /* HAVE_LIBZ */ +#ifdef HAVE_PKCS7 + +int pkcs7enveloped_test(void) +{ + int ret = 0; + + int cipher = DES3b; + int envelopedSz, decodedSz; + PKCS7 pkcs7; + byte* cert; + byte* privKey; + byte enveloped[2048]; + byte decoded[2048]; + + size_t certSz; + size_t privKeySz; + FILE* certFile; + FILE* keyFile; + FILE* pkcs7File; + const char* pkcs7OutFile = "pkcs7envelopedData.der"; + + const byte data[] = { /* Hello World */ + 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, + 0x72,0x6c,0x64 + }; + + /* read client cert and key in DER format */ + cert = (byte*)malloc(FOURK_BUF); + if (cert == NULL) + return -201; + + privKey = (byte*)malloc(FOURK_BUF); + if (privKey == NULL) + return -202; + + certFile = fopen(clientCert, "rb"); + if (!certFile) + err_sys("can't open ./certs/client-cert.der, " + "Please run from CyaSSL home dir", -42); + + certSz = fread(cert, 1, FOURK_BUF, certFile); + fclose(certFile); + + keyFile = fopen(clientKey, "rb"); + if (!keyFile) + err_sys("can't open ./certs/client-key.der, " + "Please run from CyaSSL home dir", -43); + + privKeySz = fread(privKey, 1, FOURK_BUF, keyFile); + fclose(keyFile); + + PKCS7_InitWithCert(&pkcs7, cert, (word32)certSz); + pkcs7.content = (byte*)data; + pkcs7.contentSz = (word32)sizeof(data); + pkcs7.contentOID = DATA; + pkcs7.encryptOID = cipher; + pkcs7.privateKey = privKey; + pkcs7.privateKeySz = (word32)privKeySz; + + /* encode envelopedData */ + envelopedSz = PKCS7_EncodeEnvelopedData(&pkcs7, enveloped, + sizeof(enveloped)); + if (envelopedSz <= 0) + return -203; + + /* decode envelopedData */ + decodedSz = PKCS7_DecodeEnvelopedData(&pkcs7, enveloped, envelopedSz, + decoded, sizeof(decoded)); + if (decodedSz <= 0) + return -204; + + /* test decode result */ + if (memcmp(decoded, data, sizeof(data)) != 0) { + return -205; + } + + /* output pkcs7 envelopedData for external testing */ + pkcs7File = fopen(pkcs7OutFile, "wb"); + if (!pkcs7File) + return -206; + + ret = (int)fwrite(enveloped, envelopedSz, 1, pkcs7File); + fclose(pkcs7File); + + free(cert); + free(privKey); + PKCS7_Free(&pkcs7); + + if (ret > 0) + return 0; + + return ret; +} + +int pkcs7signed_test(void) +{ + int ret = 0; + + FILE* file; + byte* certDer; + byte* keyDer; + byte* out; + char data[] = "Hello World"; + word32 dataSz, outSz, certDerSz, keyDerSz; + PKCS7 msg; + RNG rng; + + byte transIdOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x07 }; + byte messageTypeOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x02 }; + byte senderNonceOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x05 }; + byte transId[(SHA_DIGEST_SIZE + 1) * 2 + 1]; + byte messageType[] = { 0x13, 2, '1', '9' }; + byte senderNonce[PKCS7_NONCE_SZ + 2]; + + PKCS7Attrib attribs[] = + { + { transIdOid, sizeof(transIdOid), + transId, sizeof(transId) - 1 }, /* take off the null */ + { messageTypeOid, sizeof(messageTypeOid), + messageType, sizeof(messageType) }, + { senderNonceOid, sizeof(senderNonceOid), + senderNonce, sizeof(senderNonce) } + }; + + dataSz = (word32) strlen(data); + outSz = FOURK_BUF; + + certDer = (byte*)malloc(FOURK_BUF); + keyDer = (byte*)malloc(FOURK_BUF); + out = (byte*)malloc(FOURK_BUF); + + if (certDer == NULL) + return -207; + if (keyDer == NULL) + return -208; + if (out == NULL) + return -209; + + /* read in DER cert of recipient, into cert of size certSz */ + file = fopen(clientCert, "rb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + err_sys("can't open ./certs/client-cert.der, " + "Please run from CyaSSL home dir", -44); + } + certDerSz = (word32)fread(certDer, 1, FOURK_BUF, file); + fclose(file); + + file = fopen(clientKey, "rb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + err_sys("can't open ./certs/client-key.der, " + "Please run from CyaSSL home dir", -45); + } + keyDerSz = (word32)fread(keyDer, 1, FOURK_BUF, file); + fclose(file); + + ret = InitRng(&rng); + senderNonce[0] = 0x04; + senderNonce[1] = PKCS7_NONCE_SZ; + RNG_GenerateBlock(&rng, &senderNonce[2], PKCS7_NONCE_SZ); + + PKCS7_InitWithCert(&msg, certDer, certDerSz); + msg.privateKey = keyDer; + msg.privateKeySz = keyDerSz; + msg.content = (byte*)data; + msg.contentSz = dataSz; + msg.hashOID = SHAh; + msg.encryptOID = RSAk; + msg.signedAttribs = attribs; + msg.signedAttribsSz = sizeof(attribs)/sizeof(PKCS7Attrib); + msg.rng = &rng; + { + Sha sha; + byte digest[SHA_DIGEST_SIZE]; + int i,j; + + transId[0] = 0x13; + transId[1] = SHA_DIGEST_SIZE * 2; + + ret = InitSha(&sha); + if (ret != 0) + return -4003; + ShaUpdate(&sha, msg.publicKey, msg.publicKeySz); + ShaFinal(&sha, digest); + + for (i = 0, j = 2; i < SHA_DIGEST_SIZE; i++, j += 2) { + snprintf((char*)&transId[j], 3, "%02x", digest[i]); + } + } + ret = PKCS7_EncodeSignedData(&msg, out, outSz); + if (ret < 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -210; + } + else + outSz = ret; + + /* write PKCS#7 to output file for more testing */ + file = fopen("./pkcs7signedData.der", "wb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -211; + } + ret = (int)fwrite(out, 1, outSz, file); + fclose(file); + + PKCS7_Free(&msg); + PKCS7_InitWithCert(&msg, NULL, 0); + + ret = PKCS7_VerifySignedData(&msg, out, outSz); + if (ret < 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -212; + } + + if (msg.singleCert == NULL || msg.singleCertSz == 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -213; + } + + file = fopen("./pkcs7cert.der", "wb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -214; + } + ret = (int)fwrite(msg.singleCert, 1, msg.singleCertSz, file); + fclose(file); + + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + + if (ret > 0) + return 0; + + return ret; +} + +#endif /* HAVE_PKCS7 */ + #endif /* NO_CRYPT_TEST */ diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/Abstract.txt b/IDE/MDK5-ARM/Projects/CyaSSL-Full/Abstract.txt index b541cb662..dde67ce4f 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/Abstract.txt @@ -1,13 +1,12 @@ This program gives wolfCrypt and CyaSSL library demo. In order to run the demo, -Copy {PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. For demo configuration, refer config-Crypt.h and config-CyaSSL.h. After download and start the execution, you can type in commands through the Debug(printf) viewer. -time [-d date][-t time] Set/Get RTC: The time is used for certificate validation. test wolfCrypt Simple test suite benchmark wolfCrypt Simple benchmark server& simple server in background mode @@ -20,9 +19,6 @@ server/client -h help for server/client command === Typical Command Usage Scenario === Starting Shell ->time -d 9/23/2013 ->time -Date: 9/23/2013, Time: 00:38:31 >test MD5 test passed! MD4 test passed! diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvoptx b/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvoptx index 4084d9ab1..2a81e58da 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvoptx +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -221,54 +223,6 @@ 0 0 0 - 57 - 80 - 0 - .\main.c - main.c - 0 - 0 - - - 1 - 2 - 1 - 0 - 0 - 13 - 0 - 0 - 0 - 0 - .\shell.c - shell.c - 0 - 0 - - - 1 - 3 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - .\test.c - test.c - 0 - 0 - - - 1 - 4 - 1 - 0 - 0 - 0 - 0 0 0 0 @@ -279,14 +233,14 @@ 1 - 5 + 2 1 0 0 - 0 + 24 0 - 0 - 0 + 14 + 29 0 .\client.c client.c @@ -295,14 +249,14 @@ 1 - 6 + 3 1 0 0 - 2 + 10 0 - 0 - 0 + 162 + 165 0 .\echoclient.c echoclient.c @@ -311,7 +265,7 @@ 1 - 7 + 4 1 0 0 @@ -327,7 +281,7 @@ 1 - 8 + 5 1 0 0 @@ -343,7 +297,7 @@ 1 - 9 + 6 1 0 0 @@ -357,6 +311,54 @@ 0 0 + + 1 + 7 + 1 + 0 + 0 + 34 + 0 + 61 + 74 + 0 + .\test.c + test.c + 0 + 0 + + + 1 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\main.c + main.c + 0 + 0 + + + 1 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\shell.c + shell.c + 0 + 0 + @@ -397,6 +399,38 @@ 0 0 + + 2 + 12 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\RTE\wolfSSL\settings.h + settings.h + 0 + 0 + + + 2 + 13 + 5 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\RTE\Network\Net_Config_ETH_0.h + Net_Config_ETH_0.h + 0 + 0 + @@ -407,7 +441,7 @@ 0 3 - 12 + 14 5 0 0 @@ -424,30 +458,30 @@ - ::CMSIS - 0 + Devices + 1 0 0 - 1 + 0 4 - 13 - 4 + 15 + 1 0 0 0 0 - 0 - 0 + 44 + 90 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 + .\time-STM32F2xx.c + time-STM32F2xx.c + 0 0 4 - 14 + 16 1 0 0 @@ -456,11 +490,51 @@ 0 0 0 + .\time-dummy.c + time-dummy.c + 0 + 0 + + + + + ::CMSIS + 1 + 0 + 0 + 1 + + 5 + 17 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 0 RTE\CMSIS\RTX_Conf_CM.c RTX_Conf_CM.c 1 0 + + 5 + 18 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + @@ -470,8 +544,8 @@ 0 1 - 5 - 15 + 6 + 19 1 0 0 @@ -486,8 +560,8 @@ 0 - 5 - 16 + 6 + 20 1 0 0 @@ -502,8 +576,8 @@ 0 - 5 - 17 + 6 + 21 5 0 0 @@ -518,14 +592,14 @@ 0 - 5 - 18 + 6 + 22 2 0 0 0 0 - 163 + 168 169 0 RTE\Device\STM32F207IG\startup_stm32f2xx.s @@ -534,8 +608,8 @@ 0 - 5 - 19 + 6 + 23 1 0 0 @@ -558,24 +632,8 @@ 0 1 - 6 - 20 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - PHY_ST802RT1.c - 1 - 0 - - - 6 - 21 + 7 + 24 1 0 0 @@ -590,8 +648,8 @@ 0 - 6 - 22 + 7 + 25 1 0 0 @@ -605,6 +663,22 @@ 1 0 + + 7 + 26 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + PHY_ST802RT1.c + 1 + 0 + @@ -614,24 +688,8 @@ 0 1 - 7 - 23 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - - - 7 - 24 + 8 + 27 1 0 0 @@ -646,8 +704,8 @@ 0 - 7 - 25 + 8 + 28 5 0 0 @@ -661,17 +719,9 @@ 1 0 - - - - ::Network - 1 - 0 - 0 - 1 8 - 26 + 29 4 0 0 @@ -680,14 +730,22 @@ 0 0 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Dbg_CM3_L.lib + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib 1 0 + + + + ::Network + 0 + 0 + 0 + 1 - 8 - 27 + 9 + 30 1 0 0 @@ -702,8 +760,8 @@ 0 - 8 - 28 + 9 + 31 5 0 0 @@ -718,8 +776,8 @@ 0 - 8 - 29 + 9 + 32 5 0 0 @@ -734,8 +792,8 @@ 0 - 8 - 30 + 9 + 33 5 0 0 @@ -750,8 +808,8 @@ 0 - 8 - 31 + 9 + 34 5 0 0 @@ -766,8 +824,8 @@ 0 - 8 - 32 + 9 + 35 5 0 0 @@ -782,18 +840,34 @@ 0 - 8 - 33 + 9 + 36 1 0 0 0 0 + 81 + 125 + 0 + RTE\Network\Net_Debug.c + Net_Debug.c + 1 + 0 + + + 9 + 37 + 4 + 0 + 0 + 0 + 0 0 0 0 - RTE\Network\Net_Debug.c - Net_Debug.c + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + Net_Dbg_CM3_L.lib 1 0 @@ -801,13 +875,13 @@ ::wolfSSL - 1 + 0 0 0 1 - 9 - 34 + 10 + 38 5 0 0 @@ -822,8 +896,8 @@ 0 - 9 - 35 + 10 + 39 5 0 0 @@ -838,73 +912,9 @@ 0 - 9 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 9 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 9 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 9 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 9 + 10 40 - 1 + 5 0 0 0 @@ -912,13 +922,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asm.c - asm.c + RTE\wolfSSL\settings.h + settings.h 1 0 - 9 + 10 41 1 0 @@ -928,13 +938,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asn.c - asn.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c 1 0 - 9 + 10 42 1 0 @@ -944,13 +954,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\blake2b.c - blake2b.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + aes.c 1 0 - 9 + 10 43 1 0 @@ -960,13 +970,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\camellia.c - camellia.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + arc4.c 1 0 - 9 + 10 44 1 0 @@ -976,13 +986,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\coding.c - coding.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + asm.c 1 0 - 9 + 10 45 1 0 @@ -992,13 +1002,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\compress.c - compress.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + asn.c 1 0 - 9 + 10 46 1 0 @@ -1008,13 +1018,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\des3.c - des3.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + blake2b.c 1 0 - 9 + 10 47 1 0 @@ -1024,13 +1034,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dh.c - dh.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + camellia.c 1 0 - 9 + 10 48 1 0 @@ -1040,13 +1050,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dsa.c - dsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + coding.c 1 0 - 9 + 10 49 1 0 @@ -1056,13 +1066,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc.c - ecc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + compress.c 1 0 - 9 + 10 50 1 0 @@ -1072,13 +1082,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + des3.c 1 0 - 9 + 10 51 1 0 @@ -1088,13 +1098,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\error.c - error.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + dh.c 1 0 - 9 + 10 52 1 0 @@ -1104,13 +1114,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hc128.c - hc128.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + dsa.c 1 0 - 9 + 10 53 1 0 @@ -1120,13 +1130,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hmac.c - hmac.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + ecc.c 1 0 - 9 + 10 54 1 0 @@ -1136,13 +1146,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\integer.c - integer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c 1 0 - 9 + 10 55 1 0 @@ -1152,13 +1162,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\logging.c - logging.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + error.c 1 0 - 9 + 10 56 1 0 @@ -1168,13 +1178,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md2.c - md2.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + hc128.c 1 0 - 9 + 10 57 1 0 @@ -1184,13 +1194,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md4.c - md4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + hmac.c 1 0 - 9 + 10 58 1 0 @@ -1200,13 +1210,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md5.c - md5.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + integer.c 1 0 - 9 + 10 59 1 0 @@ -1216,13 +1226,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\memory.c - memory.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + logging.c 1 0 - 9 + 10 60 1 0 @@ -1232,13 +1242,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\misc.c - misc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + md2.c 1 0 - 9 + 10 61 1 0 @@ -1248,13 +1258,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\port.c - port.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + md4.c 1 0 - 9 + 10 62 1 0 @@ -1264,13 +1274,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + md5.c 1 0 - 9 + 10 63 1 0 @@ -1280,13 +1290,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rabbit.c - rabbit.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + memory.c 1 0 - 9 + 10 64 1 0 @@ -1296,13 +1306,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\random.c - random.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + misc.c 1 0 - 9 + 10 65 1 0 @@ -1312,13 +1322,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ripemd.c - ripemd.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + port.c 1 0 - 9 + 10 66 1 0 @@ -1328,13 +1338,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rsa.c - rsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c 1 0 - 9 + 10 67 1 0 @@ -1344,13 +1354,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha.c - sha.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + rabbit.c 1 0 - 9 + 10 68 1 0 @@ -1360,13 +1370,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha256.c - sha256.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + random.c 1 0 - 9 + 10 69 1 0 @@ -1376,13 +1386,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha512.c - sha512.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + ripemd.c 1 0 - 9 + 10 70 1 0 @@ -1392,13 +1402,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\tfm.c - tfm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + rsa.c 1 0 - 9 + 10 71 1 0 @@ -1408,13 +1418,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\crl.c - crl.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + sha.c 1 0 - 9 + 10 72 1 0 @@ -1424,13 +1434,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\internal.c - internal.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + sha256.c 1 0 - 9 + 10 73 1 0 @@ -1440,13 +1450,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\io.c - io.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + sha512.c 1 0 - 9 + 10 74 1 0 @@ -1456,13 +1466,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\keys.c - keys.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c + tfm.c 1 0 - 9 + 10 75 1 0 @@ -1472,13 +1482,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\ocsp.c - ocsp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\crl.c + crl.c 1 0 - 9 + 10 76 1 0 @@ -1488,13 +1498,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\sniffer.c - sniffer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\internal.c + internal.c 1 0 - 9 + 10 77 1 0 @@ -1504,13 +1514,13 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\ssl.c - ssl.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\io.c + io.c 1 0 - 9 + 10 78 1 0 @@ -1520,7 +1530,71 @@ 0 0 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\tls.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\keys.c + keys.c + 1 + 0 + + + 10 + 79 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ocsp.c + ocsp.c + 1 + 0 + + + 10 + 80 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\sniffer.c + sniffer.c + 1 + 0 + + + 10 + 81 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ssl.c + ssl.c + 1 + 0 + + + 10 + 82 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\tls.c tls.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvprojx b/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvprojx index 83d2df29f..892476880 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvprojx +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/CyaSSL-Full.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,6 +355,8 @@ 0 0 0 + 0 + 0 HAVE_CONFIG_H MDK_CONF_CYASSL @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -398,21 +404,6 @@ Source - - main.c - 1 - .\main.c - - - shell.c - 1 - .\shell.c - - - test.c - 1 - .\test.c - benchmark.c 1 @@ -443,6 +434,21 @@ 1 .\cert_data.c + + test.c + 1 + .\test.c + + + main.c + 1 + .\main.c + + + shell.c + 1 + .\shell.c + @@ -458,6 +464,16 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + settings.h + 5 + .\RTE\wolfSSL\settings.h + + + Net_Config_ETH_0.h + 5 + .\RTE\Network\Net_Config_ETH_0.h + @@ -471,18 +487,33 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-STM32F2xx.c + 1 + .\time-STM32F2xx.c + + time-dummy.c + 1 + .\time-dummy.c + + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -518,11 +549,6 @@ ::Drivers - - PHY_ST802RT1.c - 1 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - EMAC_STM32F2xx.c 1 @@ -533,16 +559,16 @@ 1 C:\Keil5\ARM\PACK\Keil\STM32F2xx_DFP\1.0.4\RTE_Driver\MCI_STM32F2xx.c + + PHY_ST802RT1.c + 1 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -553,16 +579,16 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::Network - - Net_Dbg_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Config.c 1 @@ -598,6 +624,11 @@ 1 RTE\Network\Net_Debug.c + + Net_Dbg_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + @@ -614,219 +645,219 @@ RTE\wolfSSL\config-CyaSSL.h - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c + settings.h + 5 + RTE\wolfSSL\settings.h - time-STM32F2xx.c + cyassl_MDK_ARM.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c aes.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\aes.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c arc4.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\arc4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c asm.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c asn.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\asn.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c blake2b.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\blake2b.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c camellia.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\camellia.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c coding.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\coding.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c compress.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\compress.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c des3.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\des3.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c dh.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dh.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c dsa.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\dsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c ecc.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c ecc_fp.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ecc_fp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c error.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\error.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c hc128.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hc128.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c hmac.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\hmac.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c integer.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\integer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c logging.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\logging.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c md2.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md2.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c md4.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md4.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c md5.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\md5.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c memory.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\memory.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c misc.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\misc.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c port.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\port.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c pwdbased.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\pwdbased.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c rabbit.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rabbit.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c random.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\random.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c ripemd.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\ripemd.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c rsa.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\rsa.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c sha.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c sha256.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha256.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c sha512.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\sha512.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c tfm.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\ctaocrypt\src\tfm.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c crl.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\crl.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\crl.c internal.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\internal.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\internal.c io.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\io.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\io.c keys.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\keys.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\keys.c ocsp.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\ocsp.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ocsp.c sniffer.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\sniffer.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\sniffer.c ssl.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\ssl.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ssl.c tls.c 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.1\cyassl\src\tls.c + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\tls.c @@ -836,25 +867,25 @@ - + - + - + - + @@ -868,20 +899,20 @@ - - + + - - + + - - + + @@ -958,20 +989,14 @@ - - + + - - - - - - - - + + @@ -980,8 +1005,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -1094,18 +1119,18 @@ - + RTE\wolfSSL\config-Crypt.h - - + + - + RTE\wolfSSL\config-CyaSSL.h - - + + @@ -1116,6 +1141,14 @@ + + RTE\wolfSSL\settings.h + + + + + + diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/CMSIS/RTX_Conf_CM.c index 3ff6766f3..cc5980000 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -55,28 +55,28 @@ // Defines default stack size for threads with osThreadDef stacksz = 0 // Default: 200 #ifndef OS_STKSIZE - #define OS_STKSIZE 250 + #define OS_STKSIZE 300 #endif -// Main Thread stack size [bytes] <64-4096:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE - #define OS_MAINSTKSIZE 250 + #define OS_MAINSTKSIZE 1000 #endif // Number of threads with user-provided stack size <0-250> // Defines the number of threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVCNT - #define OS_PRIVCNT 2 + #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-0x10000:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE - #define OS_PRIVSTKSIZE 4500 + #define OS_PRIVSTKSIZE 6000 #endif // Check for stack overflow @@ -158,7 +158,7 @@ #define OS_TIMERPRIO 5 #endif -// Timer Thread stack size [bytes] <64-64000:8><#/4> +// Timer Thread stack size [bytes] <64-4096:8><#/4> // Defines stack size for Timer thread. // Default: 200 #ifndef OS_TIMERSTKSZ @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Device/STM32F207IG/startup_stm32f2xx.s b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Device/STM32F207IG/startup_stm32f2xx.s index 205f9ffbb..84191d1ed 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Device/STM32F207IG/startup_stm32f2xx.s +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Device/STM32F207IG/startup_stm32f2xx.s @@ -28,7 +28,7 @@ ; Stack Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Stack_Size EQU 0x00001000 +Stack_Size EQU 0x00000400 AREA STACK, NOINIT, READWRITE, ALIGN=3 Stack_Mem SPACE Stack_Size @@ -39,7 +39,7 @@ __initial_sp ; Heap Size (in Bytes) <0x0-0xFFFFFFFF:8> ; -Heap_Size EQU 0x0000F000 +Heap_Size EQU 0x0000A000 AREA HEAP, NOINIT, READWRITE, ALIGN=3 __heap_base diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Network/Net_Config_ETH_0.h b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Network/Net_Config_ETH_0.h index 7be57ad6d..fb38650b7 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Network/Net_Config_ETH_0.h +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/Network/Net_Config_ETH_0.h @@ -14,13 +14,13 @@ // Connect to hardware via Driver_ETH# <0-255> // Select driver control block for MAC and PHY interface -#define ETH0_DRIVER 1 +#define ETH0_DRIVER 0 // MAC Address // Local Ethernet MAC Address // Value FF:FF:FF:FF:FF:FF is not allowed. // It is an ethernet Broadcast MAC address. -// Address byte 1 <0x00-0xff:2> +// A0dress byte 1 <0x00-0xff:2> // LSB is an ethernet Multicast bit. // Must be 0 for local MAC address. // Default: 0x1E @@ -61,11 +61,11 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_IP3 0 +#define ETH0_IP3 11 // Address byte 4 <0-255> // Default: 100 -#define ETH0_IP4 100 +#define ETH0_IP4 101 // // Subnet mask @@ -99,30 +99,30 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_GW3 0 +#define ETH0_GW3 11 // Address byte 4 <0-255> // Default: 254 -#define ETH0_GW4 254 +#define ETH0_GW4 1 // // Primary DNS Server // Primary DNS Server IP Address // Address byte 1 <0-255> // Default: 194 -#define ETH0_PRI_DNS1 194 +#define ETH0_PRI_DNS1 192 // Address byte 2 <0-255> // Default: 25 -#define ETH0_PRI_DNS2 25 +#define ETH0_PRI_DNS2 168 // Address byte 3 <0-255> // Default: 2 -#define ETH0_PRI_DNS3 2 +#define ETH0_PRI_DNS3 11 // Address byte 4 <0-255> // Default: 129 -#define ETH0_PRI_DNS4 129 +#define ETH0_PRI_DNS4 1 // // Secondary DNS Server @@ -198,7 +198,7 @@ // the DHCP Server on local LAN. // You need to modify also the number of UDP Sockets, // because DHCP protocol uses one UDP socket to run. -#define ETH0_DHCP_ENABLE 1 +#define ETH0_DHCP_ENABLE 0 // Vendor Class Identifier // This value is optional. If specified, it is added diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-CyaSSL.h b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..33d41cfdb --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/RTE/wolfSSL/settings.h @@ -0,0 +1,667 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using PIC32MZ Crypto Engine */ +/* #define CYASSL_MICROCHIP_PIC32MZ */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + +/* Uncomment next line if using LwIP native TCP socket settings */ +/* #define HAVE_LWIP_NATIVE */ + +/* Uncomment next line if building for EROAD */ +/* #define CYASSL_EROAD */ + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef CYASSL_USER_SETTINGS + #include +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ + #define CYASSL_LWIP + #define NO_WRITEV + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_FILESYSTEM +#endif + +#ifdef MICROCHIP_PIC32 + /* #define CYASSL_MICROCHIP_PIC32MZ */ + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef CYASSL_MICROCHIP_PIC32MZ + #define CYASSL_PIC32MZ_CE + #define CYASSL_PIC32MZ_CRYPT + #define HAVE_AES_ENGINE + #define CYASSL_PIC32MZ_RNG + /* #define CYASSL_PIC32MZ_HASH */ + #define CYASSL_AES_COUNTER + #define HAVE_AESGCM + #define NO_BIG_INT + +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "system/system_services.h" + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define CYASSL_USER_IO + #define NO_FILESYSTEM + #define NO_CERT + #define USE_CERT_BUFFERS_1024 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define HAVE_ECC + #define NO_SESSION_CACHE + #define CYASSL_CMSIS_RTOS +#endif + + +#ifdef CYASSL_EROAD + #define FREESCALE_MQX + #define FREESCALE_MMCAU + #define SINGLE_THREADED + #define NO_STDIO_FILESYSTEM + #define CYASSL_LEANPSK + #define HAVE_NULL_CIPHER + #define NO_OLD_TLS + #define NO_ASN + #define NO_BIG_INT + #define NO_RSA + #define NO_DSA + #define NO_DH + #define NO_CERTS + #define NO_PWDBASED + #define NO_DES3 + #define NO_MD4 + #define NO_RC4 + #define NO_MD5 + #define NO_SESSION_CACHE + #define NO_MAIN_DRIVER +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) && !defined(CYASSL_EROAD) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/benchmark.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/benchmark.c index 277e808fa..817d9b7c6 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/benchmark.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/benchmark.c @@ -51,9 +51,15 @@ #include "cavium_common.h" #include "cavium_ioctl.h" #endif + +#if defined(CYASSL_MDK_ARM) + extern FILE * CyaSSL_fopen(const char *fname, const char *mode) ; + #define fopen CyaSSL_fopen +#endif + #if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) /* include test cert and key buffers for use with NO_FILESYSTEM */ - #if defined(CYASSL_MDK_ARM) && !defined(SINGLE_THREADED) + #if defined(CYASSL_MDK_ARM) #include "cert_data.h" /* use certs_test.c for initial data, so other commands can share the data. */ #else @@ -61,11 +67,6 @@ #endif #endif -#if defined(CYASSL_MDK_ARM) - #include - extern FILE * CyaSSL_fopen(const char *fname, const char *mode) ; - #define fopen CyaSSL_fopen -#endif #ifdef HAVE_BLAKE2 #include @@ -84,6 +85,7 @@ void bench_rabbit(void); void bench_aes(int); void bench_aesgcm(void); void bench_aesccm(void); +void bench_aesctr(void); void bench_camellia(void); void bench_md5(void); @@ -140,7 +142,7 @@ int benchmark_test(void *args) { #endif - #ifdef HAVE_CAVIUM + #ifdef HAVE_CAVIUM int ret = OpenNitroxDevice(CAVIUM_DIRECT, CAVIUM_DEV_ID); if (ret != 0) { printf("Cavium OpenNitroxDevice failed\n"); @@ -154,6 +156,11 @@ int benchmark_test(void *args) #ifdef HAVE_AESGCM bench_aesgcm(); #endif + +#ifdef CYASSL_AES_COUNTER + bench_aesctr(); +#endif + #ifdef HAVE_AESCCM bench_aesccm(); #endif @@ -218,23 +225,31 @@ int benchmark_test(void *args) #ifdef BENCH_EMBEDDED -const int numBlocks = 25; /* how many kB/megs to test (en/de)cryption */ -const char blockType[] = "kB"; /* used in printf output */ -const int times = 1; /* public key iterations */ +enum BenchmarkBounds { + numBlocks = 25, /* how many kB to test (en/de)cryption */ + ntimes = 1, + genTimes = 5, /* public key iterations */ + agreeTimes = 5 +}; +static const char blockType[] = "kB"; /* used in printf output */ #else -const int numBlocks = 5; -const char blockType[] = "megs"; -const int times = 100; +enum BenchmarkBounds { + numBlocks = 5, /* how many megs to test (en/de)cryption */ + ntimes = 100, + genTimes = 100, + agreeTimes = 100 +}; +static const char blockType[] = "megs"; /* used in printf output */ #endif -const byte key[] = +static const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 }; -const byte iv[] = +static const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, @@ -245,11 +260,11 @@ const byte iv[] = /* use kB instead of mB for embedded benchmarking */ #ifdef BENCH_EMBEDDED -byte plain [1024]; -byte cipher[1024]; +static byte plain [1024]; +static byte cipher[1024]; #else -byte plain [1024*1024]; -byte cipher[1024*1024]; +static byte plain [1024*1024]; +static byte cipher[1024*1024]; #endif @@ -259,13 +274,20 @@ void bench_aes(int show) Aes enc; double start, total, persec; int i; + int ret; #ifdef HAVE_CAVIUM - if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) + if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) { printf("aes init cavium failed\n"); + return; + } #endif - AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION); + ret = AesSetKey(&enc, key, 16, iv, AES_ENCRYPTION); + if (ret != 0) { + printf("AesSetKey failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -280,7 +302,7 @@ void bench_aes(int show) #endif if (show) - printf("AES %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM AesFreeCavium(&enc); @@ -289,8 +311,10 @@ void bench_aes(int show) #endif -byte additional[13]; -byte tag[16]; +#if defined(HAVE_AESGCM) || defined(HAVE_AESCCM) + static byte additional[13]; + static byte tag[16]; +#endif #ifdef HAVE_AESGCM @@ -315,11 +339,38 @@ void bench_aesgcm(void) persec = persec / 1024; #endif - printf("AES-GCM %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES-GCM %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif +#ifdef CYASSL_AES_COUNTER +void bench_aesctr(void) +{ + Aes enc; + double start, total, persec; + int i; + + AesSetKeyDirect(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + start = current_time(1); + + for(i = 0; i < numBlocks; i++) + AesCtrEncrypt(&enc, plain, cipher, sizeof(plain)); + + total = current_time(0) - start; + + persec = 1 / total * numBlocks; +#ifdef BENCH_EMBEDDED + /* since using kB, convert to MB/s */ + persec = persec / 1024; +#endif + + printf("AES-CTR %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, + blockType, total, persec); +} +#endif + + #ifdef HAVE_AESCCM void bench_aesccm(void) @@ -343,7 +394,7 @@ void bench_aesccm(void) persec = persec / 1024; #endif - printf("AES-CCM %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("AES-CCM %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -370,7 +421,7 @@ void bench_camellia(void) persec = persec / 1024; #endif - printf("Camellia %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("Camellia %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -381,13 +432,17 @@ void bench_des(void) { Des3 enc; double start, total, persec; - int i; + int i, ret; #ifdef HAVE_CAVIUM if (Des3_InitCavium(&enc, CAVIUM_DEV_ID) != 0) printf("des3 init cavium failed\n"); #endif - Des3_SetKey(&enc, key, iv, DES_ENCRYPTION); + ret = Des3_SetKey(&enc, key, iv, DES_ENCRYPTION); + if (ret != 0) { + printf("Des3_SetKey failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -401,7 +456,7 @@ void bench_des(void) persec = persec / 1024; #endif - printf("3DES %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("3DES %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM Des3_FreeCavium(&enc); @@ -435,7 +490,7 @@ void bench_arc4(void) persec = persec / 1024; #endif - printf("ARC4 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("ARC4 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); #ifdef HAVE_CAVIUM Arc4FreeCavium(&enc); @@ -464,7 +519,7 @@ void bench_hc128(void) persec = persec / 1024; #endif - printf("HC128 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("HC128 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* HAVE_HC128 */ @@ -490,7 +545,7 @@ void bench_rabbit(void) persec = persec / 1024; #endif - printf("RABBIT %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("RABBIT %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_RABBIT */ @@ -519,7 +574,7 @@ void bench_md5(void) persec = persec / 1024; #endif - printf("MD5 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("MD5 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_MD5 */ @@ -531,9 +586,13 @@ void bench_sha(void) Sha hash; byte digest[SHA_DIGEST_SIZE]; double start, total, persec; - int i; + int i, ret; - InitSha(&hash); + ret = InitSha(&hash); + if (ret != 0) { + printf("InitSha failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -548,7 +607,7 @@ void bench_sha(void) persec = persec / 1024; #endif - printf("SHA %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif /* NO_SHA */ @@ -561,8 +620,13 @@ void bench_sha256(void) byte digest[SHA256_DIGEST_SIZE]; double start, total, persec; int i; + int ret; - InitSha256(&hash); + ret = InitSha256(&hash); + if (ret != 0) { + printf("InitSha256 failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -577,7 +641,7 @@ void bench_sha256(void) persec = persec / 1024; #endif - printf("SHA-256 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA-256 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -588,9 +652,13 @@ void bench_sha512(void) Sha512 hash; byte digest[SHA512_DIGEST_SIZE]; double start, total, persec; - int i; + int i, ret; - InitSha512(&hash); + ret = InitSha512(&hash); + if (ret != 0) { + printf("InitSha512 failed, ret = %d\n", ret); + return; + } start = current_time(1); for(i = 0; i < numBlocks; i++) @@ -605,7 +673,7 @@ void bench_sha512(void) persec = persec / 1024; #endif - printf("SHA-512 %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("SHA-512 %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -633,7 +701,7 @@ void bench_ripemd(void) persec = persec / 1024; #endif - printf("RIPEMD %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("RIPEMD %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -662,7 +730,7 @@ void bench_blake2(void) persec = persec / 1024; #endif - printf("BLAKE2b %d %s took %5.3f seconds, %6.2f MB/s\n", numBlocks, + printf("BLAKE2b %d %s took %5.3f seconds, %7.3f MB/s\n", numBlocks, blockType, total, persec); } #endif @@ -670,7 +738,7 @@ void bench_blake2(void) #if !defined(NO_RSA) || !defined(NO_DH) \ || defined(CYASSL_KEYGEN) || defined(HAVE_ECC) -RNG rng; +static RNG rng; #endif #ifndef NO_RSA @@ -679,7 +747,7 @@ RNG rng; #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && \ defined(CYASSL_MDK_SHELL) static char *certRSAname = "certs/rsa2048.der" ; -void set_Bench_RSA_File(char * cert) { certRSAname = cert ; } +static void set_Bench_RSA_File(char * cert) { certRSAname = cert ; } /* set by shell command */ #elif defined(CYASSL_MDK_SHELL) /* nothing */ @@ -722,7 +790,7 @@ void bench_rsa(void) fclose(file); #endif /* USE_CERT_BUFFERS */ - + #ifdef HAVE_CAVIUM if (RsaInitCavium(&rsaKey, CAVIUM_DEV_ID) != 0) printf("RSA init cavium failed\n"); @@ -732,20 +800,24 @@ void bench_rsa(void) printf("InitRNG failed\n"); return; } - InitRsaKey(&rsaKey, 0); + ret = InitRsaKey(&rsaKey, 0); + if (ret < 0) { + printf("InitRsaKey failed\n"); + return; + } ret = RsaPrivateKeyDecode(tmp, &idx, &rsaKey, (word32)bytes); start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) ret = RsaPublicEncrypt(message,len,enc,sizeof(enc), &rsaKey, &rng); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("RSA %d encryption took %6.2f milliseconds, avg over %d" - " iterations\n", rsaKeySz, milliEach, times); + printf("RSA %d encryption took %6.3f milliseconds, avg over %d" + " iterations\n", rsaKeySz, milliEach, ntimes); if (ret < 0) { printf("Rsa Public Encrypt failed\n"); @@ -754,17 +826,17 @@ void bench_rsa(void) start = current_time(1); - for (i = 0; i < times; i++) { + for (i = 0; i < ntimes; i++) { byte out[512]; /* for up to 4096 bit */ RsaPrivateDecrypt(enc, (word32)ret, out, sizeof(out), &rsaKey); } total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("RSA %d decryption took %6.2f milliseconds, avg over %d" - " iterations\n", rsaKeySz, milliEach, times); + printf("RSA %d decryption took %6.3f milliseconds, avg over %d" + " iterations\n", rsaKeySz, milliEach, ntimes); FreeRsaKey(&rsaKey); #ifdef HAVE_CAVIUM @@ -790,10 +862,10 @@ static const char *certDHname = "certs/dh2048.der" ; void bench_dh(void) { - int i; + int i, ret; byte tmp[1024]; size_t bytes; - word32 idx = 0, pubSz, privSz, pubSz2, privSz2, agreeSz; + word32 idx = 0, pubSz, privSz = 0, pubSz2, privSz2, agreeSz; byte pub[256]; /* for 2048 bit */ byte priv[256]; /* for 2048 bit */ @@ -805,7 +877,7 @@ void bench_dh(void) DhKey dhKey; int dhKeySz = 2048; /* used in printf */ - + #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dh_key_der_1024, sizeof_dh_key_der_1024); bytes = sizeof_dh_key_der_1024; @@ -821,10 +893,15 @@ void bench_dh(void) return; } + ret = InitRng(&rng); + if (ret < 0) { + printf("InitRNG failed\n"); + return; + } bytes = fread(tmp, 1, sizeof(tmp), file); #endif /* USE_CERT_BUFFERS */ - + InitDhKey(&dhKey); bytes = DhKeyDecode(tmp, &idx, &dhKey, (word32)bytes); if (bytes != 0) { @@ -837,28 +914,28 @@ void bench_dh(void) start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) DhGenerateKeyPair(&dhKey, &rng, priv, &privSz, pub, &pubSz); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("DH %d key generation %6.2f milliseconds, avg over %d" - " iterations\n", dhKeySz, milliEach, times); + printf("DH %d key generation %6.3f milliseconds, avg over %d" + " iterations\n", dhKeySz, milliEach, ntimes); DhGenerateKeyPair(&dhKey, &rng, priv2, &privSz2, pub2, &pubSz2); start = current_time(1); - for (i = 0; i < times; i++) + for (i = 0; i < ntimes; i++) DhAgree(&dhKey, agree, &agreeSz, priv, privSz, pub2, pubSz2); total = current_time(0) - start; - each = total / times; /* per second */ + each = total / ntimes; /* per second */ milliEach = each * 1000; /* milliseconds */ - printf("DH %d key agreement %6.2f milliseconds, avg over %d" - " iterations\n", dhKeySz, milliEach, times); + printf("DH %d key agreement %6.3f milliseconds, avg over %d" + " iterations\n", dhKeySz, milliEach, ntimes); #if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) fclose(file); @@ -873,7 +950,6 @@ void bench_rsaKeyGen(void) RsaKey genKey; double start, total, each, milliEach; int i; - const int genTimes = 5; /* 1024 bit */ start = current_time(1); @@ -888,7 +964,7 @@ void bench_rsaKeyGen(void) each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ printf("\n"); - printf("RSA 1024 key generation %6.2f milliseconds, avg over %d" + printf("RSA 1024 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); /* 2048 bit */ @@ -903,7 +979,7 @@ void bench_rsaKeyGen(void) total = current_time(0) - start; each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("RSA 2048 key generation %6.2f milliseconds, avg over %d" + printf("RSA 2048 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); } #endif /* CYASSL_KEY_GEN */ @@ -913,9 +989,13 @@ void bench_eccKeyGen(void) { ecc_key genKey; double start, total, each, milliEach; - int i; - const int genTimes = 5; + int i, ret; + ret = InitRng(&rng); + if (ret < 0) { + printf("InitRNG failed\n"); + return; + } /* 256 bit */ start = current_time(1); @@ -928,7 +1008,7 @@ void bench_eccKeyGen(void) each = total / genTimes; /* per second */ milliEach = each * 1000; /* millisconds */ printf("\n"); - printf("ECC 256 key generation %6.2f milliseconds, avg over %d" + printf("ECC 256 key generation %6.3f milliseconds, avg over %d" " iterations\n", milliEach, genTimes); } @@ -938,15 +1018,20 @@ void bench_eccKeyAgree(void) ecc_key genKey, genKey2; double start, total, each, milliEach; int i, ret; - const int agreeTimes = 5; byte shared[1024]; byte sig[1024]; byte digest[32]; - word32 x; + word32 x = 0; ecc_init(&genKey); ecc_init(&genKey2); + ret = InitRng(&rng); + if (ret < 0) { + printf("InitRNG failed\n"); + return; + } + ret = ecc_make_key(&rng, 32, &genKey); if (ret != 0) { printf("ecc_make_key failed\n"); @@ -963,31 +1048,56 @@ void bench_eccKeyAgree(void) for(i = 0; i < agreeTimes; i++) { x = sizeof(shared); - ecc_shared_secret(&genKey, &genKey2, shared, &x); + ret = ecc_shared_secret(&genKey, &genKey2, shared, &x); + if (ret != 0) { + printf("ecc_shared_secret failed\n"); + return; + } } total = current_time(0) - start; each = total / agreeTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("EC-DHE key agreement %6.2f milliseconds, avg over %d" + printf("EC-DHE key agreement %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); /* make dummy digest */ for (i = 0; i < (int)sizeof(digest); i++) - digest[i] = i; + digest[i] = (byte)i; start = current_time(1); for(i = 0; i < agreeTimes; i++) { x = sizeof(sig); - ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &genKey); + ret = ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &genKey); + if (ret != 0) { + printf("ecc_sign_hash failed\n"); + return; + } } total = current_time(0) - start; each = total / agreeTimes; /* per second */ milliEach = each * 1000; /* millisconds */ - printf("EC-DSA sign time %6.2f milliseconds, avg over %d" + printf("EC-DSA sign time %6.3f milliseconds, avg over %d" + " iterations\n", milliEach, agreeTimes); + + start = current_time(1); + + for(i = 0; i < agreeTimes; i++) { + int verify = 0; + ret = ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &genKey); + if (ret != 0) { + printf("ecc_verify_hash failed\n"); + return; + } + } + + total = current_time(0) - start; + each = total / agreeTimes; /* per second */ + milliEach = each * 1000; /* millisconds */ + printf("EC-DSA verify time %6.3f milliseconds, avg over %d" " iterations\n", milliEach, agreeTimes); ecc_free(&genKey2); @@ -1003,13 +1113,13 @@ void bench_eccKeyAgree(void) double current_time(int reset) { - (void)reset; - static int init = 0; static LARGE_INTEGER freq; LARGE_INTEGER count; + (void)reset; + if (!init) { QueryPerformanceFrequency(&freq); init = 1; @@ -1021,44 +1131,58 @@ void bench_eccKeyAgree(void) } #elif defined MICROCHIP_PIC32 - - #include + #if defined(CYASSL_MICROCHIP_PIC32MZ) + #define CLOCK 8000000.0 + #else + #include + #define CLOCK 4000000.0 + #endif double current_time(int reset) { - /* NOTE: core timer tick rate = 40 Mhz, 1 tick = 25 ns */ - unsigned int ns; - /* should we reset our timer back to zero? Helps prevent timer - rollover */ - if (reset) { WriteCoreTimer(0); } /* get timer in ns */ - ns = ReadCoreTimer() * 25; + ns = ReadCoreTimer(); /* return seconds as a double */ - return ( ns / 1000000000.0 ); + return ( ns / CLOCK * 2.0); } - + #elif defined CYASSL_MDK_ARM + extern double current_time(int reset) ; + +#elif defined FREERTOS + + double current_time(int reset) + { + (void) reset; + + portTickType tickCount; + + /* tick count == ms, if configTICK_RATE_HZ is set to 1000 */ + tickCount = xTaskGetTickCount(); + return (double)tickCount / 1000; + } + #else #include double current_time(int reset) { - (void) reset; - struct timeval tv; + + (void)reset; + gettimeofday(&tv, 0); return (double)tv.tv_sec + (double)tv.tv_usec / 1000000; } #endif /* _WIN32 */ - diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/client.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/client.c index 608a32457..ab17b6a49 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/client.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/client.c @@ -46,17 +46,9 @@ #endif #include - -#ifdef CYASSL_MDK_SHELL -extern void exit_command(void) ; -#define exit(code) exit_command() -#endif - #include - #include "examples/client/client.h" -#define USE_CYASSL_MEMORY #ifdef CYASSL_CALLBACKS int handShakeCB(HandShakeInfo*); @@ -145,10 +137,33 @@ static void Usage(void) #ifdef SHOW_SIZES printf("-z Print structure sizes\n"); #endif +#ifdef HAVE_SNI printf("-S Use Host Name Indication\n"); +#endif +#ifdef HAVE_MAX_FRAGMENT + printf("-L Use Maximum Fragment Length [1-5]\n"); +#endif +#ifdef HAVE_TRUNCATED_HMAC + printf("-T Use Truncated HMAC\n"); +#endif +#ifdef HAVE_OCSP + printf("-o Perform OCSP lookup on peer certificate\n"); + printf("-O Perform OCSP lookup using as responder\n"); +#endif +#ifdef ATOMIC_USER + printf("-U Atomic User Record Layer Callbacks\n"); +#endif +#ifdef HAVE_PK_CALLBACKS + printf("-P Public Key Callbacks\n"); +#endif } +#ifdef CYASSL_MDK_SHELL + #define exit(code) return(code) +#endif + + THREAD_RETURN CYASSL_THREAD client_test(void* args) { SOCKET_T sockfd = 0; @@ -167,7 +182,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) int input; int msgSz = (int)strlen(msg); - int port = yasslPort; + word16 port = yasslPort; char* host = (char*)yasslIP; char* domain = (char*)"www.yassl.com"; @@ -184,6 +199,8 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) int trackMemory = 0; int useClientCert = 1; int fewerPackets = 0; + int atomicUser = 0; + int pkCallbacks = 0; char* cipherList = NULL; char* verifyCert = (char*)caCert; char* ourCert = (char*)cliCert; @@ -192,6 +209,18 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) #ifdef HAVE_SNI char* sniHostName = NULL; #endif +#ifdef HAVE_MAX_FRAGMENT + byte maxFragment = 0; +#endif +#ifdef HAVE_TRUNCATED_HMAC + byte truncatedHMAC = 0; +#endif + + +#ifdef HAVE_OCSP + int useOcsp = 0; + char* ocspUrl = NULL; +#endif int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -207,8 +236,13 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) (void)session; (void)sslResume; (void)trackMemory; + (void)atomicUser; + (void)pkCallbacks; - while ((ch = mygetopt(argc, argv, "?gdusmNrtfxh:p:v:l:A:c:k:b:zS:")) != -1){ + StackTrap(); + + while ((ch = mygetopt(argc, argv, + "?gdusmNrtfxUPh:p:v:l:A:c:k:b:zS:L:ToO:")) != -1) { switch (ch) { case '?' : Usage(); @@ -248,13 +282,25 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) fewerPackets = 1; break; + case 'U' : + #ifdef ATOMIC_USER + atomicUser = 1; + #endif + break; + + case 'P' : + #ifdef HAVE_PK_CALLBACKS + pkCallbacks = 1; + #endif + break; + case 'h' : host = myoptarg; domain = myoptarg; break; case 'p' : - port = atoi(myoptarg); + port = (word16)atoi(myoptarg); #if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API) if (port == 0) err_sys("port number cannot be 0"); @@ -313,6 +359,36 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) #endif break; + case 'L' : + #ifdef HAVE_MAX_FRAGMENT + maxFragment = atoi(myoptarg); + if (maxFragment < CYASSL_MFL_2_9 || + maxFragment > CYASSL_MFL_2_13) { + Usage(); + exit(MY_EX_USAGE); + } + #endif + break; + + case 'T' : + #ifdef HAVE_TRUNCATED_HMAC + truncatedHMAC = 1; + #endif + break; + + case 'o' : + #ifdef HAVE_OCSP + useOcsp = 1; + #endif + break; + + case 'O' : + #ifdef HAVE_OCSP + useOcsp = 1; + ocspUrl = myoptarg; + #endif + break; + default: Usage(); exit(MY_EX_USAGE); @@ -388,7 +464,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) ctx = CyaSSL_CTX_new(method); if (ctx == NULL) err_sys("unable to get ctx"); - + if (cipherList) if (CyaSSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS) err_sys("client can't set cipher list 1"); @@ -421,7 +497,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) useClientCert = 0; } -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -434,6 +510,18 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) } #endif +#ifdef HAVE_OCSP + if (useOcsp) { + if (ocspUrl != NULL) { + CyaSSL_CTX_SetOCSP_OverrideURL(ctx, ocspUrl); + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE + | CYASSL_OCSP_URL_OVERRIDE); + } + else + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE); + } +#endif + #ifdef USER_CA_CB CyaSSL_CTX_SetCACb(ctx, CaCb); #endif @@ -473,6 +561,16 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) != SSL_SUCCESS) err_sys("UseSNI failed"); #endif +#ifdef HAVE_MAX_FRAGMENT + if (maxFragment) + if (CyaSSL_CTX_UseMaxFragment(ctx, maxFragment) != SSL_SUCCESS) + err_sys("UseMaxFragment failed"); +#endif +#ifdef HAVE_TRUNCATED_HMAC + if (truncatedHMAC) + if (CyaSSL_CTX_UseTruncatedHMAC(ctx) != SSL_SUCCESS) + err_sys("UseTruncatedHMAC failed"); +#endif if (benchmark) { /* time passed in number of connects give average */ @@ -511,9 +609,6 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) ssl = CyaSSL_new(ctx); if (ssl == NULL) err_sys("unable to get SSL object"); - - CyaSSL_set_quiet_shutdown(ssl, 1) ; - if (doDTLS) { SOCKADDR_IN_T addr; build_addr(&addr, host, port, 1); @@ -531,6 +626,14 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) err_sys("can't load crl, check crlfile and date validity"); if (CyaSSL_SetCRL_Cb(ssl, CRL_CallBack) != SSL_SUCCESS) err_sys("can't set crl callback"); +#endif +#ifdef ATOMIC_USER + if (atomicUser) + SetupAtomicUser(ctx, ssl); +#endif +#ifdef HAVE_PK_CALLBACKS + if (pkCallbacks) + SetupPkCallbacks(ctx, ssl); #endif if (matchName && doPeerCheck) CyaSSL_check_domain_name(ssl, domain); @@ -543,7 +646,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) else if (CyaSSL_connect(ssl) != SSL_SUCCESS) { /* see note at top of README */ int err = CyaSSL_get_error(ssl, 0); - char buffer[80]; + char buffer[CYASSL_MAX_ERROR_SZ]; printf("err = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer)); err_sys("SSL_connect failed"); @@ -559,7 +662,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) if (sendGET) { printf("SSL connect ok, sending GET...\n"); msgSz = 28; - strncpy(msg, "GET / HTTP/1.0\r\n\r\n", msgSz); + strncpy(msg, "GET /index.html HTTP/1.0\r\n\r\n", msgSz); msg[msgSz] = '\0'; } if (CyaSSL_write(ssl, msg, msgSz) != msgSz) @@ -568,32 +671,25 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) input = CyaSSL_read(ssl, reply, sizeof(reply)-1); if (input > 0) { reply[input] = 0; - printf("Server response: %s", reply); + printf("Server response: %s\n", reply); - if (sendGET && (input == (sizeof(reply)-1))) { /* get html */ + if (sendGET) { /* get html */ while (1) { input = CyaSSL_read(ssl, reply, sizeof(reply)-1); if (input > 0) { reply[input] = 0; - printf("%s", reply); - if(input < sizeof(reply)-1) - break ; + printf("%s\n", reply); } else break; } } - printf("\n"); } else if (input < 0) { int readErr = CyaSSL_get_error(ssl, 0); if (readErr != SSL_ERROR_WANT_READ) err_sys("CyaSSL_read failed"); } - -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif #ifndef NO_SESSION_CACHE if (resumeSession) { @@ -610,6 +706,10 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) if (doDTLS == 0) /* don't send alert after "break" command */ CyaSSL_shutdown(ssl); /* echoserver will interpret as new conn */ +#ifdef ATOMIC_USER + if (atomicUser) + FreeAtomicUser(ssl); +#endif CyaSSL_free(ssl); CloseSocket(sockfd); @@ -711,11 +811,13 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) args.argv = argv; CyaSSL_Init(); -#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) +#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) && !defined(STACK_TRAP) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("client") || CurrentDir("build")) + if (CurrentDir("client")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); #ifdef HAVE_STACK_SIZE StackSizeCheck(&args, client_test); diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoclient.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoclient.c index bc7e26310..3a62eb67d 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoclient.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoclient.c @@ -28,18 +28,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include - - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif - - #include "cyassl_MDK_ARM.h" + #include + #include + + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" #endif #include @@ -68,11 +68,11 @@ void echoclient_test(void* args) int sendSz; int argc = 0; char** argv = 0; - int port = yasslPort; + word16 port = yasslPort; ((func_args*)args)->return_code = -1; /* error state */ -#ifndef CYASSL_MDK_ARM +#ifndef CYASSL_MDK_SHELL argc = ((func_args*)args)->argc; argv = ((func_args*)args)->argv; #endif @@ -104,9 +104,6 @@ void echoclient_test(void* args) #if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && !defined(CYASSL_MDK_SHELL) port = ((func_args*)args)->signal->port; #endif -#if defined (CYASSL_CALLEE_PORT) - port = CYASSL_CALLEE_PORT ; -#endif #if defined(CYASSL_DTLS) method = DTLSv1_client_method(); @@ -150,7 +147,7 @@ void echoclient_test(void* args) #endif } -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -159,8 +156,8 @@ void echoclient_test(void* args) #endif ssl = SSL_new(ctx); - CyaSSL_set_quiet_shutdown(ssl, 1) ; - + + if (doDTLS) { SOCKADDR_IN_T addr; build_addr(&addr, yasslIP, port, 1); @@ -221,10 +218,6 @@ void echoclient_test(void* args) #endif } -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif - #ifdef CYASSL_DTLS strncpy(msg, "break", 6); @@ -270,8 +263,10 @@ void echoclient_test(void* args) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("echoclient") || CurrentDir("build")) + if (CurrentDir("echoclient")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); echoclient_test(&args); CyaSSL_Cleanup(); diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoserver.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoserver.c index ba8e10f18..c7e23bf7e 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoserver.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/echoserver.c @@ -26,18 +26,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include + #include + #include - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif - #include "cyassl_MDK_ARM.h" + #include "cyassl_MDK_ARM.h" #endif #include @@ -56,7 +56,7 @@ #define SVR_COMMAND_SIZE 256 -static void SignalReady(void* args, int port) +static void SignalReady(void* args, word16 port) { #if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER) && !defined(__MINGW32__) /* signal ready to tcp_accept */ @@ -84,7 +84,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) int outCreated = 0; int shutDown = 0; int useAnyAddr = 0; - int port = yasslPort; + word16 port = yasslPort; int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -115,7 +115,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #endif #if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && \ - !defined(CYASSL_SNIFFER) && !defined(CYASSL_MDK_ARM) + !defined(CYASSL_SNIFFER) && !defined(CYASSL_MDK_SHELL) port = 0; #endif #if defined(USE_ANY_ADDR) @@ -133,7 +133,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) ctx = CyaSSL_CTX_new(method); /* CyaSSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); */ -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -226,8 +226,6 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) ssl = CyaSSL_new(ctx); if (ssl == NULL) err_sys("SSL_new failed"); - CyaSSL_set_quiet_shutdown(ssl, 1) ; - CyaSSL_set_fd(ssl, clientfd); #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM); @@ -313,9 +311,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) SignalReady(args, port); #endif } -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif + CloseSocket(sockfd); CyaSSL_CTX_free(ctx); @@ -351,8 +347,10 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("echoserver") || CurrentDir("build")) + if (CurrentDir("echoserver")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); echoserver_test(&args); CyaSSL_Cleanup(); diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/main.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/main.c index 8f7bd1fd5..9d0e71223 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/main.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/main.c @@ -79,9 +79,10 @@ char* myoptarg = NULL; int main() { void *arg = NULL ; - init_time() ; init_filesystem (); net_initialize() ; + init_time() ; + osThreadCreate (osThread (tcp_poll), NULL); osDelay(10000) ; /* wait for DHCP */ #if defined(DEBUG_CYASSL) diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c index aeecd62fb..ae484062f 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/server.c @@ -31,27 +31,20 @@ #endif #if defined(CYASSL_MDK_ARM) - #include - #include - - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif - - #include "cyassl_MDK_ARM.h" -#endif + #include + #include + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" +#endif #include - -#ifdef CYASSL_MDK_SHELL -extern void exit_command(void) ; -#define exit(code) exit_command() -#endif - #include #include "examples/server/server.h" @@ -137,6 +130,13 @@ static void Usage(void) printf("-f Fewer packets/group messages\n"); printf("-N Use Non-blocking sockets\n"); printf("-S Use Host Name Indication\n"); +#ifdef HAVE_OCSP + printf("-o Perform OCSP lookup on peer certificate\n"); + printf("-O Perform OCSP lookup using as responder\n"); +#endif +#ifdef HAVE_PK_CALLBACKS + printf("-P Public Key Callbacks\n"); +#endif } THREAD_RETURN CYASSL_THREAD server_test(void* args) @@ -153,15 +153,16 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int idx; int ch; int version = SERVER_DEFAULT_VERSION; - int doCliCertCheck = 1; + int doCliCertCheck = 0; /* = 0 for no Realtime Clock environment */ int useAnyAddr = 0; - int port = yasslPort; + word16 port = yasslPort; int usePsk = 0; int doDTLS = 0; int useNtruKey = 0; int nonBlocking = 0; int trackMemory = 0; int fewerPackets = 0; + int pkCallbacks = 0; char* cipherList = NULL; char* verifyCert = (char*)cliCert; char* ourCert = (char*)svrCert; @@ -173,6 +174,11 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) char* sniHostName = NULL; #endif +#ifdef HAVE_OCSP + int useOcsp = 0; + char* ocspUrl = NULL; +#endif + ((func_args*)args)->return_code = -1; /* error state */ #ifdef NO_RSA @@ -181,8 +187,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) ourKey = (char*)eccKey; #endif (void)trackMemory; + (void)pkCallbacks; - while ((ch = mygetopt(argc, argv, "?dbstnNufp:v:l:A:c:k:S:")) != -1) { + while ((ch = mygetopt(argc, argv, "?dbstnNufPp:v:l:A:c:k:S:oO:")) != -1) { switch (ch) { case '?' : Usage(); @@ -218,8 +225,14 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) fewerPackets = 1; break; + case 'P' : + #ifdef HAVE_PK_CALLBACKS + pkCallbacks = 1; + #endif + break; + case 'p' : - port = atoi(myoptarg); + port = (word16)atoi(myoptarg); #if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API) if (port == 0) err_sys("port number cannot be 0"); @@ -260,6 +273,19 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #endif break; + case 'o' : + #ifdef HAVE_OCSP + useOcsp = 1; + #endif + break; + + case 'O' : + #ifdef HAVE_OCSP + useOcsp = 1; + ocspUrl = myoptarg; + #endif + break; + default: Usage(); exit(MY_EX_USAGE); @@ -347,13 +373,13 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) usePsk = 1; #endif -#ifdef OPENSSL_EXTRA - SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); -#endif - if (fewerPackets) CyaSSL_CTX_set_group_messages(ctx); +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) + SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); +#endif + #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) if (!usePsk) { if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM) @@ -376,8 +402,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (!useNtruKey && !usePsk) { if (SSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM) != SSL_SUCCESS) - err_sys("can't load server cert file, check file and run from" - " CyaSSL home dir"); + err_sys("can't load server private key file, check file and run " + "from CyaSSL home dir"); } #endif @@ -417,27 +443,38 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #endif #ifdef HAVE_SNI - if (sniHostName) { + if (sniHostName) if (CyaSSL_CTX_UseSNI(ctx, CYASSL_SNI_HOST_NAME, sniHostName, XSTRLEN(sniHostName)) != SSL_SUCCESS) err_sys("UseSNI failed"); - else - CyaSSL_CTX_SNI_SetOptions(ctx, CYASSL_SNI_HOST_NAME, - CYASSL_SNI_ABORT_ON_MISMATCH); - } #endif ssl = SSL_new(ctx); if (ssl == NULL) err_sys("unable to get SSL"); - CyaSSL_set_quiet_shutdown(ssl, 1) ; + #ifdef HAVE_CRL CyaSSL_EnableCRL(ssl, 0); CyaSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, CYASSL_CRL_MONITOR | CYASSL_CRL_START_MON); CyaSSL_SetCRL_Cb(ssl, CRL_CallBack); #endif - osDelay(5000) ; +#ifdef HAVE_OCSP + if (useOcsp) { + if (ocspUrl != NULL) { + CyaSSL_CTX_SetOCSP_OverrideURL(ctx, ocspUrl); + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE + | CYASSL_OCSP_URL_OVERRIDE); + } + else + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE); + } +#endif +#ifdef HAVE_PK_CALLBACKS + if (pkCallbacks) + SetupPkCallbacks(ctx, ssl); +#endif + tcp_accept(&sockfd, &clientfd, (func_args*)args, port, useAnyAddr, doDTLS); if (!doDTLS) CloseSocket(sockfd); @@ -450,7 +487,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) SetDH(ssl); /* repick suites with DHE, higher priority than PSK */ #endif } - osDelay(5000) ; + #ifndef CYASSL_CALLBACKS if (nonBlocking) { CyaSSL_set_using_nonblock(ssl, 1); @@ -458,7 +495,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) NonBlockingSSL_Accept(ssl); } else if (SSL_accept(ssl) != SSL_SUCCESS) { int err = SSL_get_error(ssl, 0); - char buffer[80]; + char buffer[CYASSL_MAX_ERROR_SZ]; printf("error = %d, %s\n", err, ERR_error_string(err, buffer)); err_sys("SSL_accept failed"); } @@ -466,7 +503,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) NonBlockingSSL_Accept(ssl); #endif showPeer(ssl); - osDelay(5000) ; + idx = SSL_read(ssl, input, sizeof(input)-1); if (idx > 0) { input[idx] = 0; @@ -482,6 +519,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (SSL_write(ssl, msg, sizeof(msg)) != sizeof(msg)) err_sys("SSL_write failed"); + #if defined(CYASSL_MDK_SHELL) && defined(HAVE_MDK_RTX) + os_dly_wait(500) ; + #endif + SSL_shutdown(ssl); SSL_free(ssl); SSL_CTX_free(ctx); @@ -520,8 +561,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("server") || CurrentDir("build")) + if (CurrentDir("server")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); #ifdef HAVE_STACK_SIZE StackSizeCheck(&args, server_test); diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/shell.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/shell.c index c79f276ff..183f97c87 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/shell.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/shell.c @@ -96,7 +96,6 @@ extern void ctaocrypt_test(void *args) ; extern void client_test(void *args) ; extern void server_test(void *args) ; extern void kill_task(void *args) ; -extern void time_main(void *args) ; extern void ipaddr_comm(void *args) ; extern void stack_comm(void *args) ; extern void for_command(void *args) ; @@ -214,7 +213,6 @@ static struct { "test", ctaocrypt_test, "client", client_test, "server", server_test, - "time", time_main, /* get/set RTC: [-d mm/dd/yyyy] [-t hh:mm:ss]*/ "ipaddr", ipaddr_comm, /* TBD */ "stack", stack_comm, /* On/Off check stack size */ "for", for_command, /* iterate next command X times */ @@ -470,7 +468,6 @@ static void dbg_comm(void *args) static void help_comm(void *args) { static char *commands[] = { - "time [-d mm/dd/yyyy][-t hh:mm:ss] : set/get time, for cert validation", "test", "benchmark", "echoserver& : simple echo server in background mode", @@ -604,7 +601,6 @@ void shell_main(void *arg) { #if defined(HAVE_KEIL_RTX) InitMutex(&command_mutex) ; #endif - time_main(NULL) ; help_comm(NULL) ; printf("Starting Shell\n") ; @@ -617,14 +613,14 @@ void shell_main(void *arg) { #if defined(HAVE_KEIL_RTX) && !defined(CYASSL_CMSIS_RTOS) UnLockMutex((CyaSSL_Mutex *)&command_mutex) ; os_tsk_create_user_ex( (void(*)(void *))&command_invoke, 7, - command_stack, COMMAND_STACK_SIZE, &args) ; - #else - #if defined(CYASSL_CMSIS_RTOS) - UnLockMutex((CyaSSL_Mutex *)&command_mutex) ; - osThreadCreate (osThread (command_invoke) , &args); - #else - command_invoke(&args) ; - #endif + command_stack, COMMAND_STACK_SIZE, &args) ; + #else + #if defined(CYASSL_CMSIS_RTOS) + UnLockMutex((CyaSSL_Mutex *)&command_mutex) ; + osThreadCreate (osThread (command_invoke) , &args); + #else + command_invoke(&args) ; + #endif #endif #ifdef HAVE_KEIL_RTX LockMutex((CyaSSL_Mutex *)&command_mutex) ; diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/test.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/test.c index 22b4070eb..57419e11f 100644 --- a/IDE/MDK5-ARM/Projects/CyaSSL-Full/test.c +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/test.c @@ -25,6 +25,10 @@ #include +#ifdef XMALLOC_USER + #include /* we're using malloc / free direct here */ +#endif + #ifndef NO_CRYPT_TEST #ifdef CYASSL_TEST_CERT @@ -54,13 +58,16 @@ #include #ifdef HAVE_ECC #include -#endif +#endif #ifdef HAVE_BLAKE2 #include -#endif +#endif #ifdef HAVE_LIBZ #include #endif +#ifdef HAVE_PKCS7 + #include +#endif #ifdef _MSC_VER /* 4996 warning to use MS extensions e.g., strcpy_s instead of strncpy */ @@ -74,6 +81,18 @@ #include #endif + +#if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) + /* include test cert and key buffers for use with NO_FILESYSTEM */ + #if defined(CYASSL_MDK_ARM) + #include "cert_data.h" + /* use certs_test.c for initial data, so other + commands can share the data. */ + #else + #include + #endif +#endif + #if defined(CYASSL_MDK_ARM) #include #include @@ -81,17 +100,6 @@ #define fopen CyaSSL_fopen #endif -#if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) - /* include test cert and key buffers for use with NO_FILESYSTEM */ - #if defined(CYASSL_MDK_ARM) && !defined(SINGLE_THREADED) - #include "cert_data.h" - /* use certs_test.c for initial data, so other - commands can share the data. */ - #else - #include - #endif -#endif - #ifdef HAVE_NTRU #include "crypto_ntru.h" #endif @@ -104,6 +112,7 @@ #ifdef FREESCALE_MQX #include #include + #include #else #include #endif @@ -121,7 +130,7 @@ typedef struct testVector { const char* input; - const char* output; + const char* output; size_t inLen; size_t outLen; } testVector; @@ -138,6 +147,8 @@ int hmac_sha_test(void); int hmac_sha256_test(void); int hmac_sha384_test(void); int hmac_sha512_test(void); +int hmac_blake2b_test(void); +int hkdf_test(void); int arc4_test(void); int hc128_test(void); int rabbit_test(void); @@ -145,6 +156,7 @@ int des_test(void); int des3_test(void); int aes_test(void); int aesgcm_test(void); +int gmac_test(void); int aesccm_test(void); int camellia_test(void); int rsa_test(void); @@ -159,6 +171,9 @@ int pkcs12_test(void); int pbkdf2_test(void); #ifdef HAVE_ECC int ecc_test(void); + #ifdef HAVE_ECC_ENCRYPT + int ecc_encrypt_test(void); + #endif #endif #ifdef HAVE_BLAKE2 int blake2b_test(void); @@ -166,6 +181,10 @@ int pbkdf2_test(void); #ifdef HAVE_LIBZ int compress_test(void); #endif +#ifdef HAVE_PKCS7 + int pkcs7enveloped_test(void); + int pkcs7signed_test(void); +#endif @@ -173,7 +192,7 @@ static void err_sys(const char* msg, int es) { printf("%s error = %d\n", msg, es); #if !defined(THREADX) && !defined(CYASSL_MDK_ARM) - if (msg) + if (msg) exit(es); #endif return; @@ -206,63 +225,63 @@ void ctaocrypt_test(void* args) #ifndef NO_MD5 - if ( (ret = md5_test()) != 0) + if ( (ret = md5_test()) != 0) err_sys("MD5 test failed!\n", ret); else printf( "MD5 test passed!\n"); #endif #ifdef CYASSL_MD2 - if ( (ret = md2_test()) != 0) + if ( (ret = md2_test()) != 0) err_sys("MD2 test failed!\n", ret); else printf( "MD2 test passed!\n"); #endif #ifndef NO_MD4 - if ( (ret = md4_test()) != 0) + if ( (ret = md4_test()) != 0) err_sys("MD4 test failed!\n", ret); else printf( "MD4 test passed!\n"); #endif #ifndef NO_SHA - if ( (ret = sha_test()) != 0) + if ( (ret = sha_test()) != 0) err_sys("SHA test failed!\n", ret); else printf( "SHA test passed!\n"); #endif #ifndef NO_SHA256 - if ( (ret = sha256_test()) != 0) + if ( (ret = sha256_test()) != 0) err_sys("SHA-256 test failed!\n", ret); else printf( "SHA-256 test passed!\n"); #endif #ifdef CYASSL_SHA384 - if ( (ret = sha384_test()) != 0) + if ( (ret = sha384_test()) != 0) err_sys("SHA-384 test failed!\n", ret); else printf( "SHA-384 test passed!\n"); #endif #ifdef CYASSL_SHA512 - if ( (ret = sha512_test()) != 0) + if ( (ret = sha512_test()) != 0) err_sys("SHA-512 test failed!\n", ret); else printf( "SHA-512 test passed!\n"); #endif #ifdef CYASSL_RIPEMD - if ( (ret = ripemd_test()) != 0) + if ( (ret = ripemd_test()) != 0) err_sys("RIPEMD test failed!\n", ret); else printf( "RIPEMD test passed!\n"); #endif -#ifdef HAVE_BLAKE2 - if ( (ret = blake2b_test()) != 0) +#ifdef HAVE_BLAKE2 + if ( (ret = blake2b_test()) != 0) err_sys("BLAKE2b test failed!\n", ret); else printf( "BLAKE2b test passed!\n"); @@ -270,40 +289,61 @@ void ctaocrypt_test(void* args) #ifndef NO_HMAC #ifndef NO_MD5 - if ( (ret = hmac_md5_test()) != 0) + if ( (ret = hmac_md5_test()) != 0) err_sys("HMAC-MD5 test failed!\n", ret); else printf( "HMAC-MD5 test passed!\n"); #endif #ifndef NO_SHA - if ( (ret = hmac_sha_test()) != 0) + if ( (ret = hmac_sha_test()) != 0) err_sys("HMAC-SHA test failed!\n", ret); else printf( "HMAC-SHA test passed!\n"); #endif #ifndef NO_SHA256 - if ( (ret = hmac_sha256_test()) != 0) + if ( (ret = hmac_sha256_test()) != 0) err_sys("HMAC-SHA256 test failed!\n", ret); else printf( "HMAC-SHA256 test passed!\n"); #endif #ifdef CYASSL_SHA384 - if ( (ret = hmac_sha384_test()) != 0) + if ( (ret = hmac_sha384_test()) != 0) err_sys("HMAC-SHA384 test failed!\n", ret); else printf( "HMAC-SHA384 test passed!\n"); #endif #ifdef CYASSL_SHA512 - if ( (ret = hmac_sha512_test()) != 0) + if ( (ret = hmac_sha512_test()) != 0) err_sys("HMAC-SHA512 test failed!\n", ret); else printf( "HMAC-SHA512 test passed!\n"); #endif + #ifdef HAVE_BLAKE2 + if ( (ret = hmac_blake2b_test()) != 0) + err_sys("HMAC-BLAKE2 test failed!\n", ret); + else + printf( "HMAC-BLAKE2 test passed!\n"); + #endif + + #ifdef HAVE_HKDF + if ( (ret = hkdf_test()) != 0) + err_sys("HMAC-KDF test failed!\n", ret); + else + printf( "HMAC-KDF test passed!\n"); + #endif + +#endif + +#ifdef HAVE_AESGCM + if ( (ret = gmac_test()) != 0) + err_sys("GMAC test passed!\n", ret); + else + printf( "GMAC test passed!\n"); #endif #ifndef NO_RC4 @@ -313,7 +353,7 @@ void ctaocrypt_test(void* args) printf( "ARC4 test passed!\n"); #endif -#ifndef HAVE_HC128 +#ifndef NO_HC128 if ( (ret = hc128_test()) != 0) err_sys("HC-128 test failed!\n", ret); else @@ -375,54 +415,72 @@ void ctaocrypt_test(void* args) printf( "RANDOM test passed!\n"); #ifndef NO_RSA - if ( (ret = rsa_test()) != 0) + if ( (ret = rsa_test()) != 0) err_sys("RSA test failed!\n", ret); else printf( "RSA test passed!\n"); #endif #ifndef NO_DH - if ( (ret = dh_test()) != 0) + if ( (ret = dh_test()) != 0) err_sys("DH test failed!\n", ret); else printf( "DH test passed!\n"); #endif #ifndef NO_DSA - if ( (ret = dsa_test()) != 0) + if ( (ret = dsa_test()) != 0) err_sys("DSA test failed!\n", ret); else printf( "DSA test passed!\n"); #endif - + #ifndef NO_PWDBASED - if ( (ret = pwdbased_test()) != 0) + if ( (ret = pwdbased_test()) != 0) err_sys("PWDBASED test failed!\n", ret); else printf( "PWDBASED test passed!\n"); #endif - + #ifdef OPENSSL_EXTRA - if ( (ret = openssl_test()) != 0) + if ( (ret = openssl_test()) != 0) err_sys("OPENSSL test failed!\n", ret); else printf( "OPENSSL test passed!\n"); #endif #ifdef HAVE_ECC - if ( (ret = ecc_test()) != 0) + if ( (ret = ecc_test()) != 0) err_sys("ECC test failed!\n", ret); else printf( "ECC test passed!\n"); + #ifdef HAVE_ECC_ENCRYPT + if ( (ret = ecc_encrypt_test()) != 0) + err_sys("ECC Enc test failed!\n", ret); + else + printf( "ECC Enc test passed!\n"); + #endif #endif #ifdef HAVE_LIBZ - if ( (ret = compress_test()) != 0) + if ( (ret = compress_test()) != 0) err_sys("COMPRESS test failed!\n", ret); else printf( "COMPRESS test passed!\n"); #endif +#ifdef HAVE_PKCS7 + if ( (ret = pkcs7enveloped_test()) != 0) + err_sys("PKCS7enveloped test failed!\n", ret); + else + printf( "PKCS7enveloped test passed!\n"); + + if ( (ret = pkcs7signed_test()) != 0) + err_sys("PKCS7signed test failed!\n", ret); + else + printf( "PKCS7signed test passed!\n"); +#endif + ((func_args*)args)->return_code = ret; } @@ -459,7 +517,7 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) func_args args; - + #ifdef HAVE_CAVIUM int ret = OpenNitroxDevice(CAVIUM_DIRECT, CAVIUM_DEV_ID); if (ret != 0) @@ -474,7 +532,7 @@ static int OpenNitroxDevice(int dma_mode,int dev_id) #ifdef HAVE_CAVIUM CspShutdown(CAVIUM_DEV_ID); #endif - + return args.return_code; } @@ -555,7 +613,7 @@ int md2_test() return 0; } -#endif +#endif #ifndef NO_MD5 int md5_test(void) @@ -583,21 +641,21 @@ int md5_test(void) c.output = "\xc3\xfc\xd3\xd7\x61\x92\xe4\x00\x7d\xfb\x49\x6c\xca\x67\xe1" "\x3b"; c.inLen = strlen(c.input); - c.outLen = MD5_DIGEST_SIZE; + c.outLen = MD5_DIGEST_SIZE; d.input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345" "6789"; d.output = "\xd1\x74\xab\x98\xd2\x77\xd9\xf5\xa5\x61\x1c\x2c\x9f\x41\x9d" "\x9f"; d.inLen = strlen(d.input); - d.outLen = MD5_DIGEST_SIZE; + d.outLen = MD5_DIGEST_SIZE; e.input = "1234567890123456789012345678901234567890123456789012345678" "9012345678901234567890"; e.output = "\x57\xed\xf4\xa2\x2b\xe3\xc9\x55\xac\x49\xda\x2e\x21\x07\xb6" "\x7a"; e.inLen = strlen(e.input); - e.outLen = MD5_DIGEST_SIZE; + e.outLen = MD5_DIGEST_SIZE; test_md5[0] = a; test_md5[1] = b; @@ -632,45 +690,45 @@ int md4_test(void) int times = sizeof(test_md4) / sizeof(testVector), i; a.input = ""; - a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" + a.output = "\x31\xd6\xcf\xe0\xd1\x6a\xe9\x31\xb7\x3c\x59\xd7\xe0\xc0\x89" "\xc0"; a.inLen = strlen(a.input); a.outLen = MD4_DIGEST_SIZE; b.input = "a"; - b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" + b.output = "\xbd\xe5\x2c\xb3\x1d\xe3\x3e\x46\x24\x5e\x05\xfb\xdb\xd6\xfb" "\x24"; b.inLen = strlen(b.input); - b.outLen = MD4_DIGEST_SIZE; + b.outLen = MD4_DIGEST_SIZE; c.input = "abc"; - c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" + c.output = "\xa4\x48\x01\x7a\xaf\x21\xd8\x52\x5f\xc1\x0a\xe8\x7a\xa6\x72" "\x9d"; c.inLen = strlen(c.input); c.outLen = MD4_DIGEST_SIZE; d.input = "message digest"; - d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" + d.output = "\xd9\x13\x0a\x81\x64\x54\x9f\xe8\x18\x87\x48\x06\xe1\xc7\x01" "\x4b"; d.inLen = strlen(d.input); d.outLen = MD4_DIGEST_SIZE; e.input = "abcdefghijklmnopqrstuvwxyz"; - e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" + e.output = "\xd7\x9e\x1c\x30\x8a\xa5\xbb\xcd\xee\xa8\xed\x63\xdf\x41\x2d" "\xa9"; e.inLen = strlen(e.input); e.outLen = MD4_DIGEST_SIZE; f.input = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz012345" "6789"; - f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" + f.output = "\x04\x3f\x85\x82\xf2\x41\xdb\x35\x1c\xe6\x27\xe1\x53\xe7\xf0" "\xe4"; f.inLen = strlen(f.input); f.outLen = MD4_DIGEST_SIZE; g.input = "1234567890123456789012345678901234567890123456789012345678" "9012345678901234567890"; - g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" + g.output = "\xe3\x3b\x4d\xdc\x9c\x38\xf2\x19\x9c\x3e\x7b\x16\x4f\xcc\x05" "\x36"; g.inLen = strlen(g.input); g.outLen = MD4_DIGEST_SIZE; @@ -707,6 +765,7 @@ int sha_test(void) testVector a, b, c, d; testVector test_sha[4]; + int ret; int times = sizeof(test_sha) / sizeof(struct testVector), i; a.input = "abc"; @@ -726,7 +785,7 @@ int sha_test(void) c.output = "\x00\x98\xBA\x82\x4B\x5C\x16\x42\x7B\xD7\xA1\x12\x2A\x5A\x44" "\x2A\x25\xEC\x64\x4D"; c.inLen = strlen(c.input); - c.outLen = SHA_DIGEST_SIZE; + c.outLen = SHA_DIGEST_SIZE; d.input = "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa" @@ -741,7 +800,9 @@ int sha_test(void) test_sha[2] = c; test_sha[3] = d; - InitSha(&sha); + ret = InitSha(&sha); + if (ret != 0) + return -4001; for (i = 0; i < times; ++i) { ShaUpdate(&sha, (byte*)test_sha[i].input, (word32)test_sha[i].inLen); @@ -778,7 +839,7 @@ int ripemd_test(void) b.inLen = strlen(b.input); b.outLen = RIPEMD_DIGEST_SIZE; - c.input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; + c.input = "abcdbcdecdefdefgefghfghighijhijkijkljklmklmnlmnomnopnopq"; c.output = "\x12\xa0\x53\x38\x4a\x9c\x0c\x88\xe4\x05\xa0\x6c\x27\xdc" "\xf4\x9a\xda\x62\xeb\x2b"; c.inLen = strlen(c.input); @@ -787,7 +848,7 @@ int ripemd_test(void) d.input = "12345678901234567890123456789012345678901234567890123456" "789012345678901234567890"; d.output = "\x9b\x75\x2e\x45\x57\x3d\x4b\x39\xf4\xdb\xd3\x32\x3c\xab" - "\x82\xbf\x63\x32\x6b\xfb"; + "\x82\xbf\x63\x32\x6b\xfb"; d.inLen = strlen(d.input); d.outLen = RIPEMD_DIGEST_SIZE; @@ -886,6 +947,7 @@ int sha256_test(void) testVector a, b; testVector test_sha[2]; + int ret; int times = sizeof(test_sha) / sizeof(struct testVector), i; a.input = "abc"; @@ -905,7 +967,9 @@ int sha256_test(void) test_sha[0] = a; test_sha[1] = b; - InitSha256(&sha); + ret = InitSha256(&sha); + if (ret != 0) + return -4003; for (i = 0; i < times; ++i) { Sha256Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -925,6 +989,7 @@ int sha512_test(void) { Sha512 sha; byte hash[SHA512_DIGEST_SIZE]; + int ret; testVector a, b; testVector test_sha[2]; @@ -945,14 +1010,16 @@ int sha512_test(void) "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88" "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4" "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b" - "\x87\x4b\xe9\x09"; + "\x87\x4b\xe9\x09"; b.inLen = strlen(b.input); b.outLen = SHA512_DIGEST_SIZE; test_sha[0] = a; test_sha[1] = b; - InitSha512(&sha); + ret = InitSha512(&sha); + if (ret != 0) + return -4009; for (i = 0; i < times; ++i) { Sha512Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -972,6 +1039,7 @@ int sha384_test(void) { Sha384 sha; byte hash[SHA384_DIGEST_SIZE]; + int ret; testVector a, b; testVector test_sha[2]; @@ -992,12 +1060,14 @@ int sha384_test(void) "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91" "\x74\x60\x39"; b.inLen = strlen(b.input); - b.outLen = SHA384_DIGEST_SIZE; + b.outLen = SHA384_DIGEST_SIZE; test_sha[0] = a; test_sha[1] = b; - InitSha384(&sha); + ret = InitSha384(&sha); + if (ret != 0) + return -4010; for (i = 0; i < times; ++i) { Sha384Update(&sha, (byte*)test_sha[i].input,(word32)test_sha[i].inLen); @@ -1028,6 +1098,7 @@ int hmac_md5_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1060,9 +1131,11 @@ int hmac_md5_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20009; + return -20009; #endif - HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, MD5, (byte*)keys[i], (word32)strlen(keys[i])); + if (ret != 0) + return -4011; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1096,6 +1169,7 @@ int hmac_sha_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1128,9 +1202,11 @@ int hmac_sha_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20010; + return -20010; #endif - HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA, (byte*)keys[i], (word32)strlen(keys[i])); + if (ret != 0) + return -4012; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1165,6 +1241,7 @@ int hmac_sha256_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1200,9 +1277,11 @@ int hmac_sha256_test(void) if (i == 1) continue; /* driver can't handle keys <= bytes */ if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) - return -20011; + return -20011; #endif - HmacSetKey(&hmac, SHA256, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA256, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4013; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1219,6 +1298,82 @@ int hmac_sha256_test(void) #endif +#if !defined(NO_HMAC) && defined(HAVE_BLAKE2) +int hmac_blake2b_test(void) +{ + Hmac hmac; + byte hash[BLAKE2B_256]; + + const char* keys[]= + { + "\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b\x0b" + "\x0b\x0b\x0b", + "Jefe", + "\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA\xAA" + "\xAA\xAA\xAA" + }; + + testVector a, b, c; + testVector test_hmac[3]; + + int ret; + int times = sizeof(test_hmac) / sizeof(testVector), i; + + a.input = "Hi There"; + a.output = "\x72\x93\x0d\xdd\xf5\xf7\xe1\x78\x38\x07\x44\x18\x0b\x3f\x51" + "\x37\x25\xb5\x82\xc2\x08\x83\x2f\x1c\x99\xfd\x03\xa0\x16\x75" + "\xac\xfd"; + a.inLen = strlen(a.input); + a.outLen = BLAKE2B_256; + + b.input = "what do ya want for nothing?"; + b.output = "\x3d\x20\x50\x71\x05\xc0\x8c\x0c\x38\x44\x1e\xf7\xf9\xd1\x67" + "\x21\xff\x64\xf5\x94\x00\xcf\xf9\x75\x41\xda\x88\x61\x9d\x7c" + "\xda\x2b"; + b.inLen = strlen(b.input); + b.outLen = BLAKE2B_256; + + c.input = "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD\xDD" + "\xDD\xDD\xDD\xDD\xDD\xDD"; + c.output = "\xda\xfe\x2a\x24\xfc\xe7\xea\x36\x34\xbe\x41\x92\xc7\x11\xa7" + "\x00\xae\x53\x9c\x11\x9c\x80\x74\x55\x22\x25\x4a\xb9\x55\xd3" + "\x0f\x87"; + c.inLen = strlen(c.input); + c.outLen = BLAKE2B_256; + + test_hmac[0] = a; + test_hmac[1] = b; + test_hmac[2] = c; + + for (i = 0; i < times; ++i) { +#ifdef HAVE_CAVIUM + if (i == 1) + continue; /* driver can't handle keys <= bytes */ + if (HmacInitCavium(&hmac, CAVIUM_DEV_ID) != 0) + return -20011; +#endif + ret = HmacSetKey(&hmac, BLAKE2B_ID, (byte*)keys[i], + (word32)strlen(keys[i])); + if (ret != 0) + return -4014; + HmacUpdate(&hmac, (byte*)test_hmac[i].input, + (word32)test_hmac[i].inLen); + HmacFinal(&hmac, hash); + + if (memcmp(hash, test_hmac[i].output, BLAKE2B_256) != 0) + return -20 - i; +#ifdef HAVE_CAVIUM + HmacFreeCavium(&hmac); +#endif + } + + return 0; +} +#endif + + #if !defined(NO_HMAC) && defined(CYASSL_SHA384) int hmac_sha384_test(void) { @@ -1237,6 +1392,7 @@ int hmac_sha384_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1271,7 +1427,9 @@ int hmac_sha384_test(void) test_hmac[2] = c; for (i = 0; i < times; ++i) { - HmacSetKey(&hmac, SHA384, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA384, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4015; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1303,6 +1461,7 @@ int hmac_sha512_test(void) testVector a, b, c; testVector test_hmac[3]; + int ret; int times = sizeof(test_hmac) / sizeof(testVector), i; a.input = "Hi There"; @@ -1340,7 +1499,9 @@ int hmac_sha512_test(void) test_hmac[2] = c; for (i = 0; i < times; ++i) { - HmacSetKey(&hmac, SHA512, (byte*)keys[i], (word32)strlen(keys[i])); + ret = HmacSetKey(&hmac, SHA512, (byte*)keys[i],(word32)strlen(keys[i])); + if (ret != 0) + return -4016; HmacUpdate(&hmac, (byte*)test_hmac[i].input, (word32)test_hmac[i].inLen); HmacFinal(&hmac, hash); @@ -1360,8 +1521,8 @@ int arc4_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x01\x23\x45\x67\x89\xab\xcd\xef", "\x01\x23\x45\x67\x89\xab\xcd\xef", "\x00\x00\x00\x00\x00\x00\x00\x00", @@ -1407,9 +1568,9 @@ int arc4_test(void) #ifdef HAVE_CAVIUM if (Arc4InitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20001; + return -20001; if (Arc4InitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20002; + return -20002; #endif Arc4SetKey(&enc, (byte*)keys[i], keylen); @@ -1442,8 +1603,8 @@ int hc128_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x53\xA6\xF9\x4C\x9F\xF2\x45\x98\xEB\x3E\x91\xE4\x37\x8A\xDD", @@ -1494,8 +1655,8 @@ int hc128_test(void) HC128 dec; /* align keys/ivs in plain/cipher buffers */ - memcpy(plain, keys[i], 16); - memcpy(cipher, ivs[i], 16); + memcpy(plain, keys[i], 16); + memcpy(cipher, ivs[i], 16); Hc128_SetKey(&enc, plain, cipher); Hc128_SetKey(&dec, plain, cipher); @@ -1523,8 +1684,8 @@ int rabbit_test(void) byte cipher[16]; byte plain[16]; - const char* keys[] = - { + const char* keys[] = + { "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00", "\xAC\xC3\x51\xDC\xF1\x62\xFC\x3B\xFE\x36\x3D\x2E\x29\x13\x28\x91" @@ -1553,7 +1714,7 @@ int rabbit_test(void) b.outLen = 8; c.input = "\x00\x00\x00\x00\x00\x00\x00\x00"; - c.output = "\x9C\x51\xE2\x87\x84\xC3\x7F\xE9"; + c.output = "\x04\xCE\xCA\x7A\x1A\x86\x6E\x77"; c.inLen = 8; c.outLen = 8; @@ -1608,34 +1769,40 @@ int des_test(void) Des enc; Des dec; - const byte key[] = + const byte key[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - const byte iv[] = + const byte iv[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; - const byte verify[] = + const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, 0x15,0x85,0xb3,0x22,0x4b,0x86,0x2b,0x4b }; + int ret; + + ret = Des_SetKey(&enc, key, iv, DES_ENCRYPTION); + if (ret != 0) + return -31; - Des_SetKey(&enc, key, iv, DES_ENCRYPTION); Des_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); - Des_SetKey(&dec, key, iv, DES_DECRYPTION); + ret = Des_SetKey(&dec, key, iv, DES_DECRYPTION); + if (ret != 0) + return -32; Des_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); if (memcmp(plain, vector, sizeof(plain))) - return -31; + return -33; if (memcmp(cipher, verify, sizeof(cipher))) - return -32; + return -34; return 0; } @@ -1657,44 +1824,54 @@ int des3_test(void) Des3 enc; Des3 dec; - const byte key3[] = + const byte key3[] = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef, 0xfe,0xde,0xba,0x98,0x76,0x54,0x32,0x10, 0x89,0xab,0xcd,0xef,0x01,0x23,0x45,0x67 }; - const byte iv3[] = + const byte iv3[] = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef, 0x01,0x01,0x01,0x01,0x01,0x01,0x01,0x01, 0x11,0x21,0x31,0x41,0x51,0x61,0x71,0x81 - + }; - const byte verify3[] = + const byte verify3[] = { 0x43,0xa0,0x29,0x7e,0xd1,0x84,0xf8,0x0e, 0x89,0x64,0x84,0x32,0x12,0xd5,0x08,0x98, 0x18,0x94,0x15,0x74,0x87,0x12,0x7d,0xb0 }; + int ret; + #ifdef HAVE_CAVIUM if (Des3_InitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20005; + return -20005; if (Des3_InitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20006; + return -20006; #endif - Des3_SetKey(&enc, key3, iv3, DES_ENCRYPTION); - Des3_SetKey(&dec, key3, iv3, DES_DECRYPTION); - Des3_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); - Des3_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); + ret = Des3_SetKey(&enc, key3, iv3, DES_ENCRYPTION); + if (ret != 0) + return -31; + ret = Des3_SetKey(&dec, key3, iv3, DES_DECRYPTION); + if (ret != 0) + return -32; + ret = Des3_CbcEncrypt(&enc, cipher, vector, sizeof(vector)); + if (ret != 0) + return -33; + ret = Des3_CbcDecrypt(&dec, plain, cipher, sizeof(cipher)); + if (ret != 0) + return -34; if (memcmp(plain, vector, sizeof(plain))) - return -33; + return -35; if (memcmp(cipher, verify3, sizeof(cipher))) - return -34; + return -36; #ifdef HAVE_CAVIUM Des3_FreeCavium(&enc); @@ -1717,7 +1894,7 @@ int aes_test(void) 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - const byte verify[] = + const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb @@ -1728,18 +1905,27 @@ int aes_test(void) byte cipher[AES_BLOCK_SIZE * 4]; byte plain [AES_BLOCK_SIZE * 4]; + int ret; #ifdef HAVE_CAVIUM if (AesInitCavium(&enc, CAVIUM_DEV_ID) != 0) - return -20003; + return -20003; if (AesInitCavium(&dec, CAVIUM_DEV_ID) != 0) - return -20004; + return -20004; #endif - AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); - AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + ret = AesSetKey(&enc, key, AES_BLOCK_SIZE, iv, AES_ENCRYPTION); + if (ret != 0) + return -1001; + ret = AesSetKey(&dec, key, AES_BLOCK_SIZE, iv, AES_DECRYPTION); + if (ret != 0) + return -1002; - AesCbcEncrypt(&enc, cipher, msg, AES_BLOCK_SIZE); - AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE); + ret = AesCbcEncrypt(&enc, cipher, msg, AES_BLOCK_SIZE); + if (ret != 0) + return -1005; + ret = AesCbcDecrypt(&dec, plain, cipher, AES_BLOCK_SIZE); + if (ret != 0) + return -1006; if (memcmp(plain, msg, AES_BLOCK_SIZE)) return -60; @@ -1753,7 +1939,7 @@ int aes_test(void) #endif #ifdef CYASSL_AES_COUNTER { - const byte ctrKey[] = + const byte ctrKey[] = { 0x2b,0x7e,0x15,0x16,0x28,0xae,0xd2,0xa6, 0xab,0xf7,0x15,0x88,0x09,0xcf,0x4f,0x3c @@ -1790,6 +1976,12 @@ int aes_test(void) 0x79,0x21,0x70,0xa0,0xf3,0x00,0x9c,0xee }; + const byte oddCipher[] = + { + 0xb9,0xd7,0xcb,0x08,0xb0,0xe1,0x7b,0xa0, + 0xc2 + }; + AesSetKeyDirect(&enc, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); /* Ctr only uses encrypt, even on key setup */ AesSetKeyDirect(&dec, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); @@ -1802,9 +1994,73 @@ int aes_test(void) if (memcmp(cipher, ctrCipher, AES_BLOCK_SIZE*4)) return -67; + + /* let's try with just 9 bytes, non block size test */ + AesSetKeyDirect(&enc, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); + /* Ctr only uses encrypt, even on key setup */ + AesSetKeyDirect(&dec, ctrKey, AES_BLOCK_SIZE, ctrIv, AES_ENCRYPTION); + + AesCtrEncrypt(&enc, cipher, ctrPlain, 9); + AesCtrEncrypt(&dec, plain, cipher, 9); + + if (memcmp(plain, ctrPlain, 9)) + return -68; + + if (memcmp(cipher, ctrCipher, 9)) + return -69; + + /* and an additional 9 bytes to reuse tmp left buffer */ + AesCtrEncrypt(&enc, cipher, ctrPlain, 9); + AesCtrEncrypt(&dec, plain, cipher, 9); + + if (memcmp(plain, ctrPlain, 9)) + return -70; + + if (memcmp(cipher, oddCipher, 9)) + return -71; } #endif /* CYASSL_AES_COUNTER */ +#if defined(CYASSL_AESNI) && defined(CYASSL_AES_DIRECT) + { + const byte niPlain[] = + { + 0x6b,0xc1,0xbe,0xe2,0x2e,0x40,0x9f,0x96, + 0xe9,0x3d,0x7e,0x11,0x73,0x93,0x17,0x2a + }; + + const byte niCipher[] = + { + 0xf3,0xee,0xd1,0xbd,0xb5,0xd2,0xa0,0x3c, + 0x06,0x4b,0x5a,0x7e,0x3d,0xb1,0x81,0xf8 + }; + + const byte niKey[] = + { + 0x60,0x3d,0xeb,0x10,0x15,0xca,0x71,0xbe, + 0x2b,0x73,0xae,0xf0,0x85,0x7d,0x77,0x81, + 0x1f,0x35,0x2c,0x07,0x3b,0x61,0x08,0xd7, + 0x2d,0x98,0x10,0xa3,0x09,0x14,0xdf,0xf4 + }; + + XMEMSET(cipher, 0, AES_BLOCK_SIZE); + ret = AesSetKey(&enc, niKey, sizeof(niKey), cipher, AES_ENCRYPTION); + if (ret != 0) + return -1003; + AesEncryptDirect(&enc, cipher, niPlain); + if (XMEMCMP(cipher, niCipher, AES_BLOCK_SIZE) != 0) + return -20006; + + XMEMSET(plain, 0, AES_BLOCK_SIZE); + ret = AesSetKey(&dec, niKey, sizeof(niKey), plain, AES_DECRYPTION); + if (ret != 0) + return -1004; + AesDecryptDirect(&dec, plain, niCipher); + if (XMEMCMP(plain, niPlain, AES_BLOCK_SIZE) != 0) + return -20007; + } +#endif /* CYASSL_AESNI && CYASSL_AES_DIRECT */ + return 0; } @@ -1831,7 +2087,7 @@ int aesgcm_test(void) 0xca, 0xfe, 0xba, 0xbe, 0xfa, 0xce, 0xdb, 0xad, 0xde, 0xca, 0xf8, 0x88 }; - + const byte p[] = { 0xd9, 0x31, 0x32, 0x25, 0xf8, 0x84, 0x06, 0xe5, @@ -1843,14 +2099,14 @@ int aesgcm_test(void) 0xb1, 0x6a, 0xed, 0xf5, 0xaa, 0x0d, 0xe6, 0x57, 0xba, 0x63, 0x7b, 0x39 }; - + const byte a[] = { 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xfe, 0xed, 0xfa, 0xce, 0xde, 0xad, 0xbe, 0xef, 0xab, 0xad, 0xda, 0xd2 }; - + const byte c[] = { 0x52, 0x2d, 0xc1, 0xf0, 0x99, 0x56, 0x7d, 0x07, @@ -1897,6 +2153,95 @@ int aesgcm_test(void) return 0; } + +int gmac_test(void) +{ + Gmac gmac; + + const byte k1[] = + { + 0x89, 0xc9, 0x49, 0xe9, 0xc8, 0x04, 0xaf, 0x01, + 0x4d, 0x56, 0x04, 0xb3, 0x94, 0x59, 0xf2, 0xc8 + }; + const byte iv1[] = + { + 0xd1, 0xb1, 0x04, 0xc8, 0x15, 0xbf, 0x1e, 0x94, + 0xe2, 0x8c, 0x8f, 0x16 + }; + const byte a1[] = + { + 0x82, 0xad, 0xcd, 0x63, 0x8d, 0x3f, 0xa9, 0xd9, + 0xf3, 0xe8, 0x41, 0x00, 0xd6, 0x1e, 0x07, 0x77 + }; + const byte t1[] = + { + 0x88, 0xdb, 0x9d, 0x62, 0x17, 0x2e, 0xd0, 0x43, + 0xaa, 0x10, 0xf1, 0x6d, 0x22, 0x7d, 0xc4, 0x1b + }; + + const byte k2[] = + { + 0x40, 0xf7, 0xec, 0xb2, 0x52, 0x6d, 0xaa, 0xd4, + 0x74, 0x25, 0x1d, 0xf4, 0x88, 0x9e, 0xf6, 0x5b + }; + const byte iv2[] = + { + 0xee, 0x9c, 0x6e, 0x06, 0x15, 0x45, 0x45, 0x03, + 0x1a, 0x60, 0x24, 0xa7 + }; + const byte a2[] = + { + 0x94, 0x81, 0x2c, 0x87, 0x07, 0x4e, 0x15, 0x18, + 0x34, 0xb8, 0x35, 0xaf, 0x1c, 0xa5, 0x7e, 0x56 + }; + const byte t2[] = + { + 0xc6, 0x81, 0x79, 0x8e, 0x3d, 0xda, 0xb0, 0x9f, + 0x8d, 0x83, 0xb0, 0xbb, 0x14, 0xb6, 0x91 + }; + + const byte k3[] = + { + 0xb8, 0xe4, 0x9a, 0x5e, 0x37, 0xf9, 0x98, 0x2b, + 0xb9, 0x6d, 0xd0, 0xc9, 0xb6, 0xab, 0x26, 0xac + }; + const byte iv3[] = + { + 0xe4, 0x4a, 0x42, 0x18, 0x8c, 0xae, 0x94, 0x92, + 0x6a, 0x9c, 0x26, 0xb0 + }; + const byte a3[] = + { + 0x9d, 0xb9, 0x61, 0x68, 0xa6, 0x76, 0x7a, 0x31, + 0xf8, 0x29, 0xe4, 0x72, 0x61, 0x68, 0x3f, 0x8a + }; + const byte t3[] = + { + 0x23, 0xe2, 0x9f, 0x66, 0xe4, 0xc6, 0x52, 0x48 + }; + + byte tag[16]; + + memset(tag, 0, sizeof(tag)); + GmacSetKey(&gmac, k1, sizeof(k1)); + GmacUpdate(&gmac, iv1, sizeof(iv1), a1, sizeof(a1), tag, sizeof(t1)); + if (memcmp(t1, tag, sizeof(t1)) != 0) + return -126; + + memset(tag, 0, sizeof(tag)); + GmacSetKey(&gmac, k2, sizeof(k2)); + GmacUpdate(&gmac, iv2, sizeof(iv2), a2, sizeof(a2), tag, sizeof(t2)); + if (memcmp(t2, tag, sizeof(t2)) != 0) + return -127; + + memset(tag, 0, sizeof(tag)); + GmacSetKey(&gmac, k3, sizeof(k3)); + GmacUpdate(&gmac, iv3, sizeof(iv3), a3, sizeof(a3), tag, sizeof(t3)); + if (memcmp(t3, tag, sizeof(t3)) != 0) + return -128; + + return 0; +} #endif /* HAVE_AESGCM */ #ifdef HAVE_AESCCM @@ -1940,7 +2285,7 @@ int aesccm_test(void) const byte t[] = { - 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 + 0x17, 0xe8, 0xd1, 0x2c, 0xfd, 0xf9, 0x26, 0xe0 }; byte t2[sizeof(t)]; @@ -2009,7 +2354,7 @@ typedef struct { int camellia_test(void) { /* Camellia ECB Test Plaintext */ - static const byte pte[] = + static const byte pte[] = { 0x01, 0x23, 0x45, 0x67, 0x89, 0xab, 0xcd, 0xef, 0xfe, 0xdc, 0xba, 0x98, 0x76, 0x54, 0x32, 0x10 @@ -2061,26 +2406,26 @@ int camellia_test(void) static const byte ptc[] = { 0x6B, 0xC1, 0xBE, 0xE2, 0x2E, 0x40, 0x9F, 0x96, - 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A + 0xE9, 0x3D, 0x7E, 0x11, 0x73, 0x93, 0x17, 0x2A }; /* Camellia CBC Test Initialization Vector */ static const byte ivc[] = { 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, - 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F + 0x08, 0x09, 0x0A, 0x0B, 0x0C, 0x0D, 0x0E, 0x0F }; /* Test 4: Camellia-CBC 128-bit key */ static const byte k4[] = { 0x2B, 0x7E, 0x15, 0x16, 0x28, 0xAE, 0xD2, 0xA6, - 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C + 0xAB, 0xF7, 0x15, 0x88, 0x09, 0xCF, 0x4F, 0x3C }; static const byte c4[] = { 0x16, 0x07, 0xCF, 0x49, 0x4B, 0x36, 0xBB, 0xF0, - 0x0D, 0xAE, 0xB0, 0xB5, 0x03, 0xC8, 0x31, 0xAB + 0x0D, 0xAE, 0xB0, 0xB5, 0x03, 0xC8, 0x31, 0xAB }; /* Test 5: Camellia-CBC 192-bit key */ @@ -2088,12 +2433,12 @@ int camellia_test(void) { 0x8E, 0x73, 0xB0, 0xF7, 0xDA, 0x0E, 0x64, 0x52, 0xC8, 0x10, 0xF3, 0x2B, 0x80, 0x90, 0x79, 0xE5, - 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B + 0x62, 0xF8, 0xEA, 0xD2, 0x52, 0x2C, 0x6B, 0x7B }; static const byte c5[] = { 0x2A, 0x48, 0x30, 0xAB, 0x5A, 0xC4, 0xA1, 0xA2, - 0x40, 0x59, 0x55, 0xFD, 0x21, 0x95, 0xCF, 0x93 + 0x40, 0x59, 0x55, 0xFD, 0x21, 0x95, 0xCF, 0x93 }; /* Test 6: CBC 256-bit key */ @@ -2102,12 +2447,12 @@ int camellia_test(void) 0x60, 0x3D, 0xEB, 0x10, 0x15, 0xCA, 0x71, 0xBE, 0x2B, 0x73, 0xAE, 0xF0, 0x85, 0x7D, 0x77, 0x81, 0x1F, 0x35, 0x2C, 0x07, 0x3B, 0x61, 0x08, 0xD7, - 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 + 0x2D, 0x98, 0x10, 0xA3, 0x09, 0x14, 0xDF, 0xF4 }; static const byte c6[] = { 0xE6, 0xCF, 0xA3, 0x5F, 0xC0, 0x2B, 0x13, 0x4A, - 0x4D, 0x2C, 0x0B, 0x67, 0x37, 0xAC, 0x3E, 0xDA + 0x4D, 0x2C, 0x0B, 0x67, 0x37, 0xAC, 0x3E, 0xDA }; byte out[CAMELLIA_BLOCK_SIZE]; @@ -2129,10 +2474,6 @@ int camellia_test(void) {CAM_CBC_DEC, ptc, ivc, c6, k6, sizeof(k6), -125} }; - if ((sizeof(pte) != CAMELLIA_BLOCK_SIZE) || - (sizeof(ptc) != CAMELLIA_BLOCK_SIZE)) - return -113; - testsSz = sizeof(testVectors)/sizeof(test_vector_t); for (i = 0; i < testsSz; i++) { CamelliaSetKey(&cam, testVectors[i].key, testVectors[i].keySz, @@ -2171,15 +2512,19 @@ int camellia_test(void) if (XMEMCMP(cam.reg, ivc, CAMELLIA_BLOCK_SIZE)) return -1; - /* Setting the IV to NULL should leave the IV unchanged */ + /* Setting the IV to NULL should be same as all zeros IV */ if (CamelliaSetIV(&cam, NULL) != 0 || XMEMCMP(cam.reg, ive, CAMELLIA_BLOCK_SIZE)) return -1; - + /* First parameter should never be null */ if (CamelliaSetIV(NULL, NULL) == 0) return -1; + /* First parameter should never be null, check it fails */ + if (CamelliaSetKey(NULL, k1, sizeof(k1), NULL) == 0) + return -1; + /* Key should have a size of 16, 24, or 32 */ if (CamelliaSetKey(&cam, k1, 0, NULL) == 0) return -1; @@ -2244,30 +2589,46 @@ byte GetEntropy(ENTROPY_CMD cmd, byte* out) #ifndef NO_RSA -#ifdef FREESCALE_MQX - static const char* clientKey = "a:\\certs\\client-key.der"; - static const char* clientCert = "a:\\certs\\client-cert.der"; - #ifdef CYASSL_CERT_GEN - static const char* caKeyFile = "a:\\certs\\ca-key.der"; - static const char* caCertFile = "a:\\certs\\ca-cert.pem"; - #endif -#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) && defined(CYASSL_MKD_SHELL) - static char* clientKey = "certs/client-key.der"; - static char* clientCert = "certs/client-cert.der"; - void set_clientKey(char *key) { clientKey = key ; } /* set by shell command */ - void set_clientCert(char *cert) { clientCert = cert ; } /* set by shell command */ - #ifdef CYASSL_CERT_GEN - static char* caKeyFile = "certs/ca-key.der"; - static char* caCertFile = "certs/ca-cert.pem"; - void set_caKeyFile (char * key) { caKeyFile = key ; } /* set by shell command */ - void set_caCertFile(char * cert) { caCertFile = cert ; } /* set by shell command */ - #endif -#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) - static const char* clientKey = "./certs/client-key.der"; - static const char* clientCert = "./certs/client-cert.der"; - #ifdef CYASSL_CERT_GEN - static const char* caKeyFile = "./certs/ca-key.der"; - static const char* caCertFile = "./certs/ca-cert.pem"; +#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) + #ifdef FREESCALE_MQX + static const char* clientKey = "a:\\certs\\client-key.der"; + static const char* clientCert = "a:\\certs\\client-cert.der"; + #ifdef CYASSL_CERT_GEN + static const char* caKeyFile = "a:\\certs\\ca-key.der"; + static const char* caCertFile = "a:\\certs\\ca-cert.pem"; + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "a:\\certs\\ecc-key.der"; + static const char* eccCaCertFile = "a:\\certs\\server-ecc.pem"; + #endif + #endif + #elif defined(CYASSL_MKD_SHELL) + static char* clientKey = "certs/client-key.der"; + static char* clientCert = "certs/client-cert.der"; + void set_clientKey(char *key) { clientKey = key ; } + void set_clientCert(char *cert) { clientCert = cert ; } + #ifdef CYASSL_CERT_GEN + static char* caKeyFile = "certs/ca-key.der"; + static char* caCertFile = "certs/ca-cert.pem"; + void set_caKeyFile (char * key) { caKeyFile = key ; } + void set_caCertFile(char * cert) { caCertFile = cert ; } + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "certs/ecc-key.der"; + static const char* eccCaCertFile = "certs/server-ecc.pem"; + void set_eccCaKeyFile (char * key) { eccCaKeyFile = key ; } + void set_eccCaCertFile(char * cert) { eccCaCertFile = cert ; } + #endif + #endif + #else + static const char* clientKey = "./certs/client-key.der"; + static const char* clientCert = "./certs/client-cert.der"; + #ifdef CYASSL_CERT_GEN + static const char* caKeyFile = "./certs/ca-key.der"; + static const char* caCertFile = "./certs/ca-cert.pem"; + #ifdef HAVE_ECC + static const char* eccCaKeyFile = "./certs/ecc-key.der"; + static const char* eccCaCertFile = "./certs/server-ecc.pem"; + #endif + #endif #endif #endif @@ -2314,11 +2675,12 @@ int rsa_test(void) bytes = fread(tmp, 1, FOURK_BUF, file); fclose(file); #endif /* USE_CERT_BUFFERS */ - + #ifdef HAVE_CAVIUM RsaInitCavium(&key, CAVIUM_DEV_ID); -#endif - InitRsaKey(&key, 0); +#endif + ret = InitRsaKey(&key, 0); + if (ret != 0) return -39; ret = RsaPrivateKeyDecode(tmp, &idx, &key, (word32)bytes); if (ret != 0) return -41; @@ -2362,8 +2724,8 @@ int rsa_test(void) #endif #ifdef sizeof - #undef sizeof -#endif + #undef sizeof +#endif #ifdef CYASSL_TEST_CERT InitDecodedCert(&cert, tmp, (word32)bytes, 0); @@ -2388,7 +2750,8 @@ int rsa_test(void) FILE* keyFile; FILE* pemFile; - InitRsaKey(&genKey, 0); + ret = InitRsaKey(&genKey, 0); + if (ret != 0) return -300; ret = MakeRsaKey(&genKey, 1024, 65537, &rng); if (ret != 0) return -301; @@ -2415,12 +2778,13 @@ int rsa_test(void) return -304; pemFile = fopen("./key.pem", "wb"); - if (!pemFile) + if (!pemFile) return -305; ret = (int)fwrite(pem, pemSz, 1, pemFile); fclose(pemFile); - InitRsaKey(&derIn, 0); + ret = InitRsaKey(&derIn, 0); + if (ret != 0) return -3060; idx = 0; ret = RsaPrivateKeyDecode(der, &idx, &derIn, derSz); if (ret != 0) @@ -2467,7 +2831,7 @@ int rsa_test(void) myCert.isCA = 1; myCert.sigType = CTC_SHA256wRSA; - certSz = MakeSelfCert(&myCert, derCert, FOURK_BUF, &key, &rng); + certSz = MakeSelfCert(&myCert, derCert, FOURK_BUF, &key, &rng); if (certSz < 0) return -401; @@ -2508,7 +2872,7 @@ int rsa_test(void) int pemSz; size_t bytes3; word32 idx3 = 0; - FILE* file3 ; + FILE* file3 ; #ifdef CYASSL_TEST_CERT DecodedCert decode; #endif @@ -2527,8 +2891,9 @@ int rsa_test(void) bytes3 = fread(tmp, 1, FOURK_BUF, file3); fclose(file3); - - InitRsaKey(&caKey, 0); + + ret = InitRsaKey(&caKey, 0); + if (ret != 0) return -411; ret = RsaPrivateKeyDecode(tmp, &idx3, &caKey, (word32)bytes3); if (ret != 0) return -413; @@ -2546,12 +2911,12 @@ int rsa_test(void) if (ret < 0) return -405; - certSz = MakeCert(&myCert, derCert, FOURK_BUF, &key, &rng); + certSz = MakeCert(&myCert, derCert, FOURK_BUF, &key, NULL, &rng); if (certSz < 0) return -407; certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, - &caKey, &rng); + &caKey, NULL, &rng); if (certSz < 0) return -408; @@ -2583,6 +2948,95 @@ int rsa_test(void) free(derCert); FreeRsaKey(&caKey); } +#ifdef HAVE_ECC + /* ECC CA style */ + { + ecc_key caKey; + Cert myCert; + byte* derCert; + byte* pem; + FILE* derFile; + FILE* pemFile; + int certSz; + int pemSz; + size_t bytes3; + word32 idx3 = 0; + FILE* file3 ; +#ifdef CYASSL_TEST_CERT + DecodedCert decode; +#endif + + derCert = (byte*)malloc(FOURK_BUF); + if (derCert == NULL) + return -5311; + pem = (byte*)malloc(FOURK_BUF); + if (pem == NULL) + return -5312; + + file3 = fopen(eccCaKeyFile, "rb"); + + if (!file3) + return -5412; + + bytes3 = fread(tmp, 1, FOURK_BUF, file3); + fclose(file3); + + ecc_init(&caKey); + ret = EccPrivateKeyDecode(tmp, &idx3, &caKey, (word32)bytes3); + if (ret != 0) return -5413; + + InitCert(&myCert); + myCert.sigType = CTC_SHA256wECDSA; + + strncpy(myCert.subject.country, "US", CTC_NAME_SIZE); + strncpy(myCert.subject.state, "OR", CTC_NAME_SIZE); + strncpy(myCert.subject.locality, "Portland", CTC_NAME_SIZE); + strncpy(myCert.subject.org, "wolfSSL", CTC_NAME_SIZE); + strncpy(myCert.subject.unit, "Development", CTC_NAME_SIZE); + strncpy(myCert.subject.commonName, "www.wolfssl.com", CTC_NAME_SIZE); + strncpy(myCert.subject.email, "info@wolfssl.com", CTC_NAME_SIZE); + + ret = SetIssuer(&myCert, eccCaCertFile); + if (ret < 0) + return -5405; + + certSz = MakeCert(&myCert, derCert, FOURK_BUF, NULL, &caKey, &rng); + if (certSz < 0) + return -5407; + + certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, + NULL, &caKey, &rng); + if (certSz < 0) + return -5408; + +#ifdef CYASSL_TEST_CERT + InitDecodedCert(&decode, derCert, certSz, 0); + ret = ParseCert(&decode, CERT_TYPE, NO_VERIFY, 0); + if (ret != 0) + return -5409; + FreeDecodedCert(&decode); +#endif + + derFile = fopen("./certecc.der", "wb"); + if (!derFile) + return -5410; + ret = (int)fwrite(derCert, certSz, 1, derFile); + fclose(derFile); + + pemSz = DerToPem(derCert, certSz, pem, FOURK_BUF, CERT_TYPE); + if (pemSz < 0) + return -5411; + + pemFile = fopen("./certecc.pem", "wb"); + if (!pemFile) + return -5412; + ret = (int)fwrite(pem, pemSz, 1, pemFile); + fclose(pemFile); + free(pem); + free(derCert); + ecc_free(&caKey); + } +#endif /* HAVE_ECC */ #ifdef HAVE_NTRU { RsaKey caKey; @@ -2639,8 +3093,9 @@ int rsa_test(void) bytes = fread(tmp, 1, FOURK_BUF, caFile); fclose(caFile); - - InitRsaKey(&caKey, 0); + + ret = InitRsaKey(&caKey, 0); + if (ret != 0) return -459; ret = RsaPrivateKeyDecode(tmp, &idx, &caKey, (word32)bytes); if (ret != 0) return -454; @@ -2659,12 +3114,12 @@ int rsa_test(void) return -455; certSz = MakeNtruCert(&myCert, derCert, FOURK_BUF, public_key, - public_key_len, &rng); + public_key_len, &rng); if (certSz < 0) return -456; certSz = SignCert(myCert.bodySz, myCert.sigType, derCert, FOURK_BUF, - &caKey, &rng); + &caKey, NULL, &rng); if (certSz < 0) return -457; @@ -2702,12 +3157,72 @@ int rsa_test(void) FreeRsaKey(&caKey); } #endif /* HAVE_NTRU */ +#ifdef CYASSL_CERT_REQ + { + Cert req; + byte* der; + byte* pem; + int derSz; + int pemSz; + FILE* reqFile; + + der = (byte*)malloc(FOURK_BUF); + if (der == NULL) + return -463; + pem = (byte*)malloc(FOURK_BUF); + if (pem == NULL) + return -464; + + InitCert(&req); + + req.version = 0; + req.isCA = 1; + strncpy(req.challengePw, "yassl123", CTC_NAME_SIZE); + strncpy(req.subject.country, "US", CTC_NAME_SIZE); + strncpy(req.subject.state, "OR", CTC_NAME_SIZE); + strncpy(req.subject.locality, "Portland", CTC_NAME_SIZE); + strncpy(req.subject.org, "yaSSL", CTC_NAME_SIZE); + strncpy(req.subject.unit, "Development", CTC_NAME_SIZE); + strncpy(req.subject.commonName, "www.yassl.com", CTC_NAME_SIZE); + strncpy(req.subject.email, "info@yassl.com", CTC_NAME_SIZE); + req.sigType = CTC_SHA256wRSA; + + derSz = MakeCertReq(&req, der, FOURK_BUF, &key, NULL); + if (derSz < 0) + return -465; + + derSz = SignCert(req.bodySz, req.sigType, der, FOURK_BUF, + &key, NULL, &rng); + if (derSz < 0) + return -466; + + pemSz = DerToPem(der, derSz, pem, FOURK_BUF, CERTREQ_TYPE); + if (pemSz < 0) + return -467; + + reqFile = fopen("./certreq.der", "wb"); + if (!reqFile) + return -468; + + ret = (int)fwrite(der, derSz, 1, reqFile); + fclose(reqFile); + + reqFile = fopen("./certreq.pem", "wb"); + if (!reqFile) + return -469; + ret = (int)fwrite(pem, pemSz, 1, reqFile); + fclose(reqFile); + + free(pem); + free(der); + } +#endif /* CYASSL_CERT_REQ */ #endif /* CYASSL_CERT_GEN */ FreeRsaKey(&key); #ifdef HAVE_CAVIUM RsaFreeCavium(&key); -#endif +#endif free(tmp); return 0; @@ -2718,10 +3233,12 @@ int rsa_test(void) #ifndef NO_DH -#ifdef FREESCALE_MQX - static const char* dhKey = "a:\certs\\dh2048.der"; -#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) - static const char* dhKey = "./certs/dh2048.der"; +#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) + #ifdef FREESCALE_MQX + static const char* dhKey = "a:\certs\\dh2048.der"; + #else + static const char* dhKey = "./certs/dh2048.der"; + #endif #endif int dh_test(void) @@ -2739,8 +3256,8 @@ int dh_test(void) DhKey key; DhKey key2; RNG rng; - - + + #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dh_key_der_1024, sizeof_dh_key_der_1024); bytes = sizeof_dh_key_der_1024; @@ -2757,8 +3274,8 @@ int dh_test(void) fclose(file); #endif /* USE_CERT_BUFFERS */ - InitDhKey(&key); - InitDhKey(&key2); + InitDhKey(&key); + InitDhKey(&key2); ret = DhKeyDecode(tmp, &idx, &key, bytes); if (ret != 0) return -51; @@ -2771,7 +3288,7 @@ int dh_test(void) ret = InitRng(&rng); if (ret != 0) return -53; - + ret = DhGenerateKeyPair(&key, &rng, priv, &privSz, pub, &pubSz); ret += DhGenerateKeyPair(&key2, &rng, priv2, &privSz2, pub2, &pubSz2); if (ret != 0) @@ -2796,10 +3313,12 @@ int dh_test(void) #ifndef NO_DSA -#ifdef FREESCALE_MQX - static const char* dsaKey = "a:\\certs\\dsa2048.der"; -#elif !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) - static const char* dsaKey = "./certs/dsa2048.der"; +#if !defined(USE_CERT_BUFFERS_1024) && !defined(USE_CERT_BUFFERS_2048) + #ifdef FREESCALE_MQX + static const char* dsaKey = "a:\\certs\\dsa2048.der"; + #else + static const char* dsaKey = "./certs/dsa2048.der"; + #endif #endif int dsa_test(void) @@ -2814,7 +3333,7 @@ int dsa_test(void) byte hash[SHA_DIGEST_SIZE]; byte signature[40]; - + #ifdef USE_CERT_BUFFERS_1024 XMEMCPY(tmp, dsa_key_der_1024, sizeof_dsa_key_der_1024); bytes = sizeof_dsa_key_der_1024; @@ -2830,8 +3349,10 @@ int dsa_test(void) bytes = (word32) fread(tmp, 1, sizeof(tmp), file); fclose(file); #endif /* USE_CERT_BUFFERS */ - - InitSha(&sha); + + ret = InitSha(&sha); + if (ret != 0) + return -4002; ShaUpdate(&sha, tmp, bytes); ShaFinal(&sha, hash); @@ -2848,9 +3369,9 @@ int dsa_test(void) ret = DsaVerify(hash, signature, &key, &answer); if (ret != 0) return -64; if (answer != 1) return -65; - + FreeDsaKey(&key); - + return 0; } @@ -2925,7 +3446,7 @@ int openssl_test(void) e.output = "\x09\x33\x0c\x33\xf7\x11\x47\xe8\x3d\x19\x2f\xc7\x82\xcd\x1b" "\x47\x53\x11\x1b\x17\x3b\x3b\x05\xd2\x2f\xa0\x80\x86\xe3\xb0" "\xf7\x12\xfc\xc7\xc7\x1a\x55\x7e\x2d\xb9\x66\xc3\xe9\xfa\x91" - "\x74\x60\x39"; + "\x74\x60\x39"; e.inLen = strlen(e.input); e.outLen = SHA384_DIGEST_SIZE; @@ -2949,9 +3470,9 @@ int openssl_test(void) "\x3f\x8f\x77\x79\xc6\xeb\x9f\x7f\xa1\x72\x99\xae\xad\xb6\x88" "\x90\x18\x50\x1d\x28\x9e\x49\x00\xf7\xe4\x33\x1b\x99\xde\xc4" "\xb5\x43\x3a\xc7\xd3\x29\xee\xb6\xdd\x26\x54\x5e\x96\xe5\x5b" - "\x87\x4b\xe9\x09"; + "\x87\x4b\xe9\x09"; f.inLen = strlen(f.input); - f.outLen = SHA512_DIGEST_SIZE; + f.outLen = SHA512_DIGEST_SIZE; EVP_MD_CTX_init(&md_ctx); EVP_DigestInit(&md_ctx, EVP_sha512()); @@ -2967,7 +3488,7 @@ int openssl_test(void) if (RAND_bytes(hash, sizeof(hash)) != 1) return -73; - + c.input = "what do ya want for nothing?"; c.output = "\x75\x0c\x78\x3e\x6a\xb0\xb5\x03\xea\xa8\x6e\x31\x0a\x5d\xb7" "\x38"; @@ -2989,19 +3510,19 @@ int openssl_test(void) byte plain[24]; byte cipher[24]; - const_DES_cblock key = + const_DES_cblock key = { 0x01,0x23,0x45,0x67,0x89,0xab,0xcd,0xef }; - DES_cblock iv = + DES_cblock iv = { 0x12,0x34,0x56,0x78,0x90,0xab,0xcd,0xef }; DES_key_schedule sched; - const byte verify[] = + const byte verify[] = { 0x8b,0x7c,0x52,0xb0,0x01,0x2b,0x6c,0xb8, 0x4f,0x0f,0xeb,0xf3,0xfb,0x5f,0x86,0x73, @@ -3038,7 +3559,7 @@ int openssl_test(void) 0x66,0x6f,0x72,0x20,0x61,0x6c,0x6c,0x20 }; - const byte verify[] = + const byte verify[] = { 0x95,0x94,0x92,0x57,0x5f,0x42,0x81,0x53, 0x2c,0xcc,0x9d,0x46,0x77,0xa2,0x33,0xcb @@ -3084,11 +3605,11 @@ int openssl_test(void) int pkcs12_test(void) { const byte passwd[] = { 0x00, 0x73, 0x00, 0x6d, 0x00, 0x65, 0x00, 0x67, - 0x00, 0x00 }; + 0x00, 0x00 }; const byte salt[] = { 0x0a, 0x58, 0xCF, 0x64, 0x53, 0x0d, 0x82, 0x3f }; const byte passwd2[] = { 0x00, 0x71, 0x00, 0x75, 0x00, 0x65, 0x00, 0x65, - 0x00, 0x67, 0x00, 0x00 }; + 0x00, 0x67, 0x00, 0x00 }; const byte salt2[] = { 0x16, 0x82, 0xC0, 0xfC, 0x5b, 0x3f, 0x7e, 0xc5 }; byte derived[64]; @@ -3117,7 +3638,7 @@ int pkcs12_test(void) return -104; iterations = 1000; - ret = PKCS12_PBKDF(derived, passwd2, sizeof(passwd2), salt2, 8, iterations, + ret = PKCS12_PBKDF(derived, passwd2, sizeof(passwd2), salt2, 8, iterations, kLen, SHA, id); if (ret < 0) return -105; @@ -3186,6 +3707,87 @@ int pwdbased_test(void) #endif /* NO_PWDBASED */ +#if defined(HAVE_HKDF) && (!defined(NO_SHA) || !defined(NO_SHA256)) + +int hkdf_test(void) +{ + int ret; + int L = 42; + byte okm1[42]; + byte ikm1[22] = { 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, + 0x0b, 0x0b, 0x0b, 0x0b, 0x0b, 0x0b }; + byte salt1[13] ={ 0x00, 0x01, 0x02, 0x03, 0x04, 0x05, 0x06, 0x07, + 0x08, 0x09, 0x0a, 0x0b, 0x0c }; + byte info1[10] ={ 0xf0, 0xf1, 0xf2, 0xf3, 0xf4, 0xf5, 0xf6, 0xf7, + 0xf8, 0xf9 }; + byte res1[42] = { 0x0a, 0xc1, 0xaf, 0x70, 0x02, 0xb3, 0xd7, 0x61, + 0xd1, 0xe5, 0x52, 0x98, 0xda, 0x9d, 0x05, 0x06, + 0xb9, 0xae, 0x52, 0x05, 0x72, 0x20, 0xa3, 0x06, + 0xe0, 0x7b, 0x6b, 0x87, 0xe8, 0xdf, 0x21, 0xd0, + 0xea, 0x00, 0x03, 0x3d, 0xe0, 0x39, 0x84, 0xd3, + 0x49, 0x18 }; + byte res2[42] = { 0x08, 0x5a, 0x01, 0xea, 0x1b, 0x10, 0xf3, 0x69, + 0x33, 0x06, 0x8b, 0x56, 0xef, 0xa5, 0xad, 0x81, + 0xa4, 0xf1, 0x4b, 0x82, 0x2f, 0x5b, 0x09, 0x15, + 0x68, 0xa9, 0xcd, 0xd4, 0xf1, 0x55, 0xfd, 0xa2, + 0xc2, 0x2e, 0x42, 0x24, 0x78, 0xd3, 0x05, 0xf3, + 0xf8, 0x96 }; + byte res3[42] = { 0x8d, 0xa4, 0xe7, 0x75, 0xa5, 0x63, 0xc1, 0x8f, + 0x71, 0x5f, 0x80, 0x2a, 0x06, 0x3c, 0x5a, 0x31, + 0xb8, 0xa1, 0x1f, 0x5c, 0x5e, 0xe1, 0x87, 0x9e, + 0xc3, 0x45, 0x4e, 0x5f, 0x3c, 0x73, 0x8d, 0x2d, + 0x9d, 0x20, 0x13, 0x95, 0xfa, 0xa4, 0xb6, 0x1a, + 0x96, 0xc8 }; + byte res4[42] = { 0x3c, 0xb2, 0x5f, 0x25, 0xfa, 0xac, 0xd5, 0x7a, + 0x90, 0x43, 0x4f, 0x64, 0xd0, 0x36, 0x2f, 0x2a, + 0x2d, 0x2d, 0x0a, 0x90, 0xcf, 0x1a, 0x5a, 0x4c, + 0x5d, 0xb0, 0x2d, 0x56, 0xec, 0xc4, 0xc5, 0xbf, + 0x34, 0x00, 0x72, 0x08, 0xd5, 0xb8, 0x87, 0x18, + 0x58, 0x65 }; + + (void)res1; + (void)res2; + (void)res3; + (void)res4; + +#ifndef NO_SHA + ret = HKDF(SHA, ikm1, 22, NULL, 0, NULL, 0, okm1, L); + if (ret != 0) + return -2001; + + if (memcmp(okm1, res1, L) != 0) + return -2002; + + ret = HKDF(SHA, ikm1, 11, salt1, 13, info1, 10, okm1, L); + if (ret != 0) + return -2003; + + if (memcmp(okm1, res2, L) != 0) + return -2004; +#endif /* NO_SHA */ + +#ifndef NO_SHA256 + ret = HKDF(SHA256, ikm1, 22, NULL, 0, NULL, 0, okm1, L); + if (ret != 0) + return -2005; + + if (memcmp(okm1, res3, L) != 0) + return -2006; + + ret = HKDF(SHA256, ikm1, 22, salt1, 13, info1, 10, okm1, L); + if (ret != 0) + return -2007; + + if (memcmp(okm1, res4, L) != 0) + return -2007; +#endif /* NO_SHA256 */ + + return 0; +} + +#endif /* HAVE_HKDF */ + #ifdef HAVE_ECC @@ -3217,10 +3819,10 @@ int ecc_test(void) x = sizeof(sharedA); ret = ecc_shared_secret(&userA, &userB, sharedA, &x); - + y = sizeof(sharedB); ret = ecc_shared_secret(&userB, &userA, sharedB, &y); - + if (ret != 0) return -1003; @@ -3237,12 +3839,12 @@ int ecc_test(void) ret = ecc_import_x963(exportBuf, x, &pubKey); - if (ret != 0) + if (ret != 0) return -1007; y = sizeof(sharedB); ret = ecc_shared_secret(&userB, &pubKey, sharedB, &y); - + if (ret != 0) return -1008; @@ -3251,11 +3853,11 @@ int ecc_test(void) /* test DSA sign hash */ for (i = 0; i < (int)sizeof(digest); i++) - digest[i] = i; + digest[i] = (byte)i; x = sizeof(sig); ret = ecc_sign_hash(digest, sizeof(digest), sig, &x, &rng, &userA); - + verify = 0; ret = ecc_verify_hash(sig, x, digest, sizeof(digest), &verify, &userA); @@ -3265,6 +3867,11 @@ int ecc_test(void) if (verify != 1) return -1012; + x = sizeof(exportBuf); + ret = ecc_export_private_only(&userA, exportBuf, &x); + if (ret != 0) + return -1013; + ecc_free(&pubKey); ecc_free(&userB); ecc_free(&userA); @@ -3272,6 +3879,134 @@ int ecc_test(void) return 0; } +#ifdef HAVE_ECC_ENCRYPT + +int ecc_encrypt_test(void) +{ + RNG rng; + int ret; + ecc_key userA, userB; + byte msg[48]; + byte plain[48]; + byte out[80]; + word32 outSz = sizeof(out); + word32 plainSz = sizeof(plain); + int i; + + ret = InitRng(&rng); + if (ret != 0) + return -3001; + + ecc_init(&userA); + ecc_init(&userB); + + ret = ecc_make_key(&rng, 32, &userA); + ret += ecc_make_key(&rng, 32, &userB); + + if (ret != 0) + return -3002; + + for (i = 0; i < 48; i++) + msg[i] = i; + + /* encrypt msg to B */ + ret = ecc_encrypt(&userA, &userB, msg, sizeof(msg), out, &outSz, NULL); + if (ret != 0) + return -3003; + + /* decrypt msg from A */ + ret = ecc_decrypt(&userB, &userA, out, outSz, plain, &plainSz, NULL); + if (ret != 0) + return -3004; + + if (memcmp(plain, msg, sizeof(msg)) != 0) + return -3005; + + + { /* let's verify message exchange works, A is client, B is server */ + ecEncCtx* cliCtx = ecc_ctx_new(REQ_RESP_CLIENT, &rng); + ecEncCtx* srvCtx = ecc_ctx_new(REQ_RESP_SERVER, &rng); + + byte cliSalt[EXCHANGE_SALT_SZ]; + byte srvSalt[EXCHANGE_SALT_SZ]; + const byte* tmpSalt; + + if (cliCtx == NULL || srvCtx == NULL) + return -3006; + + /* get salt to send to peer */ + tmpSalt = ecc_ctx_get_own_salt(cliCtx); + if (tmpSalt == NULL) + return -3007; + memcpy(cliSalt, tmpSalt, EXCHANGE_SALT_SZ); + + tmpSalt = ecc_ctx_get_own_salt(srvCtx); + if (tmpSalt == NULL) + return -3007; + memcpy(srvSalt, tmpSalt, EXCHANGE_SALT_SZ); + + /* in actual use, we'd get the peer's salt over the transport */ + ret = ecc_ctx_set_peer_salt(cliCtx, srvSalt); + ret += ecc_ctx_set_peer_salt(srvCtx, cliSalt); + + if (ret != 0) + return -3008; + + /* get encrypted msg (request) to send to B */ + outSz = sizeof(out); + ret = ecc_encrypt(&userA, &userB, msg, sizeof(msg), out, &outSz,cliCtx); + if (ret != 0) + return -3009; + + /* B decrypts msg (request) from A */ + plainSz = sizeof(plain); + ret = ecc_decrypt(&userB, &userA, out, outSz, plain, &plainSz, srvCtx); + if (ret != 0) + return -3010; + + if (memcmp(plain, msg, sizeof(msg)) != 0) + return -3011; + + { + /* msg2 (response) from B to A */ + byte msg2[48]; + byte plain2[48]; + byte out2[80]; + word32 outSz2 = sizeof(out2); + word32 plainSz2 = sizeof(plain2); + + for (i = 0; i < 48; i++) + msg2[i] = i+48; + + /* get encrypted msg (response) to send to B */ + ret = ecc_encrypt(&userB, &userA, msg2, sizeof(msg2), out2, + &outSz2, srvCtx); + if (ret != 0) + return -3012; + + /* A decrypts msg (response) from B */ + ret = ecc_decrypt(&userA, &userB, out2, outSz2, plain2, &plainSz2, + cliCtx); + if (ret != 0) + return -3013; + + if (memcmp(plain2, msg2, sizeof(msg2)) != 0) + return -3014; + } + + /* cleanup */ + ecc_ctx_free(srvCtx); + ecc_ctx_free(cliCtx); + } + + /* cleanup */ + ecc_free(&userB); + ecc_free(&userA); + + return 0; +} + +#endif /* HAVE_ECC_ENCRYPT */ #endif /* HAVE_ECC */ #ifdef HAVE_LIBZ @@ -3381,7 +4116,7 @@ int compress_test(void) if (ret == 0 && memcmp(d, sample_text, dSz)) ret = -303; - + if (c) free(c); if (d) free(d); @@ -3390,4 +4125,271 @@ int compress_test(void) #endif /* HAVE_LIBZ */ +#ifdef HAVE_PKCS7 + +int pkcs7enveloped_test(void) +{ + int ret = 0; + + int cipher = DES3b; + int envelopedSz, decodedSz; + PKCS7 pkcs7; + byte* cert; + byte* privKey; + byte enveloped[2048]; + byte decoded[2048]; + + size_t certSz; + size_t privKeySz; + FILE* certFile; + FILE* keyFile; + FILE* pkcs7File; + const char* pkcs7OutFile = "pkcs7envelopedData.der"; + + const byte data[] = { /* Hello World */ + 0x48,0x65,0x6c,0x6c,0x6f,0x20,0x57,0x6f, + 0x72,0x6c,0x64 + }; + + /* read client cert and key in DER format */ + cert = (byte*)malloc(FOURK_BUF); + if (cert == NULL) + return -201; + + privKey = (byte*)malloc(FOURK_BUF); + if (privKey == NULL) + return -202; + + certFile = fopen(clientCert, "rb"); + if (!certFile) + err_sys("can't open ./certs/client-cert.der, " + "Please run from CyaSSL home dir", -42); + + certSz = fread(cert, 1, FOURK_BUF, certFile); + fclose(certFile); + + keyFile = fopen(clientKey, "rb"); + if (!keyFile) + err_sys("can't open ./certs/client-key.der, " + "Please run from CyaSSL home dir", -43); + + privKeySz = fread(privKey, 1, FOURK_BUF, keyFile); + fclose(keyFile); + + PKCS7_InitWithCert(&pkcs7, cert, (word32)certSz); + pkcs7.content = (byte*)data; + pkcs7.contentSz = (word32)sizeof(data); + pkcs7.contentOID = DATA; + pkcs7.encryptOID = cipher; + pkcs7.privateKey = privKey; + pkcs7.privateKeySz = (word32)privKeySz; + + /* encode envelopedData */ + envelopedSz = PKCS7_EncodeEnvelopedData(&pkcs7, enveloped, + sizeof(enveloped)); + if (envelopedSz <= 0) + return -203; + + /* decode envelopedData */ + decodedSz = PKCS7_DecodeEnvelopedData(&pkcs7, enveloped, envelopedSz, + decoded, sizeof(decoded)); + if (decodedSz <= 0) + return -204; + + /* test decode result */ + if (memcmp(decoded, data, sizeof(data)) != 0) { + return -205; + } + + /* output pkcs7 envelopedData for external testing */ + pkcs7File = fopen(pkcs7OutFile, "wb"); + if (!pkcs7File) + return -206; + + ret = (int)fwrite(enveloped, envelopedSz, 1, pkcs7File); + fclose(pkcs7File); + + free(cert); + free(privKey); + PKCS7_Free(&pkcs7); + + if (ret > 0) + return 0; + + return ret; +} + +int pkcs7signed_test(void) +{ + int ret = 0; + + FILE* file; + byte* certDer; + byte* keyDer; + byte* out; + char data[] = "Hello World"; + word32 dataSz, outSz, certDerSz, keyDerSz; + PKCS7 msg; + RNG rng; + + byte transIdOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x07 }; + byte messageTypeOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x02 }; + byte senderNonceOid[] = + { 0x06, 0x0a, 0x60, 0x86, 0x48, 0x01, 0x86, 0xF8, 0x45, 0x01, + 0x09, 0x05 }; + byte transId[(SHA_DIGEST_SIZE + 1) * 2 + 1]; + byte messageType[] = { 0x13, 2, '1', '9' }; + byte senderNonce[PKCS7_NONCE_SZ + 2]; + + PKCS7Attrib attribs[] = + { + { transIdOid, sizeof(transIdOid), + transId, sizeof(transId) - 1 }, /* take off the null */ + { messageTypeOid, sizeof(messageTypeOid), + messageType, sizeof(messageType) }, + { senderNonceOid, sizeof(senderNonceOid), + senderNonce, sizeof(senderNonce) } + }; + + dataSz = (word32) strlen(data); + outSz = FOURK_BUF; + + certDer = (byte*)malloc(FOURK_BUF); + keyDer = (byte*)malloc(FOURK_BUF); + out = (byte*)malloc(FOURK_BUF); + + if (certDer == NULL) + return -207; + if (keyDer == NULL) + return -208; + if (out == NULL) + return -209; + + /* read in DER cert of recipient, into cert of size certSz */ + file = fopen(clientCert, "rb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + err_sys("can't open ./certs/client-cert.der, " + "Please run from CyaSSL home dir", -44); + } + certDerSz = (word32)fread(certDer, 1, FOURK_BUF, file); + fclose(file); + + file = fopen(clientKey, "rb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + err_sys("can't open ./certs/client-key.der, " + "Please run from CyaSSL home dir", -45); + } + keyDerSz = (word32)fread(keyDer, 1, FOURK_BUF, file); + fclose(file); + + ret = InitRng(&rng); + senderNonce[0] = 0x04; + senderNonce[1] = PKCS7_NONCE_SZ; + RNG_GenerateBlock(&rng, &senderNonce[2], PKCS7_NONCE_SZ); + + PKCS7_InitWithCert(&msg, certDer, certDerSz); + msg.privateKey = keyDer; + msg.privateKeySz = keyDerSz; + msg.content = (byte*)data; + msg.contentSz = dataSz; + msg.hashOID = SHAh; + msg.encryptOID = RSAk; + msg.signedAttribs = attribs; + msg.signedAttribsSz = sizeof(attribs)/sizeof(PKCS7Attrib); + msg.rng = &rng; + { + Sha sha; + byte digest[SHA_DIGEST_SIZE]; + int i,j; + + transId[0] = 0x13; + transId[1] = SHA_DIGEST_SIZE * 2; + + ret = InitSha(&sha); + if (ret != 0) + return -4003; + ShaUpdate(&sha, msg.publicKey, msg.publicKeySz); + ShaFinal(&sha, digest); + + for (i = 0, j = 2; i < SHA_DIGEST_SIZE; i++, j += 2) { + snprintf((char*)&transId[j], 3, "%02x", digest[i]); + } + } + ret = PKCS7_EncodeSignedData(&msg, out, outSz); + if (ret < 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -210; + } + else + outSz = ret; + + /* write PKCS#7 to output file for more testing */ + file = fopen("./pkcs7signedData.der", "wb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -211; + } + ret = (int)fwrite(out, 1, outSz, file); + fclose(file); + + PKCS7_Free(&msg); + PKCS7_InitWithCert(&msg, NULL, 0); + + ret = PKCS7_VerifySignedData(&msg, out, outSz); + if (ret < 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -212; + } + + if (msg.singleCert == NULL || msg.singleCertSz == 0) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -213; + } + + file = fopen("./pkcs7cert.der", "wb"); + if (!file) { + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + return -214; + } + ret = (int)fwrite(msg.singleCert, 1, msg.singleCertSz, file); + fclose(file); + + free(certDer); + free(keyDer); + free(out); + PKCS7_Free(&msg); + + if (ret > 0) + return 0; + + return ret; +} + +#endif /* HAVE_PKCS7 */ + #endif /* NO_CRYPT_TEST */ diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-STM32F2xx.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-STM32F2xx.c new file mode 100644 index 000000000..3a26db7dc --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-STM32F2xx.c @@ -0,0 +1,82 @@ +/* time-STM32F2.c + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +#define PERIPH_BASE ((uint32_t)0x40000000) +/*----------------------------------------------------------------------------- + * initialize RTC + *----------------------------------------------------------------------------*/ +#include "stm32f2xx.h" + +#define assert_param(a) + +#if 0 +#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) +#define SYNCHRO_TIMEOUT ((uint32_t) 0x00008000) +#define Bcd2ToByte(v) \ + ((((uint8_t)(v & (uint8_t)0xF0) >> (uint8_t)0x4) * 10) + (v & (uint8_t)0x0F)) +#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) +#define RTC_TR_MNT ((uint32_t)0x00007000) +#define RTC_TR_MNU ((uint32_t)0x00000F00) + +#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) +#define CR_OFFSET (PWR_OFFSET + 0x00) +#define DBP_BitNumber 0x08 +#define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4)) +#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) +#define INITMODE_TIMEOUT ((uint32_t) 0x00010000) +#endif + +/*----------------------------------------------------------------------------- + * initialize TIM + *----------------------------------------------------------------------------*/ +#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) + +void init_time(void) +{ + uint16_t tmpcr1 = 0; + + ((uint32_t *)RCC)[0x10] |= RCC_APB1Periph_TIM2 ; + + tmpcr1 = TIM2->CR1 ; + tmpcr1 &= (uint16_t) (~(((uint16_t)0x0010) | ((uint16_t)0x0060) )); + /* CR1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS) */ + tmpcr1 |= (uint16_t)0x0000 ; /* CR1 |= TIM_CounterMode_Up */ + TIM2->CR1= tmpcr1 ; + + TIM2->ARR = 0xffffffff ; /* ARR= TIM_Period */ + TIM2->PSC = 60 ; /* PSC = TIM_Prescaler */ + TIM2->EGR = ((uint16_t)0x0001) ; /* EGR = TIM_PSCReloadMode_Immediate */ + + *(uint16_t *)(PERIPH_BASE+0x0) |=((uint16_t)0x0001) ; + /* TIM_Cmd(TIM2, ENABLE) ; */ +} + +double current_time() +{ + return ((double)TIM2->CNT/1000000.0) ; +} + diff --git a/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-dummy.c b/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/CyaSSL-Full/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt b/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt index 2656e4033..42ac37cf9 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/EchoClient/Abstract.txt @@ -1,7 +1,7 @@ This program is echo client with CyaSSL/wolfCrypt library. In order to run this program, -Copy {PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. Set config-EchoClient.h configuration file for the Callee IP or Port number. For further configuration, refer config-Crypt.h and config-CyaSSL.h. diff --git a/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvoptx b/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvoptx index 7e61facf5..3d067f5b2 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvoptx +++ b/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -209,8 +211,8 @@ 0 0 0 - 0 - 0 + 16 + 99 0 .\main.c main.c @@ -223,10 +225,10 @@ 1 0 0 - 28 + 24 0 - 0 - 0 + 149 + 166 0 .\echoclient.c echoclient.c @@ -247,13 +249,13 @@ 5 0 0 - 24 + 0 0 0 0 0 - .\config-EchoClient.h - config-EchoClient.h + .\RTE\wolfSSL\config-CyaSSL.h + config-CyaSSL.h 0 0 @@ -268,8 +270,8 @@ 0 0 0 - .\RTE\wolfSSL\config-CyaSSL.h - config-CyaSSL.h + .\RTE\wolfSSL\config-Crypt.h + config-Crypt.h 0 0 @@ -279,13 +281,13 @@ 5 0 0 - 0 + 33 0 - 0 - 0 + 3 + 17 0 - .\RTE\wolfSSL\config-Crypt.h - config-Crypt.h + .\RTE\Network\Net_Config_ETH_0.h + Net_Config_ETH_0.h 0 0 @@ -305,8 +307,8 @@ 0 0 0 - 1 - 1 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -316,30 +318,14 @@ - ::CMSIS - 0 + Devices + 1 0 0 - 1 + 0 4 7 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 - 0 - - - 4 - 8 1 0 0 @@ -348,22 +334,62 @@ 0 0 0 + .\time-dummy.c + time-dummy.c + 0 + 0 + + + + + ::CMSIS + 1 + 0 + 0 + 1 + + 5 + 8 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 0 RTE\CMSIS\RTX_Conf_CM.c RTX_Conf_CM.c 1 0 + + 5 + 9 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + ::Device - 0 + 1 0 0 1 - 5 - 9 + 6 + 10 1 0 0 @@ -378,8 +404,8 @@ 0 - 5 - 10 + 6 + 11 1 0 0 @@ -394,8 +420,8 @@ 0 - 5 - 11 + 6 + 12 5 0 0 @@ -410,15 +436,15 @@ 0 - 5 - 12 + 6 + 13 2 0 0 0 0 - 0 - 0 + 163 + 169 0 RTE\Device\STM32F207IG\startup_stm32f2xx.s startup_stm32f2xx.s @@ -426,8 +452,8 @@ 0 - 5 - 13 + 6 + 14 1 0 0 @@ -450,23 +476,7 @@ 0 1 - 6 - 14 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - PHY_ST802RT1.c - 1 - 0 - - - 6 + 7 15 1 0 @@ -482,7 +492,7 @@ 0 - 6 + 7 16 1 0 @@ -497,6 +507,22 @@ 1 0 + + 7 + 17 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + PHY_ST802RT1.c + 1 + 0 + @@ -506,23 +532,7 @@ 0 1 - 7 - 17 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - - - 7 + 8 18 1 0 @@ -538,7 +548,7 @@ 0 - 7 + 8 19 5 0 @@ -553,14 +563,6 @@ 1 0 - - - - ::Network - 0 - 0 - 0 - 1 8 20 @@ -572,13 +574,21 @@ 0 0 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Dbg_CM3_L.lib + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib 1 0 + + + + ::Network + 1 + 0 + 0 + 1 - 8 + 9 21 1 0 @@ -594,7 +604,7 @@ 0 - 8 + 9 22 5 0 @@ -610,7 +620,7 @@ 0 - 8 + 9 23 5 0 @@ -626,15 +636,15 @@ 0 - 8 + 9 24 5 0 0 - 0 + 33 0 - 0 - 0 + 3 + 17 0 RTE\Network\Net_Config_ETH_0.h Net_Config_ETH_0.h @@ -642,7 +652,7 @@ 0 - 8 + 9 25 5 0 @@ -658,7 +668,7 @@ 0 - 8 + 9 26 5 0 @@ -674,9 +684,25 @@ 0 - 8 + 9 27 1 + 1 + 0 + 0 + 0 + 102 + 125 + 0 + RTE\Network\Net_Debug.c + Net_Debug.c + 1 + 0 + + + 9 + 28 + 4 0 0 0 @@ -684,8 +710,8 @@ 0 0 0 - RTE\Network\Net_Debug.c - Net_Debug.c + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + Net_Dbg_CM3_L.lib 1 0 @@ -698,680 +724,8 @@ 0 1 - 9 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 9 + 10 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 9 - 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 9 - 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 9 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - asm.c - 1 - 0 - - - 9 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - asn.c - 1 - 0 - - - 9 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - blake2b.c - 1 - 0 - - - 9 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - camellia.c - 1 - 0 - - - 9 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - coding.c - 1 - 0 - - - 9 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - compress.c - 1 - 0 - - - 9 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - des3.c - 1 - 0 - - - 9 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - dh.c - 1 - 0 - - - 9 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - dsa.c - 1 - 0 - - - 9 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - ecc.c - 1 - 0 - - - 9 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c - 1 - 0 - - - 9 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - error.c - 1 - 0 - - - 9 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - hc128.c - 1 - 0 - - - 9 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - hmac.c - 1 - 0 - - - 9 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - integer.c - 1 - 0 - - - 9 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - logging.c - 1 - 0 - - - 9 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - md2.c - 1 - 0 - - - 9 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - md4.c - 1 - 0 - - - 9 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - md5.c - 1 - 0 - - - 9 - 51 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - memory.c - 1 - 0 - - - 9 - 52 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - misc.c - 1 - 0 - - - 9 - 53 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c - 1 - 0 - - - 9 - 54 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - rabbit.c - 1 - 0 - - - 9 - 55 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - random.c - 1 - 0 - - - 9 - 56 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - ripemd.c - 1 - 0 - - - 9 - 57 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - rsa.c - 1 - 0 - - - 9 - 58 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - sha.c - 1 - 0 - - - 9 - 59 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - sha256.c - 1 - 0 - - - 9 - 60 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - sha512.c - 1 - 0 - - - 9 - 61 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - tfm.c - 1 - 0 - - - 9 - 62 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - crl.c - 1 - 0 - - - 9 - 63 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - internal.c - 1 - 0 - - - 9 - 64 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - io.c - 1 - 0 - - - 9 - 65 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - keys.c - 1 - 0 - - - 9 - 66 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - ocsp.c - 1 - 0 - - - 9 - 67 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - sniffer.c - 1 - 0 - - - 9 - 68 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - ssl.c - 1 - 0 - - - 9 - 69 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - tls.c - 1 - 0 - - - 9 - 70 5 0 0 @@ -1386,8 +740,8 @@ 0 - 9 - 71 + 10 + 30 5 0 0 @@ -1402,7 +756,663 @@ 0 - 9 + 10 + 31 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\aes.c + aes.c + 1 + 0 + + + 10 + 32 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\arc4.c + arc4.c + 1 + 0 + + + 10 + 33 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asm.c + asm.c + 1 + 0 + + + 10 + 34 + 1 + 0 + 0 + 13 + 0 + 1441 + 1569 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asn.c + asn.c + 1 + 0 + + + 10 + 35 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\blake2b.c + blake2b.c + 1 + 0 + + + 10 + 36 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\camellia.c + camellia.c + 1 + 0 + + + 10 + 37 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\coding.c + coding.c + 1 + 0 + + + 10 + 38 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\compress.c + compress.c + 1 + 0 + + + 10 + 39 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\des3.c + des3.c + 1 + 0 + + + 10 + 40 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dh.c + dh.c + 1 + 0 + + + 10 + 41 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dsa.c + dsa.c + 1 + 0 + + + 10 + 42 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc.c + ecc.c + 1 + 0 + + + 10 + 43 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c + 1 + 0 + + + 10 + 44 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\error.c + error.c + 1 + 0 + + + 10 + 45 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hc128.c + hc128.c + 1 + 0 + + + 10 + 46 + 1 + 0 + 0 + 0 + 0 + 66 + 89 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hmac.c + hmac.c + 1 + 0 + + + 10 + 47 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\integer.c + integer.c + 1 + 0 + + + 10 + 48 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\logging.c + logging.c + 1 + 0 + + + 10 + 49 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md2.c + md2.c + 1 + 0 + + + 10 + 50 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md4.c + md4.c + 1 + 0 + + + 10 + 51 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md5.c + md5.c + 1 + 0 + + + 10 + 52 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\memory.c + memory.c + 1 + 0 + + + 10 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\misc.c + misc.c + 1 + 0 + + + 10 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\port.c + port.c + 1 + 0 + + + 10 + 55 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c + 1 + 0 + + + 10 + 56 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rabbit.c + rabbit.c + 1 + 0 + + + 10 + 57 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\random.c + random.c + 1 + 0 + + + 10 + 58 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ripemd.c + ripemd.c + 1 + 0 + + + 10 + 59 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rsa.c + rsa.c + 1 + 0 + + + 10 + 60 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 10 + 61 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 10 + 62 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 10 + 63 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\tfm.c + tfm.c + 1 + 0 + + + 10 + 64 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\crl.c + crl.c + 1 + 0 + + + 10 + 65 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\internal.c + internal.c + 1 + 0 + + + 10 + 66 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\io.c + io.c + 1 + 0 + + + 10 + 67 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\keys.c + keys.c + 1 + 0 + + + 10 + 68 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ocsp.c + ocsp.c + 1 + 0 + + + 10 + 69 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\sniffer.c + sniffer.c + 1 + 0 + + + 10 + 70 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ssl.c + ssl.c + 1 + 0 + + + 10 + 71 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\tls.c + tls.c + 1 + 0 + + + 10 72 5 0 @@ -1412,8 +1422,24 @@ 0 0 0 - RTE\wolfSSL\config.h - config.h + RTE\wolfSSL\settings.h + settings.h + 1 + 0 + + + 10 + 73 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvprojx b/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvprojx index 7b4076c60..655704744 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvprojx +++ b/IDE/MDK5-ARM/Projects/EchoClient/EchoClient.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_EchoClient CYASSL_STM32F2xx + HAVE_CONFIG_H MDK_CONF_EchoClient @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -413,11 +419,6 @@ Configuration - - config-EchoClient.h - 5 - .\config-EchoClient.h - config-CyaSSL.h 5 @@ -428,6 +429,11 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + Net_Config_ETH_0.h + 5 + .\RTE\Network\Net_Config_ETH_0.h + @@ -441,18 +447,28 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-dummy.c + 1 + .\time-dummy.c + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -488,11 +504,6 @@ ::Drivers - - PHY_ST802RT1.c - 1 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - EMAC_STM32F2xx.c 1 @@ -503,16 +514,16 @@ 1 C:\Keil5\ARM\PACK\Keil\STM32F2xx_DFP\1.0.4\RTE_Driver\MCI_STM32F2xx.c + + PHY_ST802RT1.c + 1 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -523,16 +534,16 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::Network - - Net_Dbg_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Config.c 1 @@ -568,221 +579,16 @@ 1 RTE\Network\Net_Debug.c + + Net_Dbg_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + ::wolfSSL - - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - - - aes.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - - - arc4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - - - asm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - - - asn.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - - - blake2b.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - - - camellia.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - - - coding.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - - - compress.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - - - des3.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - - - dh.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - - - dsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - - - ecc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - - - ecc_fp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - - - error.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - - - hc128.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - - - hmac.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - - - integer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - - - logging.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - - - md2.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - - - md4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - - - md5.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - - - memory.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - - - misc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - - - pwdbased.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - - - rabbit.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - - - random.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - - - ripemd.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - - - rsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - - - sha.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - - - sha256.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - - - sha512.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - - - tfm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - - - crl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - - - internal.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - - - io.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - - - keys.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - - - ocsp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - - - sniffer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - - - ssl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - - - tls.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - config-Crypt.h 5 @@ -794,9 +600,219 @@ RTE\wolfSSL\config-CyaSSL.h - config.h + aes.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\aes.c + + + arc4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\arc4.c + + + asm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asm.c + + + asn.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asn.c + + + blake2b.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\blake2b.c + + + camellia.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\camellia.c + + + coding.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\coding.c + + + compress.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\compress.c + + + des3.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\des3.c + + + dh.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dh.c + + + dsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dsa.c + + + ecc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc.c + + + ecc_fp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc_fp.c + + + error.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\error.c + + + hc128.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hc128.c + + + hmac.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hmac.c + + + integer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\integer.c + + + logging.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\logging.c + + + md2.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md2.c + + + md4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md4.c + + + md5.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md5.c + + + memory.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\memory.c + + + misc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\misc.c + + + port.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\port.c + + + pwdbased.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\pwdbased.c + + + rabbit.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rabbit.c + + + random.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\random.c + + + ripemd.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ripemd.c + + + rsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rsa.c + + + sha.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha.c + + + sha256.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha256.c + + + sha512.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha512.c + + + tfm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\tfm.c + + + crl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\crl.c + + + internal.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\internal.c + + + io.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\io.c + + + keys.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\keys.c + + + ocsp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ocsp.c + + + sniffer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\sniffer.c + + + ssl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ssl.c + + + tls.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\tls.c + + + settings.h 5 - RTE\wolfSSL\config.h + RTE\wolfSSL\settings.h + + + cyassl_MDK_ARM.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c @@ -806,25 +822,25 @@ - + - + - + - + @@ -838,20 +854,20 @@ - - + + - - + + - - + + @@ -928,20 +944,14 @@ - - + + - - - - - - - - + + @@ -950,8 +960,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -1078,24 +1088,30 @@ RTE\wolfSSL\config-Crypt.h - - + + RTE\wolfSSL\config-CyaSSL.h - - + + - RTE\wolfSSL\config.h + RTE\wolfSSL\config.h + + + + RTE\wolfSSL\settings.h + + diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/EchoClient/RTE/CMSIS/RTX_Conf_CM.c index 54b3e0bfc..435c44ad9 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -48,17 +48,17 @@ // Defines max. number of threads that will run at the same time. // Default: 6 #ifndef OS_TASKCNT - #define OS_TASKCNT 5 + #define OS_TASKCNT 6 #endif // Default Thread stack size [bytes] <64-4096:8><#/4> // Defines default stack size for threads with osThreadDef stacksz = 0 // Default: 200 #ifndef OS_STKSIZE - #define OS_STKSIZE 250 + #define OS_STKSIZE 300 #endif -// Main Thread stack size [bytes] <64-20000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE @@ -69,10 +69,10 @@ // Defines the number of threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVCNT - #define OS_PRIVCNT 2 + #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-0x10000:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE @@ -158,7 +158,7 @@ #define OS_TIMERPRIO 5 #endif -// Timer Thread stack size [bytes] <64-64000:8><#/4> +// Timer Thread stack size [bytes] <64-4096:8><#/4> // Defines stack size for Timer thread. // Default: 200 #ifndef OS_TIMERSTKSZ @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_ETH_0.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_ETH_0.h index 7be57ad6d..1f3f69ae1 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_ETH_0.h +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_ETH_0.h @@ -14,7 +14,7 @@ // Connect to hardware via Driver_ETH# <0-255> // Select driver control block for MAC and PHY interface -#define ETH0_DRIVER 1 +#define ETH0_DRIVER 0 // MAC Address // Local Ethernet MAC Address @@ -61,11 +61,11 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_IP3 0 +#define ETH0_IP3 11 // Address byte 4 <0-255> // Default: 100 -#define ETH0_IP4 100 +#define ETH0_IP4 101 // // Subnet mask @@ -99,30 +99,30 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_GW3 0 +#define ETH0_GW3 11 // Address byte 4 <0-255> // Default: 254 -#define ETH0_GW4 254 +#define ETH0_GW4 1 // // Primary DNS Server // Primary DNS Server IP Address // Address byte 1 <0-255> // Default: 194 -#define ETH0_PRI_DNS1 194 +#define ETH0_PRI_DNS1 192 // Address byte 2 <0-255> // Default: 25 -#define ETH0_PRI_DNS2 25 +#define ETH0_PRI_DNS2 168 // Address byte 3 <0-255> // Default: 2 -#define ETH0_PRI_DNS3 2 +#define ETH0_PRI_DNS3 11 // Address byte 4 <0-255> // Default: 129 -#define ETH0_PRI_DNS4 129 +#define ETH0_PRI_DNS4 1 // // Secondary DNS Server @@ -190,7 +190,7 @@ // accessed by his name on the local LAN using NBNS protocol. // You need to modify also the number of UDP Sockets, // because NBNS protocol uses one UDP socket to run. -#define ETH0_NBNS_ENABLE 1 +#define ETH0_NBNS_ENABLE 0 // Dynamic Host Configuration // When this option is enabled, local IP address, Net Mask diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_UDP.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_UDP.h index b7995c22d..8c088e47b 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_UDP.h +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Config_UDP.h @@ -15,6 +15,6 @@ // Number of UDP Sockets <1-20> // Number of available UDP sockets // Default: 5 -#define UDP_NUM_SOCKS 10 +#define UDP_NUM_SOCKS 15 // diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Debug.c b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Debug.c index 735089a40..0636cdfd9 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Debug.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/Network/Net_Debug.c @@ -52,7 +52,7 @@ // TCP Debug <0=> Off <1=> Errors only <2=> Full debug // Turn On/Off TCP debug messages -#define DBG_TCP 1 +#define DBG_TCP 2 // NBNS Debug <0=> Off <1=> Errors only <2=> Full debug // Turn On/Off NetBIOS Name Service debug messages diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-CyaSSL.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..22dea06d0 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/RTE/wolfSSL/settings.h @@ -0,0 +1,627 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#ifdef MICROCHIP_PIC32 + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #include "system/system_services.h" + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 +#endif /* MBED */ + +#ifdef CYASSL_TYTO + #include "rand.h" + #define FREERTOS + #define NO_FILESYSTEM + #define CYASSL_USER_IO + #define NO_DEV_RANDOM + #define HAVE_ECC + #define HAVE_ECC_ENCRYPT + #define ECC_SHAMIR + #define HAVE_HKDF + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FP_MAX_BITS 512 + #define NO_OLD_TLS + #define NO_MD4 + #define NO_RABBIT + #define NO_HC128 + #define NO_RSA + #define NO_DSA + #define NO_PWDBASED + #define NO_PSK +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h b/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h new file mode 100644 index 000000000..82f5d4782 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/config-EchoClient.h @@ -0,0 +1,34 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + + +// <<< Use Configuration Wizard in Context Menu >>> +// Build Target: Simple Client +// Callee IP Address +// Default: "192.168.1.100" +#define CYASSL_CALLEE_IP "192.168.11.3" +// Callee Port Number +// Default: "11111" +#define CYASSL_CALLEE_PORT 443 + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/EchoClient/echoclient.c b/IDE/MDK5-ARM/Projects/EchoClient/echoclient.c index bc7e26310..3a62eb67d 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/echoclient.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/echoclient.c @@ -28,18 +28,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include - - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif - - #include "cyassl_MDK_ARM.h" + #include + #include + + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" #endif #include @@ -68,11 +68,11 @@ void echoclient_test(void* args) int sendSz; int argc = 0; char** argv = 0; - int port = yasslPort; + word16 port = yasslPort; ((func_args*)args)->return_code = -1; /* error state */ -#ifndef CYASSL_MDK_ARM +#ifndef CYASSL_MDK_SHELL argc = ((func_args*)args)->argc; argv = ((func_args*)args)->argv; #endif @@ -104,9 +104,6 @@ void echoclient_test(void* args) #if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && !defined(CYASSL_MDK_SHELL) port = ((func_args*)args)->signal->port; #endif -#if defined (CYASSL_CALLEE_PORT) - port = CYASSL_CALLEE_PORT ; -#endif #if defined(CYASSL_DTLS) method = DTLSv1_client_method(); @@ -150,7 +147,7 @@ void echoclient_test(void* args) #endif } -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -159,8 +156,8 @@ void echoclient_test(void* args) #endif ssl = SSL_new(ctx); - CyaSSL_set_quiet_shutdown(ssl, 1) ; - + + if (doDTLS) { SOCKADDR_IN_T addr; build_addr(&addr, yasslIP, port, 1); @@ -221,10 +218,6 @@ void echoclient_test(void* args) #endif } -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif - #ifdef CYASSL_DTLS strncpy(msg, "break", 6); @@ -270,8 +263,10 @@ void echoclient_test(void* args) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("echoclient") || CurrentDir("build")) + if (CurrentDir("echoclient")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); echoclient_test(&args); CyaSSL_Cleanup(); diff --git a/IDE/MDK5-ARM/Projects/EchoClient/main.c b/IDE/MDK5-ARM/Projects/EchoClient/main.c index 6df113137..7224df509 100644 --- a/IDE/MDK5-ARM/Projects/EchoClient/main.c +++ b/IDE/MDK5-ARM/Projects/EchoClient/main.c @@ -86,7 +86,6 @@ char* myoptarg = NULL; int main() { void *args = NULL ; - init_time() ; init_filesystem (); net_initialize() ; osThreadCreate (osThread (tcp_poll), NULL); diff --git a/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c b/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoClient/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt b/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt index d43c94a38..491c61020 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/EchoServer/Abstract.txt @@ -1,7 +1,7 @@ This program is echo server with CyaSSL/wolfCrypt library. In order to run this program, -Copy {PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. Set the server IP address in Net_Config_ETH_0.h The server default port is 11111, defined in test.h. diff --git a/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvoptx b/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvoptx index ba35f0f5c..82c03fd26 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvoptx +++ b/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -207,10 +209,10 @@ 1 0 0 - 0 + 11 0 - 0 - 0 + 64 + 83 0 .\main.c main.c @@ -273,6 +275,22 @@ 0 0 + + 2 + 5 + 5 + 0 + 0 + 33 + 0 + 1 + 17 + 0 + .\RTE\Network\Net_Config_ETH_0.h + Net_Config_ETH_0.h + 0 + 0 + @@ -283,14 +301,14 @@ 0 3 - 5 + 6 5 0 0 0 0 - 1 - 1 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -300,27 +318,11 @@ - ::CMSIS - 0 + Devices + 1 0 0 - 1 - - 4 - 6 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 - 0 - + 0 4 7 @@ -332,11 +334,51 @@ 0 0 0 + .\time-dummy.c + time-dummy.c + 0 + 0 + + + + + ::CMSIS + 1 + 0 + 0 + 1 + + 5 + 8 + 1 + 0 + 0 + 0 + 0 + 1 + 1 + 0 RTE\CMSIS\RTX_Conf_CM.c RTX_Conf_CM.c 1 0 + + 5 + 9 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + @@ -346,8 +388,8 @@ 0 1 - 5 - 8 + 6 + 10 1 0 0 @@ -362,8 +404,8 @@ 0 - 5 - 9 + 6 + 11 1 0 0 @@ -378,8 +420,8 @@ 0 - 5 - 10 + 6 + 12 5 0 0 @@ -394,15 +436,15 @@ 0 - 5 - 11 + 6 + 13 2 0 0 0 0 - 0 - 0 + 162 + 169 0 RTE\Device\STM32F207IG\startup_stm32f2xx.s startup_stm32f2xx.s @@ -410,8 +452,8 @@ 0 - 5 - 12 + 6 + 14 1 0 0 @@ -434,24 +476,8 @@ 0 1 - 6 - 13 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - PHY_ST802RT1.c - 1 - 0 - - - 6 - 14 + 7 + 15 1 0 0 @@ -466,8 +492,8 @@ 0 - 6 - 15 + 7 + 16 1 0 0 @@ -481,30 +507,6 @@ 1 0 - - - - ::File System - 0 - 0 - 0 - 1 - - 7 - 16 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - 7 17 @@ -516,14 +518,38 @@ 0 0 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + PHY_ST802RT1.c + 1 + 0 + + + + + ::File System + 0 + 0 + 0 + 1 + + 8 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 RTE\File_System\FS_Config.c FS_Config.c 1 0 - 7 - 18 + 8 + 19 5 0 0 @@ -537,6 +563,22 @@ 1 0 + + 8 + 20 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib + 1 + 0 + @@ -546,24 +588,8 @@ 0 1 - 8 - 19 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Dbg_CM3_L.lib - 1 - 0 - - - 8 - 20 + 9 + 21 1 0 0 @@ -578,8 +604,8 @@ 0 - 8 - 21 + 9 + 22 5 0 0 @@ -594,8 +620,8 @@ 0 - 8 - 22 + 9 + 23 5 0 0 @@ -610,15 +636,15 @@ 0 - 8 - 23 + 9 + 24 5 0 0 - 0 + 33 0 - 0 - 0 + 1 + 17 0 RTE\Network\Net_Config_ETH_0.h Net_Config_ETH_0.h @@ -626,8 +652,8 @@ 0 - 8 - 24 + 9 + 25 5 0 0 @@ -642,8 +668,8 @@ 0 - 8 - 25 + 9 + 26 5 0 0 @@ -658,8 +684,8 @@ 0 - 8 - 26 + 9 + 27 1 0 0 @@ -673,689 +699,33 @@ 1 0 + + 9 + 28 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + Net_Dbg_CM3_L.lib + 1 + 0 + ::wolfSSL - 0 + 1 0 0 1 - 9 - 27 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 9 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 9 + 10 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 9 - 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 9 - 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - asm.c - 1 - 0 - - - 9 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - asn.c - 1 - 0 - - - 9 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - blake2b.c - 1 - 0 - - - 9 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - camellia.c - 1 - 0 - - - 9 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - coding.c - 1 - 0 - - - 9 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - compress.c - 1 - 0 - - - 9 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - des3.c - 1 - 0 - - - 9 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - dh.c - 1 - 0 - - - 9 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - dsa.c - 1 - 0 - - - 9 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - ecc.c - 1 - 0 - - - 9 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c - 1 - 0 - - - 9 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - error.c - 1 - 0 - - - 9 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - hc128.c - 1 - 0 - - - 9 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - hmac.c - 1 - 0 - - - 9 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - integer.c - 1 - 0 - - - 9 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - logging.c - 1 - 0 - - - 9 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - md2.c - 1 - 0 - - - 9 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - md4.c - 1 - 0 - - - 9 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - md5.c - 1 - 0 - - - 9 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - memory.c - 1 - 0 - - - 9 - 51 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - misc.c - 1 - 0 - - - 9 - 52 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c - 1 - 0 - - - 9 - 53 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - rabbit.c - 1 - 0 - - - 9 - 54 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - random.c - 1 - 0 - - - 9 - 55 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - ripemd.c - 1 - 0 - - - 9 - 56 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - rsa.c - 1 - 0 - - - 9 - 57 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - sha.c - 1 - 0 - - - 9 - 58 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - sha256.c - 1 - 0 - - - 9 - 59 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - sha512.c - 1 - 0 - - - 9 - 60 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - tfm.c - 1 - 0 - - - 9 - 61 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - crl.c - 1 - 0 - - - 9 - 62 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - internal.c - 1 - 0 - - - 9 - 63 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - io.c - 1 - 0 - - - 9 - 64 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - keys.c - 1 - 0 - - - 9 - 65 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - ocsp.c - 1 - 0 - - - 9 - 66 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - sniffer.c - 1 - 0 - - - 9 - 67 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - ssl.c - 1 - 0 - - - 9 - 68 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - tls.c - 1 - 0 - - - 9 - 69 5 0 0 @@ -1370,8 +740,8 @@ 0 - 9 - 70 + 10 + 30 5 0 0 @@ -1386,8 +756,664 @@ 0 - 9 + 10 + 31 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\aes.c + aes.c + 1 + 0 + + + 10 + 32 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\arc4.c + arc4.c + 1 + 0 + + + 10 + 33 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asm.c + asm.c + 1 + 0 + + + 10 + 34 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asn.c + asn.c + 1 + 0 + + + 10 + 35 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\blake2b.c + blake2b.c + 1 + 0 + + + 10 + 36 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\camellia.c + camellia.c + 1 + 0 + + + 10 + 37 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\coding.c + coding.c + 1 + 0 + + + 10 + 38 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\compress.c + compress.c + 1 + 0 + + + 10 + 39 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\des3.c + des3.c + 1 + 0 + + + 10 + 40 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dh.c + dh.c + 1 + 0 + + + 10 + 41 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dsa.c + dsa.c + 1 + 0 + + + 10 + 42 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc.c + ecc.c + 1 + 0 + + + 10 + 43 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c + 1 + 0 + + + 10 + 44 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\error.c + error.c + 1 + 0 + + + 10 + 45 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hc128.c + hc128.c + 1 + 0 + + + 10 + 46 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hmac.c + hmac.c + 1 + 0 + + + 10 + 47 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\integer.c + integer.c + 1 + 0 + + + 10 + 48 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\logging.c + logging.c + 1 + 0 + + + 10 + 49 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md2.c + md2.c + 1 + 0 + + + 10 + 50 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md4.c + md4.c + 1 + 0 + + + 10 + 51 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md5.c + md5.c + 1 + 0 + + + 10 + 52 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\memory.c + memory.c + 1 + 0 + + + 10 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\misc.c + misc.c + 1 + 0 + + + 10 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\port.c + port.c + 1 + 0 + + + 10 + 55 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c + 1 + 0 + + + 10 + 56 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rabbit.c + rabbit.c + 1 + 0 + + + 10 + 57 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\random.c + random.c + 1 + 0 + + + 10 + 58 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ripemd.c + ripemd.c + 1 + 0 + + + 10 + 59 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rsa.c + rsa.c + 1 + 0 + + + 10 + 60 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 10 + 61 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 10 + 62 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 10 + 63 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\tfm.c + tfm.c + 1 + 0 + + + 10 + 64 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\crl.c + crl.c + 1 + 0 + + + 10 + 65 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\internal.c + internal.c + 1 + 0 + + + 10 + 66 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\io.c + io.c + 1 + 0 + + + 10 + 67 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\keys.c + keys.c + 1 + 0 + + + 10 + 68 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ocsp.c + ocsp.c + 1 + 0 + + + 10 + 69 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\sniffer.c + sniffer.c + 1 + 0 + + + 10 + 70 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ssl.c + ssl.c + 1 + 0 + + + 10 71 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\tls.c + tls.c + 1 + 0 + + + 10 + 72 5 0 0 @@ -1396,8 +1422,24 @@ 0 0 0 - RTE\wolfSSL\config.h - config.h + RTE\wolfSSL\settings.h + settings.h + 1 + 0 + + + 10 + 73 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvprojx b/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvprojx index b8ce12e1e..40cddeba0 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvprojx +++ b/IDE/MDK5-ARM/Projects/EchoServer/EchoServer.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_SimpleClient CYASSL_STM32F2xx + HAVE_CONFIG_H MDK_CONF_SimpleClient @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -423,6 +429,11 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + Net_Config_ETH_0.h + 5 + .\RTE\Network\Net_Config_ETH_0.h + @@ -436,18 +447,28 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-dummy.c + 1 + .\time-dummy.c + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -483,11 +504,6 @@ ::Drivers - - PHY_ST802RT1.c - 1 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - EMAC_STM32F2xx.c 1 @@ -498,16 +514,16 @@ 1 C:\Keil5\ARM\PACK\Keil\STM32F2xx_DFP\1.0.4\RTE_Driver\MCI_STM32F2xx.c + + PHY_ST802RT1.c + 1 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -518,16 +534,16 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::Network - - Net_Dbg_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Config.c 1 @@ -563,221 +579,16 @@ 1 RTE\Network\Net_Debug.c + + Net_Dbg_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + ::wolfSSL - - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - - - aes.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - - - arc4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - - - asm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - - - asn.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - - - blake2b.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - - - camellia.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - - - coding.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - - - compress.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - - - des3.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - - - dh.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - - - dsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - - - ecc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - - - ecc_fp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - - - error.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - - - hc128.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - - - hmac.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - - - integer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - - - logging.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - - - md2.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - - - md4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - - - md5.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - - - memory.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - - - misc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - - - pwdbased.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - - - rabbit.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - - - random.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - - - ripemd.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - - - rsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - - - sha.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - - - sha256.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - - - sha512.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - - - tfm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - - - crl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - - - internal.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - - - io.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - - - keys.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - - - ocsp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - - - sniffer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - - - ssl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - - - tls.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - config-Crypt.h 5 @@ -789,9 +600,219 @@ RTE\wolfSSL\config-CyaSSL.h - config.h + aes.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\aes.c + + + arc4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\arc4.c + + + asm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asm.c + + + asn.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\asn.c + + + blake2b.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\blake2b.c + + + camellia.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\camellia.c + + + coding.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\coding.c + + + compress.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\compress.c + + + des3.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\des3.c + + + dh.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dh.c + + + dsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\dsa.c + + + ecc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc.c + + + ecc_fp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ecc_fp.c + + + error.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\error.c + + + hc128.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hc128.c + + + hmac.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\hmac.c + + + integer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\integer.c + + + logging.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\logging.c + + + md2.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md2.c + + + md4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md4.c + + + md5.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\md5.c + + + memory.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\memory.c + + + misc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\misc.c + + + port.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\port.c + + + pwdbased.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\pwdbased.c + + + rabbit.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rabbit.c + + + random.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\random.c + + + ripemd.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\ripemd.c + + + rsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\rsa.c + + + sha.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha.c + + + sha256.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha256.c + + + sha512.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\sha512.c + + + tfm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\ctaocrypt\src\tfm.c + + + crl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\crl.c + + + internal.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\internal.c + + + io.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\io.c + + + keys.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\keys.c + + + ocsp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ocsp.c + + + sniffer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\sniffer.c + + + ssl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\ssl.c + + + tls.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\src\tls.c + + + settings.h 5 - RTE\wolfSSL\config.h + RTE\wolfSSL\settings.h + + + cyassl_MDK_ARM.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.0\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c @@ -833,20 +854,20 @@ - - + + - - + + - - + + @@ -923,20 +944,14 @@ - - + + - - - - - - - - + + @@ -945,8 +960,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -1073,24 +1088,30 @@ RTE\wolfSSL\config-Crypt.h - - + + RTE\wolfSSL\config-CyaSSL.h - - + + - RTE\wolfSSL\config.h + RTE\wolfSSL\config.h + + + + RTE\wolfSSL\settings.h + + diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/EchoServer/RTE/CMSIS/RTX_Conf_CM.c index 54b3e0bfc..435c44ad9 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -48,17 +48,17 @@ // Defines max. number of threads that will run at the same time. // Default: 6 #ifndef OS_TASKCNT - #define OS_TASKCNT 5 + #define OS_TASKCNT 6 #endif // Default Thread stack size [bytes] <64-4096:8><#/4> // Defines default stack size for threads with osThreadDef stacksz = 0 // Default: 200 #ifndef OS_STKSIZE - #define OS_STKSIZE 250 + #define OS_STKSIZE 300 #endif -// Main Thread stack size [bytes] <64-20000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE @@ -69,10 +69,10 @@ // Defines the number of threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVCNT - #define OS_PRIVCNT 2 + #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-0x10000:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE @@ -158,7 +158,7 @@ #define OS_TIMERPRIO 5 #endif -// Timer Thread stack size [bytes] <64-64000:8><#/4> +// Timer Thread stack size [bytes] <64-4096:8><#/4> // Defines stack size for Timer thread. // Default: 200 #ifndef OS_TIMERSTKSZ @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/Network/Net_Config_ETH_0.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/Network/Net_Config_ETH_0.h index 9a49f3821..546eb08c9 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/RTE/Network/Net_Config_ETH_0.h +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/Network/Net_Config_ETH_0.h @@ -14,7 +14,7 @@ // Connect to hardware via Driver_ETH# <0-255> // Select driver control block for MAC and PHY interface -#define ETH0_DRIVER 1 +#define ETH0_DRIVER 0 // MAC Address // Local Ethernet MAC Address @@ -61,11 +61,11 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_IP3 0 +#define ETH0_IP3 11 // Address byte 4 <0-255> // Default: 100 -#define ETH0_IP4 100 +#define ETH0_IP4 101 // // Subnet mask @@ -99,30 +99,30 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_GW3 0 +#define ETH0_GW3 11 // Address byte 4 <0-255> // Default: 254 -#define ETH0_GW4 254 +#define ETH0_GW4 1 // // Primary DNS Server // Primary DNS Server IP Address // Address byte 1 <0-255> // Default: 194 -#define ETH0_PRI_DNS1 194 +#define ETH0_PRI_DNS1 192 // Address byte 2 <0-255> // Default: 25 -#define ETH0_PRI_DNS2 25 +#define ETH0_PRI_DNS2 168 // Address byte 3 <0-255> // Default: 2 -#define ETH0_PRI_DNS3 2 +#define ETH0_PRI_DNS3 11 // Address byte 4 <0-255> // Default: 129 -#define ETH0_PRI_DNS4 129 +#define ETH0_PRI_DNS4 1 // // Secondary DNS Server diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-CyaSSL.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..22dea06d0 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoServer/RTE/wolfSSL/settings.h @@ -0,0 +1,627 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#ifdef MICROCHIP_PIC32 + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #include "system/system_services.h" + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 +#endif /* MBED */ + +#ifdef CYASSL_TYTO + #include "rand.h" + #define FREERTOS + #define NO_FILESYSTEM + #define CYASSL_USER_IO + #define NO_DEV_RANDOM + #define HAVE_ECC + #define HAVE_ECC_ENCRYPT + #define ECC_SHAMIR + #define HAVE_HKDF + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FP_MAX_BITS 512 + #define NO_OLD_TLS + #define NO_MD4 + #define NO_RABBIT + #define NO_HC128 + #define NO_RSA + #define NO_DSA + #define NO_PWDBASED + #define NO_PSK +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/EchoServer/echoserver.c b/IDE/MDK5-ARM/Projects/EchoServer/echoserver.c index ba8e10f18..c7e23bf7e 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/echoserver.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/echoserver.c @@ -26,18 +26,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include + #include + #include - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif - #include "cyassl_MDK_ARM.h" + #include "cyassl_MDK_ARM.h" #endif #include @@ -56,7 +56,7 @@ #define SVR_COMMAND_SIZE 256 -static void SignalReady(void* args, int port) +static void SignalReady(void* args, word16 port) { #if defined(_POSIX_THREADS) && defined(NO_MAIN_DRIVER) && !defined(__MINGW32__) /* signal ready to tcp_accept */ @@ -84,7 +84,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) int outCreated = 0; int shutDown = 0; int useAnyAddr = 0; - int port = yasslPort; + word16 port = yasslPort; int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -115,7 +115,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #endif #if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && \ - !defined(CYASSL_SNIFFER) && !defined(CYASSL_MDK_ARM) + !defined(CYASSL_SNIFFER) && !defined(CYASSL_MDK_SHELL) port = 0; #endif #if defined(USE_ANY_ADDR) @@ -133,7 +133,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) ctx = CyaSSL_CTX_new(method); /* CyaSSL_CTX_set_session_cache_mode(ctx, SSL_SESS_CACHE_OFF); */ -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -226,8 +226,6 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) ssl = CyaSSL_new(ctx); if (ssl == NULL) err_sys("SSL_new failed"); - CyaSSL_set_quiet_shutdown(ssl, 1) ; - CyaSSL_set_fd(ssl, clientfd); #if !defined(NO_FILESYSTEM) && defined(OPENSSL_EXTRA) CyaSSL_SetTmpDH_file(ssl, dhParam, SSL_FILETYPE_PEM); @@ -313,9 +311,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) SignalReady(args, port); #endif } -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif + CloseSocket(sockfd); CyaSSL_CTX_free(ctx); @@ -351,8 +347,10 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args) #if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("echoserver") || CurrentDir("build")) + if (CurrentDir("echoserver")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); echoserver_test(&args); CyaSSL_Cleanup(); diff --git a/IDE/MDK5-ARM/Projects/EchoServer/main.c b/IDE/MDK5-ARM/Projects/EchoServer/main.c index 09ff15d4a..c6a2212f4 100644 --- a/IDE/MDK5-ARM/Projects/EchoServer/main.c +++ b/IDE/MDK5-ARM/Projects/EchoServer/main.c @@ -83,7 +83,6 @@ char* myoptarg = NULL; int main() { void *args = NULL ; - init_time() ; init_filesystem (); net_initialize() ; osThreadCreate (osThread (tcp_poll), NULL); diff --git a/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c b/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/EchoServer/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt index 39ab9e9ef..1a9a172c9 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/SimpleClient/Abstract.txt @@ -1,10 +1,11 @@ This program is a simple client example with CyaSSL/wolfCrypt library. In order to run this program, -Copy {PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. Set config-SimpleClient.h configuration file for the Callee IP or Port number. For further configuration, refer config-Crypt.h and config-CyaSSL.h. +config-SimpleClient.h is to configure repote callee IP and port. When testing this client, it is recommended to test against one of the standard CyaSSL example applications running on a desktop machine. The standard CyaSSL diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/CMSIS/RTX_Conf_CM.c index 54b3e0bfc..435c44ad9 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -48,17 +48,17 @@ // Defines max. number of threads that will run at the same time. // Default: 6 #ifndef OS_TASKCNT - #define OS_TASKCNT 5 + #define OS_TASKCNT 6 #endif // Default Thread stack size [bytes] <64-4096:8><#/4> // Defines default stack size for threads with osThreadDef stacksz = 0 // Default: 200 #ifndef OS_STKSIZE - #define OS_STKSIZE 250 + #define OS_STKSIZE 300 #endif -// Main Thread stack size [bytes] <64-20000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE @@ -69,10 +69,10 @@ // Defines the number of threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVCNT - #define OS_PRIVCNT 2 + #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-0x10000:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE @@ -158,7 +158,7 @@ #define OS_TIMERPRIO 5 #endif -// Timer Thread stack size [bytes] <64-64000:8><#/4> +// Timer Thread stack size [bytes] <64-4096:8><#/4> // Defines stack size for Timer thread. // Default: 200 #ifndef OS_TIMERSTKSZ @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/Network/Net_Config_ETH_0.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/Network/Net_Config_ETH_0.h index 7be57ad6d..ff18944fb 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/Network/Net_Config_ETH_0.h +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/Network/Net_Config_ETH_0.h @@ -14,7 +14,7 @@ // Connect to hardware via Driver_ETH# <0-255> // Select driver control block for MAC and PHY interface -#define ETH0_DRIVER 1 +#define ETH0_DRIVER 0 // MAC Address // Local Ethernet MAC Address diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-CyaSSL.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..33d41cfdb --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/RTE/wolfSSL/settings.h @@ -0,0 +1,667 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using PIC32MZ Crypto Engine */ +/* #define CYASSL_MICROCHIP_PIC32MZ */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + +/* Uncomment next line if using LwIP native TCP socket settings */ +/* #define HAVE_LWIP_NATIVE */ + +/* Uncomment next line if building for EROAD */ +/* #define CYASSL_EROAD */ + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef CYASSL_USER_SETTINGS + #include +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#if defined(HAVE_LWIP_NATIVE) /* using LwIP native TCP socket */ + #define CYASSL_LWIP + #define NO_WRITEV + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_FILESYSTEM +#endif + +#ifdef MICROCHIP_PIC32 + /* #define CYASSL_MICROCHIP_PIC32MZ */ + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef CYASSL_MICROCHIP_PIC32MZ + #define CYASSL_PIC32MZ_CE + #define CYASSL_PIC32MZ_CRYPT + #define HAVE_AES_ENGINE + #define CYASSL_PIC32MZ_RNG + /* #define CYASSL_PIC32MZ_HASH */ + #define CYASSL_AES_COUNTER + #define HAVE_AESGCM + #define NO_BIG_INT + +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "system/system_services.h" + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define CYASSL_USER_IO + #define NO_FILESYSTEM + #define NO_CERT + #define USE_CERT_BUFFERS_1024 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define HAVE_ECC + #define NO_SESSION_CACHE + #define CYASSL_CMSIS_RTOS +#endif + + +#ifdef CYASSL_EROAD + #define FREESCALE_MQX + #define FREESCALE_MMCAU + #define SINGLE_THREADED + #define NO_STDIO_FILESYSTEM + #define CYASSL_LEANPSK + #define HAVE_NULL_CIPHER + #define NO_OLD_TLS + #define NO_ASN + #define NO_BIG_INT + #define NO_RSA + #define NO_DSA + #define NO_DH + #define NO_CERTS + #define NO_PWDBASED + #define NO_DES3 + #define NO_MD4 + #define NO_RC4 + #define NO_MD5 + #define NO_SESSION_CACHE + #define NO_MAIN_DRIVER +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) && !defined(CYASSL_EROAD) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx b/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx index 93fced476..bf7360917 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx +++ b/IDE/MDK5-ARM/Projects/SimpleClient/SimpleClient.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -289,6 +291,22 @@ 0 0 + + 2 + 6 + 5 + 0 + 0 + 33 + 0 + 0 + 0 + 0 + .\RTE\Network\Net_Config_ETH_0.h + Net_Config_ETH_0.h + 0 + 0 + @@ -299,14 +317,14 @@ 0 3 - 6 + 7 5 0 0 0 0 - 1 - 1 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -316,15 +334,15 @@ - ::CMSIS - 0 + Devices + 1 0 0 - 1 + 0 4 - 7 - 4 + 8 + 1 0 0 0 @@ -332,14 +350,38 @@ 0 0 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib - RTX_CM3.lib - 1 + .\time-dummy.c + time-dummy.c + 0 0 4 - 8 + 9 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\time-STM32F2xx.c + time-STM32F2xx.c + 0 + 0 + + + + + ::CMSIS + 1 + 0 + 0 + 1 + + 5 + 10 1 0 0 @@ -353,6 +395,22 @@ 1 0 + + 5 + 11 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + RTX_CM3.lib + 1 + 0 + @@ -362,8 +420,8 @@ 0 1 - 5 - 9 + 6 + 12 1 0 0 @@ -378,8 +436,8 @@ 0 - 5 - 10 + 6 + 13 1 0 0 @@ -394,8 +452,8 @@ 0 - 5 - 11 + 6 + 14 5 0 0 @@ -410,8 +468,8 @@ 0 - 5 - 12 + 6 + 15 2 0 0 @@ -426,8 +484,8 @@ 0 - 5 - 13 + 6 + 16 1 0 0 @@ -450,24 +508,8 @@ 0 1 - 6 - 14 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - PHY_ST802RT1.c - 1 - 0 - - - 6 - 15 + 7 + 17 1 0 0 @@ -482,8 +524,8 @@ 0 - 6 - 16 + 7 + 18 1 0 0 @@ -497,6 +539,22 @@ 1 0 + + 7 + 19 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + PHY_ST802RT1.c + 1 + 0 + @@ -506,24 +564,8 @@ 0 1 - 7 - 17 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - - - 7 - 18 + 8 + 20 1 0 0 @@ -538,8 +580,8 @@ 0 - 7 - 19 + 8 + 21 5 0 0 @@ -553,6 +595,22 @@ 1 0 + + 8 + 22 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib + 1 + 0 + @@ -562,24 +620,8 @@ 0 1 - 8 - 20 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Dbg_CM3_L.lib - 1 - 0 - - - 8 - 21 + 9 + 23 1 0 0 @@ -594,8 +636,8 @@ 0 - 8 - 22 + 9 + 24 5 0 0 @@ -610,8 +652,8 @@ 0 - 8 - 23 + 9 + 25 5 0 0 @@ -626,12 +668,12 @@ 0 - 8 - 24 + 9 + 26 5 0 0 - 0 + 33 0 0 0 @@ -642,8 +684,8 @@ 0 - 8 - 25 + 9 + 27 5 0 0 @@ -658,8 +700,8 @@ 0 - 8 - 26 + 9 + 28 5 0 0 @@ -674,8 +716,8 @@ 0 - 8 - 27 + 9 + 29 1 0 0 @@ -689,689 +731,33 @@ 1 0 + + 9 + 30 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + Net_Dbg_CM3_L.lib + 1 + 0 + ::wolfSSL - 0 + 1 0 0 1 - 9 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 9 - 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 9 - 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 9 + 10 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 9 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - asm.c - 1 - 0 - - - 9 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - asn.c - 1 - 0 - - - 9 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - blake2b.c - 1 - 0 - - - 9 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - camellia.c - 1 - 0 - - - 9 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - coding.c - 1 - 0 - - - 9 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - compress.c - 1 - 0 - - - 9 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - des3.c - 1 - 0 - - - 9 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - dh.c - 1 - 0 - - - 9 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - dsa.c - 1 - 0 - - - 9 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - ecc.c - 1 - 0 - - - 9 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c - 1 - 0 - - - 9 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - error.c - 1 - 0 - - - 9 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - hc128.c - 1 - 0 - - - 9 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - hmac.c - 1 - 0 - - - 9 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - integer.c - 1 - 0 - - - 9 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - logging.c - 1 - 0 - - - 9 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - md2.c - 1 - 0 - - - 9 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - md4.c - 1 - 0 - - - 9 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - md5.c - 1 - 0 - - - 9 - 51 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - memory.c - 1 - 0 - - - 9 - 52 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - misc.c - 1 - 0 - - - 9 - 53 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c - 1 - 0 - - - 9 - 54 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - rabbit.c - 1 - 0 - - - 9 - 55 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - random.c - 1 - 0 - - - 9 - 56 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - ripemd.c - 1 - 0 - - - 9 - 57 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - rsa.c - 1 - 0 - - - 9 - 58 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - sha.c - 1 - 0 - - - 9 - 59 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - sha256.c - 1 - 0 - - - 9 - 60 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - sha512.c - 1 - 0 - - - 9 - 61 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - tfm.c - 1 - 0 - - - 9 - 62 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - crl.c - 1 - 0 - - - 9 - 63 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - internal.c - 1 - 0 - - - 9 - 64 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - io.c - 1 - 0 - - - 9 - 65 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - keys.c - 1 - 0 - - - 9 - 66 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - ocsp.c - 1 - 0 - - - 9 - 67 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - sniffer.c - 1 - 0 - - - 9 - 68 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - ssl.c - 1 - 0 - - - 9 - 69 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - tls.c - 1 - 0 - - - 9 - 70 5 0 0 @@ -1386,8 +772,8 @@ 0 - 9 - 71 + 10 + 32 5 0 0 @@ -1402,8 +788,8 @@ 0 - 9 - 72 + 10 + 33 5 0 0 @@ -1412,8 +798,680 @@ 0 0 0 - RTE\wolfSSL\config.h - config.h + RTE\wolfSSL\settings.h + settings.h + 1 + 0 + + + 10 + 34 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c + 1 + 0 + + + 10 + 35 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + aes.c + 1 + 0 + + + 10 + 36 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + arc4.c + 1 + 0 + + + 10 + 37 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + asm.c + 1 + 0 + + + 10 + 38 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + asn.c + 1 + 0 + + + 10 + 39 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + blake2b.c + 1 + 0 + + + 10 + 40 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + camellia.c + 1 + 0 + + + 10 + 41 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + coding.c + 1 + 0 + + + 10 + 42 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + compress.c + 1 + 0 + + + 10 + 43 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + des3.c + 1 + 0 + + + 10 + 44 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + dh.c + 1 + 0 + + + 10 + 45 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + dsa.c + 1 + 0 + + + 10 + 46 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + ecc.c + 1 + 0 + + + 10 + 47 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c + 1 + 0 + + + 10 + 48 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + error.c + 1 + 0 + + + 10 + 49 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + hc128.c + 1 + 0 + + + 10 + 50 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + hmac.c + 1 + 0 + + + 10 + 51 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + integer.c + 1 + 0 + + + 10 + 52 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + logging.c + 1 + 0 + + + 10 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + md2.c + 1 + 0 + + + 10 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + md4.c + 1 + 0 + + + 10 + 55 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + md5.c + 1 + 0 + + + 10 + 56 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + memory.c + 1 + 0 + + + 10 + 57 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + misc.c + 1 + 0 + + + 10 + 58 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + port.c + 1 + 0 + + + 10 + 59 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c + 1 + 0 + + + 10 + 60 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + rabbit.c + 1 + 0 + + + 10 + 61 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + random.c + 1 + 0 + + + 10 + 62 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + ripemd.c + 1 + 0 + + + 10 + 63 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + rsa.c + 1 + 0 + + + 10 + 64 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 10 + 65 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 10 + 66 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 10 + 67 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c + tfm.c + 1 + 0 + + + 10 + 68 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\crl.c + crl.c + 1 + 0 + + + 10 + 69 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\internal.c + internal.c + 1 + 0 + + + 10 + 70 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\io.c + io.c + 1 + 0 + + + 10 + 71 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\keys.c + keys.c + 1 + 0 + + + 10 + 72 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ocsp.c + ocsp.c + 1 + 0 + + + 10 + 73 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\sniffer.c + sniffer.c + 1 + 0 + + + 10 + 74 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ssl.c + ssl.c + 1 + 0 + + + 10 + 75 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\tls.c + tls.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/client.c b/IDE/MDK5-ARM/Projects/SimpleClient/client.c index e6f6a56e3..be7e0816a 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/client.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/client.c @@ -22,7 +22,7 @@ #ifdef HAVE_CONFIG_H #include #endif - #define CYASSL_MDK_ARM + #if defined(CYASSL_MDK_ARM) #include #include @@ -46,11 +46,11 @@ #endif #include + #include #include "examples/client/client.h" -#define USE_CYASSL_MEMORY #ifdef CYASSL_CALLBACKS int handShakeCB(HandShakeInfo*); @@ -139,18 +139,27 @@ static void Usage(void) #ifdef SHOW_SIZES printf("-z Print structure sizes\n"); #endif +#ifdef HAVE_SNI printf("-S Use Host Name Indication\n"); +#endif +#ifdef HAVE_MAX_FRAGMENT + printf("-L Use Maximum Fragment Length [1-5]\n"); +#endif +#ifdef HAVE_TRUNCATED_HMAC + printf("-T Use Truncated HMAC\n"); +#endif +#ifdef HAVE_OCSP + printf("-o Perform OCSP lookup on peer certificate\n"); + printf("-O Perform OCSP lookup using as responder\n"); +#endif +#ifdef ATOMIC_USER + printf("-U Atomic User Record Layer Callbacks\n"); +#endif +#ifdef HAVE_PK_CALLBACKS + printf("-P Public Key Callbacks\n"); +#endif } -#ifdef CYASSL_MDK_SHELL -#define exit(code) return(code) -#endif - -#ifdef CYASSL_MDK_SHELL - #define exit(code) return(code) -#endif - - THREAD_RETURN CYASSL_THREAD client_test(void* args) { SOCKET_T sockfd = 0; @@ -169,7 +178,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) int input; int msgSz = (int)strlen(msg); - int port = yasslPort; + word16 port = yasslPort; char* host = (char*)yasslIP; char* domain = (char*)"www.yassl.com"; @@ -186,6 +195,8 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) int trackMemory = 0; int useClientCert = 1; int fewerPackets = 0; + int atomicUser = 0; + int pkCallbacks = 0; char* cipherList = NULL; char* verifyCert = (char*)caCert; char* ourCert = (char*)cliCert; @@ -194,6 +205,18 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) #ifdef HAVE_SNI char* sniHostName = NULL; #endif +#ifdef HAVE_MAX_FRAGMENT + byte maxFragment = 0; +#endif +#ifdef HAVE_TRUNCATED_HMAC + byte truncatedHMAC = 0; +#endif + + +#ifdef HAVE_OCSP + int useOcsp = 0; + char* ocspUrl = NULL; +#endif int argc = ((func_args*)args)->argc; char** argv = ((func_args*)args)->argv; @@ -209,8 +232,13 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) (void)session; (void)sslResume; (void)trackMemory; + (void)atomicUser; + (void)pkCallbacks; - while ((ch = mygetopt(argc, argv, "?gdusmNrtfxh:p:v:l:A:c:k:b:zS:")) != -1){ + StackTrap(); + + while ((ch = mygetopt(argc, argv, + "?gdusmNrtfxUPh:p:v:l:A:c:k:b:zS:L:ToO:")) != -1) { switch (ch) { case '?' : Usage(); @@ -250,13 +278,25 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) fewerPackets = 1; break; + case 'U' : + #ifdef ATOMIC_USER + atomicUser = 1; + #endif + break; + + case 'P' : + #ifdef HAVE_PK_CALLBACKS + pkCallbacks = 1; + #endif + break; + case 'h' : host = myoptarg; domain = myoptarg; break; case 'p' : - port = atoi(myoptarg); + port = (word16)atoi(myoptarg); #if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API) if (port == 0) err_sys("port number cannot be 0"); @@ -315,6 +355,36 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) #endif break; + case 'L' : + #ifdef HAVE_MAX_FRAGMENT + maxFragment = atoi(myoptarg); + if (maxFragment < CYASSL_MFL_2_9 || + maxFragment > CYASSL_MFL_2_13) { + Usage(); + exit(MY_EX_USAGE); + } + #endif + break; + + case 'T' : + #ifdef HAVE_TRUNCATED_HMAC + truncatedHMAC = 1; + #endif + break; + + case 'o' : + #ifdef HAVE_OCSP + useOcsp = 1; + #endif + break; + + case 'O' : + #ifdef HAVE_OCSP + useOcsp = 1; + ocspUrl = myoptarg; + #endif + break; + default: Usage(); exit(MY_EX_USAGE); @@ -390,7 +460,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) ctx = CyaSSL_CTX_new(method); if (ctx == NULL) err_sys("unable to get ctx"); - + if (cipherList) if (CyaSSL_CTX_set_cipher_list(ctx, cipherList) != SSL_SUCCESS) err_sys("client can't set cipher list 1"); @@ -423,7 +493,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) useClientCert = 0; } -#ifdef OPENSSL_EXTRA +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) CyaSSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); #endif @@ -436,6 +506,18 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) } #endif +#ifdef HAVE_OCSP + if (useOcsp) { + if (ocspUrl != NULL) { + CyaSSL_CTX_SetOCSP_OverrideURL(ctx, ocspUrl); + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE + | CYASSL_OCSP_URL_OVERRIDE); + } + else + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE); + } +#endif + #ifdef USER_CA_CB CyaSSL_CTX_SetCACb(ctx, CaCb); #endif @@ -475,6 +557,16 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) != SSL_SUCCESS) err_sys("UseSNI failed"); #endif +#ifdef HAVE_MAX_FRAGMENT + if (maxFragment) + if (CyaSSL_CTX_UseMaxFragment(ctx, maxFragment) != SSL_SUCCESS) + err_sys("UseMaxFragment failed"); +#endif +#ifdef HAVE_TRUNCATED_HMAC + if (truncatedHMAC) + if (CyaSSL_CTX_UseTruncatedHMAC(ctx) != SSL_SUCCESS) + err_sys("UseTruncatedHMAC failed"); +#endif if (benchmark) { /* time passed in number of connects give average */ @@ -513,9 +605,6 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) ssl = CyaSSL_new(ctx); if (ssl == NULL) err_sys("unable to get SSL object"); - - CyaSSL_set_quiet_shutdown(ssl, 1) ; - if (doDTLS) { SOCKADDR_IN_T addr; build_addr(&addr, host, port, 1); @@ -533,6 +622,14 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) err_sys("can't load crl, check crlfile and date validity"); if (CyaSSL_SetCRL_Cb(ssl, CRL_CallBack) != SSL_SUCCESS) err_sys("can't set crl callback"); +#endif +#ifdef ATOMIC_USER + if (atomicUser) + SetupAtomicUser(ctx, ssl); +#endif +#ifdef HAVE_PK_CALLBACKS + if (pkCallbacks) + SetupPkCallbacks(ctx, ssl); #endif if (matchName && doPeerCheck) CyaSSL_check_domain_name(ssl, domain); @@ -545,7 +642,7 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) else if (CyaSSL_connect(ssl) != SSL_SUCCESS) { /* see note at top of README */ int err = CyaSSL_get_error(ssl, 0); - char buffer[80]; + char buffer[CYASSL_MAX_ERROR_SZ]; printf("err = %d, %s\n", err, CyaSSL_ERR_error_string(err, buffer)); err_sys("SSL_connect failed"); @@ -570,32 +667,25 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) input = CyaSSL_read(ssl, reply, sizeof(reply)-1); if (input > 0) { reply[input] = 0; - printf("Server response: %s", reply); + printf("Server response: %s\n", reply); - if (sendGET && (input == (sizeof(reply)-1))) { /* get html */ + if (sendGET) { /* get html */ while (1) { input = CyaSSL_read(ssl, reply, sizeof(reply)-1); if (input > 0) { reply[input] = 0; - printf("%s", reply); - if(input < sizeof(reply)-1) - break ; + printf("%s\n", reply); } else break; } } - printf("\n"); } else if (input < 0) { int readErr = CyaSSL_get_error(ssl, 0); if (readErr != SSL_ERROR_WANT_READ) err_sys("CyaSSL_read failed"); } - -#ifdef CYASSL_CMSIS_RTOS - osDelay(5000) ; -#endif #ifndef NO_SESSION_CACHE if (resumeSession) { @@ -612,6 +702,10 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) if (doDTLS == 0) /* don't send alert after "break" command */ CyaSSL_shutdown(ssl); /* echoserver will interpret as new conn */ +#ifdef ATOMIC_USER + if (atomicUser) + FreeAtomicUser(ssl); +#endif CyaSSL_free(ssl); CloseSocket(sockfd); @@ -713,11 +807,13 @@ THREAD_RETURN CYASSL_THREAD client_test(void* args) args.argv = argv; CyaSSL_Init(); -#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) +#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) && !defined(STACK_TRAP) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("client") || CurrentDir("build")) + if (CurrentDir("client")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); #ifdef HAVE_STACK_SIZE StackSizeCheck(&args, client_test); diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h b/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h new file mode 100644 index 000000000..83582ca71 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/config-SimpleClient.h @@ -0,0 +1,70 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// Build Target: Simple Client +// Callee IP Address +// Default: "192.168.1.100" +#define CYASSL_CALLEE_IP "192.168.11.3" +// Callee Port Number +// Default: "443" +#define CYASSL_CALLEE_PORT "443" +// HTTP GET Option <0=> HTTP Get <1=> SSL/TLS Message +#define MDK_CONF_HTTP_GET 0 +#if MDK_CONF_HTTP_GET == 0 + #define CYASSL_HTTP_GET "-g" + #define CYASSL_HTTP_GET_COUNT 1 +#elif MDK_CONF_HTTP_GET == 1 + #define CYASSL_HTTP_GET "" + #define CYASSL_HTTP_GET_COUNT 0 +#endif +// SSL/TLS Version <0=> SSL3 <1=> TLS 1.0 <2=> TLS 1.1 <3=> TLS 1.2 +#define MDK_CONF_SSL_VERSION 3 +#if MDK_CONF_SSL_VERSION == 0 + #define CYASSL_SSL_VER "0" +#elif MDK_CONF_SSL_VERSION == 1 + #define CYASSL_SSL_VER "1" +#elif MDK_CONF_SSL_VERSION == 2 + #define CYASSL_SSL_VER "2" +#elif MDK_CONF_SSL_VERSION == 3 + #define CYASSL_SSL_VER "3" +#endif + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/main.c b/IDE/MDK5-ARM/Projects/SimpleClient/main.c index 7eda03912..b0efeeb5c 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleClient/main.c @@ -89,8 +89,7 @@ int main() "-v", CYASSL_SSL_VER, CYASSL_HTTP_GET } ; static func_args args = { 7 + CYASSL_HTTP_GET_COUNT, argv } ; - - init_time() ; + init_filesystem (); net_initialize() ; osThreadCreate (osThread (tcp_poll), NULL); diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx b/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx index fb0174c76..af4201e3c 100644 --- a/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx +++ b/IDE/MDK5-ARM/Projects/SimpleClient/simpleClient.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_SimpleClient CYASSL_STM32F2xx + HAVE_CONFIG_H MDK_CONF_SimpleClient @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -428,6 +434,11 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + Net_Config_ETH_0.h + 5 + .\RTE\Network\Net_Config_ETH_0.h + @@ -441,18 +452,33 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-dummy.c + 1 + .\time-dummy.c + + time-STM32F2xx.c + 1 + .\time-STM32F2xx.c + + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -488,11 +514,6 @@ ::Drivers - - PHY_ST802RT1.c - 1 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - EMAC_STM32F2xx.c 1 @@ -503,16 +524,16 @@ 1 C:\Keil5\ARM\PACK\Keil\STM32F2xx_DFP\1.0.4\RTE_Driver\MCI_STM32F2xx.c + + PHY_ST802RT1.c + 1 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -523,16 +544,16 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::Network - - Net_Dbg_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Config.c 1 @@ -568,221 +589,16 @@ 1 RTE\Network\Net_Debug.c + + Net_Dbg_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + ::wolfSSL - - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - - - aes.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - - - arc4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - - - asm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - - - asn.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - - - blake2b.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - - - camellia.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - - - coding.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - - - compress.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - - - des3.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - - - dh.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - - - dsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - - - ecc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - - - ecc_fp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - - - error.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - - - hc128.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - - - hmac.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - - - integer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - - - logging.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - - - md2.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - - - md4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - - - md5.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - - - memory.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - - - misc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - - - pwdbased.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - - - rabbit.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - - - random.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - - - ripemd.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - - - rsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - - - sha.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - - - sha256.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - - - sha512.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - - - tfm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - - - crl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - - - internal.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - - - io.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - - - keys.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - - - ocsp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - - - sniffer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - - - ssl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - - - tls.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - config-Crypt.h 5 @@ -794,9 +610,219 @@ RTE\wolfSSL\config-CyaSSL.h - config.h + settings.h 5 - RTE\wolfSSL\config.h + RTE\wolfSSL\settings.h + + + cyassl_MDK_ARM.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + + + aes.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\aes.c + + + arc4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\arc4.c + + + asm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asm.c + + + asn.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\asn.c + + + blake2b.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\blake2b.c + + + camellia.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\camellia.c + + + coding.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\coding.c + + + compress.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\compress.c + + + des3.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\des3.c + + + dh.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dh.c + + + dsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\dsa.c + + + ecc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc.c + + + ecc_fp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ecc_fp.c + + + error.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\error.c + + + hc128.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hc128.c + + + hmac.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\hmac.c + + + integer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\integer.c + + + logging.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\logging.c + + + md2.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md2.c + + + md4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md4.c + + + md5.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\md5.c + + + memory.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\memory.c + + + misc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\misc.c + + + port.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\port.c + + + pwdbased.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\pwdbased.c + + + rabbit.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rabbit.c + + + random.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\random.c + + + ripemd.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\ripemd.c + + + rsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\rsa.c + + + sha.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha.c + + + sha256.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha256.c + + + sha512.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\sha512.c + + + tfm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\ctaocrypt\src\tfm.c + + + crl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\crl.c + + + internal.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\internal.c + + + io.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\io.c + + + keys.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\keys.c + + + ocsp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ocsp.c + + + sniffer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\sniffer.c + + + ssl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\ssl.c + + + tls.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.4\cyassl\src\tls.c @@ -838,20 +864,20 @@ - - + + - - + + - - + + @@ -928,20 +954,14 @@ - - + + - - - - - - - - + + @@ -950,8 +970,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -1076,26 +1096,32 @@ - + RTE\wolfSSL\config-Crypt.h - - + + - + RTE\wolfSSL\config-CyaSSL.h - - + + - RTE\wolfSSL\config.h + RTE\wolfSSL\config.h + + + + RTE\wolfSSL\settings.h + + diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c b/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c new file mode 100644 index 000000000..3a26db7dc --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/time-STM32F2xx.c @@ -0,0 +1,82 @@ +/* time-STM32F2.c + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +#define PERIPH_BASE ((uint32_t)0x40000000) +/*----------------------------------------------------------------------------- + * initialize RTC + *----------------------------------------------------------------------------*/ +#include "stm32f2xx.h" + +#define assert_param(a) + +#if 0 +#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) +#define SYNCHRO_TIMEOUT ((uint32_t) 0x00008000) +#define Bcd2ToByte(v) \ + ((((uint8_t)(v & (uint8_t)0xF0) >> (uint8_t)0x4) * 10) + (v & (uint8_t)0x0F)) +#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) +#define RTC_TR_MNT ((uint32_t)0x00007000) +#define RTC_TR_MNU ((uint32_t)0x00000F00) + +#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) +#define CR_OFFSET (PWR_OFFSET + 0x00) +#define DBP_BitNumber 0x08 +#define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4)) +#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) +#define INITMODE_TIMEOUT ((uint32_t) 0x00010000) +#endif + +/*----------------------------------------------------------------------------- + * initialize TIM + *----------------------------------------------------------------------------*/ +#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) + +void init_time(void) +{ + uint16_t tmpcr1 = 0; + + ((uint32_t *)RCC)[0x10] |= RCC_APB1Periph_TIM2 ; + + tmpcr1 = TIM2->CR1 ; + tmpcr1 &= (uint16_t) (~(((uint16_t)0x0010) | ((uint16_t)0x0060) )); + /* CR1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS) */ + tmpcr1 |= (uint16_t)0x0000 ; /* CR1 |= TIM_CounterMode_Up */ + TIM2->CR1= tmpcr1 ; + + TIM2->ARR = 0xffffffff ; /* ARR= TIM_Period */ + TIM2->PSC = 60 ; /* PSC = TIM_Prescaler */ + TIM2->EGR = ((uint16_t)0x0001) ; /* EGR = TIM_PSCReloadMode_Immediate */ + + *(uint16_t *)(PERIPH_BASE+0x0) |=((uint16_t)0x0001) ; + /* TIM_Cmd(TIM2, ENABLE) ; */ +} + +double current_time() +{ + return ((double)TIM2->CNT/1000000.0) ; +} + diff --git a/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c b/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleClient/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt b/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt index ea3ec6412..89a9fd422 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt +++ b/IDE/MDK5-ARM/Projects/SimpleServer/Abstract.txt @@ -1,11 +1,12 @@ This program is a simple server example with CyaSSL/wolfCrypt library. In order to run this program, -Copy {PACK}\wolfSSL\CyaSSL\2.8.0\cyassl\certs folder and files to the SD memory. +Copy {PACK}\wolfSSL\CyaSSL\{version}\cyassl\certs folder and files to the SD memory. Set the server IP address in Net_Config_ETH_0.h The default server listning port is 11111, defined in test.h For further configuration, refer config-Crypt.h and config-CyaSSL.h. +config-SimpleServer.h is for configuring the server port number. When testing this server, it is recommended to test against one of the standard CyaSSL example applications running on a desktop machine. The standard CyaSSL diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/CMSIS/RTX_Conf_CM.c b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/CMSIS/RTX_Conf_CM.c index 2298f7ddb..2506e15d2 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/CMSIS/RTX_Conf_CM.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/CMSIS/RTX_Conf_CM.c @@ -3,7 +3,7 @@ *---------------------------------------------------------------------------- * Name: RTX_Conf_CM.C * Purpose: Configuration of CMSIS RTX Kernel for Cortex-M - * Rev.: V4.70 + * Rev.: V4.73 *---------------------------------------------------------------------------- * * Copyright (c) 1999-2009 KEIL, 2009-2013 ARM Germany GmbH @@ -48,21 +48,21 @@ // Defines max. number of threads that will run at the same time. // Default: 6 #ifndef OS_TASKCNT - #define OS_TASKCNT 5 + #define OS_TASKCNT 6 #endif // Default Thread stack size [bytes] <64-4096:8><#/4> // Defines default stack size for threads with osThreadDef stacksz = 0 // Default: 200 #ifndef OS_STKSIZE - #define OS_STKSIZE 250 + #define OS_STKSIZE 300 #endif -// Main Thread stack size [bytes] <64-20000:8><#/4> +// Main Thread stack size [bytes] <64-32768:8><#/4> // Defines stack size for main thread. // Default: 200 #ifndef OS_MAINSTKSIZE - #define OS_MAINSTKSIZE 3000 + #define OS_MAINSTKSIZE 2500 #endif // Number of threads with user-provided stack size <0-250> @@ -72,11 +72,11 @@ #define OS_PRIVCNT 0 #endif -// Total stack size [bytes] for threads with user-provided stack size <0-0x10000:8><#/4> +// Total stack size [bytes] for threads with user-provided stack size <0-1048576:8><#/4> // Defines the combined stack size for threads with user-provided stack size. // Default: 0 #ifndef OS_PRIVSTKSIZE - #define OS_PRIVSTKSIZE 4500 + #define OS_PRIVSTKSIZE 3000 #endif // Check for stack overflow @@ -158,7 +158,7 @@ #define OS_TIMERPRIO 5 #endif -// Timer Thread stack size [bytes] <64-64000:8><#/4> +// Timer Thread stack size [bytes] <64-4096:8><#/4> // Defines stack size for Timer thread. // Default: 200 #ifndef OS_TIMERSTKSZ @@ -256,11 +256,30 @@ void os_tick_irqack (void) { /*--------------------------- os_error --------------------------------------*/ -void os_error (uint32_t err_code) { - /* This function is called when a runtime error is detected. Parameter */ - /* 'err_code' holds the runtime error code (defined in RTL.H). */ +/* OS Error Codes */ +#define OS_ERROR_STACK_OVF 1 +#define OS_ERROR_FIFO_OVF 2 +#define OS_ERROR_MBX_OVF 3 + +extern osThreadId svcThreadGetId (void); + +void os_error (uint32_t error_code) { + /* This function is called when a runtime error is detected. */ + /* Parameter 'error_code' holds the runtime error code. */ /* HERE: include optional code to be executed on runtime error. */ + switch (error_code) { + case OS_ERROR_STACK_OVF: + /* Stack overflow detected for the currently running task. */ + /* Thread can be identified by calling svcThreadGetId(). */ + break; + case OS_ERROR_FIFO_OVF: + /* ISR FIFO Queue buffer overflow detected. */ + break; + case OS_ERROR_MBX_OVF: + /* Mailbox overflow detected. */ + break; + } for (;;); } diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_BSD.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_BSD.h index 4166a0a2d..7d515a507 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_BSD.h +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_BSD.h @@ -15,7 +15,7 @@ // Number of BSD Sockets <1-20> // Number of available Berkeley Sockets // Default: 2 -#define BSD_NUM_SOCKS 15 +#define BSD_NUM_SOCKS 10 // Number of Streaming Server Sockets <0-20> // Defines a number of Streaming (TCP) Server sockets, diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_ETH_0.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_ETH_0.h index 9a49f3821..3750eff2b 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_ETH_0.h +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Config_ETH_0.h @@ -14,7 +14,7 @@ // Connect to hardware via Driver_ETH# <0-255> // Select driver control block for MAC and PHY interface -#define ETH0_DRIVER 1 +#define ETH0_DRIVER 0 // MAC Address // Local Ethernet MAC Address @@ -61,11 +61,11 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_IP3 0 +#define ETH0_IP3 11 // Address byte 4 <0-255> // Default: 100 -#define ETH0_IP4 100 +#define ETH0_IP4 101 // // Subnet mask @@ -99,11 +99,11 @@ // Address byte 3 <0-255> // Default: 0 -#define ETH0_GW3 0 +#define ETH0_GW3 11 // Address byte 4 <0-255> // Default: 254 -#define ETH0_GW4 254 +#define ETH0_GW4 1 // // Primary DNS Server diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Debug.c b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Debug.c index 735089a40..633200afe 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Debug.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/Network/Net_Debug.c @@ -78,7 +78,7 @@ // Turn On/Off BSD Interface debug messages #define DBG_BSD 1 // - + // Application Debug Definitions // HTTP Server Debug <0=> Off <1=> Errors only <2=> Full debug // Turn On/Off Web Server debug messages diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-Crypt.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-Crypt.h new file mode 100644 index 000000000..a11c3ef24 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-Crypt.h @@ -0,0 +1,185 @@ +/* config-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +// <<< Use Configuration Wizard in Context Menu >>> + +// wolfCrypt Configuration + +// 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 +// + +// Crypt Algrithm + +// MD5, SHA, SHA-256, AES, RC4, ASN, RSA +// + +// MD2 +#define MDK_CONF_MD2 0 +#if MDK_CONF_MD2 == 1 +#define CYASSL_MD2 +#endif +// +// MD4 +#define MDK_CONF_MD4 1 +#if MDK_CONF_MD4 == 0 +#define NO_MD4 +#endif +// +// SHA-384 +// This has to be with SHA512 +#define MDK_CONF_SHA384 0 +#if MDK_CONF_SHA384 == 1 +#define CYASSL_SHA384 +#endif +// +// SHA-512 +#define MDK_CONF_SHA512 0 +#if MDK_CONF_SHA512 == 1 +#define CYASSL_SHA512 +#endif +// +// RIPEMD +#define MDK_CONF_RIPEMD 0 +#if MDK_CONF_RIPEMD == 1 +#define CYASSL_RIPEMD +#endif +// +// HMAC +#define MDK_CONF_HMAC 1 +#if MDK_CONF_HMAC == 0 +#define NO_HMAC +#endif +// +// HC128 +#define MDK_CONF_HC128 0 +#if MDK_CONF_HC128 == 1 +#define HAVE_HC128 +#endif +// +// RABBIT +#define MDK_CONF_RABBIT 1 +#if MDK_CONF_RABBI == 0 +#define NO_RABBIT +#endif +// + +// AEAD +#define MDK_CONF_AEAD 0 +#if MDK_CONF_AEAD == 1 +#define HAVE_AEAD +#endif +// +// DES3 +#define MDK_CONF_DES3 1 +#if MDK_CONF_DES3 == 0 +#define NO_DES3 +#endif +// +// CAMELLIA +#define MDK_CONF_CAMELLIA 0 +#if MDK_CONF_CAMELLIA == 1 +#define HAVE_CAMELLIA +#endif +// + +// DH +// need this for CYASSL_SERVER, OPENSSL_EXTRA +#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 +// +// PWDBASED +#define MDK_CONF_PWDBASED 1 +#if MDK_CONF_PWDBASED == 0 +#define NO_PWDBASED +#endif +// + +// ECC +#define MDK_CONF_ECC 0 +#if MDK_CONF_ECC == 1 +#define HAVE_ECC +#endif +// +// PSK +#define MDK_CONF_PSK 1 +#if MDK_CONF_PSK == 0 +#define NO_PSK +#endif +// +// AESCCM (Turn off Hardware Crypt) +#define MDK_CONF_AESCCM 0 +#if MDK_CONF_AESCCM == 1 +#define HAVE_AESCCM +#endif +// +// AESGCM (Turn off Hardware Crypt) +#define MDK_CONF_AESGCM 0 +#if MDK_CONF_AESGCM == 1 +#define HAVE_AESGCM +#define BUILD_AESGCM +#endif +// +// NTRU (need License, "crypto_ntru.h") +#define MDK_CONF_NTRU 0 +#if MDK_CONF_NTRU == 1 +#define HAVE_NTRU +#endif +// +// + +// Hardware Crypt (See document for usage) +// Hardware RNG +#define MDK_CONF_STM32F2_RNG 0 +#if MDK_CONF_STM32F2_RNG == 1 +#define STM32F2_RNG +#else + +#endif +// +// Hardware Crypt +#define MDK_CONF_STM32F2_CRYPTO 0 +#if MDK_CONF_STM32F2_CRYPTO == 1 +#define STM32F2_CRYPTO +#endif +// + +// + + + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-CyaSSL.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-CyaSSL.h new file mode 100644 index 000000000..02ba94bd4 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/config-CyaSSL.h @@ -0,0 +1,144 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + +/**** CyaSSL for KEIL-RL Configuration ****/ + +#define __CORTEX_M3__ +#define CYASSL_MDK_ARM +#define NO_WRITEV +#define NO_CYASSL_DIR +#define NO_MAIN_DRIVER + + +#define CYASSL_DER_LOAD +#define HAVE_NULL_CIPHER + +#define HAVE_KEIL_RTX +#define CYASSL_CMSIS_RTOS +#define CYASSL_KEIL_TCP_NET + + +// <<< Use Configuration Wizard in Context Menu >>> +// CyaSSL Configuration + +// SSL (Included by default) +// + +// TLS +#define MDK_CONF_TLS 1 +#if MDK_CONF_TLS == 0 +#define NO_TLS +#endif +// + +// CRL +#define MDK_CONF_DER_LOAD 0 +#if MDK_CONF_DER_LOAD == 1 +#define CYASSL_DER_LOAD +#endif +// +// OpenSSL Extra +#define MDK_CONF_OPENSSL_EXTRA 1 +#if MDK_CONF_OPENSSL_EXTRA == 1 +#define OPENSSL_EXTRA +#endif +// +// + +// Cert/Key Generation +// CertGen +#define MDK_CONF_CERT_GEN 0 +#if MDK_CONF_CERT_GEN == 1 +#define CYASSL_CERT_GEN +#endif +// +// KeyGen +#define MDK_CONF_KEY_GEN 0 +#if MDK_CONF_KEY_GEN == 1 +#define CYASSL_KEY_GEN +#endif +// +// + +// Others + +// Inline +#define MDK_CONF_INLINE 0 +#if MDK_CONF_INLINE == 0 +#define NO_INLINE +#endif +// +// Debug +// Debug Message +#define MDK_CONF_DebugMessage 0 +#if MDK_CONF_DebugMessage == 1 +#define DEBUG_CYASSL +#endif +// +// Check malloc +#define MDK_CONF_CheckMalloc 1 +#if MDK_CONF_CheckMalloc == 1 +#define CYASSL_MALLOC_CHECK +#endif +// + + +// +// ErrNo.h +#define MDK_CONF_ErrNo 0 +#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 +// +// zlib (need "zlib.h") +#define MDK_CONF_LIBZ 0 +#if MDK_CONF_LIBZ == 1 +#define HAVE_LIBZ +#endif +// +// CAVIUM (need CAVIUM headers) +#define MDK_CONF_CAVIUM 0 +#if MDK_CONF_CAVIUM == 1 +#define HAVE_CAVIUM +#endif +// +// Small Stack +#define MDK_CONF_SmallStack 1 +#if MDK_CONF_SmallStack == 0 +#define NO_CYASSL_SMALL_STACK +#endif +// +// Use Fast Math +#define MDK_CONF_FASTMATH 0 +#if MDK_CONF_FASTMATH == 1 +#define USE_FAST_MATH +#endif +// +// + +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h new file mode 100644 index 000000000..22dea06d0 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/RTE/wolfSSL/settings.h @@ -0,0 +1,627 @@ +/* settings.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +/* Place OS specific preprocessor flags, defines, includes here, will be + included into every file because types.h includes it */ + + +#ifndef CTAO_CRYPT_SETTINGS_H +#define CTAO_CRYPT_SETTINGS_H + +#ifdef __cplusplus + extern "C" { +#endif + +/* Uncomment next line if using IPHONE */ +/* #define IPHONE */ + +/* Uncomment next line if using ThreadX */ +/* #define THREADX */ + +/* Uncomment next line if using Micrium ucOS */ +/* #define MICRIUM */ + +/* Uncomment next line if using Mbed */ +/* #define MBED */ + +/* Uncomment next line if using Microchip PIC32 ethernet starter kit */ +/* #define MICROCHIP_PIC32 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 5 */ +/* #define MICROCHIP_TCPIP_V5 */ + +/* Uncomment next line if using Microchip TCP/IP stack, version 6 or later */ +/* #define MICROCHIP_TCPIP */ + +/* Uncomment next line if using FreeRTOS */ +/* #define FREERTOS */ + +/* Uncomment next line if using FreeRTOS Windows Simulator */ +/* #define FREERTOS_WINSIM */ + +/* Uncomment next line if using RTIP */ +/* #define EBSNET */ + +/* Uncomment next line if using lwip */ +/* #define CYASSL_LWIP */ + +/* Uncomment next line if building CyaSSL for a game console */ +/* #define CYASSL_GAME_BUILD */ + +/* Uncomment next line if building CyaSSL for LSR */ +/* #define CYASSL_LSR */ + +/* Uncomment next line if building CyaSSL for Freescale MQX/RTCS/MFS */ +/* #define FREESCALE_MQX */ + +/* Uncomment next line if using STM32F2 */ +/* #define CYASSL_STM32F2 */ + +/* Uncomment next line if using Comverge settings */ +/* #define COMVERGE */ + +/* Uncomment next line if using QL SEP settings */ +/* #define CYASSL_QL */ + + +#include + +#ifdef IPHONE + #define SIZEOF_LONG_LONG 8 +#endif + + +#ifdef COMVERGE + #define THREADX + #define HAVE_NETX + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_RSA + #define NO_SESSION_CACHE + #define HAVE_ECC +#endif + + +#ifdef THREADX + #define SIZEOF_LONG_LONG 8 +#endif + +#ifdef HAVE_NETX + #include "nx_api.h" +#endif + +#ifdef MICROCHIP_PIC32 + #define SIZEOF_LONG_LONG 8 + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_FILESYSTEM + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT +#endif + +#ifdef MICROCHIP_TCPIP_V5 + /* include timer functions */ + #include "TCPIP Stack/TCPIP.h" +#endif + +#ifdef MICROCHIP_TCPIP + /* include timer, NTP functions */ + #include "system/system_services.h" + #ifdef MICROCHIP_MPLAB_HARMONY + #include "tcpip/tcpip.h" + #else + #include "tcpip/sntp.h" + #endif +#endif + +#ifdef MBED + #define SINGLE_THREADED + #define CYASSL_USER_IO + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 +#endif /* MBED */ + +#ifdef CYASSL_TYTO + #include "rand.h" + #define FREERTOS + #define NO_FILESYSTEM + #define CYASSL_USER_IO + #define NO_DEV_RANDOM + #define HAVE_ECC + #define HAVE_ECC_ENCRYPT + #define ECC_SHAMIR + #define HAVE_HKDF + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FP_MAX_BITS 512 + #define NO_OLD_TLS + #define NO_MD4 + #define NO_RABBIT + #define NO_HC128 + #define NO_RSA + #define NO_DSA + #define NO_PWDBASED + #define NO_PSK +#endif + +#ifdef FREERTOS_WINSIM + #define FREERTOS + #define USE_WINDOWS_API +#endif + + +/* Micrium will use Visual Studio for compilation but not the Win32 API */ +#if defined(_WIN32) && !defined(MICRIUM) && !defined(FREERTOS) \ + && !defined(EBSNET) + #define USE_WINDOWS_API +#endif + + +#if defined(CYASSL_LEANPSK) && !defined(XMALLOC_USER) + #include + #define XMALLOC(s, h, type) malloc((s)) + #define XFREE(p, h, type) free((p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + +#if defined(XMALLOC_USER) && defined(SSN_BUILDING_LIBYASSL) + #undef XMALLOC + #define XMALLOC yaXMALLOC + #undef XFREE + #define XFREE yaXFREE + #undef XREALLOC + #define XREALLOC yaXREALLOC +#endif + + +#ifdef FREERTOS + #ifndef NO_WRITEV + #define NO_WRITEV + #endif + #ifndef NO_SHA512 + #define NO_SHA512 + #endif + #ifndef NO_DH + #define NO_DH + #endif + #ifndef NO_DSA + #define NO_DSA + #endif + #ifndef NO_HC128 + #define NO_HC128 + #endif + + #ifndef SINGLE_THREADED + #include "FreeRTOS.h" + #include "semphr.h" + #endif +#endif + +#ifdef EBSNET + #include "rtip.h" + + /* #define DEBUG_CYASSL */ + #define NO_CYASSL_DIR /* tbd */ + + #if (POLLOS) + #define SINGLE_THREADED + #endif + + #if (RTPLATFORM) + #if (!RTP_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #else + #if (!KS_LITTLE_ENDIAN) + #define BIG_ENDIAN_ORDER + #endif + #endif + + #if (WINMSP3) + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #else + #sslpro: settings.h - please implement SIZEOF_LONG and SIZEOF_LONG_LONG + #endif + + #define XMALLOC(s, h, type) ((void *)rtp_malloc((s), SSL_PRO_MALLOC)) + #define XFREE(p, h, type) (rtp_free(p)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) + +#endif /* EBSNET */ + +#ifdef CYASSL_GAME_BUILD + #define SIZEOF_LONG_LONG 8 + #if defined(__PPU) || defined(__XENON) + #define BIG_ENDIAN_ORDER + #endif +#endif + +#ifdef CYASSL_LSR + #define HAVE_WEBSERVER + #define SIZEOF_LONG_LONG 8 + #define CYASSL_LOW_MEMORY + #define NO_WRITEV + #define NO_SHA512 + #define NO_DH + #define NO_DSA + #define NO_HC128 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #ifndef NO_FILESYSTEM + #define LSR_FS + #include "inc/hw_types.h" + #include "fs.h" + #endif + #define CYASSL_LWIP + #include /* for tcp errno */ + #define CYASSL_SAFERTOS + #if defined(__IAR_SYSTEMS_ICC__) + /* enum uses enum */ + #pragma diag_suppress=Pa089 + #endif +#endif + +#ifdef CYASSL_SAFERTOS + #ifndef SINGLE_THREADED + #include "SafeRTOS/semphr.h" + #endif + + #include "SafeRTOS/heap.h" + #define XMALLOC(s, h, type) pvPortMalloc((s)) + #define XFREE(p, h, type) vPortFree((p)) + #define XREALLOC(p, n, h, t) pvPortRealloc((p), (n)) +#endif + +#ifdef CYASSL_LOW_MEMORY + #undef RSA_LOW_MEM + #define RSA_LOW_MEM + #undef CYASSL_SMALL_STACK + #define CYASSL_SMALL_STACK + #undef TFM_TIMING_RESISTANT + #define TFM_TIMING_RESISTANT +#endif + +#ifdef FREESCALE_MQX + #define SIZEOF_LONG_LONG 8 + #define NO_WRITEV + #define NO_DEV_RANDOM + #define NO_RABBIT + #define NO_CYASSL_DIR + #define USE_FAST_MATH + #define TFM_TIMING_RESISTANT + #define FREESCALE_K70_RNGA + /* #define FREESCALE_K53_RNGB */ + #include "mqx.h" + #ifndef NO_FILESYSTEM + #include "mfs.h" + #include "fio.h" + #endif + #ifndef SINGLE_THREADED + #include "mutex.h" + #endif + + #define XMALLOC(s, h, t) (void *)_mem_alloc_system((s)) + #define XFREE(p, h, t) {void* xp = (p); if ((xp)) _mem_free((xp));} + /* Note: MQX has no realloc, using fastmath above */ +#endif + +#ifdef CYASSL_STM32F2 + #define SIZEOF_LONG_LONG 8 + #define NO_DEV_RANDOM + #define NO_CYASSL_DIR + #define NO_RABBIT + #define STM32F2_RNG + #define STM32F2_CRYPTO + #define KEIL_INTRINSICS +#endif + +#ifdef MICRIUM + + #include "stdlib.h" + #include "net_cfg.h" + #include "ssl_cfg.h" + #include "net_secure_os.h" + + #define CYASSL_TYPES + + typedef CPU_INT08U byte; + typedef CPU_INT16U word16; + typedef CPU_INT32U word32; + + #if (NET_SECURE_MGR_CFG_WORD_SIZE == CPU_WORD_SIZE_32) + #define SIZEOF_LONG 4 + #undef SIZEOF_LONG_LONG + #else + #undef SIZEOF_LONG + #define SIZEOF_LONG_LONG 8 + #endif + + #define STRING_USER + + #define XSTRLEN(pstr) ((CPU_SIZE_T)Str_Len((CPU_CHAR *)(pstr))) + #define XSTRNCPY(pstr_dest, pstr_src, len_max) \ + ((CPU_CHAR *)Str_Copy_N((CPU_CHAR *)(pstr_dest), \ + (CPU_CHAR *)(pstr_src), (CPU_SIZE_T)(len_max))) + #define XSTRNCMP(pstr_1, pstr_2, len_max) \ + ((CPU_INT16S)Str_Cmp_N((CPU_CHAR *)(pstr_1), \ + (CPU_CHAR *)(pstr_2), (CPU_SIZE_T)(len_max))) + #define XSTRSTR(pstr, pstr_srch) \ + ((CPU_CHAR *)Str_Str((CPU_CHAR *)(pstr), \ + (CPU_CHAR *)(pstr_srch))) + #define XMEMSET(pmem, data_val, size) \ + ((void)Mem_Set((void *)(pmem), (CPU_INT08U) (data_val), \ + (CPU_SIZE_T)(size))) + #define XMEMCPY(pdest, psrc, size) ((void)Mem_Copy((void *)(pdest), \ + (void *)(psrc), (CPU_SIZE_T)(size))) + #define XMEMCMP(pmem_1, pmem_2, size) \ + (((CPU_BOOLEAN)Mem_Cmp((void *)(pmem_1), (void *)(pmem_2), \ + (CPU_SIZE_T)(size))) ? DEF_NO : DEF_YES) + #define XMEMMOVE XMEMCPY + +#if (NET_SECURE_MGR_CFG_EN == DEF_ENABLED) + #define MICRIUM_MALLOC + #define XMALLOC(s, h, type) ((void *)NetSecure_BlkGet((CPU_INT08U)(type), \ + (CPU_SIZE_T)(s), (void *)0)) + #define XFREE(p, h, type) (NetSecure_BlkFree((CPU_INT08U)(type), \ + (p), (void *)0)) + #define XREALLOC(p, n, h, t) realloc((p), (n)) +#endif + + #if (NET_SECURE_MGR_CFG_FS_EN == DEF_ENABLED) + #undef NO_FILESYSTEM + #else + #define NO_FILESYSTEM + #endif + + #if (SSL_CFG_TRACE_LEVEL == CYASSL_TRACE_LEVEL_DBG) + #define DEBUG_CYASSL + #else + #undef DEBUG_CYASSL + #endif + + #if (SSL_CFG_OPENSSL_EN == DEF_ENABLED) + #define OPENSSL_EXTRA + #else + #undef OPENSSL_EXTRA + #endif + + #if (SSL_CFG_MULTI_THREAD_EN == DEF_ENABLED) + #undef SINGLE_THREADED + #else + #define SINGLE_THREADED + #endif + + #if (SSL_CFG_DH_EN == DEF_ENABLED) + #undef NO_DH + #else + #define NO_DH + #endif + + #if (SSL_CFG_DSA_EN == DEF_ENABLED) + #undef NO_DSA + #else + #define NO_DSA + #endif + + #if (SSL_CFG_PSK_EN == DEF_ENABLED) + #undef NO_PSK + #else + #define NO_PSK + #endif + + #if (SSL_CFG_3DES_EN == DEF_ENABLED) + #undef NO_DES + #else + #define NO_DES + #endif + + #if (SSL_CFG_AES_EN == DEF_ENABLED) + #undef NO_AES + #else + #define NO_AES + #endif + + #if (SSL_CFG_RC4_EN == DEF_ENABLED) + #undef NO_RC4 + #else + #define NO_RC4 + #endif + + #if (SSL_CFG_RABBIT_EN == DEF_ENABLED) + #undef NO_RABBIT + #else + #define NO_RABBIT + #endif + + #if (SSL_CFG_HC128_EN == DEF_ENABLED) + #undef NO_HC128 + #else + #define NO_HC128 + #endif + + #if (CPU_CFG_ENDIAN_TYPE == CPU_ENDIAN_TYPE_BIG) + #define BIG_ENDIAN_ORDER + #else + #undef BIG_ENDIAN_ORDER + #define LITTLE_ENDIAN_ORDER + #endif + + #if (SSL_CFG_MD4_EN == DEF_ENABLED) + #undef NO_MD4 + #else + #define NO_MD4 + #endif + + #if (SSL_CFG_WRITEV_EN == DEF_ENABLED) + #undef NO_WRITEV + #else + #define NO_WRITEV + #endif + + #if (SSL_CFG_USER_RNG_SEED_EN == DEF_ENABLED) + #define NO_DEV_RANDOM + #else + #undef NO_DEV_RANDOM + #endif + + #if (SSL_CFG_USER_IO_EN == DEF_ENABLED) + #define CYASSL_USER_IO + #else + #undef CYASSL_USER_IO + #endif + + #if (SSL_CFG_DYNAMIC_BUFFERS_EN == DEF_ENABLED) + #undef LARGE_STATIC_BUFFERS + #undef STATIC_CHUNKS_ONLY + #else + #define LARGE_STATIC_BUFFERS + #define STATIC_CHUNKS_ONLY + #endif + + #if (SSL_CFG_DER_LOAD_EN == DEF_ENABLED) + #define CYASSL_DER_LOAD + #else + #undef CYASSL_DER_LOAD + #endif + + #if (SSL_CFG_DTLS_EN == DEF_ENABLED) + #define CYASSL_DTLS + #else + #undef CYASSL_DTLS + #endif + + #if (SSL_CFG_CALLBACKS_EN == DEF_ENABLED) + #define CYASSL_CALLBACKS + #else + #undef CYASSL_CALLBACKS + #endif + + #if (SSL_CFG_FAST_MATH_EN == DEF_ENABLED) + #define USE_FAST_MATH + #else + #undef USE_FAST_MATH + #endif + + #if (SSL_CFG_TFM_TIMING_RESISTANT_EN == DEF_ENABLED) + #define TFM_TIMING_RESISTANT + #else + #undef TFM_TIMING_RESISTANT + #endif + +#endif /* MICRIUM */ + + +#ifdef CYASSL_QL + #ifndef CYASSL_SEP + #define CYASSL_SEP + #endif + #ifndef OPENSSL_EXTRA + #define OPENSSL_EXTRA + #endif + #ifndef SESSION_CERTS + #define SESSION_CERTS + #endif + #ifndef HAVE_AESCCM + #define HAVE_AESCCM + #endif + #ifndef ATOMIC_USER + #define ATOMIC_USER + #endif + #ifndef CYASSL_DER_LOAD + #define CYASSL_DER_LOAD + #endif + #ifndef KEEP_PEER_CERT + #define KEEP_PEER_CERT + #endif + #ifndef HAVE_ECC + #define HAVE_ECC + #endif + #ifndef SESSION_INDEX + #define SESSION_INDEX + #endif +#endif /* CYASSL_QL */ + + +#if !defined(XMALLOC_USER) && !defined(MICRIUM_MALLOC) && \ + !defined(CYASSL_LEANPSK) && !defined(NO_CYASSL_MEMORY) + #define USE_CYASSL_MEMORY +#endif + + +#if defined(OPENSSL_EXTRA) && !defined(NO_CERTS) + #undef KEEP_PEER_CERT + #define KEEP_PEER_CERT +#endif + + +/* stream ciphers except arc4 need 32bit alignment, intel ok without */ +#ifndef XSTREAM_ALIGNMENT + #if defined(__x86_64__) || defined(__ia64__) || defined(__i386__) + #define NO_XSTREAM_ALIGNMENT + #else + #define XSTREAM_ALIGNMENT + #endif +#endif + + +/* if using hardware crypto and have alignment requirements, specify the + requirement here. The record header of SSL/TLS will prvent easy alignment. + This hint tries to help as much as possible. */ +#ifndef CYASSL_GENERAL_ALIGNMENT + #ifdef CYASSL_AESNI + #define CYASSL_GENERAL_ALIGNMENT 16 + #elif defined(XSTREAM_ALIGNMENT) + #define CYASSL_GENERAL_ALIGNMENT 4 + #else + #define CYASSL_GENERAL_ALIGNMENT 0 + #endif +#endif + +#ifdef HAVE_CRL + /* not widely supported yet */ + #undef NO_SKID + #define NO_SKID +#endif + +/* Place any other flags or defines here */ + + +#ifdef __cplusplus + } /* extern "C" */ +#endif + + +#endif /* CTAO_CRYPT_SETTINGS_H */ + diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvoptx b/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvoptx index b3a8b8dbb..0fd7be198 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvoptx +++ b/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvoptx @@ -104,6 +104,8 @@ 0 1 1 + 1 + 1 0 0 8 @@ -197,7 +199,7 @@ Source - 1 + 0 0 0 0 @@ -207,10 +209,10 @@ 1 0 0 - 4 + 0 0 - 0 - 0 + 37 + 44 0 .\main.c main.c @@ -223,7 +225,7 @@ 1 0 0 - 4 + 33 0 0 0 @@ -237,7 +239,7 @@ Configuration - 1 + 0 0 0 0 @@ -273,24 +275,56 @@ 0 0 - - - - Documentation - 1 - 0 - 0 - 0 - 3 + 2 5 5 0 0 + 33 + 0 + 0 + 0 + 0 + .\RTE\Network\Net_Config_ETH_0.h + Net_Config_ETH_0.h + 0 + 0 + + + 2 + 6 + 5 + 0 + 0 0 0 - 1 - 1 + 0 + 0 + 0 + .\config-SimpleServer.h + config-SimpleServer.h + 0 + 0 + + + + + Documentation + 0 + 0 + 0 + 0 + + 3 + 7 + 5 + 0 + 0 + 0 + 0 + 0 + 0 0 .\Abstract.txt Abstract.txt @@ -299,6 +333,30 @@ + + Devices + 1 + 0 + 0 + 0 + + 4 + 8 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + .\time-dummy.c + time-dummy.c + 0 + 0 + + + ::CMSIS 0 @@ -306,8 +364,24 @@ 0 1 - 4 - 6 + 5 + 9 + 1 + 0 + 0 + 0 + 0 + 212 + 218 + 0 + RTE\CMSIS\RTX_Conf_CM.c + RTX_Conf_CM.c + 1 + 0 + + + 5 + 10 4 0 0 @@ -316,27 +390,11 @@ 0 0 0 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib RTX_CM3.lib 1 0 - - 4 - 7 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - RTE\CMSIS\RTX_Conf_CM.c - RTX_Conf_CM.c - 1 - 0 - @@ -346,8 +404,8 @@ 0 1 - 5 - 8 + 6 + 11 1 0 0 @@ -362,8 +420,8 @@ 0 - 5 - 9 + 6 + 12 1 0 0 @@ -378,8 +436,8 @@ 0 - 5 - 10 + 6 + 13 5 0 0 @@ -394,15 +452,15 @@ 0 - 5 - 11 + 6 + 14 2 0 0 0 0 - 0 - 0 + 164 + 169 0 RTE\Device\STM32F207IG\startup_stm32f2xx.s startup_stm32f2xx.s @@ -410,8 +468,8 @@ 0 - 5 - 12 + 6 + 15 1 0 0 @@ -434,24 +492,8 @@ 0 1 - 6 - 13 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - PHY_ST802RT1.c - 1 - 0 - - - 6 - 14 + 7 + 16 1 0 0 @@ -466,8 +508,8 @@ 0 - 6 - 15 + 7 + 17 1 0 0 @@ -481,6 +523,22 @@ 1 0 + + 7 + 18 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + PHY_ST802RT1.c + 1 + 0 + @@ -490,24 +548,8 @@ 0 1 - 7 - 16 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_LFN_CM3_L.lib - 1 - 0 - - - 7 - 17 + 8 + 19 1 0 0 @@ -522,8 +564,8 @@ 0 - 7 - 18 + 8 + 20 5 0 0 @@ -537,6 +579,22 @@ 1 0 + + 8 + 21 + 4 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + FS_LFN_CM3_L.lib + 1 + 0 + @@ -546,24 +604,8 @@ 0 1 - 8 - 19 - 4 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Dbg_CM3_L.lib - 1 - 0 - - - 8 - 20 + 9 + 22 1 0 0 @@ -578,8 +620,8 @@ 0 - 8 - 21 + 9 + 23 5 0 0 @@ -594,8 +636,8 @@ 0 - 8 - 22 + 9 + 24 5 0 0 @@ -610,12 +652,12 @@ 0 - 8 - 23 + 9 + 25 5 0 0 - 0 + 33 0 0 0 @@ -626,8 +668,8 @@ 0 - 8 - 24 + 9 + 26 5 0 0 @@ -642,8 +684,8 @@ 0 - 8 - 25 + 9 + 27 5 0 0 @@ -658,18 +700,34 @@ 0 - 8 - 26 + 9 + 28 1 0 0 + 33 + 0 + 0 + 0 + 0 + RTE\Network\Net_Debug.c + Net_Debug.c + 1 + 0 + + + 9 + 29 + 4 + 0 + 0 0 0 0 0 0 - RTE\Network\Net_Debug.c - Net_Debug.c + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + Net_Dbg_CM3_L.lib 1 0 @@ -682,680 +740,8 @@ 0 1 - 9 - 27 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - cyassl_MDK_ARM.c - 1 - 0 - - - 9 - 28 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - time-STM32F2xx.c - 1 - 0 - - - 9 - 29 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - aes.c - 1 - 0 - - - 9 + 10 30 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - arc4.c - 1 - 0 - - - 9 - 31 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - asm.c - 1 - 0 - - - 9 - 32 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - asn.c - 1 - 0 - - - 9 - 33 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - blake2b.c - 1 - 0 - - - 9 - 34 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - camellia.c - 1 - 0 - - - 9 - 35 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - coding.c - 1 - 0 - - - 9 - 36 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - compress.c - 1 - 0 - - - 9 - 37 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - des3.c - 1 - 0 - - - 9 - 38 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - dh.c - 1 - 0 - - - 9 - 39 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - dsa.c - 1 - 0 - - - 9 - 40 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - ecc.c - 1 - 0 - - - 9 - 41 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - ecc_fp.c - 1 - 0 - - - 9 - 42 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - error.c - 1 - 0 - - - 9 - 43 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - hc128.c - 1 - 0 - - - 9 - 44 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - hmac.c - 1 - 0 - - - 9 - 45 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - integer.c - 1 - 0 - - - 9 - 46 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - logging.c - 1 - 0 - - - 9 - 47 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - md2.c - 1 - 0 - - - 9 - 48 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - md4.c - 1 - 0 - - - 9 - 49 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - md5.c - 1 - 0 - - - 9 - 50 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - memory.c - 1 - 0 - - - 9 - 51 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - misc.c - 1 - 0 - - - 9 - 52 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - pwdbased.c - 1 - 0 - - - 9 - 53 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - rabbit.c - 1 - 0 - - - 9 - 54 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - random.c - 1 - 0 - - - 9 - 55 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - ripemd.c - 1 - 0 - - - 9 - 56 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - rsa.c - 1 - 0 - - - 9 - 57 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - sha.c - 1 - 0 - - - 9 - 58 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - sha256.c - 1 - 0 - - - 9 - 59 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - sha512.c - 1 - 0 - - - 9 - 60 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - tfm.c - 1 - 0 - - - 9 - 61 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - crl.c - 1 - 0 - - - 9 - 62 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - internal.c - 1 - 0 - - - 9 - 63 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - io.c - 1 - 0 - - - 9 - 64 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - keys.c - 1 - 0 - - - 9 - 65 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - ocsp.c - 1 - 0 - - - 9 - 66 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - sniffer.c - 1 - 0 - - - 9 - 67 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - ssl.c - 1 - 0 - - - 9 - 68 - 1 - 0 - 0 - 0 - 0 - 0 - 0 - 0 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - tls.c - 1 - 0 - - - 9 - 69 5 0 0 @@ -1370,8 +756,8 @@ 0 - 9 - 70 + 10 + 31 5 0 0 @@ -1386,8 +772,8 @@ 0 - 9 - 71 + 10 + 32 5 0 0 @@ -1396,8 +782,680 @@ 0 0 0 - RTE\wolfSSL\config.h - config.h + RTE\wolfSSL\settings.h + settings.h + 1 + 0 + + + 10 + 33 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + cyassl_MDK_ARM.c + 1 + 0 + + + 10 + 34 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\aes.c + aes.c + 1 + 0 + + + 10 + 35 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\arc4.c + arc4.c + 1 + 0 + + + 10 + 36 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\asm.c + asm.c + 1 + 0 + + + 10 + 37 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\asn.c + asn.c + 1 + 0 + + + 10 + 38 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\blake2b.c + blake2b.c + 1 + 0 + + + 10 + 39 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\camellia.c + camellia.c + 1 + 0 + + + 10 + 40 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\coding.c + coding.c + 1 + 0 + + + 10 + 41 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\compress.c + compress.c + 1 + 0 + + + 10 + 42 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\des3.c + des3.c + 1 + 0 + + + 10 + 43 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\dh.c + dh.c + 1 + 0 + + + 10 + 44 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\dsa.c + dsa.c + 1 + 0 + + + 10 + 45 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ecc.c + ecc.c + 1 + 0 + + + 10 + 46 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ecc_fp.c + ecc_fp.c + 1 + 0 + + + 10 + 47 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\error.c + error.c + 1 + 0 + + + 10 + 48 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\hc128.c + hc128.c + 1 + 0 + + + 10 + 49 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\hmac.c + hmac.c + 1 + 0 + + + 10 + 50 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\integer.c + integer.c + 1 + 0 + + + 10 + 51 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\logging.c + logging.c + 1 + 0 + + + 10 + 52 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md2.c + md2.c + 1 + 0 + + + 10 + 53 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md4.c + md4.c + 1 + 0 + + + 10 + 54 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md5.c + md5.c + 1 + 0 + + + 10 + 55 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\memory.c + memory.c + 1 + 0 + + + 10 + 56 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\misc.c + misc.c + 1 + 0 + + + 10 + 57 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\port.c + port.c + 1 + 0 + + + 10 + 58 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\pwdbased.c + pwdbased.c + 1 + 0 + + + 10 + 59 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\rabbit.c + rabbit.c + 1 + 0 + + + 10 + 60 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\random.c + random.c + 1 + 0 + + + 10 + 61 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ripemd.c + ripemd.c + 1 + 0 + + + 10 + 62 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\rsa.c + rsa.c + 1 + 0 + + + 10 + 63 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha.c + sha.c + 1 + 0 + + + 10 + 64 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha256.c + sha256.c + 1 + 0 + + + 10 + 65 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha512.c + sha512.c + 1 + 0 + + + 10 + 66 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\tfm.c + tfm.c + 1 + 0 + + + 10 + 67 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\crl.c + crl.c + 1 + 0 + + + 10 + 68 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\internal.c + internal.c + 1 + 0 + + + 10 + 69 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\io.c + io.c + 1 + 0 + + + 10 + 70 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\keys.c + keys.c + 1 + 0 + + + 10 + 71 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\ocsp.c + ocsp.c + 1 + 0 + + + 10 + 72 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\sniffer.c + sniffer.c + 1 + 0 + + + 10 + 73 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\ssl.c + ssl.c + 1 + 0 + + + 10 + 74 + 1 + 0 + 0 + 0 + 0 + 0 + 0 + 0 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\tls.c + tls.c 1 0 diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvprojx b/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvprojx index d354efbe4..2ca16a273 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvprojx +++ b/IDE/MDK5-ARM/Projects/SimpleServer/SimpleServer.uvprojx @@ -139,6 +139,8 @@ 0 1 1 + 1 + 1 0 8 @@ -353,9 +355,11 @@ 0 0 0 + 0 + 0 - HAVE_CONFIG_H MDK_CONF_SimpleServer CYASSL_STM32F2xx + HAVE_CONFIG_H MDK_CONF_SimpleServer @@ -369,6 +373,7 @@ 0 0 0 + 0 @@ -385,6 +390,7 @@ 0 0x08000000 0x20000000 + @@ -423,6 +429,16 @@ 5 .\RTE\wolfSSL\config-Crypt.h + + Net_Config_ETH_0.h + 5 + .\RTE\Network\Net_Config_ETH_0.h + + + config-SimpleServer.h + 5 + .\config-SimpleServer.h + @@ -436,18 +452,28 @@ - ::CMSIS + Devices - RTX_CM3.lib - 4 - C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.3\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + time-dummy.c + 1 + .\time-dummy.c + + + + ::CMSIS + RTX_Conf_CM.c 1 RTE\CMSIS\RTX_Conf_CM.c + + RTX_CM3.lib + 4 + C:\Keil5\ARM\PACK\ARM\CMSIS\3.20.4\CMSIS_RTX\Lib\ARM\RTX_CM3.lib + @@ -483,11 +509,6 @@ ::Drivers - - PHY_ST802RT1.c - 1 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Driver\PHY_ST802RT1.c - EMAC_STM32F2xx.c 1 @@ -498,16 +519,16 @@ 1 C:\Keil5\ARM\PACK\Keil\STM32F2xx_DFP\1.0.4\RTE_Driver\MCI_STM32F2xx.c + + PHY_ST802RT1.c + 1 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Driver\PHY_ST802RT1.c + ::File System - - FS_LFN_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib - FS_Config.c 1 @@ -518,16 +539,16 @@ 5 RTE\File_System\FS_Config_MC_0.h + + FS_LFN_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\FileSystem\Lib\ARM\FS_LFN_CM3_L.lib + ::Network - - Net_Dbg_CM3_L.lib - 4 - C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.2\Network\Lib\ARM\Net_Dbg_CM3_L.lib - Net_Config.c 1 @@ -563,221 +584,16 @@ 1 RTE\Network\Net_Debug.c + + Net_Dbg_CM3_L.lib + 4 + C:\Keil5\ARM\PACK\Keil\MDK-Middleware\5.1.4\Network\Lib\ARM\Net_Dbg_CM3_L.lib + ::wolfSSL - - cyassl_MDK_ARM.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\MDK-ARM\CyaSSL\cyassl_MDK_ARM.c - - - time-STM32F2xx.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\IDE\MDK5-ARM\STM32F2xx_StdPeriph_Lib\time-STM32F2xx.c - - - aes.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\aes.c - - - arc4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\arc4.c - - - asm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asm.c - - - asn.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\asn.c - - - blake2b.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\blake2b.c - - - camellia.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\camellia.c - - - coding.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\coding.c - - - compress.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\compress.c - - - des3.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\des3.c - - - dh.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dh.c - - - dsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\dsa.c - - - ecc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc.c - - - ecc_fp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ecc_fp.c - - - error.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\error.c - - - hc128.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hc128.c - - - hmac.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\hmac.c - - - integer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\integer.c - - - logging.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\logging.c - - - md2.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md2.c - - - md4.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md4.c - - - md5.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\md5.c - - - memory.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\memory.c - - - misc.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\misc.c - - - pwdbased.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\pwdbased.c - - - rabbit.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rabbit.c - - - random.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\random.c - - - ripemd.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\ripemd.c - - - rsa.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\rsa.c - - - sha.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha.c - - - sha256.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha256.c - - - sha512.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\sha512.c - - - tfm.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\ctaocrypt\src\tfm.c - - - crl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\crl.c - - - internal.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\internal.c - - - io.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\io.c - - - keys.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\keys.c - - - ocsp.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ocsp.c - - - sniffer.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\sniffer.c - - - ssl.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\ssl.c - - - tls.c - 1 - C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.8.0\cyassl\src\tls.c - config-Crypt.h 5 @@ -789,9 +605,219 @@ RTE\wolfSSL\config-CyaSSL.h - config.h + settings.h 5 - RTE\wolfSSL\config.h + RTE\wolfSSL\settings.h + + + cyassl_MDK_ARM.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\IDE\MDK5-ARM\Src\cyassl_MDK_ARM.c + + + aes.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\aes.c + + + arc4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\arc4.c + + + asm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\asm.c + + + asn.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\asn.c + + + blake2b.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\blake2b.c + + + camellia.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\camellia.c + + + coding.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\coding.c + + + compress.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\compress.c + + + des3.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\des3.c + + + dh.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\dh.c + + + dsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\dsa.c + + + ecc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ecc.c + + + ecc_fp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ecc_fp.c + + + error.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\error.c + + + hc128.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\hc128.c + + + hmac.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\hmac.c + + + integer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\integer.c + + + logging.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\logging.c + + + md2.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md2.c + + + md4.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md4.c + + + md5.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\md5.c + + + memory.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\memory.c + + + misc.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\misc.c + + + port.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\port.c + + + pwdbased.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\pwdbased.c + + + rabbit.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\rabbit.c + + + random.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\random.c + + + ripemd.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\ripemd.c + + + rsa.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\rsa.c + + + sha.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha.c + + + sha256.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha256.c + + + sha512.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\sha512.c + + + tfm.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\ctaocrypt\src\tfm.c + + + crl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\crl.c + + + internal.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\internal.c + + + io.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\io.c + + + keys.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\keys.c + + + ocsp.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\ocsp.c + + + sniffer.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\sniffer.c + + + ssl.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\ssl.c + + + tls.c + 1 + C:\Keil5\ARM\PACK\wolfSSL\CyaSSL\2.9.1\cyassl\src\tls.c @@ -801,25 +827,25 @@ - + - + - + - + @@ -833,20 +859,20 @@ - - + + - - + + - - + + @@ -923,20 +949,14 @@ - - + + - - - - - - - - + + @@ -945,8 +965,8 @@ RTE\CMSIS\RTX_Conf_CM.c - - + + @@ -1071,26 +1091,32 @@ - + RTE\wolfSSL\config-Crypt.h - - + + - + RTE\wolfSSL\config-CyaSSL.h - - + + - RTE\wolfSSL\config.h + RTE\wolfSSL\config.h + + + + RTE\wolfSSL\settings.h + + diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h b/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h new file mode 100644 index 000000000..19685ee09 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/config-SimpleServer.h @@ -0,0 +1,31 @@ +/* config-RTX-TCP-FS.h + * + * Copyright (C) 2006-2013 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + + + +// <<< Use Configuration Wizard in Context Menu >>> +// Build Target: Simple Server +// Listen Port Number +// Default: "11111" +#define CYASSL_LISTEN_PORT "443" + +// +// <<< end of configuration section >>> diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/main.c b/IDE/MDK5-ARM/Projects/SimpleServer/main.c index d42ef2f88..bba0c5f24 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/main.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/main.c @@ -33,6 +33,8 @@ #include "cyassl_MDK_ARM.h" #include +#include "config-SimpleServer.h" + /*----------------------------------------------------------------------------- * Initialize a Flash Memory Card *----------------------------------------------------------------------------*/ @@ -82,10 +84,9 @@ char* myoptarg = NULL; int main() { - static char *argv[] = { "client", ""} ; - static func_args args = { 2, argv } ; + static char *argv[] = { "server", "-p", CYASSL_LISTEN_PORT, "-d"} ; + static func_args args = { 4, argv } ; - init_time() ; init_filesystem (); net_initialize() ; osThreadCreate (osThread (tcp_poll), NULL); diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/server.c b/IDE/MDK5-ARM/Projects/SimpleServer/server.c index ecc9b510b..5d5256d4a 100644 --- a/IDE/MDK5-ARM/Projects/SimpleServer/server.c +++ b/IDE/MDK5-ARM/Projects/SimpleServer/server.c @@ -31,20 +31,19 @@ #endif #if defined(CYASSL_MDK_ARM) - #include - #include - - #if defined(CYASSL_MDK5) - #include "cmsis_os.h" - #include "rl_fs.h" - #include "rl_net.h" - #else - #include "rtl.h" - #endif - - #include "cyassl_MDK_ARM.h" -#endif + #include + #include + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" +#endif #include #include @@ -131,12 +130,14 @@ static void Usage(void) printf("-f Fewer packets/group messages\n"); printf("-N Use Non-blocking sockets\n"); printf("-S Use Host Name Indication\n"); -} - -#ifdef CYASSL_MDK_SHELL -#define exit(code) return(code) +#ifdef HAVE_OCSP + printf("-o Perform OCSP lookup on peer certificate\n"); + printf("-O Perform OCSP lookup using as responder\n"); #endif - +#ifdef HAVE_PK_CALLBACKS + printf("-P Public Key Callbacks\n"); +#endif +} THREAD_RETURN CYASSL_THREAD server_test(void* args) { @@ -154,13 +155,14 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) int version = SERVER_DEFAULT_VERSION; int doCliCertCheck = 1; int useAnyAddr = 0; - int port = yasslPort; + word16 port = yasslPort; int usePsk = 0; int doDTLS = 0; int useNtruKey = 0; int nonBlocking = 0; int trackMemory = 0; int fewerPackets = 0; + int pkCallbacks = 0; char* cipherList = NULL; char* verifyCert = (char*)cliCert; char* ourCert = (char*)svrCert; @@ -172,6 +174,11 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) char* sniHostName = NULL; #endif +#ifdef HAVE_OCSP + int useOcsp = 0; + char* ocspUrl = NULL; +#endif + ((func_args*)args)->return_code = -1; /* error state */ #ifdef NO_RSA @@ -180,8 +187,9 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) ourKey = (char*)eccKey; #endif (void)trackMemory; + (void)pkCallbacks; - while ((ch = mygetopt(argc, argv, "?dbstnNufp:v:l:A:c:k:S:")) != -1) { + while ((ch = mygetopt(argc, argv, "?dbstnNufPp:v:l:A:c:k:S:oO:")) != -1) { switch (ch) { case '?' : Usage(); @@ -217,8 +225,14 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) fewerPackets = 1; break; + case 'P' : + #ifdef HAVE_PK_CALLBACKS + pkCallbacks = 1; + #endif + break; + case 'p' : - port = atoi(myoptarg); + port = (word16)atoi(myoptarg); #if !defined(NO_MAIN_DRIVER) || defined(USE_WINDOWS_API) if (port == 0) err_sys("port number cannot be 0"); @@ -259,6 +273,19 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #endif break; + case 'o' : + #ifdef HAVE_OCSP + useOcsp = 1; + #endif + break; + + case 'O' : + #ifdef HAVE_OCSP + useOcsp = 1; + ocspUrl = myoptarg; + #endif + break; + default: Usage(); exit(MY_EX_USAGE); @@ -349,6 +376,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (fewerPackets) CyaSSL_CTX_set_group_messages(ctx); +#if defined(OPENSSL_EXTRA) || defined(HAVE_WEBSERVER) + SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); +#endif + #if !defined(NO_FILESYSTEM) && !defined(NO_CERTS) if (!usePsk) { if (SSL_CTX_use_certificate_file(ctx, ourCert, SSL_FILETYPE_PEM) @@ -371,8 +402,8 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (!useNtruKey && !usePsk) { if (SSL_CTX_use_PrivateKey_file(ctx, ourKey, SSL_FILETYPE_PEM) != SSL_SUCCESS) - err_sys("can't load server cert file, check file and run from" - " CyaSSL home dir"); + err_sys("can't load server private key file, check file and run " + "from CyaSSL home dir"); } #endif @@ -403,10 +434,6 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) } #endif -#ifdef OPENSSL_EXTRA - SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack); -#endif - #if defined(CYASSL_SNIFFER) && !defined(HAVE_NTRU) && !defined(HAVE_ECC) /* don't use EDH, can't sniff tmp keys */ if (cipherList == NULL) { @@ -416,27 +443,38 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #endif #ifdef HAVE_SNI - if (sniHostName) { + if (sniHostName) if (CyaSSL_CTX_UseSNI(ctx, CYASSL_SNI_HOST_NAME, sniHostName, XSTRLEN(sniHostName)) != SSL_SUCCESS) err_sys("UseSNI failed"); - else - CyaSSL_CTX_SNI_SetOptions(ctx, CYASSL_SNI_HOST_NAME, - CYASSL_SNI_ABORT_ON_MISMATCH); - } #endif ssl = SSL_new(ctx); if (ssl == NULL) err_sys("unable to get SSL"); - CyaSSL_set_quiet_shutdown(ssl, 1) ; + #ifdef HAVE_CRL CyaSSL_EnableCRL(ssl, 0); CyaSSL_LoadCRL(ssl, crlPemDir, SSL_FILETYPE_PEM, CYASSL_CRL_MONITOR | CYASSL_CRL_START_MON); CyaSSL_SetCRL_Cb(ssl, CRL_CallBack); #endif - osDelay(5000) ; +#ifdef HAVE_OCSP + if (useOcsp) { + if (ocspUrl != NULL) { + CyaSSL_CTX_SetOCSP_OverrideURL(ctx, ocspUrl); + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE + | CYASSL_OCSP_URL_OVERRIDE); + } + else + CyaSSL_CTX_EnableOCSP(ctx, CYASSL_OCSP_NO_NONCE); + } +#endif +#ifdef HAVE_PK_CALLBACKS + if (pkCallbacks) + SetupPkCallbacks(ctx, ssl); +#endif + tcp_accept(&sockfd, &clientfd, (func_args*)args, port, useAnyAddr, doDTLS); if (!doDTLS) CloseSocket(sockfd); @@ -449,7 +487,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) SetDH(ssl); /* repick suites with DHE, higher priority than PSK */ #endif } - osDelay(5000) ; + #ifndef CYASSL_CALLBACKS if (nonBlocking) { CyaSSL_set_using_nonblock(ssl, 1); @@ -457,7 +495,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) NonBlockingSSL_Accept(ssl); } else if (SSL_accept(ssl) != SSL_SUCCESS) { int err = SSL_get_error(ssl, 0); - char buffer[80]; + char buffer[CYASSL_MAX_ERROR_SZ]; printf("error = %d, %s\n", err, ERR_error_string(err, buffer)); err_sys("SSL_accept failed"); } @@ -465,7 +503,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) NonBlockingSSL_Accept(ssl); #endif showPeer(ssl); - osDelay(5000) ; + idx = SSL_read(ssl, input, sizeof(input)-1); if (idx > 0) { input[idx] = 0; @@ -481,6 +519,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) if (SSL_write(ssl, msg, sizeof(msg)) != sizeof(msg)) err_sys("SSL_write failed"); + #if defined(CYASSL_MDK_SHELL) && defined(HAVE_MDK_RTX) + os_dly_wait(500) ; + #endif + SSL_shutdown(ssl); SSL_free(ssl); SSL_CTX_free(ctx); @@ -519,8 +561,10 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args) #if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL) CyaSSL_Debugging_ON(); #endif - if (CurrentDir("server") || CurrentDir("build")) + if (CurrentDir("server")) ChangeDirBack(2); + else if (CurrentDir("Debug") || CurrentDir("Release")) + ChangeDirBack(3); #ifdef HAVE_STACK_SIZE StackSizeCheck(&args, server_test); diff --git a/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c b/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c new file mode 100644 index 000000000..2525eba38 --- /dev/null +++ b/IDE/MDK5-ARM/Projects/SimpleServer/time-dummy.c @@ -0,0 +1,34 @@ +/* time-dummy.c.c + * + * Copyright (C) 2006-2014 wolfSSL Inc. + * + * This file is part of CyaSSL. + * + * CyaSSL 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. + * + * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA + */ + +#ifdef HAVE_CONFIG_H + #include +#endif + +#include "time.h" + +struct tm *Cyassl_MDK_gmtime(const time_t *c) +{ + static struct tm date ; + return(&date) ; +} + +time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c b/IDE/MDK5-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c deleted file mode 100644 index 37154d136..000000000 --- a/IDE/MDK5-ARM/STM32F2xx_StdPeriph_Lib/time-STM32F2xx.c +++ /dev/null @@ -1,299 +0,0 @@ -/* main.c - * - * Copyright (C) 2006-2013 wolfSSL Inc. - * - * This file is part of CyaSSL. - * - * CyaSSL 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. - * - * CyaSSL 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., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA - */ - -#ifdef HAVE_CONFIG_H - #include -#endif - -#include "time.h" - -#define PERIPH_BASE ((uint32_t)0x40000000) -/*----------------------------------------------------------------------------- - * initialize RTC - *----------------------------------------------------------------------------*/ -#include "stm32f2xx.h" - -#define assert_param(a) - -#define RTC_RSF_MASK ((uint32_t)0xFFFFFF5F) -#define SYNCHRO_TIMEOUT ((uint32_t) 0x00008000) -#define Bcd2ToByte(v) \ - ((((uint8_t)(v & (uint8_t)0xF0) >> (uint8_t)0x4) * 10) + (v & (uint8_t)0x0F)) -#define RTC_TR_RESERVED_MASK ((uint32_t)0x007F7F7F) -#define RTC_TR_MNT ((uint32_t)0x00007000) -#define RTC_TR_MNU ((uint32_t)0x00000F00) - -#define PWR_OFFSET (PWR_BASE - PERIPH_BASE) -#define CR_OFFSET (PWR_OFFSET + 0x00) -#define DBP_BitNumber 0x08 -#define CR_DBP_BB (PERIPH_BB_BASE + (CR_OFFSET * 32) + (DBP_BitNumber * 4)) -#define RTC_INIT_MASK ((uint32_t)0xFFFFFFFF) -#define INITMODE_TIMEOUT ((uint32_t) 0x00010000) - -static void init_RTC() -{ - __IO uint32_t initcounter = 0x00 ; - uint32_t initstatus = 0x00; /* Enable the PWR clock : RCC_APB1Periph_PWR */ - ((uint32_t *)RCC)[0x10] |= ((uint32_t)0x10000000) ; - - /* Allow access to RTC */ - *(__IO uint32_t *) CR_DBP_BB = ENABLE ; - /* RCC_LSEConfig(RCC_LSE_ON) */ - *(__IO uint8_t *) (RCC_BASE + 0x70) = ((uint8_t)0x00); - /* Reset LSEBYP bit */ - *(__IO uint8_t *) (RCC_BASE + 0x70) = ((uint8_t)0x00); - *(__IO uint8_t *) (RCC_BASE + 0x70) = ((uint8_t)0x01); - /* Wait till LSE is ready */ - while((RCC->BDCR << 0x2) == 0x0) { } - /* Select the RTC clock source: RCC_RTCCLKSource_LSE */ - ((RCC_TypeDef *)RCC)->BDCR |= (uint32_t)0x00000100; - - /* Enable the RTC Clock */ - *(__IO uint32_t *) (PERIPH_BB_BASE + (((RCC_BASE - PERIPH_BASE)+ 0x70) * 32) + (0x0F* 4)) = (uint32_t)ENABLE; - - *(__IO uint32_t *) CR_DBP_BB = (uint32_t)ENABLE; - RTC->ISR = (uint32_t) RTC_INIT_MASK; - do { - initstatus = RTC->ISR & RTC_ISR_INITF; - initcounter++; - } while((initcounter != INITMODE_TIMEOUT) && (initstatus == 0x00)); - - /* Disable the write protection for RTC registers */ - RTC->WPR = 0xCA; - RTC->WPR = 0x53; - - RTC->CR &= ((uint32_t)~(RTC_CR_FMT)); /* Clear RTC CR FMT Bit */ - /* Set RTC_CR register */ - RTC->CR |= ((uint32_t)0x00000000) ; /* RTC_HourFormat_24 */ - - /* Configure the RTC PRER */ - RTC->PRER = 0x7f ; - RTC->PRER |= (uint32_t)(0xff << 16); - - /* Exit Initialization mode */ - RTC->ISR &= (uint32_t)~RTC_ISR_INIT; - - /* Enable the write protection for RTC registers */ - RTC->WPR = 0xFF; -} - -/*----------------------------------------------------------------------------- - * initialize TIM - *----------------------------------------------------------------------------*/ -#define RCC_APB1Periph_TIM2 ((uint32_t)0x00000001) - -static void init_TIM() -{ - uint16_t tmpcr1 = 0; - - ((uint32_t *)RCC)[0x10] |= RCC_APB1Periph_TIM2 ; - - tmpcr1 = TIM2->CR1 ; - tmpcr1 &= (uint16_t) (~(((uint16_t)0x0010) | ((uint16_t)0x0060) )); - /* CR1 &= ~(TIM_CR1_DIR | TIM_CR1_CMS) */ - tmpcr1 |= (uint16_t)0x0000 ; /* CR1 |= TIM_CounterMode_Up */ - TIM2->CR1= tmpcr1 ; - - TIM2->ARR = 0xffffffff ; /* ARR= TIM_Period */ - TIM2->PSC = 60 ; /* PSC = TIM_Prescaler */ - TIM2->EGR = ((uint16_t)0x0001) ; /* EGR = TIM_PSCReloadMode_Immediate */ - - *(uint16_t *)(PERIPH_BASE+0x0) |=((uint16_t)0x0001) ; - /* TIM_Cmd(TIM2, ENABLE) ; */ -} - -void init_time(void) { - init_RTC() ; - init_TIM() ; -} - -static void GetTime(uint8_t *h, uint8_t *m, uint8_t *s) -{ - uint32_t tmpreg = 0; - tmpreg = (uint32_t)(RTC->TR & RTC_TR_RESERVED_MASK); - *h = (uint8_t)Bcd2ToByte((uint8_t)((tmpreg & (RTC_TR_HT | RTC_TR_HU)) >> 16)); - *m = (uint8_t)Bcd2ToByte((uint8_t)((tmpreg & (RTC_TR_MNT | RTC_TR_MNU)) >>8)); - *s = (uint8_t)Bcd2ToByte((tmpreg & (RTC_TR_ST | RTC_TR_SU))); -} - -static uint32_t ByteToBcd2(uint8_t Value) -{ - uint8_t bcdhigh = 0; - while (Value >= 10) { - bcdhigh++; - Value -= 10; - } - return ((uint8_t)(bcdhigh << 4) | Value); -} - -static void SetTime(uint8_t h, uint8_t m, uint8_t s) -{ - __IO uint32_t synchrocounter = 0; - uint32_t synchrostatus = 0x00; - __IO uint32_t initcounter = 0; - uint32_t initstatus = 0x00; - uint32_t tmpreg ; - - tmpreg = ((ByteToBcd2(h) << 16) | (ByteToBcd2(m) << 8) | ByteToBcd2(s)) ; - /* Disable the write protection for RTC registers */ - RTC->WPR = 0xCA; - RTC->WPR = 0x53; - RTC->ISR &= (uint32_t)~RTC_ISR_INIT; - - RTC->ISR = (uint32_t)RTC_INIT_MASK; - - /* Wait till RTC is in INIT state and if Time out is reached exit */ - do { - initstatus = RTC->ISR & RTC_ISR_INITF; - initcounter++; - } while((initcounter != INITMODE_TIMEOUT) && (initstatus == 0x00)); - - RTC->TR = (uint32_t)(tmpreg & RTC_TR_RESERVED_MASK); - - RTC->ISR &= (uint32_t)RTC_RSF_MASK; - /* Wait the registers to be synchronised */ - do { - synchrostatus = RTC->ISR & RTC_ISR_RSF; - synchrocounter++; - } while((synchrocounter != SYNCHRO_TIMEOUT) && (synchrostatus == 0x00)); - - RTC->WPR = 0xFF; -} - -static void GetDate(uint8_t *y, uint8_t *m, uint8_t *d) -{ - uint32_t tmpreg = 0; - tmpreg = (uint32_t)(RTC->DR & RTC_TR_RESERVED_MASK); - *y = (uint8_t)Bcd2ToByte((uint8_t)((tmpreg & (RTC_DR_YT|RTC_DR_YU)) >>16)); - *m = (uint8_t)Bcd2ToByte((uint8_t)((tmpreg & (RTC_DR_MT|RTC_DR_MU)) >> 8)); - *d = (uint8_t)Bcd2ToByte((uint8_t)(tmpreg & (RTC_DR_DT |RTC_DR_DU))); -} - -static void SetDate(uint8_t y, uint8_t m, uint8_t d) -{ - __IO uint32_t synchrocounter = 0; - uint32_t synchrostatus = 0x00; - __IO uint32_t initcounter = 0; - uint32_t initstatus = 0x00; - uint32_t tmpreg = 0 ; - - tmpreg = ((ByteToBcd2(y) << 16) | (ByteToBcd2(m) << 8) | ByteToBcd2(d)) ; - /* Disable the write protection for RTC registers */ - RTC->WPR = 0xCA; - RTC->WPR = 0x53; - RTC->ISR &= (uint32_t)~RTC_ISR_INIT; - - RTC->ISR = (uint32_t)RTC_INIT_MASK; - - /* Wait till RTC is in INIT state and if Time out is reached exit */ - do { - initstatus = RTC->ISR & RTC_ISR_INITF; - initcounter++; - } while((initcounter != INITMODE_TIMEOUT) && (initstatus == 0x00)); - - RTC->DR = (uint32_t)(tmpreg & RTC_TR_RESERVED_MASK); - - RTC->ISR &= (uint32_t)RTC_RSF_MASK; - /* Wait the registers to be synchronised */ - do { - synchrostatus = RTC->ISR & RTC_ISR_RSF; - synchrocounter++; - } while((synchrocounter != SYNCHRO_TIMEOUT) && (synchrostatus == 0x00)); - - RTC->WPR = 0xFF; -} - - -#include -void CYASSL_MSG(const char *msg) ; - -struct tm *Cyassl_MDK_gmtime(const time_t *c) -{ - uint8_t h, m, s ; - uint8_t y, mo, d ; - static struct tm date ; - - GetTime(&h, &m, &s) ; - GetDate(&y, &mo, &d) ; - - date.tm_year = y + 100 ; - date.tm_mon = mo - 1 ; - date.tm_mday = d ; - date.tm_hour = h ; - date.tm_min = m ; - date.tm_sec = s ; - - #if defined(DEBUG_CYASSL) - { - char msg[100] ; - sprintf(msg, - "Debug::Cyassl_KEIL_gmtime(DATE=/%2d/%02d/%04d TIME=%02d:%02d:%02d)\n", - d, mo, y+2000, h, m, s) ; - CYASSL_MSG(msg) ; - } - #endif - - return(&date) ; -} - -double current_time() -{ - return ((double)TIM2->CNT/1000000.0) ; -} - -typedef struct func_args { - int argc; - char** argv; - int return_code; -} func_args; - -void time_main(void *args) -{ - char * datetime ; - uint8_t h, m, s ; - uint8_t y, mo, d ; - - if( args == NULL || ((func_args *)args)->argc == 1) { - GetTime(&h, &m, &s) ; - GetDate(&y, &mo, &d) ; - printf("Date: %d/%d/%d, Time: %02d:%02d:%02d\n", - mo, d, y+2000, h, m, s) ; - } else if(((func_args *)args)->argc == 3 && - ((func_args *)args)->argv[1][0] == '-' && - ((func_args *)args)->argv[1][1] == 'd' ) { - datetime = ((func_args *)args)->argv[2]; - sscanf(datetime, "%d/%d/%d", (int *)&mo, (int *)&d, (int *) &y) ; - SetDate(y-2000, mo, d) ; - } else if(((func_args *)args)->argc == 3 && - ((func_args *)args)->argv[1][0] == '-' && - ((func_args *)args)->argv[1][1] == 't' ) { - datetime = ((func_args *)args)->argv[2]; - sscanf(datetime, "%d:%d:%d", - (int *)&h, (int *)&m, (int *)&s) ; - SetTime(h, m, s) ; - } else printf("Invalid argument\n") ; -} - - -/******************************************************************* - time() -********************************************************************/ -time_t time(time_t * t) { return 0 ; } diff --git a/IDE/MDK5-ARM/MDK-ARM/CyaSSL/cert_data.c b/IDE/MDK5-ARM/Src/cert_data.c similarity index 100% rename from IDE/MDK5-ARM/MDK-ARM/CyaSSL/cert_data.c rename to IDE/MDK5-ARM/Src/cert_data.c diff --git a/IDE/MDK5-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c b/IDE/MDK5-ARM/Src/cyassl_MDK_ARM.c similarity index 100% rename from IDE/MDK5-ARM/MDK-ARM/CyaSSL/cyassl_MDK_ARM.c rename to IDE/MDK5-ARM/Src/cyassl_MDK_ARM.c diff --git a/IDE/MDK5-ARM/MDK-ARM/CyaSSL/ssl-dummy.c b/IDE/MDK5-ARM/Src/ssl-dummy.c similarity index 100% rename from IDE/MDK5-ARM/MDK-ARM/CyaSSL/ssl-dummy.c rename to IDE/MDK5-ARM/Src/ssl-dummy.c diff --git a/IDE/MDK5-ARM/wolfSSL.CyaSSL.pdsc b/IDE/MDK5-ARM/wolfSSL.CyaSSL.pdsc deleted file mode 100644 index b0a7a6b34..000000000 --- a/IDE/MDK5-ARM/wolfSSL.CyaSSL.pdsc +++ /dev/null @@ -1,281 +0,0 @@ - - - - CyaSSL - Light weight SSL/TLS and Crypt Library for Embedded Systems - wolfSSL - http://www.wolfSSL.com/files/ide - cyassl\IDE\MDK5-ARM\Docs\CyaSSL-License.txt - - wolfSSL: SSL/TLS and Crypt Library - CyaSSL: SSL/TLS Library - wolfCrypt: Crypt Library - - - - - Oct/7/2013, Initial release of CyaSSL pack - - - - - CyaSSL - wolfSSL - Security - Crypt - Cipher - SSL - TLS - - - - - - - - The condition is true if the package is used with a Cortex-Mx based device - - - - - - - CMSIS Core with Cortex-M processor - - - - - - CMSIS Core with RTOS for Cortex-M processor - - - - - - File System on Memory Card - - - - - Network UDP/TCP and CORE component - - - - - - - - - - - - - - - - - - - - - - - - wolfSSL: SSL/TLS and Crypt Library - cyassl\IDE\MDK5-ARM\Docs\CyaSSLManual-TableofContents.htm - - CyaSSL, Light weight SSL/TLS library - - - - - - - - - - - - - - - - - - - - wolfCrypt Core, Light weight Crypt/Cipher Library - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Dummy file for Crypt alone use - - - - - - - - Device depend Timer functions - - - - - - - - - - - - CyaSSL Demo, SSL/TLS Server/Client Examples, Simple test suites, Benchmark - - - - - - - Middleware - Security - SSL - TLS - - - - wolfCrypt Simple Test Suite - - - - - - - Middleware - Security - Crypt - Cipher - - - - wolfCrypt Benchmark Suite - - - - - - - Middleware - Security - Crypt - Cipher - - - - CyaSSL Simple Client Example - - - - - - - Middleware - Security - Crypt - Cipher - - - - CyaSSL Simple Server Example - - - - - - - Middleware - Security - Crypt - Cipher - - - - CyaSSL Echo Client Example - - - - - - - Middleware - Security - Crypt - Cipher - - - - CyaSSL Echo Server Example - - - - - - - Middleware - Security - Crypt - Cipher - - - - diff --git a/ctaocrypt/src/random.c b/ctaocrypt/src/random.c index 08d4b4d0a..e5127690b 100644 --- a/ctaocrypt/src/random.c +++ b/ctaocrypt/src/random.c @@ -616,7 +616,7 @@ int GenerateSeed(OS_Seed* os, byte* output, word32 sz) #endif /* FREESCALE_K70_RNGA */ #elif defined(CYASSL_SAFERTOS) || defined(CYASSL_LEANPSK) \ - || defined(CYASSL_IAR_ARM) + || defined(CYASSL_IAR_ARM) || defined(CYASSL_MDK_ARM) #warning "write a real random seed!!!!, just for testing now" diff --git a/cyassl/ctaocrypt/port.h b/cyassl/ctaocrypt/port.h index 1f06c20e6..fd07b206e 100644 --- a/cyassl/ctaocrypt/port.h +++ b/cyassl/ctaocrypt/port.h @@ -168,6 +168,7 @@ CYASSL_LOCAL int UnLockMutex(CyaSSL_Mutex*); /* stdio, default case */ #define XFILE FILE* #if defined(CYASSL_MDK_ARM) + #include extern FILE * CyaSSL_fopen(const char *name, const char *mode) ; #define XFOPEN CyaSSL_fopen #else diff --git a/examples/client/client.c b/examples/client/client.c index b2564d102..be7e0816a 100644 --- a/examples/client/client.c +++ b/examples/client/client.c @@ -20,13 +20,21 @@ */ #ifdef HAVE_CONFIG_H - #include + #include #endif - + #if defined(CYASSL_MDK_ARM) - #include + #include #include - #include + + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + #include "cyassl_MDK_ARM.h" #endif @@ -38,6 +46,7 @@ #endif #include + #include #include "examples/client/client.h" @@ -151,12 +160,6 @@ static void Usage(void) #endif } - -#ifdef CYASSL_MDK_SHELL - #define exit(code) return(code) -#endif - - THREAD_RETURN CYASSL_THREAD client_test(void* args) { SOCKET_T sockfd = 0; diff --git a/examples/echoclient/echoclient.c b/examples/echoclient/echoclient.c index 787d104ef..3a62eb67d 100644 --- a/examples/echoclient/echoclient.c +++ b/examples/echoclient/echoclient.c @@ -28,10 +28,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include - #include - #include "cyassl_MDK_ARM.h" + #include + #include + + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" #endif #include diff --git a/examples/echoserver/echoserver.c b/examples/echoserver/echoserver.c index d612bfb76..c7e23bf7e 100644 --- a/examples/echoserver/echoserver.c +++ b/examples/echoserver/echoserver.c @@ -26,10 +26,18 @@ #include #if defined(CYASSL_MDK_ARM) - #include - #include - #include - #include "cyassl_MDK_ARM.h" + #include + #include + + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" #endif #include diff --git a/examples/server/server.c b/examples/server/server.c index 435db8a23..5d5256d4a 100644 --- a/examples/server/server.c +++ b/examples/server/server.c @@ -31,12 +31,19 @@ #endif #if defined(CYASSL_MDK_ARM) - #include - #include - #include - #include "cyassl_MDK_ARM.h" -#endif + #include + #include + #if defined(CYASSL_MDK5) + #include "cmsis_os.h" + #include "rl_fs.h" + #include "rl_net.h" + #else + #include "rtl.h" + #endif + + #include "cyassl_MDK_ARM.h" +#endif #include #include @@ -132,11 +139,6 @@ static void Usage(void) #endif } -#ifdef CYASSL_MDK_SHELL -#define exit(code) return(code) -#endif - - THREAD_RETURN CYASSL_THREAD server_test(void* args) { SOCKET_T sockfd = 0;