2 * Copyright (C) 2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
\r
4 * Permission is hereby granted, free of charge, to any person obtaining a copy of
\r
5 * this software and associated documentation files (the "Software"), to deal in
\r
6 * the Software without restriction, including without limitation the rights to
\r
7 * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
\r
8 * the Software, and to permit persons to whom the Software is furnished to do so,
\r
9 * subject to the following conditions:
\r
11 * The above copyright notice and this permission notice shall be included in all
\r
12 * copies or substantial portions of the Software.
\r
14 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
\r
15 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
\r
16 * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
\r
17 * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
\r
18 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
\r
19 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
\r
22 /* This file configures mbed TLS for FreeRTOS. */
\r
24 #ifndef MBEDTLS_CONFIG_H_
\r
25 #define MBEDTLS_CONFIG_H_
\r
27 /* FreeRTOS include. */
\r
28 #include "FreeRTOS.h"
\r
30 /* Generate errors if deprecated functions are used. */
\r
31 #define MBEDTLS_DEPRECATED_REMOVED
\r
33 /* Place AES tables in ROM. */
\r
34 #define MBEDTLS_AES_ROM_TABLES
\r
36 /* Enable the following cipher modes. */
\r
37 #define MBEDTLS_CIPHER_MODE_CBC
\r
38 #define MBEDTLS_CIPHER_MODE_CFB
\r
39 #define MBEDTLS_CIPHER_MODE_CTR
\r
41 /* Enable the following cipher padding modes. */
\r
42 #define MBEDTLS_CIPHER_PADDING_PKCS7
\r
43 #define MBEDTLS_CIPHER_PADDING_ONE_AND_ZEROS
\r
44 #define MBEDTLS_CIPHER_PADDING_ZEROS_AND_LEN
\r
45 #define MBEDTLS_CIPHER_PADDING_ZEROS
\r
47 /* Cipher suite configuration. */
\r
48 #define MBEDTLS_REMOVE_ARC4_CIPHERSUITES
\r
49 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
\r
50 #define MBEDTLS_ECP_NIST_OPTIM
\r
51 #define MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED
\r
52 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
\r
54 /* Enable all SSL alert messages. */
\r
55 #define MBEDTLS_SSL_ALL_ALERT_MESSAGES
\r
57 /* Enable the following SSL features. */
\r
58 #define MBEDTLS_SSL_ENCRYPT_THEN_MAC
\r
59 #define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
\r
60 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
\r
61 #define MBEDTLS_SSL_PROTO_TLS1_2
\r
62 #define MBEDTLS_SSL_ALPN
\r
63 #define MBEDTLS_SSL_SERVER_NAME_INDICATION
\r
65 /* Check certificate key usage. */
\r
66 #define MBEDTLS_X509_CHECK_KEY_USAGE
\r
67 #define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
\r
69 /* Disable platform entropy functions. */
\r
70 #define MBEDTLS_NO_PLATFORM_ENTROPY
\r
72 /* Enable the following mbed TLS features. */
\r
73 #define MBEDTLS_AES_C
\r
74 #define MBEDTLS_ASN1_PARSE_C
\r
75 #define MBEDTLS_ASN1_WRITE_C
\r
76 #define MBEDTLS_BASE64_C
\r
77 #define MBEDTLS_BIGNUM_C
\r
78 #define MBEDTLS_CIPHER_C
\r
79 #define MBEDTLS_CTR_DRBG_C
\r
80 #define MBEDTLS_ECDH_C
\r
81 #define MBEDTLS_ECDSA_C
\r
82 #define MBEDTLS_ECP_C
\r
83 #define MBEDTLS_ENTROPY_C
\r
84 #define MBEDTLS_GCM_C
\r
85 #define MBEDTLS_MD_C
\r
86 #define MBEDTLS_OID_C
\r
87 #define MBEDTLS_PEM_PARSE_C
\r
88 #define MBEDTLS_PK_C
\r
89 #define MBEDTLS_PK_PARSE_C
\r
90 #define MBEDTLS_PKCS1_V15
\r
91 #define MBEDTLS_PLATFORM_C
\r
92 #define MBEDTLS_RSA_C
\r
93 #define MBEDTLS_SHA1_C
\r
94 #define MBEDTLS_SHA256_C
\r
95 #define MBEDTLS_SSL_CLI_C
\r
96 #define MBEDTLS_SSL_TLS_C
\r
97 #define MBEDTLS_THREADING_ALT
\r
98 #define MBEDTLS_THREADING_C
\r
99 #define MBEDTLS_X509_USE_C
\r
100 #define MBEDTLS_X509_CRT_PARSE_C
\r
102 /* Set the memory allocation functions on FreeRTOS. */
\r
103 void * mbedtls_platform_calloc( size_t nmemb,
\r
105 void mbedtls_platform_free( void * ptr );
\r
106 #define MBEDTLS_PLATFORM_MEMORY
\r
107 #define MBEDTLS_PLATFORM_CALLOC_MACRO mbedtls_platform_calloc
\r
108 #define MBEDTLS_PLATFORM_FREE_MACRO mbedtls_platform_free
\r
110 /* The network send and receive functions on FreeRTOS. */
\r
111 int mbedtls_platform_send( void * ctx,
\r
112 const unsigned char * buf,
\r
114 int mbedtls_platform_recv( void * ctx,
\r
115 unsigned char * buf,
\r
118 /* The entropy poll function. */
\r
119 int mbedtls_platform_entropy_poll( void * data,
\r
120 unsigned char * output,
\r
124 #include "mbedtls/check_config.h"
\r
126 #endif /* ifndef MBEDTLS_CONFIG_H_ */
\r