user_settings.h 7.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2023 wolfSSL Inc.
  4. *
  5. * This file is part of wolfSSL.
  6. *
  7. * wolfSSL is free software; you can redistribute it and/or modify
  8. * it under the terms of the GNU General Public License as published by
  9. * the Free Software Foundation; either version 2 of the License, or
  10. * (at your option) any later version.
  11. *
  12. * wolfSSL is distributed in the hope that it will be useful,
  13. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  15. * GNU General Public License for more details.
  16. *
  17. * You should have received a copy of the GNU General Public License
  18. * along with this program; if not, write to the Free Software
  19. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1335, USA
  20. */
  21. /*-- Renesas MCU type ---------------------------------------------------------
  22. *
  23. *
  24. *----------------------------------------------------------------------------*/
  25. #define WOLFSSL_RENESAS_RX65N
  26. /*-- Renesas TSIP usage and its version ---------------------------------------
  27. *
  28. * "WOLFSSL_RENESAS_TSIP" definition makes wolfSSL to use H/W acceleration
  29. * for cipher operations.
  30. * TSIP definition asks to have its version number.
  31. * "WOLFSSL_RENESAS_TSIP_VER" takes following value:
  32. * 106: TSIPv1.06
  33. * 109: TSIPv1.09
  34. * 113: TSIPv1.13
  35. * 114: TSIPv1.14
  36. * 115: TSIPv1.15
  37. *----------------------------------------------------------------------------*/
  38. #define WOLFSSL_RENESAS_TSIP
  39. #define WOLFSSL_RENESAS_TSIP_VER 117
  40. /*-- TLS version definitions --------------------------------------------------
  41. *
  42. * wolfSSL supports TLSv1.2 by default. In case you want your system to support
  43. * TLSv1.3, uncomment line below.
  44. *
  45. *----------------------------------------------------------------------------*/
  46. #define WOLFSSL_TLS13
  47. /*-- Operating System related definitions --------------------------------------
  48. *
  49. * In case any real-time OS is used, define its name(e.g. FREERTOS).
  50. * Otherwise, define "SINGLE_THREADED". They are exclusive each other.
  51. *
  52. *----------------------------------------------------------------------------*/
  53. #define SINGLE_THREADED
  54. /*#define FREERTOS*/
  55. /*-- Compiler related definitions ---------------------------------------------
  56. *
  57. * CC-RX is C99 compliant, but may not provide the features wolfSSL requires.
  58. * This section defines macros for such cases to avoid build-time or run-time
  59. * failures.
  60. *
  61. *----------------------------------------------------------------------------*/
  62. /* CC-RX does not support variable length array */
  63. #define WOLFSSL_SP_NO_DYN_STACK
  64. /*-- Cipher related definitions -----------------------------------------------
  65. *
  66. *
  67. *----------------------------------------------------------------------------*/
  68. #define NO_DEV_RANDOM
  69. #define NO_MD4
  70. #define WOLFSSL_DH_CONST
  71. #define HAVE_TLS_EXTENSIONS
  72. #define HAVE_AESGCM
  73. #define HAVE_AESCCM
  74. #define HAVE_AES_CBC
  75. #define WOLFSSL_SHA512
  76. #define HAVE_SUPPORTED_CURVES
  77. #define HAVE_ECC
  78. #define HAVE_CURVE25519
  79. #define CURVE25519_SMALL
  80. #define HAVE_ED25519
  81. #define WOLFSSL_STATIC_RSA
  82. /* USE_ECC_CERT
  83. * This macro is for selecting root CA certificate to load, it is valid only
  84. * in example applications. wolfSSL does not refer this macro.
  85. * If you want to use cipher suites including ECDSA authentication in
  86. * the example applications with TSIP, enable this macro.
  87. * In TSIP 1.13 or later version, following cipher suites are
  88. * available:
  89. * - TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256
  90. * - TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SAH256
  91. *
  92. * Note that, this macro disables cipher suites including RSA
  93. * authentication such as:
  94. * - TLS_RSA_WITH_AES_128_CBC_SHA
  95. * - TLS_RSA_WITH_AES_256_CBC_SHA
  96. * - TLS_RSA_WITH_AES_128_CBC_SHA256
  97. * - TLS_RSA_WITH_AES_256_CBC_SHA256
  98. * - TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256
  99. * - TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA256
  100. *
  101. */
  102. #define USE_ECC_CERT
  103. /* In this example application, Root CA cert buffer named
  104. * "ca_ecc_cert_der_256" is used under the following macro definition
  105. * for ECDSA.
  106. */
  107. #define USE_CERT_BUFFERS_256
  108. /* In this example application, Root CA cert buffer named
  109. * "ca_cert_der_2048" is used under the following macro definition
  110. * for RSA authentication.
  111. */
  112. #define USE_CERT_BUFFERS_2048
  113. /*-- Misc definitions ---------------------------------------------------------
  114. *
  115. *
  116. *----------------------------------------------------------------------------*/
  117. #define SIZEOF_LONG_LONG 8
  118. /*#define WOLFSSL_STATIC_MEMORY*/
  119. #if defined(WOLFSSL_STATIC_MEMORY)
  120. #define USE_FAST_MATH
  121. #else
  122. #define WOLFSSL_SMALL_STACK
  123. #endif /* WOLFSSL_STATIC_MEMORY */
  124. /*
  125. * -- "NO_ASN_TIME" macro is to avoid certificate expiration validation --
  126. *
  127. * Note. In your actual products, do not forget to comment-out
  128. * "NO_ASN_TIME" macro. And prepare time function to get calendar time,
  129. * otherwise, certificate expiration validation will not work.
  130. */
  131. /*#define NO_ASN_TIME*/
  132. #define NO_MAIN_DRIVER
  133. #define BENCH_EMBEDDED
  134. #define NO_WOLFSSL_DIR
  135. #define WOLFSSL_NO_CURRDIR
  136. #define NO_FILESYSTEM
  137. #define WOLFSSL_LOG_PRINTF
  138. #define WOLFSSL_HAVE_MIN
  139. #define WOLFSSL_HAVE_MAX
  140. #define NO_WRITEV
  141. #define WOLFSSL_USER_IO
  142. #define WOLFSSL_USER_CURRTIME /* for benchmark */
  143. #define TIME_OVERRIDES
  144. #define XTIME time
  145. #define WOLFSSL_GMTIME
  146. #define XGMTIME(c,t) gmtime(c)
  147. #define USE_WOLF_SUSECONDS_T
  148. #define USE_WOLF_TIMEVAL_T
  149. #define WC_RSA_BLINDING
  150. #define TFM_TIMING_RESISTANT
  151. #define ECC_TIMING_RESISTANT
  152. /*-- Debugging options ------------------------------------------------------
  153. *
  154. * "DEBUG_WOLFSSL" definition enables log to output into stdout.
  155. * Note: wolfSSL_Debugging_ON() must be called just after wolfSSL_Init().
  156. *----------------------------------------------------------------------------*/
  157. /*#define DEBUG_WOLFSSL*/
  158. /*-- Definitions for functionality negation -----------------------------------
  159. *
  160. *
  161. *----------------------------------------------------------------------------*/
  162. /*#define NO_RENESAS_TSIP_CRYPT*/
  163. /*#define NO_WOLFSSL_RENESAS_TSIP_TLS_SESSION*/
  164. #if defined(WOLFCRYPT_ONLY)
  165. #undef WOLFSSL_RENESAS_TSIP
  166. #endif
  167. /*-- Consistency checking between definitions ---------------------------------
  168. *
  169. *
  170. *----------------------------------------------------------------------------*/
  171. /*-- TSIP TLS specific definitions --*/
  172. #if defined(WOLFSSL_RENESAS_TSIP)
  173. #if !defined(WOLFSSL_RENESAS_TSIP_VER)
  174. #error "WOLFSSL_RENESAS_TSIP_VER is required to be defined and have value"
  175. #endif
  176. #endif
  177. /*-- Complementary definitions ------------------------------------------------
  178. *
  179. *
  180. *----------------------------------------------------------------------------*/
  181. #if defined(WOLFSSL_RENESAS_TSIP)
  182. /*-- TSIP TLS and/or CRYPTONLY Definition --------------------------------*/
  183. /* Enable TSIP TLS (default)
  184. * TSIP CRYPTONLY is also enabled.
  185. * Disable TSIP TLS
  186. * TSIP CRYPTONLY is only enabled.
  187. */
  188. #define WOLFSSL_RENESAS_TSIP_TLS
  189. #if !defined(NO_RENESAS_TSIP_CRYPT)
  190. #define WOLFSSL_RENESAS_TSIP_CRYPTONLY
  191. #define HAVE_PK_CALLBACKS
  192. #define WOLF_CRYPTO_CB
  193. #if defined(WOLFSSL_RENESAS_TSIP_TLS)
  194. #define WOLFSSL_RENESAS_TSIP_TLS_AES_CRYPT
  195. #define WOLF_PRIVATE_KEY_ID
  196. #endif
  197. #endif
  198. #if !defined(WOLFSSL_RENESAS_TSIP_TLS) && \
  199. defined(WOLFSSL_RENESAS_TSIP_CRYPTONLY)
  200. # undef WOLFSSL_RENESAS_TSIP_TLS
  201. # undef WOLFSSL_RENESAS_TSIP_CRYPT
  202. #endif
  203. #else
  204. #define OPENSSL_EXTRA
  205. #define WOLFSSL_GENSEED_FORTEST /* Warning: define your own seed gen */
  206. #endif
  207. /*-- TLS version and required definitions --*/
  208. #if defined(WOLFSSL_TLS13)
  209. #define HAVE_FFDHE_2048
  210. #define HAVE_HKDF
  211. #define WC_RSA_PSS
  212. #endif
  213. #define XSTRCASECMP(s1,s2) strcmp((s1),(s2))
  214. #if !defined(WOLFSSL_RENESAS_TSIP_TLS)
  215. #define min(x,y) ((x)<(y)?(x):(y))
  216. #endif