blob: aee10b86fe90b07eadd89d270d7cfc3735ca5e04 [file] [log] [blame] [raw]
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +02001/*
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +02002 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
3 *
4 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
Manuel Pégourié-Gonnard37ff1402015-09-04 14:21:07 +02005 * SPDX-License-Identifier: Apache-2.0
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License"); you may
8 * not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
15 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +020018 *
19 * This file is part of mbed TLS (https://tls.mbed.org)
Manuel Pégourié-Gonnard8119dad2015-08-06 10:59:26 +020020 */
21/*
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020022 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020023 * Distinguishing features:
24 * - no bignum, no PK, no X509
25 * - fully modern and secure (provided the pre-shared keys have high entropy)
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020026 * - very low record overhead with CCM-8
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020027 * - optimized for low RAM usage
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020028 *
29 * See README.txt for usage instructions.
30 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020031#ifndef MBEDTLS_CONFIG_H
32#define MBEDTLS_CONFIG_H
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020033
34/* System support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020035//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */
36/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020037
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000038/* mbed TLS feature support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020039#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
40#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020041
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000042/* mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020043#define MBEDTLS_AES_C
44#define MBEDTLS_CCM_C
45#define MBEDTLS_CIPHER_C
46#define MBEDTLS_CTR_DRBG_C
47#define MBEDTLS_ENTROPY_C
48#define MBEDTLS_MD_C
49#define MBEDTLS_NET_C
50#define MBEDTLS_SHA256_C
51#define MBEDTLS_SSL_CLI_C
52#define MBEDTLS_SSL_SRV_C
53#define MBEDTLS_SSL_TLS_C
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020054
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020055/* Save RAM at the expense of ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020056#define MBEDTLS_AES_ROM_TABLES
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020057
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020058/* Save some RAM by adjusting to your exact needs */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020059#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020060
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020061/*
62 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard66e20c62014-06-24 17:47:40 +020063 * is the "platform_entropy_poll" source, but you may want to add other ones
64 * Minimum is 2 for the entropy test suite.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020065 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020066#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020067
68/*
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020069 * Use only CCM_8 ciphersuites, and
70 * save ROM and a few bytes of RAM by specifying our own ciphersuite list
71 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020072#define MBEDTLS_SSL_CIPHERSUITES \
73 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
74 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020075
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020076/*
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020077 * Save RAM at the expense of interoperability: do this only if you control
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000078 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020079 * The optimal size here depends on the typical size of records.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020080 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020081#define MBEDTLS_SSL_MAX_CONTENT_LEN 512
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020082
Pascal Bach5e4c2062015-09-15 21:38:12 +020083#include "mbedtls/check_config.h"
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020084
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020085#endif /* MBEDTLS_CONFIG_H */