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