1/**
2 * Copyright (c) 2020 Huawei Device Co., Ltd.
3 * Licensed under the Apache License, Version 2.0 (the "License");
4 * you may not use this file except in compliance with the License.
5 * You may obtain a copy of the License at
6 *
7 *   http://www.apache.org/licenses/LICENSE-2.0
8 *
9 * Unless required by applicable law or agreed to in writing, software
10 * distributed under the License is distributed on an "AS IS" BASIS,
11 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 * See the License for the specific language governing permissions and
13 * limitations under the License.
14 */
15
16#ifndef MBEDTLS_CONFIG_H
17#define MBEDTLS_CONFIG_H
18
19#define MBEDTLS_CONFIG_FILE_NO 4
20
21/* System support */
22#define MBEDTLS_HAVE_ASM
23#define MBEDTLS_HAVE_TIME
24
25/* mbed TLS feature support */
26#define MBEDTLS_KEY_EXCHANGE_RSA_ENABLED
27#define MBEDTLS_SSL_PROTO_TLS1_2
28
29/* mbed TLS modules */
30#define MBEDTLS_AES_C
31#define MBEDTLS_ASN1_PARSE_C
32#define MBEDTLS_ASN1_WRITE_C
33#define MBEDTLS_BIGNUM_C
34#define MBEDTLS_CIPHER_C
35#define MBEDTLS_CTR_DRBG_C
36#define MBEDTLS_ENTROPY_C
37#define MBEDTLS_CIPHER_MODE_CBC
38
39#define MBEDTLS_MD_C
40#define MBEDTLS_NET_C
41#define MBEDTLS_OID_C
42#define MBEDTLS_PK_C
43#define MBEDTLS_PK_PARSE_C
44#define MBEDTLS_SHA256_C
45#define MBEDTLS_SHA1_C
46#define MBEDTLS_SSL_CLI_C
47#define MBEDTLS_SSL_TLS_C
48#define MBEDTLS_X509_CRT_PARSE_C
49#define MBEDTLS_X509_USE_C
50
51#define MBEDTLS_RSA_C
52#define MBEDTLS_PKCS1_V15
53
54
55/* For test certificates */
56#define MBEDTLS_BASE64_C
57#define MBEDTLS_PEM_PARSE_C
58
59/* Save RAM at the expense of ROM */
60#define MBEDTLS_AES_ROM_TABLES
61
62/* Save RAM by adjusting to our exact needs */
63#define MBEDTLS_MPI_MAX_SIZE    512 // 4096 bits is 512 bytes
64
65/*
66 * You should adjust this to the exact number of sources you're using: default
67 * is the "mbedtls_platform_entropy_poll" source, but you may want to add other ones.
68 * Minimum is 2 for the entropy test suite.
69 */
70#define MBEDTLS_ENTROPY_MAX_SOURCES 2
71
72/* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
73#define MBEDTLS_SSL_CIPHERSUITES                        \
74    MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA256,    \
75    MBEDTLS_TLS_RSA_WITH_AES_128_CBC_SHA,    \
76    MBEDTLS_TLS_RSA_WITH_AES_256_CBC_SHA
77
78/*
79 * Save RAM at the expense of interoperability: do this only if you control
80 * both ends of the connection!  (See coments in "mbedtls/ssl.h".)
81 * The minimum size here depends on the certificate chain used as well as the
82 * typical size of records.
83 */
84#define MBEDTLS_SSL_MAX_CONTENT_LEN             16384
85#include "mbedtls/check_config.h"
86
87#endif /* MBEDTLS_CONFIG_H */
88
89