Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 1 | /** |
Ronald Cron | 135f2ae | 2023-02-08 12:25:38 +0100 | [diff] [blame] | 2 | * \file mbedtls/build_info.h |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 3 | * |
| 4 | * \brief Build-time configuration info |
| 5 | * |
| 6 | * Include this file if you need to depend on the |
Bence Szépkúti | e55a821 | 2021-06-28 15:15:56 +0100 | [diff] [blame] | 7 | * configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 8 | */ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 9 | /* |
| 10 | * Copyright The Mbed TLS Contributors |
Dave Rodgman | 16799db | 2023-11-02 19:47:20 +0000 | [diff] [blame] | 11 | * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 12 | */ |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 13 | |
| 14 | #ifndef MBEDTLS_BUILD_INFO_H |
| 15 | #define MBEDTLS_BUILD_INFO_H |
| 16 | |
Ronald Cron | 51f228c | 2024-11-06 14:32:52 +0100 | [diff] [blame^] | 17 | #include "tf-psa-crypto/build_info.h" |
| 18 | |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 19 | /* |
| 20 | * This set of compile-time defines can be used to determine the version number |
Bence Szépkúti | 1b2a883 | 2021-06-28 10:26:11 +0100 | [diff] [blame] | 21 | * of the Mbed TLS library used. Run-time variables for the same can be found in |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 22 | * version.h |
| 23 | */ |
| 24 | |
| 25 | /** |
| 26 | * The version number x.y.z is split into three parts. |
| 27 | * Major, Minor, Patchlevel |
| 28 | */ |
David Horstmann | 7ba04a2 | 2024-09-03 17:36:30 +0100 | [diff] [blame] | 29 | #define MBEDTLS_VERSION_MAJOR 4 |
| 30 | #define MBEDTLS_VERSION_MINOR 0 |
Minos Galanakis | 4492dbd | 2024-03-21 15:52:49 +0000 | [diff] [blame] | 31 | #define MBEDTLS_VERSION_PATCH 0 |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 32 | |
| 33 | /** |
| 34 | * The single version number has the following structure: |
| 35 | * MMNNPP00 |
| 36 | * Major version | Minor version | Patch version |
| 37 | */ |
David Horstmann | 7ba04a2 | 2024-09-03 17:36:30 +0100 | [diff] [blame] | 38 | #define MBEDTLS_VERSION_NUMBER 0x04000000 |
| 39 | #define MBEDTLS_VERSION_STRING "4.0.0" |
| 40 | #define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 4.0.0" |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 41 | |
Gilles Peskine | c8d45cd | 2024-05-29 09:34:20 +0200 | [diff] [blame] | 42 | #if defined(MBEDTLS_CONFIG_FILES_READ) |
| 43 | #error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!" |
| 44 | #endif |
| 45 | #if defined(MBEDTLS_CONFIG_IS_FINALIZED) |
| 46 | #error "Something went wrong: MBEDTLS_CONFIG_IS_FINALIZED defined before reading the config files!" |
| 47 | #endif |
Gilles Peskine | d33eb55 | 2024-05-16 14:44:15 +0200 | [diff] [blame] | 48 | |
Ronald Cron | 51f228c | 2024-11-06 14:32:52 +0100 | [diff] [blame^] | 49 | /* X.509 and TLS configuration */ |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 50 | #if !defined(MBEDTLS_CONFIG_FILE) |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 51 | #include "mbedtls/mbedtls_config.h" |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 52 | #else |
| 53 | #include MBEDTLS_CONFIG_FILE |
| 54 | #endif |
| 55 | |
Bence Szépkúti | 1cafe5c | 2021-06-22 09:30:08 +0200 | [diff] [blame] | 56 | #if defined(MBEDTLS_CONFIG_VERSION) && ( \ |
| 57 | MBEDTLS_CONFIG_VERSION < 0x03000000 || \ |
Gilles Peskine | 449bd83 | 2023-01-11 14:50:10 +0100 | [diff] [blame] | 58 | MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER) |
Bence Szépkúti | b2e23de | 2021-06-21 15:53:07 +0200 | [diff] [blame] | 59 | #error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported" |
Bence Szépkúti | ba7248a | 2021-05-31 16:53:56 +0200 | [diff] [blame] | 60 | #endif |
| 61 | |
Bence Szépkúti | c5c9eb4 | 2021-05-27 23:31:30 +0200 | [diff] [blame] | 62 | /* Target and application specific configurations |
| 63 | * |
| 64 | * Allow user to override any previous default. |
| 65 | * |
| 66 | */ |
| 67 | #if defined(MBEDTLS_USER_CONFIG_FILE) |
| 68 | #include MBEDTLS_USER_CONFIG_FILE |
| 69 | #endif |
| 70 | |
Gilles Peskine | d33eb55 | 2024-05-16 14:44:15 +0200 | [diff] [blame] | 71 | /* Indicate that all configuration files have been read. |
| 72 | * It is now time to adjust the configuration (follow through on dependencies, |
| 73 | * make PSA and legacy crypto consistent, etc.). |
| 74 | */ |
| 75 | #define MBEDTLS_CONFIG_FILES_READ |
| 76 | |
Gilles Peskine | dc720b0 | 2023-09-04 17:50:28 +0200 | [diff] [blame] | 77 | #include "mbedtls/config_adjust_x509.h" |
| 78 | |
Gilles Peskine | edc2379 | 2023-09-04 17:53:11 +0200 | [diff] [blame] | 79 | #include "mbedtls/config_adjust_ssl.h" |
Ronald Cron | d8d2ea5 | 2022-10-04 15:48:06 +0200 | [diff] [blame] | 80 | |
Gilles Peskine | d33eb55 | 2024-05-16 14:44:15 +0200 | [diff] [blame] | 81 | /* Indicate that all configuration symbols are set, |
| 82 | * even the ones that are calculated programmatically. |
| 83 | * It is now safe to query the configuration (to check it, to size buffers, |
| 84 | * etc.). |
| 85 | */ |
| 86 | #define MBEDTLS_CONFIG_IS_FINALIZED |
| 87 | |
Bence Szépkúti | c5c9eb4 | 2021-05-27 23:31:30 +0200 | [diff] [blame] | 88 | #include "mbedtls/check_config.h" |
| 89 | |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 90 | #endif /* MBEDTLS_BUILD_INFO_H */ |