blob: 6b41e765f2e11842c0b50874900242410e5f5b26 [file] [log] [blame]
Hanno Beckerabc22b72019-03-18 12:39:49 +00001/**
2 * \file baremetal.h
3 *
4 * \brief Test configuration for minimal baremetal Mbed TLS builds
5 * based on the following primitives:
6 * - ECDHE-ECDSA only
7 * - Elliptic curve SECP256R1 only
8 * - SHA-256 only
9 * - AES-CCM-8 only
10 *
11 * The library compiles in this configuration, but the example
12 * programs `ssl_client2` and `ssl_server2` require the
13 * modifications from `baremetal_test.h`.
14 */
15/*
16 * Copyright (C) 2006-2018, ARM Limited, All Rights Reserved
17 * SPDX-License-Identifier: Apache-2.0
18 *
19 * Licensed under the Apache License, Version 2.0 (the "License"); you may
20 * not use this file except in compliance with the License.
21 * You may obtain a copy of the License at
22 *
23 * http://www.apache.org/licenses/LICENSE-2.0
24 *
25 * Unless required by applicable law or agreed to in writing, software
26 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
27 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
28 * See the License for the specific language governing permissions and
29 * limitations under the License.
30 *
31 * This file is part of mbed TLS (https://tls.mbed.org)
32 */
33
34#ifndef MBEDTLS_BAREMETAL_CONFIG_H
35#define MBEDTLS_BAREMETAL_CONFIG_H
36
37#define MBEDTLS_HAVE_TIME
38#define MBEDTLS_HAVE_TIME_DATE
39
40/* Symmetric crypto: AES-CCM only */
41#define MBEDTLS_CIPHER_C
42#define MBEDTLS_AES_C
43#define MBEDTLS_AES_ROM_TABLES
44#define MBEDTLS_AES_FEWER_TABLES
45#define MBEDTLS_CCM_C
46
47/* Asymmetric crypto: Single-curve ECC only. */
48#define MBEDTLS_BIGNUM_C
49#define MBEDTLS_PK_C
50#define MBEDTLS_PK_PARSE_C
51#define MBEDTLS_PK_WRITE_C
52#define MBEDTLS_ECDH_C
53#define MBEDTLS_ECDSA_C
54#define MBEDTLS_ECP_C
55#define MBEDTLS_ECP_DP_SECP256R1_ENABLED
56#define MBEDTLS_ECP_NIST_OPTIM
57#define MBEDTLS_ECDSA_DETERMINISTIC
58
59/* Key exchanges */
60#define MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED
61#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECDHE_ECDSA_WITH_AES_256_CCM_8
62
63/* Digests - just SHA-256 */
64#define MBEDTLS_MD_C
65#define MBEDTLS_SHA256_C
66#define MBEDTLS_SHA256_SMALLER
67
68/* TLS options */
69#define MBEDTLS_SSL_CLI_C
70#define MBEDTLS_SSL_TLS_C
71#define MBEDTLS_SSL_PROTO_TLS1_2
72#define MBEDTLS_SSL_EXTENDED_MASTER_SECRET
73#define MBEDTLS_SSL_SESSION_TICKETS
74#define MBEDTLS_SSL_COOKIE_C
75#define MBEDTLS_SSL_PROTO_DTLS /* TODO: Unset TLS one possible. */
76#define MBEDTLS_SSL_DTLS_ANTI_REPLAY
77#define MBEDTLS_SSL_DTLS_HELLO_VERIFY
78#define MBEDTLS_SSL_DTLS_BADMAC_LIMIT
79
80/* X.509 CRT parsing */
81#define MBEDTLS_X509_USE_C
82#define MBEDTLS_X509_CRT_PARSE_C
83#define MBEDTLS_X509_CHECK_KEY_USAGE
84#define MBEDTLS_X509_CHECK_EXTENDED_KEY_USAGE
85#define MBEDTLS_ASN1_PARSE_C
86
87/* X.509 CSR writing */
88#define MBEDTLS_X509_CSR_WRITE_C
89#define MBEDTLS_X509_CREATE_C
90#define MBEDTLS_ASN1_WRITE_C
91
92/* RNG and PRNG */
93#define MBEDTLS_NO_PLATFORM_ENTROPY
94#define MBEDTLS_ENTROPY_C
95#define MBEDTLS_HMAC_DRBG_C
96
97#define MBEDTLS_OID_C
98#define MBEDTLS_PLATFORM_C
99
100/* I/O buffer configuration */
101#define MBEDTLS_SSL_MAX_CONTENT_LEN 2048
102
103/* Server-side only */
104#define MBEDTLS_SSL_TICKET_C
105#define MBEDTLS_SSL_SRV_C
106
107#if defined(MBEDTLS_USER_CONFIG_FILE)
108#include MBEDTLS_USER_CONFIG_FILE
109#endif
110
111#include <mbedtls/check_config.h>
112
113#endif /* MBEDTLS_BAREMETAL_CONFIG_H */