Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 1 | /* |
| 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 Ban | 81daed0 | 2019-05-20 15:05:22 +0100 | [diff] [blame^] | 6 | * Copyright (c) 2019, Arm Limited. |
| 7 | * |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 8 | * 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 Ban | 581034a | 2017-12-19 19:54:37 +0000 | [diff] [blame] | 28 | * - RSA signature verification |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 29 | */ |
| 30 | |
| 31 | #ifndef MBEDTLS_CONFIG_BOOT_H |
| 32 | #define MBEDTLS_CONFIG_BOOT_H |
| 33 | |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 34 | /* System support */ |
| 35 | #define MBEDTLS_PLATFORM_C |
| 36 | #define MBEDTLS_PLATFORM_MEMORY |
| 37 | #define MBEDTLS_MEMORY_BUFFER_ALLOC_C |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 38 | #define MBEDTLS_NO_PLATFORM_ENTROPY |
| 39 | #define MBEDTLS_NO_DEFAULT_ENTROPY_SOURCES |
Tamas Ban | 81daed0 | 2019-05-20 15:05:22 +0100 | [diff] [blame^] | 40 | |
| 41 | #define MBEDTLS_PLATFORM_EXIT_ALT |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 42 | #define MBEDTLS_PLATFORM_PRINTF_ALT |
| 43 | |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 44 | #define MBEDTLS_RSA_C |
| 45 | #define MBEDTLS_PKCS1_V15 |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 46 | |
| 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 Ban | 81daed0 | 2019-05-20 15:05:22 +0100 | [diff] [blame^] | 56 | #if MCUBOOT_SIGN_RSA_LEN == 3072 |
| 57 | #define MBEDTLS_MPI_MAX_SIZE 384 |
| 58 | #else /* RSA2048 */ |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 59 | #define MBEDTLS_MPI_MAX_SIZE 256 |
Tamas Ban | f70ef8c | 2017-12-19 15:35:09 +0000 | [diff] [blame] | 60 | #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 */ |