xref: /aosp_15_r20/external/ot-br-posix/third_party/openthread/mbedtls-config.h (revision 4a64e381480ef79f0532b2421e44e6ee336b8e0d)
1 /*
2  *    Copyright (c) 2019, The OpenThread Authors.
3  *    All rights reserved.
4  *
5  *    Redistribution and use in source and binary forms, with or without
6  *    modification, are permitted provided that the following conditions are met:
7  *    1. Redistributions of source code must retain the above copyright
8  *       notice, this list of conditions and the following disclaimer.
9  *    2. Redistributions in binary form must reproduce the above copyright
10  *       notice, this list of conditions and the following disclaimer in the
11  *       documentation and/or other materials provided with the distribution.
12  *    3. Neither the name of the copyright holder nor the
13  *       names of its contributors may be used to endorse or promote products
14  *       derived from this software without specific prior written permission.
15  *
16  *    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
17  *    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
18  *    IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
19  *    ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE
20  *    LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
21  *    CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
22  *    SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
23  *    INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
24  *    CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
25  *    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
26  *    POSSIBILITY OF SUCH DAMAGE.
27  */
28 
29 #ifndef OTBR_MBEDTLS_CONFIG_H_
30 #define OTBR_MBEDTLS_CONFIG_H_
31 
32 #define MBEDTLS_DEBUG_C
33 
34 // Not supported on MIPS
35 #ifndef __mips__
36 #define MBEDTLS_HAVE_ASM
37 #endif
38 
39 #define MBEDTLS_AES_ROM_TABLES
40 #define MBEDTLS_ECP_DP_SECP256R1_ENABLED
41 #define MBEDTLS_ECP_NIST_OPTIM
42 #define MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED
43 #define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
44 #define MBEDTLS_SSL_PROTO_TLS1_2
45 #define MBEDTLS_SSL_PROTO_DTLS
46 #define MBEDTLS_SSL_DTLS_ANTI_REPLAY
47 #define MBEDTLS_SSL_DTLS_HELLO_VERIFY
48 #define MBEDTLS_SSL_EXPORT_KEYS
49 #define MBEDTLS_SSL_KEEP_PEER_CERTIFICATE
50 
51 #define MBEDTLS_AES_C
52 #define MBEDTLS_ASN1_PARSE_C
53 #define MBEDTLS_ASN1_WRITE_C
54 #define MBEDTLS_BIGNUM_C
55 #define MBEDTLS_CAN_ECDH
56 #define MBEDTLS_CCM_C
57 #define MBEDTLS_CIPHER_C
58 #define MBEDTLS_CTR_DRBG_C
59 #define MBEDTLS_CMAC_C
60 #define MBEDTLS_ECJPAKE_C
61 #define MBEDTLS_ECP_C
62 #define MBEDTLS_ENTROPY_C
63 #define MBEDTLS_HMAC_DRBG_C
64 #define MBEDTLS_MD_C
65 #define MBEDTLS_OID_C
66 #define MBEDTLS_PK_C
67 #define MBEDTLS_PK_HAVE_ECC_KEYS
68 #define MBEDTLS_PK_PARSE_C
69 #define MBEDTLS_SHA256_C
70 #define MBEDTLS_SHA256_SMALLER
71 #define MBEDTLS_SSL_COOKIE_C
72 #define MBEDTLS_SSL_CLI_C
73 #define MBEDTLS_SSL_SRV_C
74 #define MBEDTLS_SSL_TLS_C
75 
76 // Enable CoAPS PSK support
77 #define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
78 
79 // Enable CoAPS ECDSA support
80 #define MBEDTLS_BASE64_C
81 #define MBEDTLS_ECDH_C
82 #define MBEDTLS_ECDSA_C
83 #define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
84 #define MBEDTLS_ECDSA_DETERMINISTIC
85 #define MBEDTLS_OID_C
86 #define MBEDTLS_PEM_PARSE_C
87 #define MBEDTLS_PK_CAN_ECDSA_SIGN
88 #define MBEDTLS_PK_WRITE_C
89 
90 #define MBEDTLS_X509_USE_C
91 #define MBEDTLS_X509_CRT_PARSE_C
92 #define MBEDTLS_X509_CRL_PARSE_C
93 #define MBEDTLS_X509_CSR_PARSE_C
94 
95 #define MBEDTLS_NET_C
96 #define MBEDTLS_TIMING_C
97 
98 #define MBEDTLS_AES_ROM_TABLES
99 
100 #define MBEDTLS_ECP_MAX_BITS 256
101 #define MBEDTLS_MPI_MAX_SIZE 32
102 #define MBEDTLS_SSL_MAX_CONTENT_LEN 900
103 
104 #define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
105 
106 #include "mbedtls/version.h"
107 #if (MBEDTLS_VERSION_NUMBER < 0x03000000)
108     // Configuration sanity check. Done automatically in Mbed TLS >= 3.0.
109     #include "mbedtls/check_config.h"
110 #endif
111 
112 #endif // OTBR_MBEDTLS_CONFIG_H_
113