1 /* 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 * 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. 18 * 19 * This file is part of mbed TLS (https://tls.mbed.org) 20 */ 21 /* 22 * Minimal configuration for TLS 1.2 with PSK and AES-CCM ciphersuites 23 * Distinguishing features: 24 * - no bignum, no PK, no X509 25 * - fully modern and secure (provided the pre-shared keys have high entropy) 26 * - very low record overhead with CCM-8 27 * - optimized for low RAM usage 28 * 29 * See README.txt for usage instructions. 30 */ 31 #ifndef MBEDTLS_CONFIG_H 32 #define MBEDTLS_CONFIG_H 33 34 /* System support */ 35 //#define MBEDTLS_HAVE_TIME /* Optionally used in Hello messages */ 36 /* Other MBEDTLS_HAVE_XXX flags irrelevant for this configuration */ 37 //#define MBEDTLS_NO_PLATFORM_ENTROPY 38 //#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES 39 //#define MBEDTLS_TEST_NULL_ENTROPY 40 //#define MBEDTLS_HAVEGE_C 41 //#define MBEDTLS_DEBUG_C 42 //#define MBEDTLS_PLATFORM_C 43 //#define MBEDTLS_PLATFORM_MEMORY 44 //#define MBEDTLS_TIMING_C 45 46 /* mbed TLS feature support */ 47 //#define MBEDTLS_CIPHER_MODE_CBC 48 //#define MBEDTLS_PKCS1_V15 49 //#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED 50 //#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED 51 //#define MBEDTLS_SSL_PROTO_TLS1_2 52 //#define MBEDTLS_SSL_PROTO_DTLS 53 //#define MBEDTLS_SSL_DTLS_HELLO_VERIFY 54 55 /* mbed TLS modules */ 56 //#define MBEDTLS_AES_C 57 //#define MBEDTLS_AES_ALT 58 //#define MBEDTLS_ASN1_PARSE_C 59 //#define MBEDTLS_BIGNUM_C 60 // #define MBEDTLS_CCM_C 61 // #define MBEDTLS_GCM_C 62 //#define MBEDTLS_CIPHER_C 63 //#define MBEDTLS_CTR_DRBG_C 64 //#define MBEDTLS_ENTROPY_C 65 //#define MBEDTLS_MD_C 66 #define MBEDTLS_MD5_C 67 //#define MBEDTLS_NET_C 68 //#define MBEDTLS_OID_C 69 #define MBEDTLS_SHA1_C 70 //#define MBEDTLS_SHA1_ALT 71 #define MBEDTLS_SHA256_C 72 //#define MBEDTLS_SHA256_ALT 73 //#define MBEDTLS_SHA512_C 74 //#define MBEDTLS_PK_C 75 //#define MBEDTLS_PK_PARSE_C 76 //#define MBEDTLS_RSA_C 77 //#define MBEDTLS_RSA_ALT 78 //#define MBEDTLS_SSL_CLI_C 79 //#define MBEDTLS_SSL_COOKIE_C 80 //#define MBEDTLS_SSL_SRV_C 81 82 //#define MBEDTLS_SSL_TLS_C 83 //#define MBEDTLS_X509_CRT_PARSE_C 84 //#define MBEDTLS_X509_USE_C 85 #define MBEDTLS_BASE64_C 86 //#define MBEDTLS_CERTS_C 87 //#define MBEDTLS_PEM_PARSE_C 88 89 //#define MBEDTLS_ENTROPY_SHA512_ACCUMULATOR 90 91 /* Save RAM at the expense of ROM */ 92 // #define MBEDTLS_AES_ROM_TABLES 93 94 /* Save some RAM by adjusting to your exact needs */ 95 //#define MBEDTLS_PSK_MAX_LEN 16 /* 128-bits keys are generally enough */ 96 97 /* 98 * You should adjust this to the exact number of sources you're using: default 99 * is the "platform_entropy_poll" source, but you may want to add other ones 100 * Minimum is 2 for the entropy test suite. 101 */ 102 //#define MBEDTLS_ENTROPY_MAX_SOURCES 128 103 104 /* 105 * Use only CCM_8 ciphersuites, and 106 * save ROM and a few bytes of RAM by specifying our own ciphersuite list 107 */ 108 /* 109 #define MBEDTLS_SSL_CIPHERSUITES \ 110 MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA 111 */ 112 113 /* 114 * Save RAM at the expense of interoperability: do this only if you control 115 * both ends of the connection! (See comments in "mbedtls/ssl.h".) 116 * The optimal size here depends on the typical size of records. 117 */ 118 //#define MBEDTLS_SSL_MAX_CONTENT_LEN (1 * 1024) 119 120 //#if !defined (MBEDTLS_DEBUG_C) 121 /*reduce readonly date size*/ 122 //#define CK_REMOVE_UNUSED_FUNCTION_AND_DATA 123 //#endif 124 125 /* save cert in flash, save about 3.7K ram use*/ 126 //#define CK_SAVE_MEM_L2 127 128 //#ifdef CK_SAVE_MEM_L2 129 // 130 //#error "comment this line and set CK_FLASH_BLOCK_START,CK_FLAHS_BLOCK_NUM" 131 132 /* CK_FLASH_BLOCK_START flash start address where certificates in*/ 133 /* CK_FLAHS_BLOCK_NUM flash size, this MUSH larger than all certificates total size*/ 134 135 /*examples for hobbit, 0x10030000 ~ 0x10031400 */ 136 //#define CK_FLASH_BLOCK_START (384) 137 //#define CK_FLAHS_BLOCK_NUM 10 138 139 /*examples for phobos, 0x1002fc00 ~ 0x1003100*/ 140 //#define CK_FLASH_BLOCK_START (382) 141 //#define CK_FLAHS_BLOCK_NUM 10 142 143 //#define ck_alloc(a) ck_cert_flash_alloc(a) 144 //#define ck_memcpy(d,s,l) ck_cert_flash_copy((uint32_t)d,s,l) 145 // 146 //#endif 147 148 /*disable rsa private key check,save about 5k rom use*/ 149 //#define CK_SAVE_MEM_L3 150 151 /* reduce ram use in certificate handshake message*/ 152 //#define CK_SAVE_MEM_L4 153 154 #include "mbedtls/check_config.h" 155 156 #endif /* MBEDTLS_CONFIG_H */ 157