OpenVPN 3 Core Library
Loading...
Searching...
No Matches
cryptochoose.hpp
Go to the documentation of this file.
1
// OpenVPN -- An application to securely tunnel IP networks
2
// over a single port, with support for SSL/TLS-based
3
// session authentication and key exchange,
4
// packet encryption, packet authentication, and
5
// packet compression.
6
//
7
// Copyright (C) 2012- OpenVPN Inc.
8
//
9
// SPDX-License-Identifier: MPL-2.0 OR AGPL-3.0-only WITH openvpn3-openssl-exception
10
//
11
12
#ifndef OPENVPN_CRYPTO_CRYPTO_CHOOSE_H
13
#define OPENVPN_CRYPTO_CRYPTO_CHOOSE_H
14
15
#include <
openvpn/crypto/definitions.hpp
>
16
17
#ifdef USE_OPENSSL
18
#include <
openvpn/openssl/crypto/api.hpp
>
19
#include <
openvpn/openssl/util/rand.hpp
>
20
#endif
21
22
#ifdef USE_MBEDTLS
23
#include <mbedtls/platform.h>
24
#include <mbedtls/debug.h>
// for debug_set_threshold
25
#include <
openvpn/mbedtls/crypto/api.hpp
>
26
#include <
openvpn/mbedtls/util/rand.hpp
>
27
#ifdef OPENVPN_PLATFORM_UWP
28
#include <openvpn/mbedtls/util/uwprand.hpp>
29
#endif
30
#endif
31
32
namespace
openvpn::SSLLib
{
33
#ifdef USE_MBEDTLS
34
#define SSL_LIB_NAME "MbedTLS"
35
using
CryptoAPI =
MbedTLSCryptoAPI
;
36
#if defined OPENVPN_PLATFORM_UWP
37
using
RandomAPI
= MbedTLSRandomWithUWPEntropy;
38
#else
39
using
RandomAPI
=
MbedTLSRandom
;
40
#endif
41
#elif defined(USE_OPENSSL)
42
#define SSL_LIB_NAME "OpenSSL"
43
using
CryptoAPI =
OpenSSLCryptoAPI
;
44
using
RandomAPI
=
OpenSSLRandom
;
45
#else
46
#error no SSL library defined
47
#endif
48
}
// namespace openvpn::SSLLib
49
50
#endif
openvpn::MbedTLSRandom
Definition
rand.hpp:31
openvpn::OpenSSLRandom
Definition
rand.hpp:26
openvpn::RandomAPI
Abstract base class for random number generators.
Definition
randapi.hpp:39
definitions.hpp
api.hpp
rand.hpp
openvpn::SSLLib
Definition
cryptochoose.hpp:32
api.hpp
rand.hpp
openvpn::MbedTLSCryptoAPI
Definition
api.hpp:25
openvpn::OpenSSLCryptoAPI
Definition
api.hpp:26
openvpn
crypto
cryptochoose.hpp
Generated by
1.9.8