blob: 5fb67fe4b86f3e922fb3f2efe1113f157bab77c4 [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
Dave Rodgman16799db2023-11-02 19:47:20 +00008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +02009 */
10/*
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020011 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
Gilles Peskine7451e5a2022-02-25 19:20:36 +010012 *
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020013 * Distinguishing features:
Gilles Peskined725bf72022-04-05 21:52:14 +020014 * - Optimized for small code size, low bandwidth (on a reliable transport),
Gilles Peskine7451e5a2022-02-25 19:20:36 +010015 * 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é-Gonnard1a74a262014-06-24 15:51:32 +020021 *
22 * See README.txt for usage instructions.
23 */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020024
Gilles Peskine7451e5a2022-02-25 19:20:36 +010025/* Mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020026#define MBEDTLS_NET_C
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020027#define MBEDTLS_SSL_CLI_C
28#define MBEDTLS_SSL_SRV_C
29#define MBEDTLS_SSL_TLS_C
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020030
Gilles Peskine7451e5a2022-02-25 19:20:36 +010031/* TLS protocol feature support */
32#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
33#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020034
35/*
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020036 * Use only CCM_8 ciphersuites, and
37 * save ROM and a few bytes of RAM by specifying our own ciphersuite list
38 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020039#define MBEDTLS_SSL_CIPHERSUITES \
Gilles Peskine449bd832023-01-11 14:50:10 +010040 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
41 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020042
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020043/*
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020044 * Save RAM at the expense of interoperability: do this only if you control
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000045 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020046 * The optimal size here depends on the typical size of records.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020047 */
Gilles Peskine7451e5a2022-02-25 19:20:36 +010048#define MBEDTLS_SSL_IN_CONTENT_LEN 1024
David Horstmann95d516f2021-05-04 18:36:56 +010049#define MBEDTLS_SSL_OUT_CONTENT_LEN 1024
Andrzej Kurek01005b92022-01-17 15:32:02 +010050
Gilles Peskine7451e5a2022-02-25 19:20:36 +010051
52/* Save some RAM by adjusting to your exact needs */
53#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
54
Gilles Peskinec6d197b2022-02-25 21:00:16 +010055/* Error messages and TLS debugging traces
56 * (huge code size increase, needed for tests/ssl-opt.sh) */
57//#define MBEDTLS_DEBUG_C
58//#define MBEDTLS_ERROR_C