Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 1 | /* |
Manuel Pégourié-Gonnard | 8119dad | 2015-08-06 10:59:26 +0200 | [diff] [blame^] | 2 | * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites |
| 3 | * |
| 4 | * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved |
| 5 | * |
| 6 | * This file is part of mbed TLS (https://tls.mbed.org) |
| 7 | * |
| 8 | * This program is free software; you can redistribute it and/or modify |
| 9 | * it under the terms of the GNU General Public License as published by |
| 10 | * the Free Software Foundation; either version 2 of the License, or |
| 11 | * (at your option) any later version. |
| 12 | * |
| 13 | * This program is distributed in the hope that it will be useful, |
| 14 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 15 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 16 | * GNU General Public License for more details. |
| 17 | * |
| 18 | * You should have received a copy of the GNU General Public License along |
| 19 | * with this program; if not, write to the Free Software Foundation, Inc., |
| 20 | * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. |
| 21 | */ |
| 22 | /* |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 23 | * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 24 | * 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é-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 27 | * - very low record overhead with CCM-8 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 28 | * - optimized for low RAM usage |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 29 | * |
| 30 | * See README.txt for usage instructions. |
| 31 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 32 | #ifndef MBEDTLS_CONFIG_H |
| 33 | #define MBEDTLS_CONFIG_H |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 34 | |
| 35 | /* System support */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 36 | //#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */ |
| 37 | /* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */ |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 38 | |
Manuel Pégourié-Gonnard | b4fe3cb | 2015-01-22 16:11:05 +0000 | [diff] [blame] | 39 | /* mbed TLS feature support */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 40 | #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
| 41 | #define MBEDTLS_SSL_PROTO_TLS1_2 |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 42 | |
Manuel Pégourié-Gonnard | b4fe3cb | 2015-01-22 16:11:05 +0000 | [diff] [blame] | 43 | /* mbed TLS modules */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 44 | #define MBEDTLS_AES_C |
| 45 | #define MBEDTLS_CCM_C |
| 46 | #define MBEDTLS_CIPHER_C |
| 47 | #define MBEDTLS_CTR_DRBG_C |
| 48 | #define MBEDTLS_ENTROPY_C |
| 49 | #define MBEDTLS_MD_C |
| 50 | #define MBEDTLS_NET_C |
| 51 | #define MBEDTLS_SHA256_C |
| 52 | #define MBEDTLS_SSL_CLI_C |
| 53 | #define MBEDTLS_SSL_SRV_C |
| 54 | #define MBEDTLS_SSL_TLS_C |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 55 | |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 56 | /* Save RAM at the expense of ROM */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 57 | #define MBEDTLS_AES_ROM_TABLES |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 58 | |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 59 | /* Save some RAM by adjusting to your exact needs */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 60 | #define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */ |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 61 | |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 62 | /* |
| 63 | * You should adjust this to the exact number of sources you're using: default |
Manuel Pégourié-Gonnard | 66e20c6 | 2014-06-24 17:47:40 +0200 | [diff] [blame] | 64 | * is the "platform_entropy_poll" source, but you may want to add other ones |
| 65 | * Minimum is 2 for the entropy test suite. |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 66 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 67 | #define MBEDTLS_ENTROPY_MAX_SOURCES 2 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 68 | |
| 69 | /* |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 70 | * Use only CCM_8 ciphersuites, and |
| 71 | * save ROM and a few bytes of RAM by specifying our own ciphersuite list |
| 72 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 73 | #define MBEDTLS_SSL_CIPHERSUITES \ |
| 74 | MBEDTLS_TLS_PSK_WITH_AES_256_CCM_8, \ |
| 75 | MBEDTLS_TLS_PSK_WITH_AES_128_CCM_8 |
Manuel Pégourié-Gonnard | ac7dd33 | 2014-07-03 16:17:59 +0200 | [diff] [blame] | 76 | |
Manuel Pégourié-Gonnard | cc10f4d | 2014-06-30 19:22:44 +0200 | [diff] [blame] | 77 | /* |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 78 | * Save RAM at the expense of interoperability: do this only if you control |
Manuel Pégourié-Gonnard | 7f80997 | 2015-03-09 17:05:11 +0000 | [diff] [blame] | 79 | * both ends of the connection! (See comments in "mbedtls/ssl.h".) |
Manuel Pégourié-Gonnard | e38eb0b | 2014-06-24 17:30:05 +0200 | [diff] [blame] | 80 | * The optimal size here depends on the typical size of records. |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 81 | */ |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 82 | #define MBEDTLS_SSL_MAX_CONTENT_LEN 512 |
Manuel Pégourié-Gonnard | 0ac844c | 2014-06-24 16:30:49 +0200 | [diff] [blame] | 83 | |
Manuel Pégourié-Gonnard | 1a74a26 | 2014-06-24 15:51:32 +0200 | [diff] [blame] | 84 | #include "check_config.h" |
| 85 | |
Manuel Pégourié-Gonnard | 2cf5a7c | 2015-04-08 12:49:31 +0200 | [diff] [blame] | 86 | #endif /* MBEDTLS_CONFIG_H */ |