blob: 3fd8cc0a3217ef2d74d7c6b8ecd4a20ae75173cf [file] [log] [blame]
Tamas Banf70ef8c2017-12-19 15:35:09 +00001/*
2 * Minimal configuration for using TLS in the bootloader
3 *
4 * Copyright (C) 2006-2015, ARM Limited, All Rights Reserved
5 * Copyright (C) 2016, Linaro Ltd
Tamas Ban81daed02019-05-20 15:05:22 +01006 * Copyright (c) 2019, Arm Limited.
7 *
Tamas Banf70ef8c2017-12-19 15:35:09 +00008 * SPDX-License-Identifier: Apache-2.0
9 *
10 * Licensed under the Apache License, Version 2.0 (the "License"); you may
11 * not use this file except in compliance with the License.
12 * You may obtain a copy of the License at
13 *
14 * http://www.apache.org/licenses/LICENSE-2.0
15 *
16 * Unless required by applicable law or agreed to in writing, software
17 * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
18 * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19 * See the License for the specific language governing permissions and
20 * limitations under the License.
21 *
22 * This file is part of mbed TLS (https://tls.mbed.org)
23 */
24
25/*
26 * Minimal configuration for using TLS in the bootloader
27 *
Tamas Ban581034a2017-12-19 19:54:37 +000028 * - RSA signature verification
Tamas Banf70ef8c2017-12-19 15:35:09 +000029 */
30
31#ifndef MBEDTLS_CONFIG_BOOT_H
32#define MBEDTLS_CONFIG_BOOT_H
33
Tamas Banf70ef8c2017-12-19 15:35:09 +000034/* System support */
35#define MBEDTLS_PLATFORM_C
36#define MBEDTLS_PLATFORM_MEMORY
37#define MBEDTLS_MEMORY_BUFFER_ALLOC_C
Tamas Banf70ef8c2017-12-19 15:35:09 +000038#define MBEDTLS_NO_PLATFORM_ENTROPY
39#define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES
Tamas Ban81daed02019-05-20 15:05:22 +010040
41#define MBEDTLS_PLATFORM_EXIT_ALT
Tamas Banf70ef8c2017-12-19 15:35:09 +000042#define MBEDTLS_PLATFORM_PRINTF_ALT
43
Tamas Banf70ef8c2017-12-19 15:35:09 +000044#define MBEDTLS_RSA_C
45#define MBEDTLS_PKCS1_V15
Tamas Banf70ef8c2017-12-19 15:35:09 +000046
47/* mbed TLS modules */
48#define MBEDTLS_ASN1_PARSE_C
49#define MBEDTLS_ASN1_WRITE_C
50#define MBEDTLS_BIGNUM_C
51#define MBEDTLS_MD_C
52#define MBEDTLS_OID_C
53#define MBEDTLS_SHA256_C
54
55/* Save RAM by adjusting to our exact needs */
Tamas Ban81daed02019-05-20 15:05:22 +010056#if MCUBOOT_SIGN_RSA_LEN == 3072
57#define MBEDTLS_MPI_MAX_SIZE 384
58#else /* RSA2048 */
Tamas Banf70ef8c2017-12-19 15:35:09 +000059#define MBEDTLS_MPI_MAX_SIZE 256
Tamas Banf70ef8c2017-12-19 15:35:09 +000060#endif
61
62#define MBEDTLS_SSL_MAX_CONTENT_LEN 1024
63
64/* Save ROM and a few bytes of RAM by specifying our own ciphersuite list */
65#define MBEDTLS_SSL_CIPHERSUITES MBEDTLS_TLS_ECJPAKE_WITH_AES_128_CCM_8
66
67#include "mbedtls/check_config.h"
68
69#endif /* MBEDTLS_CONFIG_BOOT_H */