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
16
17#ifdef USE_OPENSSL
20#endif
21
22#ifdef USE_MBEDTLS
23#include <mbedtls/platform.h>
24#include <mbedtls/debug.h> // for debug_set_threshold
27#ifdef OPENVPN_PLATFORM_UWP
28#include <openvpn/mbedtls/util/uwprand.hpp>
29#endif
30#endif
31
32namespace openvpn::SSLLib {
33#ifdef USE_MBEDTLS
34#define SSL_LIB_NAME "MbedTLS"
35using CryptoAPI = MbedTLSCryptoAPI;
36#if defined OPENVPN_PLATFORM_UWP
37using RandomAPI = MbedTLSRandomWithUWPEntropy;
38#else
40#endif
41#elif defined(USE_OPENSSL)
42#define SSL_LIB_NAME "OpenSSL"
43using CryptoAPI = OpenSSLCryptoAPI;
45#else
46#error no SSL library defined
47#endif
48} // namespace openvpn::SSLLib
49
50#endif
Abstract base class for random number generators.
Definition randapi.hpp:39