mirror of https://github.com/wolfSSL/wolfssl.git
commit
837e9856f5
|
@ -14,7 +14,7 @@ These examples use the Cube HAL for STM32.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
|
|
||||||
The settings for the wolfSSL CubeMX pack are in the generated `wolfSSL.wolfSSL_conf.h` file. An example of this is located in `IDE/STM32Cube/wolfSSL_conf.h` (renamed to avoid possible conflicts with generated file).
|
The settings for the wolfSSL CubeMX pack are in the generated `wolfSSL.I-CUBE-wolfSSL_conf.h` file. An example of this is located in `IDE/STM32Cube/wolfSSL_conf.h` (renamed to avoid possible conflicts with generated file).
|
||||||
|
|
||||||
The template used for generation is `IDE/STM32Cube/default_conf.ftl` which can be updated at `STM32Cube/Repository/Packs/wolfSSL/wolfSSL/[Version]/CubeMX/templates/default_conf.ftl`.
|
The template used for generation is `IDE/STM32Cube/default_conf.ftl` which can be updated at `STM32Cube/Repository/Packs/wolfSSL/wolfSSL/[Version]/CubeMX/templates/default_conf.ftl`.
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@
|
||||||
[#assign s = name]
|
[#assign s = name]
|
||||||
[#assign toto = s?replace(".","_")]
|
[#assign toto = s?replace(".","_")]
|
||||||
[#assign toto = toto?replace("/","")]
|
[#assign toto = toto?replace("/","")]
|
||||||
|
[#assign toto = toto?replace("-","_")]
|
||||||
[#assign inclusion_protection = toto?upper_case]
|
[#assign inclusion_protection = toto?upper_case]
|
||||||
/* Define to prevent recursive inclusion -------------------------------------*/
|
/* Define to prevent recursive inclusion -------------------------------------*/
|
||||||
#ifndef __${inclusion_protection}__
|
#ifndef __${inclusion_protection}__
|
||||||
|
@ -128,7 +129,9 @@ extern ${variable.value} ${variable.name};
|
||||||
WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
|
WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
|
||||||
#define WOLFSSL_STM32F4
|
#define WOLFSSL_STM32F4
|
||||||
|
|
||||||
/* Debug UART */
|
/* Debug UART used for printf */
|
||||||
|
/* The UART interface number varies for each board/CPU */
|
||||||
|
/* Typically this is the UART attached to the ST-Link USB CDC UART port */
|
||||||
#define HAL_CONSOLE_UART huart4
|
#define HAL_CONSOLE_UART huart4
|
||||||
|
|
||||||
/* Hardware Crypto - uncomment as available on hardware */
|
/* Hardware Crypto - uncomment as available on hardware */
|
||||||
|
@ -526,7 +529,7 @@ extern ${variable.value} ${variable.name};
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
#endif /*__ ${inclusion_protection}_H */
|
#endif /* ${inclusion_protection}_H */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @}
|
* @}
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
/* wolfSSL_conf.h (example of generated wolfSSL.wolfSSL_conf.h)
|
/* wolfSSL_conf.h (example of generated wolfSSL.I-CUBE-wolfSSL_conf.h)
|
||||||
*
|
*
|
||||||
* Copyright (C) 2006-2020 wolfSSL Inc.
|
* Copyright (C) 2006-2020 wolfSSL Inc.
|
||||||
*
|
*
|
||||||
|
@ -26,95 +26,96 @@
|
||||||
* (and not WOLFSSL_USER_SETTINGS or HAVE_CONF_H).
|
* (and not WOLFSSL_USER_SETTINGS or HAVE_CONF_H).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#ifndef __WOLFSSL_WOLFSSL_CONF_H__
|
#ifndef __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__
|
||||||
#define __WOLFSSL_WOLFSSL_CONF_H__
|
#define __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__
|
||||||
|
|
||||||
#ifdef __cplusplus
|
/**
|
||||||
extern "C" {
|
MiddleWare name : wolfSSL.I-CUBE-wolfSSL.4.6.0
|
||||||
#endif
|
MiddleWare fileName : ./wolfSSL.I-CUBE-wolfSSL_conf.h
|
||||||
|
MiddleWare version :
|
||||||
|
*/
|
||||||
|
|
||||||
/*---------- Debug Support -----------*/
|
/*---------- WOLF_CONF_DEBUG -----------*/
|
||||||
#define WOLF_CONF_DEBUG 0
|
#define WOLF_CONF_DEBUG 0
|
||||||
|
|
||||||
/*---------- wolfCrypt Only -----------*/
|
/*---------- WOLF_CONF_WOLFCRYPT_ONLY -----------*/
|
||||||
#define WOLF_CONF_WOLFCRYPT_ONLY 0
|
#define WOLF_CONF_WOLFCRYPT_ONLY 0
|
||||||
|
|
||||||
/*---------- TLS v1.3 -----------*/
|
/*---------- WOLF_CONF_TLS13 -----------*/
|
||||||
#define WOLF_CONF_TLS13 1
|
#define WOLF_CONF_TLS13 1
|
||||||
|
|
||||||
/*---------- TLS v1.2 -----------*/
|
/*---------- WOLF_CONF_TLS12 -----------*/
|
||||||
#define WOLF_CONF_TLS12 1
|
#define WOLF_CONF_TLS12 1
|
||||||
|
|
||||||
/*---------- DTLS Support -----------*/
|
/*---------- WOLF_CONF_DTLS -----------*/
|
||||||
#define WOLF_CONF_DTLS 0
|
#define WOLF_CONF_DTLS 0
|
||||||
|
|
||||||
/*---------- Math Configuration -----------*/
|
/*---------- WOLF_CONF_MATH -----------*/
|
||||||
#define WOLF_CONF_MATH 4
|
#define WOLF_CONF_MATH 4
|
||||||
|
|
||||||
/*---------- RTOS -----------*/
|
/*---------- WOLF_CONF_RTOS -----------*/
|
||||||
#define WOLF_CONF_RTOS 2
|
#define WOLF_CONF_RTOS 2
|
||||||
|
|
||||||
/*---------- RSA Support -----------*/
|
/*---------- WOLF_CONF_RSA -----------*/
|
||||||
#define WOLF_CONF_RSA 1
|
#define WOLF_CONF_RSA 1
|
||||||
|
|
||||||
/*---------- ECC Support -----------*/
|
/*---------- WOLF_CONF_ECC -----------*/
|
||||||
#define WOLF_CONF_ECC 1
|
#define WOLF_CONF_ECC 1
|
||||||
|
|
||||||
/*---------- DH (Diffie–Hellman) Support -----------*/
|
/*---------- WOLF_CONF_DH -----------*/
|
||||||
#define WOLF_CONF_DH 1
|
#define WOLF_CONF_DH 1
|
||||||
|
|
||||||
/*---------- AES GCM Support -----------*/
|
/*---------- WOLF_CONF_AESGCM -----------*/
|
||||||
#define WOLF_CONF_AESGCM 1
|
#define WOLF_CONF_AESGCM 1
|
||||||
|
|
||||||
/*---------- AES CBC Support -----------*/
|
/*---------- WOLF_CONF_AESCBC -----------*/
|
||||||
#define WOLF_CONF_AESCBC 0
|
#define WOLF_CONF_AESCBC 0
|
||||||
|
|
||||||
/*---------- ChaCha20 / Poly1305 Support -----------*/
|
/*---------- WOLF_CONF_CHAPOLY -----------*/
|
||||||
#define WOLF_CONF_CHAPOLY 1
|
#define WOLF_CONF_CHAPOLY 1
|
||||||
|
|
||||||
/*---------- Ed25519 / Curve25519 Support -----------*/
|
/*---------- WOLF_CONF_EDCURVE25519 -----------*/
|
||||||
#define WOLF_CONF_EDCURVE25519 0
|
#define WOLF_CONF_EDCURVE25519 0
|
||||||
|
|
||||||
/*---------- MD5 Support -----------*/
|
/*---------- WOLF_CONF_MD5 -----------*/
|
||||||
#define WOLF_CONF_MD5 0
|
#define WOLF_CONF_MD5 0
|
||||||
|
|
||||||
/*---------- SHA1 Support -----------*/
|
/*---------- WOLF_CONF_SHA1 -----------*/
|
||||||
#define WOLF_CONF_SHA1 0
|
#define WOLF_CONF_SHA1 0
|
||||||
|
|
||||||
/*---------- SHA2-224 Support -----------*/
|
/*---------- WOLF_CONF_SHA2_224 -----------*/
|
||||||
#define WOLF_CONF_SHA2_224 0
|
#define WOLF_CONF_SHA2_224 0
|
||||||
|
|
||||||
/*---------- SHA2-256 Support -----------*/
|
/*---------- WOLF_CONF_SHA2_256 -----------*/
|
||||||
#define WOLF_CONF_SHA2_256 1
|
#define WOLF_CONF_SHA2_256 1
|
||||||
|
|
||||||
/*---------- SHA2-384 Support -----------*/
|
/*---------- WOLF_CONF_SHA2_384 -----------*/
|
||||||
#define WOLF_CONF_SHA2_384 0
|
#define WOLF_CONF_SHA2_384 0
|
||||||
|
|
||||||
/*---------- SHA2-512 Support -----------*/
|
/*---------- WOLF_CONF_SHA2_512 -----------*/
|
||||||
#define WOLF_CONF_SHA2_512 0
|
#define WOLF_CONF_SHA2_512 0
|
||||||
|
|
||||||
/*---------- SHA3 Support -----------*/
|
/*---------- WOLF_CONF_SHA3 -----------*/
|
||||||
#define WOLF_CONF_SHA3 0
|
#define WOLF_CONF_SHA3 0
|
||||||
|
|
||||||
/*---------- Pre-Shared-Key Support -----------*/
|
/*---------- WOLF_CONF_PSK -----------*/
|
||||||
#define WOLF_CONF_PSK 0
|
#define WOLF_CONF_PSK 0
|
||||||
|
|
||||||
/*---------- Pwd Based Key Derivation Support -----------*/
|
/*---------- WOLF_CONF_PWDBASED -----------*/
|
||||||
#define WOLF_CONF_PWDBASED 0
|
#define WOLF_CONF_PWDBASED 0
|
||||||
|
|
||||||
/*---------- Keep Peer Cert Support -----------*/
|
/*---------- WOLF_CONF_KEEP_PEER_CERT -----------*/
|
||||||
#define WOLF_CONF_KEEP_PEER_CERT 0
|
#define WOLF_CONF_KEEP_PEER_CERT 0
|
||||||
|
|
||||||
/*---------- Base64 Encode Support -----------*/
|
/*---------- WOLF_CONF_BASE64_ENCODE -----------*/
|
||||||
#define WOLF_CONF_BASE64_ENCODE 0
|
#define WOLF_CONF_BASE64_ENCODE 0
|
||||||
|
|
||||||
/*---------- OpenSSL Extra Support -----------*/
|
/*---------- WOLF_CONF_OPENSSL_EXTRA -----------*/
|
||||||
#define WOLF_CONF_OPENSSL_EXTRA 0
|
#define WOLF_CONF_OPENSSL_EXTRA 0
|
||||||
|
|
||||||
/*---------- wolfCrypt test/benchmark -----------*/
|
/*---------- WOLF_CONF_TEST -----------*/
|
||||||
#define WOLF_CONF_TEST 1
|
#define WOLF_CONF_TEST 1
|
||||||
|
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
/* Hardware platform */
|
/* Hardware platform */
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
@ -177,9 +178,25 @@ extern "C" {
|
||||||
#define NO_STM32_RNG
|
#define NO_STM32_RNG
|
||||||
#define WOLFSSL_GENSEED_FORTEST
|
#define WOLFSSL_GENSEED_FORTEST
|
||||||
#else
|
#else
|
||||||
#warning Please define a hardware platform!
|
#warning Please define a hardware platform!
|
||||||
#define WOLFSSL_STM32F4 /* default */
|
/* This means there is not a pre-defined platform for your board/CPU */
|
||||||
|
/* You need to define a CPU type, HW crypto and debug UART */
|
||||||
|
/* CPU Type: WOLFSSL_STM32F1, WOLFSSL_STM32F2, WOLFSSL_STM32F4,
|
||||||
|
WOLFSSL_STM32F7, WOLFSSL_STM32H7, WOLFSSL_STM32L4 and WOLFSSL_STM32L5 */
|
||||||
|
#define WOLFSSL_STM32F4
|
||||||
|
|
||||||
|
/* Debug UART used for printf */
|
||||||
|
/* The UART interface number varies for each board/CPU */
|
||||||
|
/* Typically this is the UART attached to the ST-Link USB CDC UART port */
|
||||||
#define HAL_CONSOLE_UART huart4
|
#define HAL_CONSOLE_UART huart4
|
||||||
|
|
||||||
|
/* Hardware Crypto - uncomment as available on hardware */
|
||||||
|
//#define WOLFSSL_STM32_PKA
|
||||||
|
//#define NO_STM32_RNG
|
||||||
|
//#undef NO_STM32_HASH
|
||||||
|
//#undef NO_STM32_CRYPTO
|
||||||
|
//#define WOLFSSL_GENSEED_FORTEST
|
||||||
|
//#define STM32_HAL_V2
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* ------------------------------------------------------------------------- */
|
/* ------------------------------------------------------------------------- */
|
||||||
|
@ -257,7 +274,7 @@ extern "C" {
|
||||||
#if defined(WOLF_CONF_PWDBASED) && WOLF_CONF_PWDBASED == 0
|
#if defined(WOLF_CONF_PWDBASED) && WOLF_CONF_PWDBASED == 0
|
||||||
#define NO_PWDBASED
|
#define NO_PWDBASED
|
||||||
#endif
|
#endif
|
||||||
#if defined(WOLF_CONF_KEEPPEERCERT) && WOLF_CONF_KEEPPEERCERT == 1
|
#if defined(WOLF_CONF_KEEP_PEER_CERT) && WOLF_CONF_KEEP_PEER_CERT == 1
|
||||||
#define KEEP_PEER_CERT
|
#define KEEP_PEER_CERT
|
||||||
#endif
|
#endif
|
||||||
#if defined(WOLF_CONF_BASE64_ENCODE) && WOLF_CONF_BASE64_ENCODE == 1
|
#if defined(WOLF_CONF_BASE64_ENCODE) && WOLF_CONF_BASE64_ENCODE == 1
|
||||||
|
@ -558,4 +575,4 @@ extern "C" {
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif /*__WOLFSSL_WOLFSSL_CONF_H__ */
|
#endif /* __WOLFSSL_I_CUBE_WOLFSSL_CONF_H__ */
|
||||||
|
|
|
@ -225,7 +225,7 @@
|
||||||
#include "user_settings.h"
|
#include "user_settings.h"
|
||||||
#elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H)
|
#elif defined(USE_HAL_DRIVER) && !defined(HAVE_CONFIG_H)
|
||||||
/* STM Configuration File (generated by CubeMX) */
|
/* STM Configuration File (generated by CubeMX) */
|
||||||
#include "wolfSSL.wolfSSL_conf.h"
|
#include "wolfSSL.I-CUBE-wolfSSL_conf.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* make sure old RNG name is used with CTaoCrypt FIPS */
|
/* make sure old RNG name is used with CTaoCrypt FIPS */
|
||||||
|
|
Loading…
Reference in New Issue