Contiki-NG
Loading...
Searching...
No Matches
mbedtls-config.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2022, RISE Research Institutes of Sweden AB
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
7
* are met:
8
*
9
* 1. Redistributions of source code must retain the above copyright
10
* notice, this list of conditions and the following disclaimer.
11
*
12
* 2. Redistributions in binary form must reproduce the above copyright
13
* notice, this list of conditions and the following disclaimer in the
14
* documentation and/or other materials provided with the distribution.
15
*
16
* 3. Neither the name of the copyright holder nor the names of its
17
* contributors may be used to endorse or promote products derived
18
* from this software without specific prior written permission.
19
*
20
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21
* ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
23
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
24
* COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
25
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
26
* (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
28
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
29
* STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
30
* ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
31
* OF THE POSSIBILITY OF SUCH DAMAGE.
32
*/
33
34
/**
35
* \file
36
* Mbed TLS library configuration for CoAP
37
*
38
* \author
39
* Jayendra Ellamathy <ejayen@gmail.com>
40
*/
41
42
#include "dtls-support-config.h"
43
#include "
lib/heapmem.h
"
44
45
/* Basic settings */
46
#define MBEDTLS_SSL_TLS_C
47
#define MBEDTLS_VERSION_C
48
49
/* RNG Support */
50
#ifndef CONTIKI_TARGET_NATIVE
51
#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
52
#define MBEDTLS_NO_PLATFORM_ENTROPY
53
#endif
/* CONTIKI_TARGET_NATIVE */
54
#define MBEDTLS_ENTROPY_C
55
#define MBEDTLS_CTR_DRBG_C
56
57
/* Timing */
58
#define MBEDTLS_TIMING_C
59
#define MBEDTLS_TIMING_ALT
60
61
#ifdef COAP_DTLS_CONF_WITH_CERT
62
#define MBEDTLS_HMAC_DRBG_C
63
#endif
/* COAP_DTLS_CONF_WITH_CERT */
64
65
/* RFC 7925 profile */
66
#define MBEDTLS_SSL_PROTO_DTLS
67
#define MBEDTLS_SSL_PROTO_TLS1_2
68
69
#ifdef COAP_DTLS_CONF_WITH_PSK
70
#define MBEDTLS_KEY_EXCHANGE_PSK_ENABLED
71
#endif
/* COAP_DTLS_CONF_WITH_PSK */
72
73
#ifdef COAP_DTLS_CONF_WITH_CERT
74
#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
75
#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
76
#define MBEDTLS_ECDH_C
77
#define MBEDTLS_CAN_ECDH
78
#define MBEDTLS_ECDSA_C
79
#define MBEDTLS_ECP_C
80
#define MBEDTLS_ECP_LIGHT
81
#define MBEDTLS_BIGNUM_C
82
#define MBEDTLS_ASN1_PARSE_C
83
#define MBEDTLS_OID_C
84
#define MBEDTLS_PK_PARSE_C
85
#define MBEDTLS_PK_C
86
#define MBEDTLS_PK_CAN_ECDSA_SIGN
87
#define MBEDTLS_PK_HAVE_ECC_KEYS
88
#define MBEDTLS_BASE64_C
89
#define MBEDTLS_PEM_PARSE_C
90
#define MBEDTLS_ASN1_WRITE_C
91
#define MBEDTLS_X509_USE_C
92
#define MBEDTLS_X509_CRT_PARSE_C
93
#define MBEDTLS_ECP_NIST_OPTIM
94
#define MBEDTLS_ECDSA_DETERMINISTIC
95
#endif
/* COAP_DTLS_CONF_WITH_CERT */
96
97
#define MBEDTLS_AES_C
98
#define MBEDTLS_CCM_GCM_CAN_AES
99
#define MBEDTLS_CCM_C
100
#define MBEDTLS_SHA256_C
101
#define MBEDTLS_MD_CAN_SHA256
102
#define MBEDTLS_MD_C
103
#define MBEDTLS_CIPHER_C
104
105
/* DTLS */
106
#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
107
#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
108
109
/* I/O message buffer sizes */
110
#define MBEDTLS_SSL_IN_CONTENT_LEN COAP_MBEDTLS_MTU
111
#define MBEDTLS_SSL_OUT_CONTENT_LEN COAP_MBEDTLS_MTU
112
#define MBEDTLS_SSL_DTLS_MAX_BUFFERING (2 * COAP_MBEDTLS_MTU)
113
114
/* Client Role */
115
#ifdef COAP_DTLS_CONF_WITH_CLIENT
116
#define MBEDTLS_SSL_CLI_C
117
/*#define MBEDTLS_SSL_SERVER_NAME_INDICATION */
118
#endif
/* COAP_DTLS_CONF_WITH_CLIENT */
119
120
/* Server Role */
121
#ifdef COAP_DTLS_CONF_WITH_SERVER
122
#define MBEDTLS_SSL_SRV_C
123
#define MBEDTLS_SSL_COOKIE_C
124
#define MBEDTLS_SSL_CACHE_C
125
#endif
/* COAP_DTLS_CONF_WITH_SERVER */
126
127
#ifdef COAP_DTLS_CONF_DEBUG
128
/* Debugging */
129
#define MBEDTLS_DEBUG_C
130
#define MBEDTLS_ERROR_C
131
#define MBEDTLS_SSL_ALL_ALERT_MESSAGES
132
#define MBEDTLS_SSL_DEBUG_ALL
133
#endif
/* COAP_DTLS_CONF_DEBUG */
134
135
/* IoT features */
136
#define MBEDTLS_SSL_MAX_FRAGMENT_LENGTH
137
138
/* HW Acceleration. This is disabled because the current nRF SDK
139
submodule lacks the necessary modules. */
140
#ifdef COAP_DTLS_CONF_HW_ACCEL
141
#ifdef COAP_DTLS_CONF_WITH_CERT
142
#ifdef NRF52840_XXAA
/* Curr. only for nRF52840 */
143
#define NRF_HW_ACCEL_FOR_MBEDTLS
144
#define MBEDTLS_ECDSA_VERIFY_ALT
145
#define MBEDTLS_ECDH_COMPUTE_SHARED_ALT
146
#else
147
#error "COAP_DTLS_CONF_HW_ACCEL enabled, but is not implemented for the Contiki-NG target."
148
#endif
/* NRF52840_XXAA */
149
#endif
/* COAP_DTLS_CONF_WITH_CERT */
150
#endif
/* COAP_DTLS_CONF_HW_ACCEL */
151
152
/* Use the Contiki-NG HeapMem module for Mbed TLS dynamic memory. */
153
#define MBEDTLS_PLATFORM_C
154
#define MBEDTLS_PLATFORM_MEMORY
155
#define MBEDTLS_PLATFORM_CALLOC_MACRO heapmem_calloc
156
#define MBEDTLS_PLATFORM_FREE_MACRO heapmem_free
157
158
#include "mbedtls/build_info.h"
heapmem.h
Header file for the dynamic heap memory allocator.
os
net
app-layer
coap
mbedtls-support
mbedtls-config.h
Generated on Sat Sep 20 2025 07:49:20 for Contiki-NG by
1.10.0