config-coap.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /*
  2. * Minimal configuration for DTLS 1.2 with PSK and AES-CCM ciphersuites
  3. *
  4. * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
  5. * SPDX-License-Identifier: Apache-2.0
  6. *
  7. * Licensed under the Apache License, Version 2.0 (the "License"); you may
  8. * not use this file except in compliance with the License.
  9. * You may obtain a copy of the License at
  10. *
  11. * http://www.apache.org/licenses/LICENSE-2.0
  12. *
  13. * Unless required by applicable law or agreed to in writing, software
  14. * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
  15. * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  16. * See the License for the specific language governing permissions and
  17. * limitations under the License.
  18. *
  19. * This file is part of mbed TLS (https://tls.mbed.org)
  20. */
  21. /*
  22. * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
  23. * Distinguishing features:
  24. * - no bignum, no PK, no X509
  25. * - fully modern and secure (provided the pre-shared keys have high entropy)
  26. * - very low record overhead with CCM-8
  27. * - optimized for low RAM usage
  28. *
  29. * See README.txt for usage instructions.
  30. */
  31. #ifndef MBEDTLS_CONFIG_H
  32. #define MBEDTLS_CONFIG_H
  33. /* System support */
  34. #define MBEDTLS_PLATFORM_C
  35. #define MBEDTLS_PLATFORM_MEMORY
  36. #define MBEDTLS_MEMORY_BUFFER_ALLOC_C
  37. #define MBEDTLS_PLATFORM_NO_STD_FUNCTIONS
  38. #define MBEDTLS_PLATFORM_EXIT_ALT
  39. #define MBEDTLS_NO_PLATFORM_ENTROPY
  40. #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
  41. #define MBEDTLS_PLATFORM_PRINTF_ALT
  42. #if defined(CONFIG_MBEDTLS_TEST)
  43. #define MBEDTLS_SELF_TEST
  44. #define MBEDTLS_DEBUG_C
  45. #else
  46. #define MBEDTLS_ENTROPY_C
  47. #endif
  48. /* mbed TLS feature support */
  49. #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
  50. #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
  51. #define MBEDTLS_SSL_PROTO_TLS1_2
  52. #define MBEDTLS_SSL_PROTO_DTLS
  53. #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
  54. #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
  55. /* mbed TLS modules */
  56. #define MBEDTLS_AES_C
  57. #define MBEDTLS_CCM_C
  58. #define MBEDTLS_CIPHER_C
  59. #define MBEDTLS_CTR_DRBG_C
  60. #define MBEDTLS_ENTROPY_C
  61. #define MBEDTLS_MD_C
  62. #define MBEDTLS_SHA256_C
  63. #define MBEDTLS_SSL_COOKIE_C
  64. #define MBEDTLS_SSL_CLI_C
  65. #define MBEDTLS_SSL_SRV_C
  66. #define MBEDTLS_SSL_TLS_C
  67. /* Save RAM at the expense of ROM */
  68. #define MBEDTLS_AES_ROM_TABLES
  69. /* Save some RAM by adjusting to your exact needs */
  70. #define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
  71. /*
  72. * You should adjust this to the exact number of sources you're using: default
  73. * is the "platform_entropy_poll" source, but you may want to add other ones
  74. * Minimum is 2 for the entropy test suite.
  75. */
  76. #define MBEDTLS_ENTROPY_MAX_SOURCES 2
  77. /*
  78. * Use only CCM_8 ciphersuites, and
  79. * save ROM and a few bytes of RAM by specifying our own ciphersuite list
  80. */
  81. #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
  82. /*
  83. * Allow to save RAM at the expense of interoperability: do this only if you
  84. * control both ends of the connection! (See comments in "mbedtls/ssl.h".)
  85. * The optimal size here depends on the typical size of records.
  86. */
  87. #define MBEDTLS_SSL_MAX_CONTENT_LEN CONFIG_MBEDTLS_SSL_MAX_CONTENT_LEN
  88. #include "mbedtls/check_config.h"
  89. #endif /* MBEDTLS_CONFIG_H */