config-ccm-psk-tls1_2.h 2.8 KB

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