2
0

user_settings.h 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  1. /* user_settings.h
  2. *
  3. * Copyright (C) 2006-2024 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. /* Example build settings for Infineon Modus Toolbox */
  22. /* Enables wolfSSL TLS v1.2-v1.3 and TPM support */
  23. /* SHA-1, SHA-2, AES CBC/GCM, ECDHE, ECDSA, RSA, HMAC, HKDF */
  24. #ifndef WOLF_USER_SETTINGS_TPM_H
  25. #define WOLF_USER_SETTINGS_TPM_H
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29. /* Platform / Porting */
  30. #define NO_FILESYSTEM /* File system disable */
  31. #define SINGLE_THREADED /* No threading */
  32. #define WOLFSSL_USER_IO /* user recv/send callbacks for network IO */
  33. #define NO_WRITEV
  34. #define NO_MAIN_DRIVER
  35. #define WOLFSSL_IGNORE_FILE_WARN /* ignore file include warnings */
  36. #define WOLFSSL_SMALL_STACK /* limit stack usage */
  37. #define BENCH_EMBEDDED
  38. /* TLS (allow TLS v1.3 or v1.2) */
  39. #define WOLFSSL_TLS13
  40. //#define WOLFSSL_NO_TLS12
  41. #define NO_OLD_TLS
  42. #define WOLFSSL_EITHER_SIDE /* allow context to be created for either server or client */
  43. #define HAVE_TLS_EXTENSIONS
  44. #define HAVE_SUPPORTED_CURVES
  45. #define HAVE_SERVER_RENEGOTIATION_INFO
  46. #define HAVE_ENCRYPT_THEN_MAC
  47. #ifdef WOLFSSL_TLS13
  48. #define HAVE_HKDF
  49. #define WC_RSA_PSS
  50. #define WOLFSSL_PSS_LONG_SALT
  51. #endif
  52. /* Enable crypto callbacks - for TPM offloading */
  53. #define WOLF_CRYPTO_CB
  54. /* Enable SP math all (sp_int.c) with multi-precision support */
  55. #define WOLFSSL_SP_MATH_ALL
  56. #if 1
  57. /* Single Precision math for ECC 256 and RSA 2048 */
  58. #define WOLFSSL_HAVE_SP_RSA
  59. #define WOLFSSL_HAVE_SP_ECC
  60. #define WOLFSSL_SP_SMALL
  61. #endif
  62. #if 0
  63. /* only single precision math */
  64. #define WOLFSSL_SP_MATH
  65. #endif
  66. /* Enable hardening (timing resistance) */
  67. #define TFM_TIMING_RESISTANT
  68. #define ECC_TIMING_RESISTANT
  69. #define WC_RSA_BLINDING
  70. /* Enable PRNG (SHA2-256) */
  71. #define HAVE_HASHDRBG
  72. /* Asymmetric */
  73. #if 1 /* RSA - needed to encrypt salt */
  74. #undef NO_RSA
  75. #ifdef USE_LOW_RESOURCE
  76. #define WOLFSSL_RSA_PUBLIC_ONLY
  77. #define WOLFSSL_RSA_VERIFY_INLINE
  78. #define NO_CHECK_PRIVATE_KEY
  79. #endif
  80. #else
  81. #define NO_RSA
  82. #endif
  83. #if 1 /* ECC - needed for encrypt ECC salt */
  84. #define HAVE_ECC
  85. #define ECC_USER_CURVES /* default to only SECP256R1 */
  86. #endif
  87. #if 0 /* DH - TPM doesn't support it */
  88. #undef NO_DH
  89. #define HAVE_FFDHE_2048
  90. #define HAVE_DH_DEFAULT_PARAMS
  91. #else
  92. #define NO_DH
  93. #endif
  94. /* Symmetric Hash */
  95. #undef NO_SHA /* allow SHA-1 */
  96. #undef NO_SHA256 /* allow SHA2-256 */
  97. #define WOLFSSL_SHA384
  98. #define WOLFSSL_SHA512
  99. /* Symmetric Cipher */
  100. #define WOLFSSL_AES_CFB
  101. #define HAVE_AES_DECRYPT
  102. #define HAVE_AES_KEYWRAP
  103. #define WOLFSSL_AES_DIRECT
  104. #define HAVE_AESGCM
  105. #define GCM_TABLE_4BIT
  106. /* Features */
  107. #define WOLFSSL_ASN_TEMPLATE
  108. #define WOLFSSL_CERT_GEN
  109. #define WOLFSSL_CERT_REQ
  110. #define WOLFSSL_CERT_EXT
  111. #define HAVE_PKCS7
  112. #define HAVE_X963_KDF
  113. #define WOLFSSL_BASE64_ENCODE
  114. #if 1
  115. #define HAVE_SESSION_TICKETS
  116. #define SMALL_SESSION_CACHE
  117. #else
  118. #define NO_SESSION_CACHE
  119. #endif
  120. /* Disables */
  121. #define NO_PKCS8
  122. #define NO_PKCS12
  123. #define NO_PWDBASED
  124. #define NO_DSA
  125. #define NO_DES3
  126. #define NO_RC4
  127. #define NO_PSK
  128. #define NO_MD4
  129. #define NO_MD5
  130. #define WOLFSSL_NO_SHAKE128
  131. #define WOLFSSL_NO_SHAKE256
  132. /* Logging */
  133. #ifdef ENABLE_SECURE_SOCKETS_LOGS
  134. #define DEBUG_WOLFSSL
  135. #else
  136. #define NO_ERROR_STRINGS
  137. #endif
  138. #ifdef __cplusplus
  139. }
  140. #endif
  141. #endif /* WOLF_USER_SETTINGS_TPM_H */