Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 1 | /** |
| 2 | * \file config-ccm-psk-tls1_2.h |
Manuel Pégourié-Gonnard | 8119dad | 2015-08-06 10:59:26 +0200 | [diff] [blame] | 3 | * |
Darryl Green | a40a101 | 2018-01-05 15:33:17 +0000 | [diff] [blame] | 4 | * \brief Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites |
| 5 | */ |
| 6 | /* |
Bence Szépkúti | 1e14827 | 2020-08-07 13:07:28 +0200 | [diff] [blame] | 7 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 7ff7965 | 2023-11-03 12:04:52 +0000 | [diff] [blame] | 8 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Manuel Pégourié-Gonnard | 8119dad | 2015-08-06 10:59:26 +0200 | [diff] [blame] | 9 | */ |
| 10 | /* |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 11 | * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites |
Gilles Peskine | a132beb | 2022-02-25 19:20:36 +0100 | [diff] [blame] | 12 | * |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 13 | * Distinguishing features: |
Gilles Peskine | e719d17 | 2022-04-05 21:52:14 +0200 | [diff] [blame] | 14 | * - Optimized for small code size, low bandwidth (on a reliable transport), |
Gilles Peskine | a132beb | 2022-02-25 19:20:36 +0100 | [diff] [blame] | 15 | * and low RAM usage. |
| 16 | * - No asymmetric cryptography (no certificates, no Diffie-Hellman key |
| 17 | * exchange). |
| 18 | * - Fully modern and secure (provided the pre-shared keys are generated and |
| 19 | * stored securely). |
| 20 | * - Very low record overhead with CCM-8. |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 21 | * |
| 22 | * See README.txt for usage instructions. |
| 23 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 24 | #ifndef MBEDTLS_CONFIG_H |
| 25 | #define MBEDTLS_CONFIG_H |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 26 | |
| 27 | /* System support */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 28 | //#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */ |
| 29 | /* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */ |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 30 | |
Gilles Peskine | a132beb | 2022-02-25 19:20:36 +0100 | [diff] [blame] | 31 | /* Mbed TLS modules */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 32 | #define MBEDTLS_AES_C |
| 33 | #define MBEDTLS_CCM_C |
| 34 | #define MBEDTLS_CIPHER_C |
| 35 | #define MBEDTLS_CTR_DRBG_C |
| 36 | #define MBEDTLS_ENTROPY_C |
| 37 | #define MBEDTLS_MD_C |
| 38 | #define MBEDTLS_NET_C |
| 39 | #define MBEDTLS_SHA256_C |
| 40 | #define MBEDTLS_SSL_CLI_C |
| 41 | #define MBEDTLS_SSL_SRV_C |
| 42 | #define MBEDTLS_SSL_TLS_C |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 43 | |
Gilles Peskine | a132beb | 2022-02-25 19:20:36 +0100 | [diff] [blame] | 44 | /* TLS protocol feature support */ |
| 45 | #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
| 46 | #define MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 47 | |
| 48 | /* |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 49 | * Use only CCM_8 ciphersuites, and |
| 50 | * save ROM and a few bytes of RAM by specifying our own ciphersuite list |
| 51 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 52 | #define MBEDTLS_SSL_CIPHERSUITES \ |
Gilles Peskine | 1b6c09a | 2023-01-11 14:52:35 +0100 | [diff] [blame] | 53 | MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \ |
| 54 | MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 55 | |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 56 | /* |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 57 | * Save RAM at the expense of interoperability: do this only if you control |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 58 | * both ends of the connection! (See comments in "mbedtls/ssl.h".) |
Manuel Pégourié-Gonnard | e38eb0b | 2014-06-24 17:30:05 +0200 | [diff] [blame] | 59 | * The optimal size here depends on the typical size of records. |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 60 | */ |
Manuel Pégourié-Gonnard | e12f0ac | 2018-06-19 14:54:11 +0200 | [diff] [blame] | 61 | #define MBEDTLS_SSL_MAX_CONTENT_LEN 1024 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 62 | |
Gilles Peskine | a132beb | 2022-02-25 19:20:36 +0100 | [diff] [blame] | 63 | /* Save RAM at the expense of ROM */ |
| 64 | #define MBEDTLS_AES_ROM_TABLES |
| 65 | |
| 66 | /* Save some RAM by adjusting to your exact needs */ |
| 67 | #define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */ |
| 68 | |
| 69 | /* |
| 70 | * You should adjust this to the exact number of sources you're using: default |
| 71 | * is the "platform_entropy_poll" source, but you may want to add other ones |
| 72 | * Minimum is 2 for the entropy test suite. |
| 73 | */ |
| 74 | #define MBEDTLS_ENTROPY_MAX_SOURCES 2 |
| 75 | |
Andrzej Kurek | 19e83fa | 2022-01-17 16:05:43 +0100 | [diff] [blame] | 76 | /* These defines are present so that the config modifying scripts can enable |
| 77 | * them during tests/scripts/test-ref-configs.pl */ |
| 78 | //#define MBEDTLS_USE_PSA_CRYPTO |
| 79 | //#define MBEDTLS_PSA_CRYPTO_C |
| 80 | |
Gilles Peskine | dcb13af | 2022-02-25 21:00:16 +0100 | [diff] [blame] | 81 | /* Error messages and TLS debugging traces |
| 82 | * (huge code size increase, needed for tests/ssl-opt.sh) */ |
| 83 | //#define MBEDTLS_DEBUG_C |
| 84 | //#define MBEDTLS_ERROR_C |
| 85 | |
Pascal Bach | 5e4c206 | 2015-09-15 21:38:12 +0200 | [diff] [blame] | 86 | #include "mbedtls/check_config.h" |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 87 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 88 | #endif /* MBEDTLS_CONFIG_H */ |