E-MailRelay
gssl_mbedtls_headers.h
Go to the documentation of this file.
1//
2// Copyright (C) 2001-2024 Graeme Walker <graeme_walker@users.sourceforge.net>
3//
4// This program is free software: you can redistribute it and/or modify
5// it under the terms of the GNU General Public License as published by
6// the Free Software Foundation, either version 3 of the License, or
7// (at your option) any later version.
8//
9// This program is distributed in the hope that it will be useful,
10// but WITHOUT ANY WARRANTY; without even the implied warranty of
11// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12// GNU General Public License for more details.
13//
14// You should have received a copy of the GNU General Public License
15// along with this program. If not, see <http://www.gnu.org/licenses/>.
16// ===
17///
18/// \file gssl_mbedtls_headers.h
19///
20
21#ifndef G_SSL_MBEDTLS_HEADERS_H
22#define G_SSL_MBEDTLS_HEADERS_H
23
24#include "gdef.h"
25
26// workround for msvc 'c linkage function cannot return
27// c++ class' with mbedtls 3.x and msvc 2019 -- see also
28// https://github.com/Mbed-TLS/mbedtls/issues/7087
29#if !defined(GCONFIG_MBEDTLS_INCLUDE_PSA_CRYPTO_STRUCT)
30 #if defined(_MSC_VER) && _MSC_VER <= 1929 && defined(__has_include)
31 #if __has_include(<psa/crypto_struct.h>)
32 #define GCONFIG_MBEDTLS_INCLUDE_PSA_CRYPTO_STRUCT 1
33 #define GCONFIG_MBEDTLS_DISABLE_PSA_HEADER 1
34 #else
35 #define GCONFIG_MBEDTLS_INCLUDE_PSA_CRYPTO_STRUCT 0
36 #endif
37 #else
38 #define GCONFIG_MBEDTLS_INCLUDE_PSA_CRYPTO_STRUCT 0
39 #endif
40#endif
41
42// 3.3.0's psa/crypto_extra.h is broken for c++17
43#if !defined(GCONFIG_MBEDTLS_DISABLE_PSA_HEADER)
44 #define GCONFIG_MBEDTLS_DISABLE_PSA_HEADER 0
45#endif
46
47#if GCONFIG_MBEDTLS_DISABLE_PSA_HEADER
48#define PSA_CRYPTO_EXTRA_H
49#endif
50
51#if GCONFIG_MBEDTLS_INCLUDE_PSA_CRYPTO_STRUCT
52#include <psa/crypto_struct.h>
53#endif
54
55#include <mbedtls/ssl_ciphersuites.h>
56#include <mbedtls/entropy.h>
57#if GCONFIG_HAVE_MBEDTLS_NET_H
58#include <mbedtls/net.h>
59#else
60#include <mbedtls/net_sockets.h>
61#endif
62#include <mbedtls/ctr_drbg.h>
63#include <mbedtls/error.h>
64#include <mbedtls/version.h>
65#include <mbedtls/pem.h>
66#include <mbedtls/base64.h>
67#include <mbedtls/debug.h>
68#include <mbedtls/md5.h>
69#include <mbedtls/sha1.h>
70#include <mbedtls/sha256.h>
71#include <mbedtls/sha512.h>
72
73#endif