blob: 534f01658ca8895002f3f3ecb985574bb952afb7 [file] [log] [blame]
Bence Szépkúti5ab73032021-05-27 11:25:03 +02001/**
Ronald Cron135f2ae2023-02-08 12:25:38 +01002 * \file mbedtls/build_info.h
Bence Szépkúti5ab73032021-05-27 11:25:03 +02003 *
4 * \brief Build-time configuration info
5 *
6 * Include this file if you need to depend on the
Bence Szépkútie55a8212021-06-28 15:15:56 +01007 * configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE
Bence Szépkúti5ab73032021-05-27 11:25:03 +02008 */
Gilles Peskine449bd832023-01-11 14:50:10 +01009/*
10 * Copyright The Mbed TLS Contributors
Dave Rodgman16799db2023-11-02 19:47:20 +000011 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
Gilles Peskine449bd832023-01-11 14:50:10 +010012 */
Bence Szépkúti5ab73032021-05-27 11:25:03 +020013
14#ifndef MBEDTLS_BUILD_INFO_H
15#define MBEDTLS_BUILD_INFO_H
16
Ronald Cron51f228c2024-11-06 14:32:52 +010017#include "tf-psa-crypto/build_info.h"
18
Bence Szépkúti04982f72021-06-21 14:40:51 +020019/*
20 * This set of compile-time defines can be used to determine the version number
Bence Szépkúti1b2a8832021-06-28 10:26:11 +010021 * of the Mbed TLS library used. Run-time variables for the same can be found in
Bence Szépkúti04982f72021-06-21 14:40:51 +020022 * version.h
23 */
24
25/**
26 * The version number x.y.z is split into three parts.
27 * Major, Minor, Patchlevel
28 */
David Horstmann7ba04a22024-09-03 17:36:30 +010029#define MBEDTLS_VERSION_MAJOR 4
30#define MBEDTLS_VERSION_MINOR 0
Minos Galanakis4492dbd2024-03-21 15:52:49 +000031#define MBEDTLS_VERSION_PATCH 0
Bence Szépkúti04982f72021-06-21 14:40:51 +020032
33/**
34 * The single version number has the following structure:
35 * MMNNPP00
36 * Major version | Minor version | Patch version
37 */
David Horstmann7ba04a22024-09-03 17:36:30 +010038#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úti04982f72021-06-21 14:40:51 +020041
Gilles Peskinec8d45cd2024-05-29 09:34:20 +020042#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 Peskined33eb552024-05-16 14:44:15 +020048
Ronald Cron51f228c2024-11-06 14:32:52 +010049/* X.509 and TLS configuration */
Bence Szépkúti5ab73032021-05-27 11:25:03 +020050#if !defined(MBEDTLS_CONFIG_FILE)
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +020051#include "mbedtls/mbedtls_config.h"
Bence Szépkúti5ab73032021-05-27 11:25:03 +020052#else
53#include MBEDTLS_CONFIG_FILE
54#endif
55
Bence Szépkúti1cafe5c2021-06-22 09:30:08 +020056#if defined(MBEDTLS_CONFIG_VERSION) && ( \
57 MBEDTLS_CONFIG_VERSION < 0x03000000 || \
Gilles Peskine449bd832023-01-11 14:50:10 +010058 MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER)
Bence Szépkútib2e23de2021-06-21 15:53:07 +020059#error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
Bence Szépkútiba7248a2021-05-31 16:53:56 +020060#endif
61
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020062/* 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 Peskined33eb552024-05-16 14:44:15 +020071/* 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 Peskinedc720b02023-09-04 17:50:28 +020077#include "mbedtls/config_adjust_x509.h"
78
Gilles Peskineedc23792023-09-04 17:53:11 +020079#include "mbedtls/config_adjust_ssl.h"
Ronald Crond8d2ea52022-10-04 15:48:06 +020080
Gilles Peskined33eb552024-05-16 14:44:15 +020081/* 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útic5c9eb42021-05-27 23:31:30 +020088#include "mbedtls/check_config.h"
89
Bence Szépkúti5ab73032021-05-27 11:25:03 +020090#endif /* MBEDTLS_BUILD_INFO_H */