scorpiox-bot-plugin-ntfy
←build_info.hc
203 lines · 6 KBHEADBlameDownload
1/**
2 * \file mbedtls/build_info.h
3 *
4 * \brief Build-time configuration info
5 *
6 * Include this file if you need to depend on the
7 * configuration options defined in mbedtls_config.h or MBEDTLS_CONFIG_FILE
8 */
9/*
10 * Copyright The Mbed TLS Contributors
11 * SPDX-License-Identifier: Apache-2.0 OR GPL-2.0-or-later
12 */
13
14#ifndef MBEDTLS_BUILD_INFO_H
15#define MBEDTLS_BUILD_INFO_H
16
17/*
18 * This set of compile-time defines can be used to determine the version number
19 * of the Mbed TLS library used. Run-time variables for the same can be found in
20 * version.h
21 */
22
23/**
24 * The version number x.y.z is split into three parts.
25 * Major, Minor, Patchlevel
26 */
27#define MBEDTLS_VERSION_MAJOR 3
28#define MBEDTLS_VERSION_MINOR 6
29#define MBEDTLS_VERSION_PATCH 6
30
31/**
32 * The single version number has the following structure:
33 * MMNNPP00
34 * Major version | Minor version | Patch version
35 */
36#define MBEDTLS_VERSION_NUMBER 0x03060600
37#define MBEDTLS_VERSION_STRING "3.6.6"
38#define MBEDTLS_VERSION_STRING_FULL "Mbed TLS 3.6.6"
39
40/* Macros for build-time platform detection */
41
42#if !defined(MBEDTLS_ARCH_IS_ARM64) && \
43 (defined(__aarch64__) || defined(_M_ARM64) || defined(_M_ARM64EC))
44#define MBEDTLS_ARCH_IS_ARM64
45#endif
46
47#if !defined(MBEDTLS_ARCH_IS_ARM32) && \
48 (defined(__arm__) || defined(_M_ARM) || \
49 defined(_M_ARMT) || defined(__thumb__) || defined(__thumb2__))
50#define MBEDTLS_ARCH_IS_ARM32
51#endif
52
53#if !defined(MBEDTLS_ARCH_IS_X64) && \
54 (defined(__amd64__) || defined(__x86_64__) || \
55 ((defined(_M_X64) || defined(_M_AMD64)) && !defined(_M_ARM64EC)))
56#define MBEDTLS_ARCH_IS_X64
57#endif
58
59#if !defined(MBEDTLS_ARCH_IS_X86) && \
60 (defined(__i386__) || defined(_X86_) || \
61 (defined(_M_IX86) && !defined(_M_I86)))
62#define MBEDTLS_ARCH_IS_X86
63#endif
64
65#if !defined(MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64) && \
66 (defined(_M_ARM64) || defined(_M_ARM64EC))
67#define MBEDTLS_PLATFORM_IS_WINDOWS_ON_ARM64
68#endif
69
70/* This is defined if the architecture is Armv8-A, or higher */
71#if !defined(MBEDTLS_ARCH_IS_ARMV8_A)
72#if defined(__ARM_ARCH) && defined(__ARM_ARCH_PROFILE)
73#if (__ARM_ARCH >= 8) && (__ARM_ARCH_PROFILE == 'A')
74/* GCC, clang, armclang and IAR */
75#define MBEDTLS_ARCH_IS_ARMV8_A
76#endif
77#elif defined(__ARM_ARCH_8A)
78/* Alternative defined by clang */
79#define MBEDTLS_ARCH_IS_ARMV8_A
80#elif defined(_M_ARM64) || defined(_M_ARM64EC)
81/* MSVC ARM64 is at least Armv8.0-A */
82#define MBEDTLS_ARCH_IS_ARMV8_A
83#endif
84#endif
85
86#if defined(__GNUC__) && !defined(__ARMCC_VERSION) && !defined(__clang__) \
87 && !defined(__llvm__) && !defined(__INTEL_COMPILER)
88/* Defined if the compiler really is gcc and not clang, etc */
89#define MBEDTLS_COMPILER_IS_GCC
90#define MBEDTLS_GCC_VERSION \
91 (__GNUC__ * 10000 + __GNUC_MINOR__ * 100 + __GNUC_PATCHLEVEL__)
92#endif
93
94#if defined(_MSC_VER) && !defined(_CRT_SECURE_NO_DEPRECATE)
95#define _CRT_SECURE_NO_DEPRECATE 1
96#endif
97
98/* Define `inline` on some non-C99-compliant compilers. */
99#if (defined(__ARMCC_VERSION) || defined(_MSC_VER)) && \
100 !defined(inline) && !defined(__cplusplus)
101#define inline __inline
102#endif
103
104#if defined(MBEDTLS_CONFIG_FILES_READ)
105#error "Something went wrong: MBEDTLS_CONFIG_FILES_READ defined before reading the config files!"
106#endif
107#if defined(MBEDTLS_CONFIG_IS_FINALIZED)
108#error "Something went wrong: MBEDTLS_CONFIG_IS_FINALIZED defined before reading the config files!"
109#endif
110
111/* X.509, TLS and non-PSA crypto configuration */
112/*
113 * plugin_ntfy patch (vendored tree): the build system of the SCORPIOX BOT
114 * plugin release CLI passes a FIXED flag set (-O2 -w -I src -I vendor plus a
115 * validated plugin.json flag list that forbids quotes and spaces), so it
116 * cannot carry -DMBEDTLS_CONFIG_FILE="...". The client configuration is
117 * therefore named here instead, next to the upstream default it replaces.
118 * An explicit -DMBEDTLS_CONFIG_FILE still wins, so the upstream contract is
119 * preserved for anyone building this tree another way.
120 */
121#if defined(MBEDTLS_CONFIG_FILE)
122#include MBEDTLS_CONFIG_FILE
123#else
124#include "sx_ntfy_mbedtls_config.h"
125#endif
126
127#if defined(MBEDTLS_CONFIG_VERSION) && ( \
128 MBEDTLS_CONFIG_VERSION < 0x03000000 || \
129 MBEDTLS_CONFIG_VERSION > MBEDTLS_VERSION_NUMBER)
130#error "Invalid config version, defined value of MBEDTLS_CONFIG_VERSION is unsupported"
131#endif
132
133/* Target and application specific configurations
134 *
135 * Allow user to override any previous default.
136 *
137 */
138#if defined(MBEDTLS_USER_CONFIG_FILE)
139#include MBEDTLS_USER_CONFIG_FILE
140#endif
141
142/* PSA crypto configuration */
143#if defined(MBEDTLS_PSA_CRYPTO_CONFIG)
144#if defined(MBEDTLS_PSA_CRYPTO_CONFIG_FILE)
145#include MBEDTLS_PSA_CRYPTO_CONFIG_FILE
146#else
147#include "psa/crypto_config.h"
148#endif
149#if defined(MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE)
150#include MBEDTLS_PSA_CRYPTO_USER_CONFIG_FILE
151#endif
152#endif /* defined(MBEDTLS_PSA_CRYPTO_CONFIG) */
153
154/* Indicate that all configuration files have been read.
155 * It is now time to adjust the configuration (follow through on dependencies,
156 * make PSA and legacy crypto consistent, etc.).
157 */
158#define MBEDTLS_CONFIG_FILES_READ
159
160/* Auto-enable MBEDTLS_CTR_DRBG_USE_128_BIT_KEY if
161 * MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH and MBEDTLS_CTR_DRBG_C defined
162 * to ensure a 128-bit key size in CTR_DRBG.
163 */
164#if defined(MBEDTLS_AES_ONLY_128_BIT_KEY_LENGTH) && defined(MBEDTLS_CTR_DRBG_C)
165#define MBEDTLS_CTR_DRBG_USE_128_BIT_KEY
166#endif
167
168/* Auto-enable MBEDTLS_MD_C if needed by a module that didn't require it
169 * in a previous release, to ensure backwards compatibility.
170 */
171#if defined(MBEDTLS_PKCS5_C)
172#define MBEDTLS_MD_C
173#endif
174
175/* PSA crypto specific configuration options
176 * - If config_psa.h reads a configuration option in preprocessor directive,
177 * this symbol should be set before its inclusion. (e.g. MBEDTLS_MD_C)
178 * - If config_psa.h writes a configuration option in conditional directive,
179 * this symbol should be consulted after its inclusion.
180 * (e.g. MBEDTLS_MD_LIGHT)
181 */
182#if defined(MBEDTLS_PSA_CRYPTO_CONFIG) /* PSA_WANT_xxx influences MBEDTLS_xxx */ || \
183 defined(MBEDTLS_PSA_CRYPTO_C) /* MBEDTLS_xxx influences PSA_WANT_xxx */ || \
184 defined(MBEDTLS_PSA_CRYPTO_CLIENT) /* The same as the previous, but with separation only */
185#include "mbedtls/config_psa.h"
186#endif
187
188#include "mbedtls/config_adjust_legacy_crypto.h"
189
190#include "mbedtls/config_adjust_x509.h"
191
192#include "mbedtls/config_adjust_ssl.h"
193
194/* Indicate that all configuration symbols are set,
195 * even the ones that are calculated programmatically.
196 * It is now safe to query the configuration (to check it, to size buffers,
197 * etc.).
198 */
199#define MBEDTLS_CONFIG_IS_FINALIZED
200
201#include "mbedtls/check_config.h"
202
203#endif /* MBEDTLS_BUILD_INFO_H */