blob: 72a03608c4e80b2b4a345013a9abb01d97fbe365 [file] [log] [blame]
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +02001/*
2 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +02003 * Distinguishing features:
4 * - no bignum, no PK, no X509
5 * - fully modern and secure (provided the pre-shared keys have high entropy)
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +02006 * - very low record overhead with CCM-8
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +02007 * - optimized for low RAM usage
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +02008 *
9 * See README.txt for usage instructions.
10 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020011#ifndef MBEDTLS_CONFIG_H
12#define MBEDTLS_CONFIG_H
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020013
14/* System support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020015//#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */
16/* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020017
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000018/* mbed TLS feature support */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020019#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
20#define MBEDTLS_SSL_PROTO_TLS1_2
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020021
Manuel Pégourié-Gonnardb4fe3cb2015-01-22 16:11:05 +000022/* mbed TLS modules */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020023#define MBEDTLS_AES_C
24#define MBEDTLS_CCM_C
25#define MBEDTLS_CIPHER_C
26#define MBEDTLS_CTR_DRBG_C
27#define MBEDTLS_ENTROPY_C
28#define MBEDTLS_MD_C
29#define MBEDTLS_NET_C
30#define MBEDTLS_SHA256_C
31#define MBEDTLS_SSL_CLI_C
32#define MBEDTLS_SSL_SRV_C
33#define MBEDTLS_SSL_TLS_C
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020034
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020035/* Save RAM at the expense of ROM */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020036#define MBEDTLS_AES_ROM_TABLES
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020037
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020038/* Save some RAM by adjusting to your exact needs */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020039#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020040
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020041/*
42 * You should adjust this to the exact number of sources you're using: default
Manuel Pégourié-Gonnard66e20c62014-06-24 17:47:40 +020043 * is the "platform_entropy_poll" source, but you may want to add other ones
44 * Minimum is 2 for the entropy test suite.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020045 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020046#define MBEDTLS_ENTROPY_MAX_SOURCES 2
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020047
48/*
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020049 * Use only CCM_8 ciphersuites, and
50 * save ROM and a few bytes of RAM by specifying our own ciphersuite list
51 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020052#define MBEDTLS_SSL_CIPHERSUITES \
53 MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \
54 MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8
Manuel Pégourié-Gonnardac7dd332014-07-03 16:17:59 +020055
Manuel Pégourié-Gonnardcc10f4d2014-06-30 19:22:44 +020056/*
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020057 * Save RAM at the expense of interoperability: do this only if you control
Manuel Pégourié-Gonnard7f809972015-03-09 17:05:11 +000058 * both ends of the connection! (See comments in "mbedtls/ssl.h".)
Manuel Pégourié-Gonnarde38eb0b2014-06-24 17:30:05 +020059 * The optimal size here depends on the typical size of records.
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020060 */
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020061#define MBEDTLS_SSL_MAX_CONTENT_LEN 512
Manuel Pégourié-Gonnard0ac844c2014-06-24 16:30:49 +020062
Manuel Pégourié-Gonnard1a74a262014-06-24 15:51:32 +020063#include "check_config.h"
64
Manuel Pégourié-Gonnard2cf5a7c2015-04-08 12:49:31 +020065#endif /* MBEDTLS_CONFIG_H */