blob: f3929aef092ea0488c1923e0b930fe10f54d6839 [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útia2947ac2020-08-19 16:37:36 +02007 * Copyright The Mbed TLS Contributors
Bence Szépkútif744bd72020-06-05 13:02:18 +02008 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
9 *
10 * This file is provided under the Apache License 2.0, or the
11 * GNU General Public License v2.0 or later.
12 *
13 * **********
14 * Apache License 2.0:
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +020015 *
16 * Licensed under the Apache License, Version 2.0 (the "License"); you may
17 * not use this file except in compliance with the License.
18 * You may obtain a copy of the License at
19 *
20 * http://www.apache.org/licenses/LICENSE-2.0
21 *
22 * Unless required by applicable law or agreed to in writing, software
23 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
25 * See the License for the specific language governing permissions and
26 * limitations under the License.
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +020027 *
Bence Szépkútif744bd72020-06-05 13:02:18 +020028 * **********
29 *
30 * **********
31 * GNU General Public License v2.0 or later:
32 *
33 * This program is free software; you can redistribute it and/or modify
34 * it under the terms of the GNU General Public License as published by
35 * the Free Software Foundation; either version 2 of the License, or
36 * (at your option) any later version.
37 *
38 * This program is distributed in the hope that it will be useful,
39 * but WITHOUT ANY WARRANTY; without even the implied warranty of
40 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
41 * GNU General Public License for more details.
42 *
43 * You should have received a copy of the GNU General Public License along
44 * with this program; if not, write to the Free Software Foundation, Inc.,
45 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
46 *
47 * **********
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +020048 */
49/*
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020050 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020051 * Distinguishing features:
52 * - no bignum, no PK, no X509
53 * - fully modern and secure (provided the pre-shared keys have high entropy)
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020054 * - very low record overhead with CCM-8
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020055 * - optimized for low RAM usage
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020056 *
57 * See README.txt for usage instructions.
58 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#ifndef MBEDTLS_CONFIG_H
60#define MBEDTLS_CONFIG_H
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020061
62/* System support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020063//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */
64/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020065
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000066/* mbed TLS feature support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020067#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
68#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020069
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000070/* mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020071#define MBEDTLS_AES_C
72#define MBEDTLS_CCM_C
73#define MBEDTLS_CIPHER_C
74#define MBEDTLS_CTR_DRBG_C
75#define MBEDTLS_ENTROPY_C
76#define MBEDTLS_MD_C
77#define MBEDTLS_NET_C
78#define MBEDTLS_SHA256_C
79#define MBEDTLS_SSL_CLI_C
80#define MBEDTLS_SSL_SRV_C
81#define MBEDTLS_SSL_TLS_C
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020082
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020083/* Save RAM at the expense of ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020084#define MBEDTLS_AES_ROM_TABLES
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020085
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020086/* Save some RAM by adjusting to your exact needs */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020087#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020088
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020089/*
90 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard66e20c62014-06-24 17:47:40 +020091 * is the "platform_entropy_poll" source, but you may want to add other ones
92 * Minimum is 2 for the entropy test suite.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020093 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020094#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020095
96/*
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020097 * Use only CCM_8 ciphersuites, and
98 * save ROM and a few bytes of RAM by specifying our own ciphersuite list
99 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200100#define MBEDTLS_SSL_CIPHERSUITES \
101 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
102 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +0200103
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +0200104/*
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +0200105 * Save RAM at the expense of interoperability: do this only if you control
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +0000106 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +0200107 * The optimal size here depends on the typical size of records.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +0200108 */
Manuel Pégourié-Gonnarde12f0ac2018-06-19 14:54:11 +0200109#define MBEDTLS_SSL_MAX_CONTENT_LEN 1024
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +0200110
Pascal Bach5e4c2062015-09-15 21:38:12 +0200111#include "mbedtls/check_config.h"
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +0200112
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +0200113#endif /* MBEDTLS_CONFIG_H */