mbedtls_config.h 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166
  1. /**
  2. *
  3. * Portions COPYRIGHT 2016 STMicroelectronics
  4. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  5. *
  6. ******************************************************************************
  7. * @file mbedtls_config.h
  8. * @author MCD Application Team
  9. * @version V1.1.0
  10. * @date 17-February-2017
  11. * @brief the mbedtls custom config header file.
  12. ******************************************************************************
  13. * @attention
  14. *
  15. * <h2><center>&copy; COPYRIGHT(c) 2017 STMicroelectronics</center></h2>
  16. *
  17. * Redistribution and use in source and binary forms, with or without modification,
  18. * are permitted provided that the following conditions are met:
  19. * 1. Redistributions of source code must retain the above copyright notice,
  20. * this list of conditions and the following disclaimer.
  21. * 2. Redistributions in binary form must reproduce the above copyright notice,
  22. * this list of conditions and the following disclaimer in the documentation
  23. * and/or other materials provided with the distribution.
  24. * 3. Neither the name of STMicroelectronics nor the names of its contributors
  25. * may be used to endorse or promote products derived from this software
  26. * without specific prior written permission.
  27. *
  28. * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  29. * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  30. * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  31. * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  32. * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  33. * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  34. * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  35. * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  36. * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  37. * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  38. *
  39. ******************************************************************************
  40. */
  41. #ifndef MBEDTLS_CONFIG_H
  42. #define MBEDTLS_CONFIG_H
  43. /* System support */
  44. #define MBEDTLS_HAVE_ASM
  45. #define MBEDTLS_HAVE_TIME
  46. /* mbed TLS feature support */
  47. #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
  48. #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
  49. #define MBEDTLS_SSL_PROTO_TLS1_2
  50. //#define MBEDTLS_SSL_PROTO_SSL3
  51. //#define MBEDTLS_SSL_PROTO_TLS1
  52. /* mbed TLS modules */
  53. #define MBEDTLS_AES_C
  54. #define MBEDTLS_ASN1_PARSE_C
  55. #define MBEDTLS_ASN1_WRITE_C
  56. #define MBEDTLS_BIGNUM_C
  57. #define MBEDTLS_CIPHER_C
  58. #define MBEDTLS_CTR_DRBG_C
  59. #define MBEDTLS_ECDH_C
  60. #define MBEDTLS_ECDSA_C
  61. #define MBEDTLS_ECP_C
  62. #define MBEDTLS_ENTROPY_C
  63. #define MBEDTLS_GCM_C
  64. #define MBEDTLS_MD_C
  65. #define MBEDTLS_NET_C
  66. #define MBEDTLS_OID_C
  67. #define MBEDTLS_PK_C
  68. #define MBEDTLS_PK_PARSE_C
  69. #define MBEDTLS_SHA256_C
  70. #define MBEDTLS_SSL_CLI_C
  71. #define MBEDTLS_SSL_SRV_C
  72. #define MBEDTLS_SSL_TLS_C
  73. #define MBEDTLS_X509_CRT_PARSE_C
  74. #define MBEDTLS_X509_USE_C
  75. #define MBEDTLS_MD4_C
  76. #define MBEDTLS_X509_CRL_PARSE_C
  77. // User
  78. #define MBEDTLS_PKCS1_V15
  79. #define MBEDTLS_DHM_C
  80. #define MBEDTLS_SHA1_C
  81. #define MBEDTLS_MD5_C
  82. #define MBEDTLS_CIPHER_MODE_CBC
  83. #define MBEDTLS_DES_C
  84. /* For test certificates */
  85. #define MBEDTLS_BASE64_C
  86. #define MBEDTLS_CERTS_C
  87. #define MBEDTLS_PEM_PARSE_C
  88. /* Save RAM at the expense of ROM */
  89. #define MBEDTLS_AES_ROM_TABLES
  90. /* Save RAM by adjusting to our exact needs */
  91. //#define MBEDTLS_ECP_MAX_BITS 384
  92. //#define MBEDTLS_MPI_MAX_SIZE 48 // 384 bits is 48 bytes
  93. //#define MBEDTLS_ECP_MAX_BITS 2048
  94. //#define MBEDTLS_MPI_MAX_SIZE 256 // 384 bits is 48 bytes
  95. /* Save RAM at the expense of speed, see ecp.h */
  96. #define MBEDTLS_ECP_WINDOW_SIZE 2
  97. #define MBEDTLS_ECP_FIXED_POINT_OPTIM 0
  98. /* Significant speed benefit at the expense of some ROM */
  99. #define MBEDTLS_ECP_NIST_OPTIM
  100. /*
  101. * You should adjust this to the exact number of sources you're using: default
  102. * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
  103. * Minimum is 2 for the entropy test suite.
  104. */
  105. #define MBEDTLS_ENTROPY_MAX_SOURCES 1
  106. /* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
  107. //#define MBEDTLS_SSL_CIPHERSUITES \
  108. /*
  109. * Save RAM at the expense of interoperability: do this only if you control
  110. * both ends of the connection! (See coments in "mbedtls/ssl.h".)
  111. * The minimum size here depends on the certificate chain used as well as the
  112. * typical size of records.
  113. */
  114. #define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
  115. #define MBEDTLS_CAMELLIA_C
  116. #define MBEDTLS_PLATFORM_C
  117. //#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
  118. #define MBEDTLS_PLATFORM_MEMORY
  119. //#define MBEDTLS_MEMORY_DEBUG
  120. #define MBEDTLS_SELF_TEST
  121. #define MBEDTLS_PLATFORM_PRINTF_MACRO printf
  122. /* Customize the entropy data generation */
  123. #define MBEDTLS_NO_PLATFORM_ENTROPY
  124. #define MBEDTLS_ENTROPY_HARDWARE_ALT
  125. #define MBEDTLS_PLATFORM_TIME_ALT
  126. //#define MBEDTLS_SSL_CBC_RECORD_SPLITTING
  127. // User debug options
  128. //#define MBEDTLS_DEBUG_C
  129. #define DEBUG_LEVEL 3 // 0 No debug
  130. // 1 Error
  131. // 2 State change
  132. // 3 Informational
  133. // 4 Verbose
  134. // User define for create req_cert
  135. #define MBEDTLS_X509_CSR_WRITE_C
  136. #define MBEDTLS_X509_CREATE_C
  137. #define MBEDTLS_PK_WRITE_C
  138. #define MBEDTLS_PEM_WRITE_C
  139. #define UNUSED(x) ((void)(x))
  140. #include "mbedtls/check_config.h"
  141. #endif /* MBEDTLS_CONFIG_H */