blob: 51bb962919e0ef91c98355e488335033ae9e2331 [file] [log] [blame]
Darryl Greena40a1012018-01-05 15:33:17 +00001/**
2 * \file config-ccm-psk-tls1_2.h
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +02003 *
Darryl Greena40a1012018-01-05 15:33:17 +00004 * \brief Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
5 */
6/*
Bence Szépkúti1e148272020-08-07 13:07:28 +02007 * Copyright The Mbed TLS Contributors
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02008 * 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é-Gonnard8119dad2015-08-06 10:59:26 +020021 */
22/*
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020023 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020024 * 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é-Gonnardcc10f4d2014-06-30 19:22:44 +020027 * - very low record overhead with CCM-8
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020028 * - optimized for low RAM usage
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020029 *
30 * See README.txt for usage instructions.
31 */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020032
33/* System support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020034//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */
35/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020036
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000037/* mbed TLS feature support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020038#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
39#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020040
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000041/* mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020042#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 Starzyk9d2d6c92021-05-18 15:54:20 +020049/* 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 Starzyke3c48b42021-04-19 16:46:28 +020052#define MBEDTLS_SHA224_C
Mateusz Starzyk6326a8d2021-05-10 13:51:53 +020053#define MBEDTLS_SHA256_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020054#define MBEDTLS_SSL_CLI_C
55#define MBEDTLS_SSL_SRV_C
56#define MBEDTLS_SSL_TLS_C
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020057
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020058/* Save RAM at the expense of ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#define MBEDTLS_AES_ROM_TABLES
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020060
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020061/* Save some RAM by adjusting to your exact needs */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020062#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020063
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020064/*
65 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard66e20c62014-06-24 17:47:40 +020066 * 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é-Gonnard0ac844c2014-06-24 16:30:49 +020068 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020069#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020070
71/*
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020072 * 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é-Gonnard2cf5a7c2015-04-08 12:49:31 +020075#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é-Gonnardac7dd332014-07-03 16:17:59 +020078
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020079/*
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020080 * Save RAM at the expense of interoperability: do this only if you control
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000081 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020082 * The optimal size here depends on the typical size of records.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020083 */
David Horstmann95d516f2021-05-04 18:36:56 +010084#define MBEDTLS_SSL_IN_CONTENT_LEN 1024
85#define MBEDTLS_SSL_OUT_CONTENT_LEN 1024