mirror of https://github.com/wolfSSL/wolfssl.git
MDK4, wolfSSL name change
parent
e16ff73273
commit
30f6bc1e27
|
@ -1,291 +0,0 @@
|
|||
/* config-BEREFOOT.h
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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 SINGLE_THREADED
|
||||
#define NO_FILESYSTEM
|
||||
#define NO_TLS
|
||||
|
||||
#define NO_ECHOSERVER
|
||||
#define NO_ECHOCLIENT
|
||||
#define NO_SIMPLE_SERVER
|
||||
#define NO_SIMPLE_CLIENT
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Build Target: KEIL-BAREFOOT
|
||||
// <h> Single Threaded, No File System, No TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>Cert Storage <1=> Mem Buff (1024bytes) <2=> Mem Buff (2048bytes)
|
||||
#define MDK_CONF_CERT_BUFF 1
|
||||
#if MDK_CONF_CERT_BUFF == 1
|
||||
#define USE_CERT_BUFFERS_1024
|
||||
#elif MDK_CONF_CERT_BUFF == 2
|
||||
#define USE_CERT_BUFFERS_2048
|
||||
#endif
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#define BENCH_EMBEDDED
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 0
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 0
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DebugMessage 0
|
||||
#if MDK_CONF_DebugMessage == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CheckMalloc 1
|
||||
#if MDK_CONF_CheckMalloc == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ErrNo 0
|
||||
#if MDK_CONF_ErrNo == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SmallStack 1
|
||||
#if MDK_CONF_SmallStack == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
|
@ -1,329 +0,0 @@
|
|||
/* config-FS.h
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
|
||||
/**** CyaSSL for KEIL-RL Configuration ****/
|
||||
|
||||
#define __CORTEX_M3__
|
||||
#define CYASSL_KEIL_RL
|
||||
#define NO_WRITEV
|
||||
#define NO_CYASSL_DIR
|
||||
#define NO_MAIN_DRIVER
|
||||
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#define SINGLE_THREADED
|
||||
|
||||
#define NO_ECHOSERVER
|
||||
#define NO_ECHOCLIENT
|
||||
#define NO_SIMPLE_SERVER
|
||||
#define NO_SIMPLE_CLIENT
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
|
||||
// <h> Build Target: KEIL-FS
|
||||
// <h> Single Threaded, With File System, No TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>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
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CyaSSL Library
|
||||
// <h>SSL (Included by default)
|
||||
// </h>
|
||||
|
||||
// <e>TLS
|
||||
#define MDK_CONF_TLS 1
|
||||
#if MDK_CONF_TLS == 0
|
||||
#define NO_TLS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>CertGen
|
||||
#define MDK_CONF_CERT_GEN 0
|
||||
#if MDK_CONF_CERT_GEN == 1
|
||||
#define CYASSL_CERT_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>KeyGen
|
||||
#define MDK_CONF_KEY_GEN 0
|
||||
#if MDK_CONF_KEY_GEN == 1
|
||||
#define CYASSL_KEY_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CRL
|
||||
#define MDK_CONF_DER_LOAD 0
|
||||
#if MDK_CONF_DER_LOAD == 1
|
||||
#define CYASSL_DER_LOAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>OpenSSL Extra
|
||||
#define MDK_CONF_OPENSSL_EXTRA 0
|
||||
#if MDK_CONF_OPENSSL_EXTRA == 1
|
||||
#define OPENSSL_EXTRA
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CRL Monitor, OCSP (not supported with KEIL)
|
||||
// </h>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 0
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 0
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DebugMessage 0
|
||||
#if MDK_CONF_DebugMessage == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CheckMalloc 1
|
||||
#if MDK_CONF_CheckMalloc == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ErrNo 0
|
||||
#if MDK_CONF_ErrNo == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SmallStack 1
|
||||
#if MDK_CONF_SmallStack == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
|
@ -1,351 +0,0 @@
|
|||
/* config-RTX-TCP-FS.h
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
* This file is part of wolfSSL. (formerly known as CyaSSL)
|
||||
*
|
||||
* wolfSSL is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation; either version 2 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* wolfSSL is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, 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_KEIL_TCP_NET
|
||||
|
||||
|
||||
// <<< Use Configuration Wizard in Context Menu >>>
|
||||
// <h> Build Target: KEIL-RTX-TCP-FS
|
||||
// <h> RTOS, File System and TCP-net
|
||||
// </h>
|
||||
// <e>Command Shell
|
||||
#define MDK_CONF_SHELL 1
|
||||
#if MDK_CONF_SHELL == 1
|
||||
#define CYASSL_MDK_SHELL
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CyaSSL Apps
|
||||
// <h>Crypt/Cipher
|
||||
// <o>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
|
||||
|
||||
// <e>Crypt/Cipher Test Suite
|
||||
#define MDK_CONF_CTaoCryptTest 1
|
||||
#if MDK_CONF_CTaoCryptTest == 0
|
||||
#define NO_CRYPT_TEST
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Crypt/Cipher Benchmark
|
||||
#define MDK_CONF_CTaoCryptBenchmark 1
|
||||
#if MDK_CONF_CTaoCryptBenchmark == 0
|
||||
#define NO_CRYPT_BENCHMARK
|
||||
#define BENCH_EMBEDDED
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
// <h>SSL/TLS Server/Client
|
||||
// <e>echoServer
|
||||
#define MDK_CONF_echoServer 1
|
||||
#if MDK_CONF_echoServer == 0
|
||||
#define NO_ECHOSERVER
|
||||
#endif
|
||||
// </e>
|
||||
// <e>echoClient
|
||||
#define MDK_CONF_echoClient 1
|
||||
#if MDK_CONF_echoClient == 0
|
||||
#define NO_ECHOCLIENT
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SimpleServer
|
||||
#define MDK_CONF_simpleServer 1
|
||||
#if MDK_CONF_simpleServer == 0
|
||||
#define NO_SIMPLE_SERVER
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SimpleCliet
|
||||
#define MDK_CONF_simpleClient 1
|
||||
#if MDK_CONF_simpleClient == 0
|
||||
#define NO_SIMPLE_CLIENT
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
// </h>
|
||||
// <h>STM32 Hardware Crypt
|
||||
// <e>STM32F2 Hardware RNG
|
||||
#define MDK_CONF_STM32F2_RNG 0
|
||||
#if MDK_CONF_STM32F2_RNG == 1
|
||||
#define STM32F2_RNG
|
||||
#else
|
||||
#define NO_DEV_RANDOM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>STM32F2 Hardware Crypt
|
||||
#define MDK_CONF_STM32F2_CRYPTO 0
|
||||
#if MDK_CONF_STM32F2_CRYPTO == 1
|
||||
#define STM32F2_CRYPTO
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CyaSSL Library
|
||||
// <h>SSL (Included by default)
|
||||
// </h>
|
||||
|
||||
// <e>TLS
|
||||
#define MDK_CONF_TLS 1
|
||||
#if MDK_CONF_TLS == 0
|
||||
#define NO_TLS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>CertGen
|
||||
#define MDK_CONF_CERT_GEN 0
|
||||
#if MDK_CONF_CERT_GEN == 1
|
||||
#define CYASSL_CERT_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>KeyGen
|
||||
#define MDK_CONF_KEY_GEN 0
|
||||
#if MDK_CONF_KEY_GEN == 1
|
||||
#define CYASSL_KEY_GEN
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CRL
|
||||
#define MDK_CONF_DER_LOAD 0
|
||||
#if MDK_CONF_DER_LOAD == 1
|
||||
#define CYASSL_DER_LOAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>OpenSSL Extra
|
||||
#define MDK_CONF_OPENSSL_EXTRA 1
|
||||
#if MDK_CONF_OPENSSL_EXTRA == 1
|
||||
#define OPENSSL_EXTRA
|
||||
#endif
|
||||
// </e>
|
||||
// <h>CRL Monitor, OCSP (not supported with KEIL)
|
||||
// </h>
|
||||
|
||||
// </h>
|
||||
|
||||
// <h>CTaoCrypt Library
|
||||
|
||||
// <h>MD5, SHA, SHA-256, AES, RC4, ASN, RSA
|
||||
// </h>
|
||||
// <e>MD2
|
||||
#define MDK_CONF_MD2 0
|
||||
#if MDK_CONF_MD2 == 1
|
||||
#define CYASSL_MD2
|
||||
#endif
|
||||
// </e>
|
||||
// <e>MD4
|
||||
#define MDK_CONF_MD4 1
|
||||
#if MDK_CONF_MD4 == 0
|
||||
#define NO_MD4
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-384
|
||||
// <i>This has to be with SHA512
|
||||
#define MDK_CONF_SHA384 0
|
||||
#if MDK_CONF_SHA384 == 1
|
||||
#define CYASSL_SHA384
|
||||
#endif
|
||||
// </e>
|
||||
// <e>SHA-512
|
||||
#define MDK_CONF_SHA512 0
|
||||
#if MDK_CONF_SHA512 == 1
|
||||
#define CYASSL_SHA512
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RIPEMD
|
||||
#define MDK_CONF_RIPEMD 1
|
||||
#if MDK_CONF_RIPEMD == 1
|
||||
#define CYASSL_RIPEMD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HMAC
|
||||
#define MDK_CONF_HMAC 1
|
||||
#if MDK_CONF_HMAC == 0
|
||||
#define NO_HMAC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>HC128
|
||||
#define MDK_CONF_HC128 0
|
||||
#if MDK_CONF_HC128 == 1
|
||||
#define HAVE_HC128
|
||||
#endif
|
||||
// </e>
|
||||
// <e>RABBIT
|
||||
#define MDK_CONF_RABBIT 1
|
||||
#if MDK_CONF_RABBI == 0
|
||||
#define NO_RABBIT
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>AEAD
|
||||
#define MDK_CONF_AEAD 0
|
||||
#if MDK_CONF_AEAD == 1
|
||||
#define HAVE_AEAD
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DES3
|
||||
#define MDK_CONF_DES3 1
|
||||
#if MDK_CONF_DES3 == 0
|
||||
#define NO_DES3
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAMELLIA
|
||||
#define MDK_CONF_CAMELLIA 0
|
||||
#if MDK_CONF_CAMELLIA == 1
|
||||
#define HAVE_CAMELLIA
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>DH
|
||||
// <i>need this for CYASSL_SERVER, OPENSSL_EXTRA
|
||||
#define MDK_CONF_DH 1
|
||||
#if MDK_CONF_DH == 0
|
||||
#define NO_DH
|
||||
#endif
|
||||
// </e>
|
||||
// <e>DSA
|
||||
#define MDK_CONF_DSA 1
|
||||
#if MDK_CONF_DSA == 0
|
||||
#define NO_DSA
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PWDBASED
|
||||
#define MDK_CONF_PWDBASED 1
|
||||
#if MDK_CONF_PWDBASED == 0
|
||||
#define NO_PWDBASED
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>ECC
|
||||
#define MDK_CONF_ECC 1
|
||||
#if MDK_CONF_ECC == 1
|
||||
#define HAVE_ECC
|
||||
#endif
|
||||
// </e>
|
||||
// <e>PSK
|
||||
#define MDK_CONF_PSK 1
|
||||
#if MDK_CONF_PSK == 0
|
||||
#define NO_PSK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESCCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESCCM 0
|
||||
#if MDK_CONF_AESCCM == 1
|
||||
#define HAVE_AESCCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>AESGCM (Turn off Hardware Crypt)
|
||||
#define MDK_CONF_AESGCM 0
|
||||
#if MDK_CONF_AESGCM == 1
|
||||
#define HAVE_AESGCM
|
||||
#define BUILD_AESGCM
|
||||
#endif
|
||||
// </e>
|
||||
// <e>NTRU (need License, "crypto_ntru.h")
|
||||
#define MDK_CONF_NTRU 0
|
||||
#if MDK_CONF_NTRU == 1
|
||||
#define HAVE_NTRU
|
||||
#endif
|
||||
// </e>
|
||||
// </h>
|
||||
|
||||
// <h>Others
|
||||
|
||||
// <e>Inline
|
||||
#define MDK_CONF_INLINE 0
|
||||
#if MDK_CONF_INLINE == 0
|
||||
#define NO_INLINE
|
||||
#endif
|
||||
// </e>
|
||||
// <h>Debug
|
||||
// <e>Debug Message
|
||||
#define MDK_CONF_DEBUG_MSG 0
|
||||
#if MDK_CONF_DEBUG_MSG == 1
|
||||
#define DEBUG_CYASSL
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Check malloc
|
||||
#define MDK_CONF_CHECK_MALLOC 1
|
||||
#if MDK_CONF_CHECK_MALLOC == 1
|
||||
#define CYASSL_MALLOC_CHECK
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
// <e>ErrNo.h
|
||||
#define MDK_CONF_ERR_NO 0
|
||||
#if MDK_CONF_ERR_NO == 1
|
||||
#define HAVE_ERRNO
|
||||
#endif
|
||||
// </e>
|
||||
// <e>zlib (need "zlib.h")
|
||||
#define MDK_CONF_LIBZ 0
|
||||
#if MDK_CONF_LIBZ == 1
|
||||
#define HAVE_LIBZ
|
||||
#endif
|
||||
// </e>
|
||||
// <e>CAVIUM (need CAVIUM headers)
|
||||
#define MDK_CONF_CAVIUM 0
|
||||
#if MDK_CONF_CAVIUM == 1
|
||||
#define HAVE_CAVIUM
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Error Strings
|
||||
#define MDK_CONF_ErrorStrings 1
|
||||
#if MDK_CONF_ErrorStrings == 0
|
||||
#define NO_ERROR_STRINGS
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
// <e>Small Stack
|
||||
#define MDK_CONF_SMALL_STACK 1
|
||||
#if MDK_CONF_SMALL_STACK == 0
|
||||
#define NO_CYASSL_SMALL_STACK
|
||||
#endif
|
||||
// </e>
|
||||
// <e>Use Fast Math
|
||||
#define MDK_CONF_FASTMATH 0
|
||||
#if MDK_CONF_FASTMATH == 1
|
||||
#define USE_FAST_MATH
|
||||
#endif
|
||||
// </e>
|
||||
|
||||
|
||||
// </h>
|
||||
|
||||
//</h>
|
||||
// <<< end of configuration section >>>
|
|
@ -55,7 +55,9 @@ int sendchar (int c)
|
|||
int getkey (void)
|
||||
{
|
||||
int ch = SER_GetChar();
|
||||
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
os_itv_wait ();
|
||||
#endif
|
||||
if (ch < 0) {
|
||||
return 0;
|
||||
}
|
||||
|
@ -250,7 +252,7 @@ char *_sys_command_string (char *cmd, int len)
|
|||
|
||||
void _sys_exit (int return_code)
|
||||
{
|
||||
#ifdef CYASSL_MDK_SHELL
|
||||
#ifdef WOLFSSL_MDK_SHELL
|
||||
return ;
|
||||
#else
|
||||
/* Endless loop. */
|
|
@ -24,5 +24,5 @@
|
|||
#endif
|
||||
|
||||
/* Define initial data for cert buffers */
|
||||
#include <cyassl/certs_test.h>
|
||||
#include <wolfssl/certs_test.h>
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
#ifndef CYASSL_CERT_DATA_H
|
||||
#define CYASSL_CERT_DATA_H
|
||||
#ifndef WOLFSSL_CERT_DATA_H
|
||||
#define WOLFSSL_CERT_DATA_H
|
||||
|
||||
#ifdef USE_CERT_BUFFERS_1024
|
||||
extern const unsigned char client_key_der_1024[] ;
|
|
@ -23,12 +23,12 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ctaocrypt/visibility.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include <wolfssl/wolfcrypt/visibility.h>
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
|
||||
#include <RTL.h>
|
||||
#include <stdio.h>
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
|
||||
/*-----------------------------------------------------------------------------
|
||||
* Initialize a Flash Memory Card
|
||||
|
@ -53,11 +53,11 @@ static void init_card (void)
|
|||
/*-----------------------------------------------------------------------------
|
||||
* TCP/IP tasks
|
||||
*----------------------------------------------------------------------------*/
|
||||
#ifdef CYASSL_KEIL_TCP_NET
|
||||
#ifdef WOLFSSL_KEIL_TCP_NET
|
||||
__task void tcp_tick (void)
|
||||
{
|
||||
|
||||
CYASSL_MSG("Time tick started.") ;
|
||||
WOLFSSL_MSG("Time tick started.") ;
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
os_itv_set (10);
|
||||
#endif
|
||||
|
@ -73,7 +73,7 @@ __task void tcp_tick (void)
|
|||
|
||||
__task void tcp_poll (void)
|
||||
{
|
||||
CYASSL_MSG("TCP polling started.\n") ;
|
||||
WOLFSSL_MSG("TCP polling started.\n") ;
|
||||
while (1) {
|
||||
main_TcpNet ();
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
|
@ -83,13 +83,13 @@ __task void tcp_poll (void)
|
|||
}
|
||||
#endif
|
||||
|
||||
#if defined(HAVE_KEIL_RTX) && defined(CYASSL_MDK_SHELL)
|
||||
#if defined(HAVE_KEIL_RTX) && defined(WOLFSSL_MDK_SHELL)
|
||||
#define SHELL_STACKSIZE 1000
|
||||
static unsigned char Shell_stack[SHELL_STACKSIZE] ;
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(CYASSL_MDK_SHELL)
|
||||
#if defined(WOLFSSL_MDK_SHELL)
|
||||
extern void shell_main(void) ;
|
||||
#endif
|
||||
|
||||
|
@ -104,14 +104,14 @@ extern void SER_Init(void) ;
|
|||
/*** This is the parent task entry ***/
|
||||
void main_task (void)
|
||||
{
|
||||
#ifdef CYASSL_KEIL_TCP_NET
|
||||
#ifdef WOLFSSL_KEIL_TCP_NET
|
||||
init_TcpNet ();
|
||||
|
||||
os_tsk_create (tcp_tick, 2);
|
||||
os_tsk_create (tcp_poll, 1);
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_MDK_SHELL
|
||||
#ifdef WOLFSSL_MDK_SHELL
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
os_tsk_create_user(shell_main, 1, Shell_stack, SHELL_STACKSIZE) ;
|
||||
#else
|
||||
|
@ -127,7 +127,7 @@ void main_task (void)
|
|||
#endif
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
CYASSL_MSG("Terminating tcp_main\n") ;
|
||||
WOLFSSL_MSG("Terminating tcp_main\n") ;
|
||||
os_tsk_delete_self ();
|
||||
#endif
|
||||
|
||||
|
@ -137,28 +137,24 @@ void main_task (void)
|
|||
int myoptind = 0;
|
||||
char* myoptarg = NULL;
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
extern void CyaSSL_Debugging_ON(void) ;
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
extern void wolfSSL_Debugging_ON(void) ;
|
||||
#endif
|
||||
|
||||
|
||||
/*** main entry ***/
|
||||
extern void init_time(void) ;
|
||||
extern void SystemInit(void);
|
||||
|
||||
int main() {
|
||||
|
||||
SystemInit();
|
||||
SER_Init() ;
|
||||
#if !defined(NO_FILESYSTEM)
|
||||
init_card () ; /* initializing SD card */
|
||||
#endif
|
||||
|
||||
init_time() ;
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
printf("Turning ON Debug message\n") ;
|
||||
CyaSSL_Debugging_ON() ;
|
||||
wolfSSL_Debugging_ON() ;
|
||||
#endif
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
|
@ -19,26 +19,26 @@
|
|||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
*/
|
||||
|
||||
/*** tiny Shell for CyaSSL apps ***/
|
||||
/*** tiny Shell for wolfSSL apps ***/
|
||||
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "cyassl/internal.h"
|
||||
#undef RNG
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <stdlib.h>
|
||||
#include <rtl.h>
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
#include "cyassl/test.h"
|
||||
#ifdef WOLFSSL_KEIL_NET
|
||||
#include "wolfassl/test.h"
|
||||
#else
|
||||
typedef struct func_args {
|
||||
int argc;
|
||||
|
@ -66,7 +66,7 @@ typedef struct func_args {
|
|||
#define ctaocrypt_test command_not_found
|
||||
#endif
|
||||
|
||||
#ifndef CYASSL_KEIL_NET
|
||||
#ifndef WOLFSSL_KEIL_NET
|
||||
#define ipaddr_comm command_not_found
|
||||
#endif
|
||||
|
||||
|
@ -75,7 +75,7 @@ typedef struct func_args {
|
|||
#endif
|
||||
|
||||
|
||||
#if !defined(DEBUG_CYASSL)
|
||||
#if !defined(DEBUG_WOLFSSL)
|
||||
#define dbg_comm command_not_found
|
||||
#endif
|
||||
|
||||
|
@ -87,11 +87,11 @@ void command_not_found(void *argv) {
|
|||
extern void echoclient_test(void *args) ;
|
||||
extern void echoserver_test(void *args) ;
|
||||
extern void benchmark_test(void *args) ;
|
||||
extern void ctaocrypt_test(void *args) ;
|
||||
extern void wolfcrypt_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) ;
|
||||
|
@ -103,7 +103,7 @@ extern void help_comm(void *arg) ;
|
|||
#ifndef NO_MD5
|
||||
extern void md5_test(void *arg) ;
|
||||
#endif
|
||||
#ifdef CYASSL_MD2
|
||||
#ifdef WOLFSSL_MD2
|
||||
extern void md2_test(void *arg) ;
|
||||
#endif
|
||||
#ifndef NO_MD4
|
||||
|
@ -115,15 +115,15 @@ extern void sha_test(void *arg) ;
|
|||
#ifndef NO_SHA256
|
||||
extern void sha256_test(void *arg) ;
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
extern void sha384_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA512
|
||||
#ifdef WOLFSSL_SHA512
|
||||
extern void sha512_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_RIPEMD
|
||||
#ifdef WOLFSSL_RIPEMD
|
||||
extern void ripemd_test(void *arg) ;
|
||||
#endif
|
||||
#ifndef NO_HMAC
|
||||
|
@ -136,7 +136,7 @@ extern void hmac_sha_test(void *arg) ;
|
|||
extern void hmac_sha256_test(void *arg) ;
|
||||
#endif
|
||||
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
extern void hmac_sha384_test(void *arg) ;
|
||||
#endif
|
||||
#endif
|
||||
|
@ -206,10 +206,9 @@ static struct {
|
|||
"echoclient", echoclient_test,
|
||||
"echoserver", echoserver_test,
|
||||
"benchmark", benchmark_test,
|
||||
"test", ctaocrypt_test,
|
||||
"test", wolfcrypt_test,
|
||||
"client", client_test,
|
||||
"server", server_test,
|
||||
"time", time_main, /* get/set RTC: [-d yy/mm/dd] [-t hh:mm:ss]*/
|
||||
"ipaddr", ipaddr_comm, /* TBD */
|
||||
"stack", stack_comm, /* On/Off check stack size */
|
||||
"for", for_command, /* iterate next command X times */
|
||||
|
@ -220,7 +219,7 @@ static struct {
|
|||
"ec", echoclient_test,
|
||||
"es", echoserver_test,
|
||||
"bm", benchmark_test,
|
||||
"te", ctaocrypt_test,
|
||||
"te", wolfcrypt_test,
|
||||
"cl", client_test,
|
||||
"sv", server_test,
|
||||
"ip", ipaddr_comm,
|
||||
|
@ -233,7 +232,7 @@ static struct {
|
|||
#ifndef NO_MD5
|
||||
"md5", md5_test,
|
||||
#endif
|
||||
#ifdef CYASSL_MD2
|
||||
#ifdef WOLFSSL_MD2
|
||||
"md2", md2_test,
|
||||
#endif
|
||||
#ifndef NO_MD4
|
||||
|
@ -243,13 +242,13 @@ static struct {
|
|||
#ifndef NO_SHA256
|
||||
"sha256", sha256_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
"sha384", sha384_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA512
|
||||
#ifdef WOLFSSL_SHA512
|
||||
"sha512", sha512_test,
|
||||
#endif
|
||||
#ifdef CYASSL_RIPEMD
|
||||
#ifdef WOLFSSL_RIPEMD
|
||||
"ripemd", ripemd_test,
|
||||
#endif
|
||||
#ifndef NO_HMAC
|
||||
|
@ -260,7 +259,7 @@ static struct {
|
|||
#ifndef NO_SHA256
|
||||
"hmac_sha256", hmac_sha256_test,
|
||||
#endif
|
||||
#ifdef CYASSL_SHA384
|
||||
#ifdef WOLFSSL_SHA384
|
||||
"hmac_sha384", hmac_sha384_test,
|
||||
#endif
|
||||
#endif
|
||||
|
@ -362,18 +361,18 @@ static int BackGround = 0 ; /* 1: background job is running */
|
|||
/************* Embedded Shell Commands **********************************/
|
||||
#define IP_SIZE 16
|
||||
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
#ifdef WOLFSSL_KEIL_NET
|
||||
static void ipaddr_comm(void *args)
|
||||
{
|
||||
if(((func_args *)args)->argc == 1) {
|
||||
printf("IP addr: %s, port %d\n", yasslIP, yasslPort) ;
|
||||
printf("IP addr: %s, port %d\n", wolfSSLIP, wolfSSLPort) ;
|
||||
} else {
|
||||
if(BackGround != 0) {
|
||||
printf("Cannot change IP addr while background server is running\n") ;
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-'&&
|
||||
((func_args *)args)->argv[1][1] == 'a' ) {
|
||||
/* strcpy(yasslIP, ((func_args *)args)->argv[2]) ; */
|
||||
/* strcpy(wolfSSLIP, ((func_args *)args)->argv[2]) ; */
|
||||
} else if(((func_args *)args)->argc == 3 &&
|
||||
((func_args *)args)->argv[1][0] == '-' &&
|
||||
((func_args *)args)->argv[1][1] == 'p' ) {
|
||||
|
@ -442,20 +441,20 @@ static void for_command(void *args)
|
|||
}
|
||||
|
||||
|
||||
#if defined(DEBUG_CYASSL)
|
||||
#if defined(DEBUG_WOLFSSL)
|
||||
|
||||
static int CyasslDebug = 1 ;
|
||||
static int wolfsslDebug = 1 ;
|
||||
|
||||
static void dbg_comm(void *args)
|
||||
{
|
||||
if(CyasslDebug == 1) {
|
||||
CyasslDebug = 0 ;
|
||||
if(wolfsslDebug == 1) {
|
||||
wolfsslDebug = 0 ;
|
||||
printf("Turning OFF Debug message\n") ;
|
||||
CyaSSL_Debugging_OFF() ;
|
||||
wolfSSL_Debugging_OFF() ;
|
||||
} else {
|
||||
CyasslDebug = 1 ;
|
||||
wolfsslDebug = 1 ;
|
||||
printf("Turning ON Debug message\n") ;
|
||||
CyaSSL_Debugging_ON() ;
|
||||
wolfSSL_Debugging_ON() ;
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
@ -467,20 +466,20 @@ static void help_comm(void *args)
|
|||
|
||||
|
||||
|
||||
#define BG_JOB_STACK_SIZE 12000
|
||||
#define BG_JOB_STACK_SIZE 16000
|
||||
#if (!defined(NO_SIMPLE_SERVER) && !defined(NO_ECHOSERVER)) && \
|
||||
defined(HAVE_KEIL_RTX)
|
||||
static char bg_job_stack[BG_JOB_STACK_SIZE] ;
|
||||
#endif
|
||||
|
||||
#define COMMAND_STACK_SIZE 12000
|
||||
#define COMMAND_STACK_SIZE 16000
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
static char command_stack[COMMAND_STACK_SIZE] ;
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
static CyaSSL_Mutex command_mutex ;
|
||||
static wolfSSL_Mutex command_mutex ;
|
||||
#endif
|
||||
|
||||
/*********** Invoke Forground Command *********************/
|
||||
|
@ -491,7 +490,7 @@ static void command_invoke(void *args)
|
|||
|
||||
func = (void(*)(void *))((func_args *)args)->argv[0] ;
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
LockMutex((wolfSSL_Mutex *)&command_mutex) ;
|
||||
#endif
|
||||
iteration = for_iteration ;
|
||||
for(i=0; i< iteration; i++) {
|
||||
|
@ -509,7 +508,7 @@ static void command_invoke(void *args)
|
|||
if(iteration > 1)
|
||||
for_iteration = 1 ;
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
UnLockMutex((wolfSSL_Mutex *)&command_mutex) ;
|
||||
os_tsk_delete_self() ;
|
||||
#endif
|
||||
}
|
||||
|
@ -525,7 +524,7 @@ static void bg_job_invoke(void *args)
|
|||
func = (void(*)(void *))((func_args *)args)->argv[0] ;
|
||||
func(args) ; /* invoke command */
|
||||
stack_check(bg_job_stack, BG_JOB_STACK_SIZE) ;
|
||||
#ifdef CYASSL_KEIL_NET
|
||||
#ifdef WOLFSSL_KEIL_NET
|
||||
init_TcpNet ();
|
||||
#endif
|
||||
BackGround = 0 ;
|
||||
|
@ -550,7 +549,6 @@ void shell_main(void) {
|
|||
#if defined(HAVE_KEIL_RTX)
|
||||
InitMutex(&command_mutex) ;
|
||||
#endif
|
||||
time_main(NULL) ;
|
||||
printf("Starting Shell\n") ;
|
||||
while(1) {
|
||||
if(getline(line, LINESIZE, &args, &bf_flg) > 0) {
|
||||
|
@ -559,14 +557,14 @@ void shell_main(void) {
|
|||
args.argv[0] = (char *) commandTable[i].func ;
|
||||
if(bf_flg == FORGROUND) {
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
UnLockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
UnLockMutex((wolfSSL_Mutex *)&command_mutex) ;
|
||||
os_tsk_create_user_ex( (void(*)(void *))&command_invoke, 7,
|
||||
command_stack, COMMAND_STACK_SIZE, &args) ;
|
||||
#else
|
||||
command_invoke(&args) ;
|
||||
#endif
|
||||
#ifdef HAVE_KEIL_RTX
|
||||
LockMutex((CyaSSL_Mutex *)&command_mutex) ;
|
||||
LockMutex((wolfSSL_Mutex *)&command_mutex) ;
|
||||
#endif
|
||||
} else {
|
||||
#if (!defined(NO_SIMPLE_SERVER) && \
|
|
@ -1,4 +1,4 @@
|
|||
/* ssl-dummy.c
|
||||
/* time-STM32F2.c
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
|
@ -23,31 +23,19 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <cyassl/ssl.h>
|
||||
#include <cyassl/internal.h>
|
||||
#include <cyassl/error-ssl.h>
|
||||
#include <cyassl/ctaocrypt/coding.h>
|
||||
|
||||
Signer* GetCA(void* vp, byte* hash)
|
||||
#include <stdint.h>
|
||||
#define DWT ((DWT_Type *) (0xE0001000UL) )
|
||||
typedef struct
|
||||
{
|
||||
Signer*s ;
|
||||
return s ;
|
||||
}
|
||||
uint32_t CTRL; /*!< Offset: 0x000 (R/W) Control Register */
|
||||
uint32_t CYCCNT; /*!< Offset: 0x004 (R/W) Cycle Count Register */
|
||||
} DWT_Type;
|
||||
|
||||
int CyaSSL_dtls(CYASSL* ssl)
|
||||
{
|
||||
return ssl->options.dtls;
|
||||
}
|
||||
extern uint32_t SystemCoreClock ;
|
||||
|
||||
int CyaSSL_get_using_nonblock(CYASSL* ssl)
|
||||
double current_time(int reset)
|
||||
{
|
||||
CYASSL_ENTER("CyaSSL_get_using_nonblock");
|
||||
CYASSL_LEAVE("CyaSSL_get_using_nonblock", ssl->options.usingNonblock);
|
||||
return ssl->options.usingNonblock;
|
||||
}
|
||||
|
||||
Signer* GetCAByName(void* vp, byte* hash)
|
||||
{
|
||||
Signer * ca ;
|
||||
return(ca) ;
|
||||
if(reset) DWT->CYCCNT = 0 ;
|
||||
return ((double)DWT->CYCCNT/SystemCoreClock) ;
|
||||
}
|
|
@ -1,4 +1,4 @@
|
|||
/* config.h
|
||||
/* time-dummy.c.c
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
|
@ -16,31 +16,19 @@
|
|||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
|
||||
* 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
|
||||
|
||||
/* for Retarget.c */
|
||||
#define STDIO
|
||||
#define BENCH_EMBEDDED
|
||||
|
||||
#define CYASSL_DER_LOAD
|
||||
#define HAVE_NULL_CIPHER
|
||||
|
||||
#if defined(MDK_CONF_RTX_TCP_FS)
|
||||
#include "config-RTX-TCP-FS.h"
|
||||
#elif defined(MDK_CONF_TCP_FS)
|
||||
#include "config-TCP-FS.h"
|
||||
#elif defined(MDK_CONF_FS)
|
||||
#include "config-FS.h"
|
||||
#elif defined(MDK_CONF_BARE_METAL)
|
||||
#include "config-BARE-METAL.h"
|
||||
#ifdef HAVE_CONFIG_H
|
||||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include "time.h"
|
||||
|
||||
struct tm *wolfssl_MDK_gmtime(const time_t *c)
|
||||
{
|
||||
static struct tm date ;
|
||||
return(&date) ;
|
||||
}
|
||||
|
||||
time_t time(time_t * t) { return 0 ; }
|
|
@ -1,4 +1,4 @@
|
|||
/* cyassl_MDK_ARM.c
|
||||
/* wolfssl_KEIL_RL.c
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
|
@ -27,22 +27,29 @@
|
|||
#include <config.h>
|
||||
#endif
|
||||
|
||||
#include <stdio.h>
|
||||
#if defined (CYASSL_MDK5)
|
||||
#include <wolfssl/wolfcrypt/settings.h>
|
||||
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#include "rl_fs.h"
|
||||
#include "rl_net.h"
|
||||
#else
|
||||
#include "rtl.h"
|
||||
#endif
|
||||
#else
|
||||
#include <rtl.h>
|
||||
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#endif
|
||||
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
|
||||
#include <cyassl/ctaocrypt/visibility.h>
|
||||
#include <cyassl/ctaocrypt/logging.h>
|
||||
#include <wolfssl/wolfcrypt/visibility.h>
|
||||
#include <wolfssl/wolfcrypt/logging.h>
|
||||
|
||||
#if defined (CYASSL_CMSIS_RTOS)
|
||||
#if defined (WOLFSSL_CMSIS_RTOS)
|
||||
#define os_dly_wait(t) osDelay(10*t)
|
||||
#endif
|
||||
|
||||
|
@ -50,7 +57,7 @@
|
|||
/** KEIL-RL TCPnet ****/
|
||||
/** TCPnet BSD socket does not have following functions. **/
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
char *inet_ntoa(struct in_addr in)
|
||||
{
|
||||
#define NAMESIZE 16
|
||||
|
@ -69,10 +76,10 @@ unsigned long inet_addr(const char *cp)
|
|||
|
||||
|
||||
/*** tcp_connect is actually associated with following syassl_tcp_connect. ***/
|
||||
int Cyassl_connect(int sd, const struct sockaddr* sa, int sz)
|
||||
int wolfssl_connect(int sd, const struct sockaddr* sa, int sz)
|
||||
{
|
||||
int ret = 0 ;
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
|
||||
SOCKADDR_IN addr ;
|
||||
|
||||
|
@ -83,100 +90,100 @@ int Cyassl_connect(int sd, const struct sockaddr* sa, int sz)
|
|||
ret = connect(sd, (SOCKADDR *)&addr, sizeof(addr)) ;
|
||||
os_dly_wait(50);
|
||||
} while(ret == SCK_EWOULDBLOCK) ;
|
||||
#ifdef DEBUG_CYASSL
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Connect return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
WOLFSSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
}
|
||||
|
||||
|
||||
int Cyassl_accept(int sd, struct sockaddr *addr, int *addrlen)
|
||||
int wolfssl_accept(int sd, struct sockaddr *addr, int *addrlen)
|
||||
{
|
||||
int ret = 0 ;
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef accept /* Go to KEIL TCPnet accept */
|
||||
ret = accept(sd, addr, addrlen) ;
|
||||
if(ret != SCK_EWOULDBLOCK) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Accept return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
WOLFSSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
|
||||
}
|
||||
|
||||
int Cyassl_recv(int sd, void *buf, size_t len, int flags)
|
||||
int wolfssl_recv(int sd, void *buf, size_t len, int flags)
|
||||
{
|
||||
int ret = 0;
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef recv /* Go to KEIL TCPnet recv */
|
||||
ret = recv(sd, buf, len, flags) ;
|
||||
if((ret != SCK_EWOULDBLOCK) &&( ret != SCK_ETIMEOUT)) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Recv return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
WOLFSSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
return(ret ) ;
|
||||
}
|
||||
|
||||
int Cyassl_send(int sd, const void *buf, size_t len, int flags)
|
||||
int wolfssl_send(int sd, const void *buf, size_t len, int flags)
|
||||
{
|
||||
int ret = 0 ;
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
while(1) {
|
||||
#undef send /* Go to KEIL TCPnet send */
|
||||
ret = send(sd, buf, len, flags) ;
|
||||
if(ret != SCK_EWOULDBLOCK) break ;
|
||||
os_dly_wait(1);
|
||||
}
|
||||
#ifdef DEBUG_CYASSL
|
||||
#ifdef DEBUG_WOLFSSL
|
||||
{
|
||||
char msg[50] ;
|
||||
sprintf(msg, "BSD Send return code: %d\n", ret) ;
|
||||
CYASSL_MSG(msg) ;
|
||||
WOLFSSL_MSG(msg) ;
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
return(ret) ;
|
||||
|
||||
}
|
||||
|
||||
#endif /* CYASSL_KEIL_TCP_NET */
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
|
||||
#if defined(CYASSL_KEIL_TCP_NET)
|
||||
void Cyassl_sleep(int t)
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
void wolfssl_sleep(int t)
|
||||
{
|
||||
#if defined(HAVE_KEIL_RTX)
|
||||
os_dly_wait(t/1000+1) ;
|
||||
#endif
|
||||
}
|
||||
|
||||
int Cyassl_tcp_select(int sd, int timeout)
|
||||
int wolfssl_tcp_select(int sd, int timeout)
|
||||
{
|
||||
|
||||
return 0 ;
|
||||
|
@ -184,9 +191,7 @@ int Cyassl_tcp_select(int sd, int timeout)
|
|||
}
|
||||
#endif
|
||||
|
||||
extern int strlen(const char *s) ;
|
||||
|
||||
FILE * CyaSSL_fopen(const char *name, const char *openmode)
|
||||
FILE * wolfSSL_fopen(const char *name, const char *openmode)
|
||||
{
|
||||
int i ; FILE * ret ;
|
||||
#define PATHSIZE 100
|
||||
|
@ -206,27 +211,20 @@ FILE * CyaSSL_fopen(const char *name, const char *openmode)
|
|||
return(ret) ;
|
||||
}
|
||||
|
||||
#if defined (CYASSL_MDK5)
|
||||
#define getkey getchar
|
||||
#define sendchar putchar
|
||||
#else
|
||||
extern int getkey(void) ;
|
||||
extern int sendchar(int c) ;
|
||||
#endif
|
||||
|
||||
char * Cyassl_fgets ( char * str, int num, FILE * f )
|
||||
char * wolfssl_fgets ( char * str, int num, FILE * f )
|
||||
{
|
||||
int i ;
|
||||
|
||||
for(i = 0 ; i< num ; i++) {
|
||||
while((str[i] = getkey()) == 0) {
|
||||
#if defined (HAVE_KEIL_RTX)
|
||||
#if !defined(CYASSL_CMSIS_RTOS)
|
||||
#if defined (HAVE_KEIL_RTX) && !defined(WOLFSSL_CMSIS_RTOS)
|
||||
os_tsk_pass ();
|
||||
#else
|
||||
#elif defined(WOLFSSL_CMSIS_RTOS)
|
||||
osThreadYield ();
|
||||
#endif
|
||||
#endif
|
||||
}
|
||||
if(str[i] == '\n' || str[i] == '\012' || str[i] == '\015') {
|
||||
sendchar('\n') ;
|
|
@ -1,4 +1,4 @@
|
|||
/* cyassl_KEIL_RL.h
|
||||
/* wolfssl_KEIL_RL.h
|
||||
*
|
||||
* Copyright (C) 2006-2015 wolfSSL Inc.
|
||||
*
|
||||
|
@ -22,16 +22,16 @@
|
|||
/******************************************************************************/
|
||||
/** This file is for defining types, values for specific to KEIL-MDK-ARM. **/
|
||||
/******************************************************************************/
|
||||
#ifndef CYASSL_KEIL_RL_H
|
||||
#define CYASSL_KEIL_RL_H
|
||||
#ifndef WOLFSSL_KEIL_RL_H
|
||||
#define WOLFSSL_KEIL_RL_H
|
||||
|
||||
|
||||
|
||||
#include <stdio.h>
|
||||
|
||||
/* Go to STDIN */
|
||||
#define fgets(buff, sz, fd) Cyassl_fgets(buff, sz, fd)
|
||||
extern char * Cyassl_fgets ( char * str, int num, FILE * f ) ;
|
||||
#define fgets(buff, sz, fd) wolfssl_fgets(buff, sz, fd)
|
||||
extern char * wolfssl_fgets ( char * str, int num, FILE * f ) ;
|
||||
|
||||
#define SOCKET_T int
|
||||
|
||||
|
@ -52,39 +52,37 @@ struct timeval {
|
|||
long tv_usec; /* microseconds */
|
||||
};
|
||||
|
||||
#if defined(WOLFSSL_KEIL_TCP_NET)
|
||||
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#define SCK_EWOULDBLOCK BSD_ERROR_WOULDBLOCK
|
||||
#define SCK_ETIMEOUT BSD_ERROR_TIMEOUT
|
||||
#include "rl_net.h"
|
||||
#endif
|
||||
|
||||
/*** #include <unistd.h> **/
|
||||
/*
|
||||
int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, const struct timeval *timeout);
|
||||
void FD_CLR(int fd, fd_set *set);
|
||||
int FD_ISSET(int fd, fd_set *set);
|
||||
void FD_SET(int fd, fd_set *set);
|
||||
void FD_ZERO(fd_set *set);
|
||||
*/
|
||||
typedef int socklen_t ;
|
||||
|
||||
/* for avoiding conflict with KEIL-TCPnet BSD socket */
|
||||
/* Bodies are in cyassl_KEIL_RL.c */
|
||||
#define connect Cyassl_connect
|
||||
#define accept Cyassl_accept
|
||||
#define recv Cyassl_recv
|
||||
#define send Cyassl_send
|
||||
#define sleep Cyassl_sleep
|
||||
/* Bodies are in wolfssl_KEIL_RL.c */
|
||||
#define connect(a,b,c) wolfssl_connect(a, (struct sockaddr* )(b), c)
|
||||
#define accept wolfssl_accept
|
||||
#define recv wolfssl_recv
|
||||
#define send wolfssl_send
|
||||
#define sleep wolfssl_sleep
|
||||
|
||||
/* for avoiding conflicting with KEIL-TCPnet TCP socket */
|
||||
/* Bodies are in test.h */
|
||||
#define tcp_connect Cyassl_tcp_connect
|
||||
#define tcp_socket Cyassl_tcp_soket
|
||||
#define tcp_listen Cyassl_tcp_listen
|
||||
#define tcp_select Cyassl_tcp_select
|
||||
#define tcp_connect wolfssl_tcp_connect
|
||||
#define tcp_socket wolfssl_tcp_soket
|
||||
#define tcp_listen wolfssl_tcp_listen
|
||||
#define tcp_select wolfssl_tcp_select
|
||||
|
||||
extern int Cyassl_connect(int sd, const struct sockaddr * sa, int sz) ;
|
||||
extern int Cyassl_accept(int sd, struct sockaddr *addr, socklen_t *addrlen);
|
||||
extern int Cyassl_recv(int sd, void *buf, size_t len, int flags);
|
||||
extern int Cyassl_send(int sd, const void *buf, size_t len, int flags);
|
||||
extern void Cyassl_sleep(int sec) ;
|
||||
extern int Cyassl_tcp_select(int sd, int timeout) ;
|
||||
extern int wolfssl_connect(int sd, const struct sockaddr* sa, int sz) ;
|
||||
extern int wolfssl_accept(int sd, struct sockaddr*addr, socklen_t *addrlen);
|
||||
extern int wolfssl_recv(int sd, void *buf, size_t len, int flags);
|
||||
extern int wolfssl_send(int sd, const void *buf, size_t len, int flags);
|
||||
extern void wolfssl_sleep(int sec) ;
|
||||
extern int wolfssl_tcp_select(int sd, int timeout) ;
|
||||
|
||||
/** KEIL-RL TCPnet ****/
|
||||
/* TCPnet BSD socket does not have following functions. */
|
||||
|
@ -95,9 +93,6 @@ extern int setsockopt(int sockfd, int level, int optname,
|
|||
extern int select(int nfds, fd_set *readfds, fd_set *writefds,
|
||||
fd_set *exceptfds, const struct timeval *timeout);
|
||||
|
||||
/* CyaSSL MDK-ARM time functions */
|
||||
#include <time.h>
|
||||
struct tm *Cyassl_MDK_gmtime(const time_t *c) ;
|
||||
extern double current_time(void) ;
|
||||
#endif /* WOLFSSL_KEIL_TCP_NET */
|
||||
|
||||
#endif /* CYASSL_KEIL_RL_H */
|
||||
#endif /* WOLFSSL_KEIL_RL_H */
|
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,8 @@
|
|||
|
||||
Use appropriate config file for the target library.
|
||||
|
||||
Configfile files Target
|
||||
config-WOLFLIB.h: wolfSSL-Lib /* for general use wolfSSL library */
|
||||
config-BARE-METAL.h: MDK-BAREMETAL-Lib /* for linking with MDK-BAREMETAL target in MDK-ARM-STM32F2xx project */
|
||||
config-FS.h: MDK-FS-Lib /* for linking with MDK-FS target in MDK-ARM-STM32F2xx project */
|
||||
config-RTX-TCP-FS.h: MDK-RTX-TCP-FS-Lib /* for linking with MDK-RTX-TCP-FS target in MDK-ARM-STM32F2xx project */
|
|
@ -29,11 +29,11 @@
|
|||
#include <cyassl/ssl.h>
|
||||
#include <cyassl/openssl/ssl.h>
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(CYASSL_MDK5)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#include "rl_fs.h"
|
||||
#include "rl_net.h"
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include "rtl.h"
|
||||
#endif
|
||||
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#endif
|
||||
|
||||
#include <cyassl/test.h>
|
||||
|
@ -74,7 +74,7 @@ void echoclient_test(void* args)
|
|||
|
||||
((func_args*)args)->return_code = -1; /* error state */
|
||||
|
||||
#ifndef CYASSL_MDK_SHELL
|
||||
#ifndef WOLFSSL_MDK_SHELL
|
||||
argc = ((func_args*)args)->argc;
|
||||
argv = ((func_args*)args)->argv;
|
||||
#endif
|
||||
|
@ -103,7 +103,7 @@ void echoclient_test(void* args)
|
|||
doPSK = 1;
|
||||
#endif
|
||||
|
||||
#if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && !defined(CYASSL_MDK_SHELL)
|
||||
#if defined(NO_MAIN_DRIVER) && !defined(USE_WINDOWS_API) && !defined(WOLFSSL_MDK_SHELL)
|
||||
port = ((func_args*)args)->signal->port;
|
||||
#endif
|
||||
|
||||
|
@ -153,7 +153,7 @@ void echoclient_test(void* args)
|
|||
SSL_CTX_set_default_passwd_cb(ctx, PasswordCallBack);
|
||||
#endif
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
CyaSSL_CTX_set_verify(ctx, SSL_VERIFY_NONE, 0);
|
||||
#endif
|
||||
|
||||
|
@ -194,7 +194,7 @@ void echoclient_test(void* args)
|
|||
break;
|
||||
}
|
||||
|
||||
#ifndef CYASSL_MDK_SHELL
|
||||
#ifndef WOLFSSL_MDK_SHELL
|
||||
while (sendSz) {
|
||||
int got;
|
||||
if ( (got = SSL_read(ssl, reply, sizeof(reply)-1)) > 0) {
|
||||
|
@ -260,7 +260,7 @@ void echoclient_test(void* args)
|
|||
args.argv = argv;
|
||||
|
||||
CyaSSL_Init();
|
||||
#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL)
|
||||
#if defined(DEBUG_CYASSL) && !defined(WOLFSSL_MDK_SHELL)
|
||||
CyaSSL_Debugging_ON();
|
||||
#endif
|
||||
#ifndef CYASSL_TIRTOS
|
||||
|
|
|
@ -29,11 +29,11 @@
|
|||
#include <cyassl/ctaocrypt/ecc.h> /* ecc_fp_free */
|
||||
#endif
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(CYASSL_MDK5)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#include "rl_fs.h"
|
||||
#include "rl_net.h"
|
||||
|
@ -41,7 +41,7 @@
|
|||
#include "rtl.h"
|
||||
#endif
|
||||
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#endif
|
||||
|
||||
#include <cyassl/ssl.h>
|
||||
|
@ -83,7 +83,7 @@ THREAD_RETURN CYASSL_THREAD echoserver_test(void* args)
|
|||
int outCreated = 0;
|
||||
int shutDown = 0;
|
||||
int useAnyAddr = 0;
|
||||
word16 port = yasslPort;
|
||||
word16 port = wolfSSLPort;
|
||||
int argc = ((func_args*)args)->argc;
|
||||
char** argv = ((func_args*)args)->argv;
|
||||
|
||||
|
@ -114,7 +114,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_SHELL) && \
|
||||
!defined(CYASSL_SNIFFER) && !defined(WOLFSSL_MDK_SHELL) && \
|
||||
!defined(CYASSL_TIRTOS)
|
||||
port = 0;
|
||||
#endif
|
||||
|
|
|
@ -34,11 +34,11 @@
|
|||
#define WOLFSSL_TRACK_MEMORY
|
||||
#endif
|
||||
|
||||
#if defined(CYASSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
|
||||
#if defined(CYASSL_MDK5)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#include "rl_fs.h"
|
||||
#include "rl_net.h"
|
||||
|
@ -46,7 +46,7 @@
|
|||
#include "rtl.h"
|
||||
#endif
|
||||
|
||||
#include "cyassl_MDK_ARM.h"
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#endif
|
||||
#include <cyassl/openssl/ssl.h>
|
||||
#include <cyassl/test.h>
|
||||
|
@ -179,7 +179,7 @@ THREAD_RETURN CYASSL_THREAD server_test(void* args)
|
|||
int version = SERVER_DEFAULT_VERSION;
|
||||
int doCliCertCheck = 1;
|
||||
int useAnyAddr = 0;
|
||||
word16 port = yasslPort;
|
||||
word16 port = wolfSSLPort;
|
||||
int usePsk = 0;
|
||||
int useAnon = 0;
|
||||
int doDTLS = 0;
|
||||
|
@ -659,7 +659,7 @@ while (1) { /* allow resume option */
|
|||
if (SSL_write(ssl, msg, sizeof(msg)) != sizeof(msg))
|
||||
err_sys("SSL_write failed");
|
||||
|
||||
#if defined(CYASSL_MDK_SHELL) && defined(HAVE_MDK_RTX)
|
||||
#if defined(WOLFSSL_MDK_SHELL) && defined(HAVE_MDK_RTX)
|
||||
os_dly_wait(500) ;
|
||||
#elif defined (CYASSL_TIRTOS)
|
||||
Task_yield();
|
||||
|
@ -729,7 +729,7 @@ while (1) { /* allow resume option */
|
|||
args.argv = argv;
|
||||
|
||||
CyaSSL_Init();
|
||||
#if defined(DEBUG_CYASSL) && !defined(CYASSL_MDK_SHELL)
|
||||
#if defined(DEBUG_CYASSL) && !defined(WOLFSSL_MDK_SHELL)
|
||||
CyaSSL_Debugging_ON();
|
||||
#endif
|
||||
if (CurrentDir("_build"))
|
||||
|
|
|
@ -113,19 +113,7 @@
|
|||
#define XTIME(t1) mqx_time((t1))
|
||||
#define XGMTIME(c, t) mqx_gmtime((c), (t))
|
||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||
#elif defined(WOLFSSL_MDK_ARM)
|
||||
#if defined(WOLFSSL_MDK5)
|
||||
#include "cmsis_os.h"
|
||||
#else
|
||||
#include <rtl.h>
|
||||
#endif
|
||||
#undef RNG
|
||||
#include "wolfssl_MDK_ARM.h"
|
||||
#undef RNG
|
||||
#define RNG wolfSSL_RNG /*for avoiding name conflict in "stm32f2xx.h" */
|
||||
#define XTIME(tl) (0)
|
||||
#define XGMTIME(c, t) wolfssl_MDK_gmtime((c))
|
||||
#define XVALIDATE_DATE(d, f, t) ValidateDate((d), (f), (t))
|
||||
|
||||
#elif defined(USER_TIME)
|
||||
/* user time, and gmtime compatible functions, there is a gmtime
|
||||
implementation here that WINCE uses, so really just need some ticks
|
||||
|
@ -1456,6 +1444,7 @@ int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen)
|
|||
word32 seqSz, verSz, rawLen, intTotalLen = 0;
|
||||
word32 sizes[DSA_INTS];
|
||||
int i, j, outLen, ret = 0, lbit;
|
||||
int err ;
|
||||
|
||||
byte seq[MAX_SEQ_SZ];
|
||||
byte ver[MAX_VERSION_SZ];
|
||||
|
@ -1496,7 +1485,7 @@ int wc_DsaKeyToDer(DsaKey* key, byte* output, word32 inLen)
|
|||
if (lbit)
|
||||
tmps[i][sizes[i]-1] = 0x00;
|
||||
|
||||
int err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]);
|
||||
err = mp_to_unsigned_bin(keyInt, tmps[i] + sizes[i]);
|
||||
if (err == MP_OKAY) {
|
||||
sizes[i] += (rawLen-lbit); /* lbit included in rawLen */
|
||||
intTotalLen += sizes[i];
|
||||
|
|
|
@ -99,13 +99,7 @@
|
|||
#if defined(USE_CERT_BUFFERS_1024) || defined(USE_CERT_BUFFERS_2048) \
|
||||
|| !defined(NO_DH)
|
||||
/* include test cert and key buffers for use with NO_FILESYSTEM */
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#include "cert_data.h"
|
||||
/* use certs_test.c for initial data, so other
|
||||
commands can share the data. */
|
||||
#else
|
||||
#include <wolfssl/certs_test.h>
|
||||
#endif
|
||||
#endif
|
||||
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
|
|
|
@ -67,13 +67,6 @@ typedef struct OS_Seed {
|
|||
#endif
|
||||
} OS_Seed;
|
||||
|
||||
|
||||
#if defined(WOLFSSL_MDK_ARM)
|
||||
#undef RNG
|
||||
#define RNG wolfSSL_RNG /* for avoiding name conflict in "stm32f2xx.h" */
|
||||
#endif
|
||||
|
||||
|
||||
#if defined(HAVE_HASHDRBG) || defined(NO_RC4)
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue