blob: 1bb133dc7d960599a8632c0b755d764b679ba00e [file] [log] [blame]
Bence Szépkúti5ab73032021-05-27 11:25:03 +02001/**
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útibb0cfeb2021-05-28 09:42:25 +02007 * configuration options defined in mbedtls_config.h
Bence Szépkúti5ab73032021-05-27 11:25:03 +02008 */
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úti04982f72021-06-21 14:40:51 +020029/*
30 * This set of compile-time defines can be used to determine the version number
31 * of the mbed TLS library used. Run-time variables for the same can be found in
32 * version.h
33 */
34
35/**
36 * The version number x.y.z is split into three parts.
37 * Major, Minor, Patchlevel
38 */
39#define MBEDTLS_VERSION_MAJOR 2
40#define MBEDTLS_VERSION_MINOR 26
41#define MBEDTLS_VERSION_PATCH 0
42
43/**
44 * The single version number has the following structure:
45 * MMNNPP00
46 * Major version | Minor version | Patch version
47 */
48#define MBEDTLS_VERSION_NUMBER 0x021A0000
49#define MBEDTLS_VERSION_STRING "2.26.0"
50#define MBEDTLS_VERSION_STRING_FULL "mbed TLS 2.26.0"
51
Bence Szépkúti2bb74562021-06-21 16:19:00 +020052/**
53 * Equal to the #MBEDTLS_VERSION_NUMBER of the mbedtls version that introduced
54 * the most recent config version
55 */
56#define MBEDTLS_CONFIG_VERSION_LATEST 0x03000000
Bence Szépkútib2e23de2021-06-21 15:53:07 +020057
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020058#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
59#define _CRT_SECURE_NO_DEPRECATE 1
60#endif
61
Bence Szépkúti5ab73032021-05-27 11:25:03 +020062#if !defined(MBEDTLS_CONFIG_FILE)
Bence Szépkútibb0cfeb2021-05-28 09:42:25 +020063#include "mbedtls/mbedtls_config.h"
Bence Szépkúti5ab73032021-05-27 11:25:03 +020064#else
65#include MBEDTLS_CONFIG_FILE
66#endif
67
Bence Szépkútib2e23de2021-06-21 15:53:07 +020068#if !defined(MBEDTLS_CONFIG_VERSION)
69#define MBEDTLS_CONFIG_VERSION MBEDTLS_CONFIG_VERSION_LATEST
70#elif MBEDTLS_CONFIG_VERSION != MBEDTLS_CONFIG_VERSION_LATEST
71#error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
Bence Szépkútiba7248a2021-05-31 16:53:56 +020072#endif
73
Bence Szépkútid3da5032021-06-02 11:31:51 +020074#if defined(MBEDTLS_USER_CONFIG_VERSION)
75#error "MBEDTLS_USER_CONFIG_VERSION defined outside MBEDTLS_USER_CONFIG_FILE"
76#endif
77
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020078/* Target and application specific configurations
79 *
80 * Allow user to override any previous default.
81 *
82 */
83#if defined(MBEDTLS_USER_CONFIG_FILE)
84#include MBEDTLS_USER_CONFIG_FILE
Bence Szépkútib2e23de2021-06-21 15:53:07 +020085#if defined(MBEDTLS_USER_CONFIG_VERSION) && \
Bence Szépkútiba7248a2021-05-31 16:53:56 +020086 MBEDTLS_USER_CONFIG_VERSION != MBEDTLS_CONFIG_VERSION
87#error "Version mismatch between config file and MBEDTLS_USER_CONFIG_FILE"
88#endif
Bence Szépkútic5c9eb42021-05-27 23:31:30 +020089#endif
90
91#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
92#include "mbedtls/config_psa.h"
93#endif
94
95#include "mbedtls/check_config.h"
96
Bence Szépkúti5ab73032021-05-27 11:25:03 +020097#endif /* MBEDTLS_BUILD_INFO_H */