U_Blox device connector

Dependencies:   mbed

Fork of mbed-os-example-client by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers mbedtls_mbed_client_config.h Source File

mbedtls_mbed_client_config.h

00001 /**
00002  *  Minimal configuration for using mbedtls as part of mbed-client
00003  *
00004  *  NOTE! This is an optimized, minimal configuration for mbed Client.
00005  *  We know it works with mbed Client but if you want to add more
00006  *  services/communications to the application yourself - please ensure
00007  *  you update this configuration accordingly. The default configuration
00008  *  can be found from mbedTLS Github:
00009  *
00010  *  https://github.com/ARMmbed/mbedtls/blob/development/include/mbedtls/config.h
00011  *
00012  *
00013  *  Copyright (C) 2006-2016, ARM Limited, All Rights Reserved
00014  *  SPDX-License-Identifier: Apache-2.0
00015  *
00016  *  Licensed under the Apache License, Version 2.0 (the "License"); you may
00017  *  not use this file except in compliance with the License.
00018  *  You may obtain a copy of the License at
00019  *
00020  *  http://www.apache.org/licenses/LICENSE-2.0
00021  *
00022  *  Unless required by applicable law or agreed to in writing, software
00023  *  distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
00024  *  WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
00025  *  See the License for the specific language governing permissions and
00026  *  limitations under the License.
00027  *
00028  *  This file is part of mbed TLS (https://tls.mbed.org)
00029  */
00030 
00031 
00032 #ifndef MBEDTLS_CUSTOM_CONFIG_H
00033 #define MBEDTLS_CUSTOM_CONFIG_H
00034 
00035 /* System support */
00036 #define MBEDTLS_HAVE_ASM
00037 
00038 /* mbed TLS feature support */
00039 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
00040 #define MBEDTLS_ECP_NIST_OPTIM
00041 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
00042 #define MBEDTLS_SSL_PROTO_TLS1_2
00043 #define MBEDTLS_SSL_PROTO_DTLS
00044 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
00045 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
00046 #define MBEDTLS_SSL_EXPORT_KEYS
00047 
00048 /* mbed TLS modules */
00049 #define MBEDTLS_AES_C
00050 #define MBEDTLS_ASN1_PARSE_C
00051 #define MBEDTLS_ASN1_WRITE_C
00052 #define MBEDTLS_BIGNUM_C
00053 #define MBEDTLS_CIPHER_C
00054 #define MBEDTLS_CTR_DRBG_C
00055 #define MBEDTLS_ECP_C
00056 #define MBEDTLS_ENTROPY_C
00057 #define MBEDTLS_MD_C
00058 #define MBEDTLS_OID_C
00059 #define MBEDTLS_PK_C
00060 #define MBEDTLS_PK_PARSE_C
00061 #define MBEDTLS_SHA256_C
00062 #define MBEDTLS_SSL_COOKIE_C
00063 #define MBEDTLS_SSL_CLI_C
00064 #define MBEDTLS_SSL_SRV_C
00065 #define MBEDTLS_SSL_TLS_C
00066 
00067 // XXX mbedclient needs these: mbedtls_x509_crt_free, mbedtls_x509_crt_init, mbedtls_x509_crt_parse
00068 #define MBEDTLS_X509_USE_C
00069 #define MBEDTLS_X509_CRT_PARSE_C
00070 
00071 // XXX: clean these up!!
00072 #define MBEDTLS_SHA512_C
00073 #define MBEDTLS_ECDH_C
00074 #define MBEDTLS_GCM_C
00075 
00076 #define MBEDTLS_ECDH_C
00077 #define MBEDTLS_ECDSA_C
00078 #define MBEDTLS_X509_CRT_PARSE_C
00079 
00080 // Remove RSA, save 20KB at total
00081 #undef MBEDTLS_RSA_C
00082 #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
00083 
00084 // Remove error messages, save 10KB of ROM
00085 #undef MBEDTLS_ERROR_C
00086 
00087 // Remove selftesting and save 11KB of ROM
00088 #undef MBEDTLS_SELF_TEST
00089 
00090 // Reduces ROM size by 30 kB
00091 #undef MBEDTLS_ERROR_STRERROR_DUMMY
00092 #undef MBEDTLS_VERSION_FEATURES
00093 #undef MBEDTLS_DEBUG_C
00094 
00095 // needed for parsing the certificates
00096 #define MBEDTLS_PEM_PARSE_C
00097 // dep of the previous
00098 #define MBEDTLS_BASE64_C
00099 
00100 // Reduce IO buffer to save RAM, default is 16KB
00101 #define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
00102 
00103 // define to save 8KB RAM at the expense of ROM
00104 #undef MBEDTLS_AES_ROM_TABLES
00105 
00106 // Save ROM and a few bytes of RAM by specifying our own ciphersuite list
00107 #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384,MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256
00108 
00109 #include "mbedtls/check_config.h"
00110 
00111 #endif /* MBEDTLS_CUSTOM_CONFIG_H */