Example program running mbedClient over UbloxATCellularInterface or OnboardCellularInterface for the C030 platform.

Dependencies:   ublox-cellular-base ublox-at-cellular-interface ublox-ppp-cellular-interface ublox-at-cellular-interface-n2xx ublox-cellular-base-n2xx

Committer:
rob.meades@u-blox.com
Date:
Fri Jun 09 15:28:40 2017 +0100
Revision:
1:9f355da25904
Flesh out example.

Who changed what in which revision?

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