Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 1 | /** |
| 2 | * \file build_info.h |
| 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 | */ |
| 9 | /* |
| 10 | * Copyright The Mbed TLS Contributors |
| 11 | * SPDX-License-Identifier: Apache-2.0 |
| 12 | * |
| 13 | * Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 14 | * not use this file except in compliance with the License. |
| 15 | * You may obtain a copy of the License at |
| 16 | * |
| 17 | * http://www.apache.org/licenses/LICENSE-2.0 |
| 18 | * |
| 19 | * Unless required by applicable law or agreed to in writing, software |
| 20 | * distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 21 | * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 22 | * See the License for the specific language governing permissions and |
| 23 | * limitations under the License. |
| 24 | */ |
| 25 | |
| 26 | #ifndef MBEDTLS_BUILD_INFO_H |
| 27 | #define MBEDTLS_BUILD_INFO_H |
| 28 | |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 29 | /* |
| 30 | * 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] | 31 | * 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] | 32 | * version.h |
| 33 | */ |
| 34 | |
| 35 | /** |
| 36 | * The version number x.y.z is split into three parts. |
| 37 | * Major, Minor, Patchlevel |
| 38 | */ |
Dave Rodgman | 1bc9e93 | 2021-07-01 09:20:13 +0100 | [diff] [blame] | 39 | #define MBEDTLS_VERSION_MAJOR 3 |
Paul Elliott | 20362cd | 2022-07-08 12:21:35 +0100 | [diff] [blame] | 40 | #define MBEDTLS_VERSION_MINOR 2 |
Paul Elliott | cd08ba0 | 2022-07-12 10:36:53 +0100 | [diff] [blame] | 41 | #define MBEDTLS_VERSION_PATCH 1 |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 42 | |
| 43 | /** |
| 44 | * The single version number has the following structure: |
| 45 | * MMNNPP00 |
| 46 | * Major version | Minor version | Patch version |
| 47 | */ |
Paul Elliott | cd08ba0 | 2022-07-12 10:36:53 +0100 | [diff] [blame] | 48 | #define MBEDTLS_VERSION_NUMBER 0x03020100 |
| 49 | #define MBEDTLS_VERSION_STRING "3.2.1" |
| 50 | #define MBEDTLS_VERSION_STRING_FULL "mbed TLS 3.2.1" |
Bence Szépkúti | 04982f7 | 2021-06-21 14:40:51 +0200 | [diff] [blame] | 51 | |
Bence Szépkúti | c5c9eb4 | 2021-05-27 23:31:30 +0200 | [diff] [blame] | 52 | #if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE) |
| 53 | #define _CRT_SECURE_NO_DEPRECATE 1 |
| 54 | #endif |
| 55 | |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 56 | #if !defined(MBEDTLS_CONFIG_FILE) |
Bence Szépkúti | bb0cfeb | 2021-05-28 09:42:25 +0200 | [diff] [blame] | 57 | #include "mbedtls/mbedtls_config.h" |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 58 | #else |
| 59 | #include MBEDTLS_CONFIG_FILE |
| 60 | #endif |
| 61 | |
Bence Szépkúti | 1cafe5c | 2021-06-22 09:30:08 +0200 | [diff] [blame] | 62 | #if defined(MBEDTLS_CONFIG_VERSION) && ( \ |
| 63 | MBEDTLS_CONFIG_VERSION < 0x03000000 || \ |
Bence Szépkúti | a1d1f5b | 2021-06-28 09:49:04 +0100 | [diff] [blame] | 64 | MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER ) |
Bence Szépkúti | b2e23de | 2021-06-21 15:53:07 +0200 | [diff] [blame] | 65 | #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] | 66 | #endif |
| 67 | |
Bence Szépkúti | c5c9eb4 | 2021-05-27 23:31:30 +0200 | [diff] [blame] | 68 | /* Target and application specific configurations |
| 69 | * |
| 70 | * Allow user to override any previous default. |
| 71 | * |
| 72 | */ |
| 73 | #if defined(MBEDTLS_USER_CONFIG_FILE) |
| 74 | #include MBEDTLS_USER_CONFIG_FILE |
| 75 | #endif |
| 76 | |
Andrzej Kurek | 8d2864d | 2022-01-17 15:30:06 +0100 | [diff] [blame] | 77 | #if defined(MBEDTLS_PK_C) && defined(MBEDTLS_USE_PSA_CRYPTO) |
| 78 | #define MBEDTLS_PK_WRITE_C |
| 79 | #endif |
Przemek Stekiel | a06787a | 2022-09-02 14:41:44 +0200 | [diff] [blame] | 80 | |
Ronald Cron | 571f1ff | 2022-10-04 09:33:27 +0200 | [diff] [blame^] | 81 | #if !defined(MBEDTLS_SSL_PROTO_TLS1_2) |
| 82 | #undef MBEDTLS_KEY_EXCHANGE_RSA_ENABLED |
| 83 | #undef MBEDTLS_KEY_EXCHANGE_DHE_RSA_ENABLED |
| 84 | #undef MBEDTLS_KEY_EXCHANGE_ECDHE_RSA_ENABLED |
| 85 | #undef MBEDTLS_KEY_EXCHANGE_ECDHE_ECDSA_ENABLED |
| 86 | #undef MBEDTLS_KEY_EXCHANGE_PSK_ENABLED |
| 87 | #undef MBEDTLS_KEY_EXCHANGE_DHE_PSK_ENABLED |
| 88 | #undef MBEDTLS_KEY_EXCHANGE_RSA_PSK_ENABLED |
| 89 | #undef MBEDTLS_KEY_EXCHANGE_ECDHE_PSK_ENABLED |
| 90 | #undef MBEDTLS_KEY_EXCHANGE_ECDH_RSA_ENABLED |
| 91 | #undef MBEDTLS_KEY_EXCHANGE_ECDH_ECDSA_ENABLED |
| 92 | #undef MBEDTLS_KEY_EXCHANGE_ECJPAKE_ENABLED |
| 93 | #endif |
| 94 | |
Ronald Cron | d8d2ea5 | 2022-10-04 15:48:06 +0200 | [diff] [blame] | 95 | #if !defined(MBEDTLS_SSL_PROTO_TLS1_3) |
| 96 | #undef MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED |
| 97 | #undef MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED |
| 98 | #undef MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED |
| 99 | #endif |
| 100 | |
| 101 | #if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_ENABLED) || \ |
| 102 | defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) |
| 103 | #define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_SOME_PSK_ENABLED |
| 104 | #endif |
| 105 | |
| 106 | #if defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_EPHEMERAL_ENABLED) || \ |
| 107 | defined(MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_PSK_EPHEMERAL_ENABLED) |
| 108 | #define MBEDTLS_SSL_TLS1_3_KEY_EXCHANGE_MODE_SOME_EPHEMERAL_ENABLED |
| 109 | #endif |
| 110 | |
Przemek Stekiel | a06787a | 2022-09-02 14:41:44 +0200 | [diff] [blame] | 111 | /* Make sure all configuration symbols are set before including check_config.h, |
| 112 | * even the ones that are calculated programmatically. */ |
| 113 | #if defined(MBEDTLS_PSA_CRYPTO_CONFIG) /* PSA_WANT_xxx influences MBEDTLS_xxx */ || \ |
| 114 | defined(MBEDTLS_PSA_CRYPTO_C) /* MBEDTLS_xxx influences PSA_WANT_xxx */ |
Bence Szépkúti | c5c9eb4 | 2021-05-27 23:31:30 +0200 | [diff] [blame] | 115 | #include "mbedtls/config_psa.h" |
| 116 | #endif |
| 117 | |
| 118 | #include "mbedtls/check_config.h" |
| 119 | |
Bence Szépkúti | 5ab7303 | 2021-05-27 11:25:03 +0200 | [diff] [blame] | 120 | #endif /* MBEDTLS_BUILD_INFO_H */ |