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 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 24 | * Distinguishing features: |
| 25 | * - no bignum, no PK, no X509 |
| 26 | * - fully modern and secure (provided the pre-shared keys have high entropy) |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 27 | * - very low record overhead with CCM-8 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 28 | * - optimized for low RAM usage |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 29 | * |
| 30 | * See README.txt for usage instructions. |
| 31 | */ |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 32 | |
| 33 | /* System support */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 34 | //#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */ |
| 35 | /* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */ |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 36 | |
Manuel Pégourié-Gonnard | b4fe3cb | 2015-01-22 16:11:05 +0000 | [diff] [blame] | 37 | /* mbed TLS feature support */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 38 | #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
| 39 | #define MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 40 | |
Manuel Pégourié-Gonnard | b4fe3cb | 2015-01-22 16:11:05 +0000 | [diff] [blame] | 41 | /* mbed TLS modules */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 42 | #define MBEDTLS_AES_C |
| 43 | #define MBEDTLS_CCM_C |
| 44 | #define MBEDTLS_CIPHER_C |
| 45 | #define MBEDTLS_CTR_DRBG_C |
| 46 | #define MBEDTLS_ENTROPY_C |
| 47 | #define MBEDTLS_MD_C |
| 48 | #define MBEDTLS_NET_C |
Mateusz Starzyk | 9d2d6c9 | 2021-05-18 15:54:20 +0200 | [diff] [blame] | 49 | /* The library does not currently support enabling SHA-224 without SHA-256. |
| 50 | * A future version of the library will have this option disabled |
| 51 | * by default. */ |
Mateusz Starzyk | e3c48b4 | 2021-04-19 16:46:28 +0200 | [diff] [blame] | 52 | #define MBEDTLS_SHA224_C |
Mateusz Starzyk | 6326a8d | 2021-05-10 13:51:53 +0200 | [diff] [blame] | 53 | #define MBEDTLS_SHA256_C |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 54 | #define MBEDTLS_SSL_CLI_C |
| 55 | #define MBEDTLS_SSL_SRV_C |
| 56 | #define MBEDTLS_SSL_TLS_C |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 57 | |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 58 | /* Save RAM at the expense of ROM */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 59 | #define MBEDTLS_AES_ROM_TABLES |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 60 | |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 61 | /* Save some RAM by adjusting to your exact needs */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 62 | #define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */ |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 63 | |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 64 | /* |
| 65 | * You should adjust this to the exact number of sources you're using: default |
Manuel Pégourié-Gonnard | 66e20c6 | 2014-06-24 17:47:40 +0200 | [diff] [blame] | 66 | * is the "platform_entropy_poll" source, but you may want to add other ones |
| 67 | * Minimum is 2 for the entropy test suite. |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 68 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 69 | #define MBEDTLS_ENTROPY_MAX_SOURCES 2 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 70 | |
| 71 | /* |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 72 | * Use only CCM_8 ciphersuites, and |
| 73 | * save ROM and a few bytes of RAM by specifying our own ciphersuite list |
| 74 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 75 | #define MBEDTLS_SSL_CIPHERSUITES \ |
| 76 | MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \ |
| 77 | MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 78 | |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 79 | /* |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 80 | * 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] | 81 | * 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] | 82 | * 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] | 83 | */ |
David Horstmann | 95d516f | 2021-05-04 18:36:56 +0100 | [diff] [blame] | 84 | #define MBEDTLS_SSL_IN_CONTENT_LEN 1024 |
| 85 | #define MBEDTLS_SSL_OUT_CONTENT_LEN 1024 |