FRDM K64F Metronome

Committer:
ram54288
Date:
Sun May 14 18:37:05 2017 +0000
Revision:
0:dbad57390bd1
Initial commit

Who changed what in which revision?

UserRevisionLine numberNew contents of line
ram54288 0:dbad57390bd1 1 /**
ram54288 0:dbad57390bd1 2 * Minimal configuration for using mbedtls as part of mbed-client
ram54288 0:dbad57390bd1 3 *
ram54288 0:dbad57390bd1 4 * NOTE! This is an optimized, minimal configuration for mbed Client.
ram54288 0:dbad57390bd1 5 * We know it works with mbed Client but if you want to add more
ram54288 0:dbad57390bd1 6 * services/communications to the application yourself - please ensure
ram54288 0:dbad57390bd1 7 * you update this configuration accordingly. The default configuration
ram54288 0:dbad57390bd1 8 * can be found from mbedTLS Github:
ram54288 0:dbad57390bd1 9 *
ram54288 0:dbad57390bd1 10 * https://github.com/ARMmbed/mbedtls/blob/development/include/mbedtls/config.h
ram54288 0:dbad57390bd1 11 *
ram54288 0:dbad57390bd1 12 *
ram54288 0:dbad57390bd1 13 * Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
ram54288 0:dbad57390bd1 14 * SPDX-License-Identifier: Apache-2.0
ram54288 0:dbad57390bd1 15 *
ram54288 0:dbad57390bd1 16 * Licensed under the Apache License, Version 2.0 (the "License"); you may
ram54288 0:dbad57390bd1 17 * not use this file except in compliance with the License.
ram54288 0:dbad57390bd1 18 * You may obtain a copy of the License at
ram54288 0:dbad57390bd1 19 *
ram54288 0:dbad57390bd1 20 * http://www.apache.org/licenses/LICENSE-2.0
ram54288 0:dbad57390bd1 21 *
ram54288 0:dbad57390bd1 22 * Unless required by applicable law or agreed to in writing, software
ram54288 0:dbad57390bd1 23 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
ram54288 0:dbad57390bd1 24 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
ram54288 0:dbad57390bd1 25 * See the License for the specific language governing permissions and
ram54288 0:dbad57390bd1 26 * limitations under the License.
ram54288 0:dbad57390bd1 27 *
ram54288 0:dbad57390bd1 28 * This file is part of mbed TLS (https://tls.mbed.org)
ram54288 0:dbad57390bd1 29 */
ram54288 0:dbad57390bd1 30
ram54288 0:dbad57390bd1 31
ram54288 0:dbad57390bd1 32 #ifndef MBEDTLS_CUSTOM_CONFIG_H
ram54288 0:dbad57390bd1 33 #define MBEDTLS_CUSTOM_CONFIG_H
ram54288 0:dbad57390bd1 34
ram54288 0:dbad57390bd1 35 /* System support */
ram54288 0:dbad57390bd1 36 #define MBEDTLS_HAVE_ASM
ram54288 0:dbad57390bd1 37
ram54288 0:dbad57390bd1 38 /* mbed TLS feature support */
ram54288 0:dbad57390bd1 39 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
ram54288 0:dbad57390bd1 40 #define MBEDTLS_ECP_NIST_OPTIM
ram54288 0:dbad57390bd1 41 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
ram54288 0:dbad57390bd1 42 #define MBEDTLS_SSL_PROTO_TLS1_2
ram54288 0:dbad57390bd1 43 #define MBEDTLS_SSL_PROTO_DTLS
ram54288 0:dbad57390bd1 44 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
ram54288 0:dbad57390bd1 45 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
ram54288 0:dbad57390bd1 46 #define MBEDTLS_SSL_EXPORT_KEYS
ram54288 0:dbad57390bd1 47
ram54288 0:dbad57390bd1 48 /* mbed TLS modules */
ram54288 0:dbad57390bd1 49 #define MBEDTLS_AES_C
ram54288 0:dbad57390bd1 50 #define MBEDTLS_ASN1_PARSE_C
ram54288 0:dbad57390bd1 51 #define MBEDTLS_ASN1_WRITE_C
ram54288 0:dbad57390bd1 52 #define MBEDTLS_BIGNUM_C
ram54288 0:dbad57390bd1 53 #define MBEDTLS_CIPHER_C
ram54288 0:dbad57390bd1 54 #define MBEDTLS_CTR_DRBG_C
ram54288 0:dbad57390bd1 55 #define MBEDTLS_ECP_C
ram54288 0:dbad57390bd1 56 #define MBEDTLS_ENTROPY_C
ram54288 0:dbad57390bd1 57 #define MBEDTLS_MD_C
ram54288 0:dbad57390bd1 58 #define MBEDTLS_OID_C
ram54288 0:dbad57390bd1 59 #define MBEDTLS_PK_C
ram54288 0:dbad57390bd1 60 #define MBEDTLS_PK_PARSE_C
ram54288 0:dbad57390bd1 61 #define MBEDTLS_SHA256_C
ram54288 0:dbad57390bd1 62 #define MBEDTLS_SSL_COOKIE_C
ram54288 0:dbad57390bd1 63 #define MBEDTLS_SSL_CLI_C
ram54288 0:dbad57390bd1 64 #define MBEDTLS_SSL_SRV_C
ram54288 0:dbad57390bd1 65 #define MBEDTLS_SSL_TLS_C
ram54288 0:dbad57390bd1 66
ram54288 0:dbad57390bd1 67 // XXX mbedclient needs these: mbedtls_x509_crt_free, mbedtls_x509_crt_init, mbedtls_x509_crt_parse
ram54288 0:dbad57390bd1 68 #define MBEDTLS_X509_USE_C
ram54288 0:dbad57390bd1 69 #define MBEDTLS_X509_CRT_PARSE_C
ram54288 0:dbad57390bd1 70
ram54288 0:dbad57390bd1 71 // XXX: clean these up!!
ram54288 0:dbad57390bd1 72 #define MBEDTLS_SHA512_C
ram54288 0:dbad57390bd1 73 #define MBEDTLS_ECDH_C
ram54288 0:dbad57390bd1 74 #define MBEDTLS_GCM_C
ram54288 0:dbad57390bd1 75
ram54288 0:dbad57390bd1 76 #define MBEDTLS_ECDH_C
ram54288 0:dbad57390bd1 77 #define MBEDTLS_ECDSA_C
ram54288 0:dbad57390bd1 78 #define MBEDTLS_X509_CRT_PARSE_C
ram54288 0:dbad57390bd1 79
ram54288 0:dbad57390bd1 80 // Remove RSA, save 20KB at total
ram54288 0:dbad57390bd1 81 #undef MBEDTLS_RSA_C
ram54288 0:dbad57390bd1 82 #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
ram54288 0:dbad57390bd1 83
ram54288 0:dbad57390bd1 84 // Remove error messages, save 10KB of ROM
ram54288 0:dbad57390bd1 85 #undef MBEDTLS_ERROR_C
ram54288 0:dbad57390bd1 86
ram54288 0:dbad57390bd1 87 // Remove selftesting and save 11KB of ROM
ram54288 0:dbad57390bd1 88 #undef MBEDTLS_SELF_TEST
ram54288 0:dbad57390bd1 89
ram54288 0:dbad57390bd1 90 // Reduces ROM size by 30 kB
ram54288 0:dbad57390bd1 91 #undef MBEDTLS_ERROR_STRERROR_DUMMY
ram54288 0:dbad57390bd1 92 #undef MBEDTLS_VERSION_FEATURES
ram54288 0:dbad57390bd1 93 #undef MBEDTLS_DEBUG_C
ram54288 0:dbad57390bd1 94
ram54288 0:dbad57390bd1 95 // needed for parsing the certificates
ram54288 0:dbad57390bd1 96 #define MBEDTLS_PEM_PARSE_C
ram54288 0:dbad57390bd1 97 // dep of the previous
ram54288 0:dbad57390bd1 98 #define MBEDTLS_BASE64_C
ram54288 0:dbad57390bd1 99
ram54288 0:dbad57390bd1 100 // Reduce IO buffer to save RAM, default is 16KB
ram54288 0:dbad57390bd1 101 #define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
ram54288 0:dbad57390bd1 102
ram54288 0:dbad57390bd1 103 // define to save 8KB RAM at the expense of ROM
ram54288 0:dbad57390bd1 104 #undef MBEDTLS_AES_ROM_TABLES
ram54288 0:dbad57390bd1 105
ram54288 0:dbad57390bd1 106 // Save ROM and a few bytes of RAM by specifying our own ciphersuite list
ram54288 0:dbad57390bd1 107 #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
ram54288 0:dbad57390bd1 108
ram54288 0:dbad57390bd1 109 #include "mbedtls/check_config.h"
ram54288 0:dbad57390bd1 110
ram54288 0:dbad57390bd1 111 #endif /* MBEDTLS_CUSTOM_CONFIG_H */