mirror of
https://github.com/deneraraujo/OpenVPNAdapter.git
synced 2026-04-24 00:00:05 +08:00
56284506fc
35bbca799 Merged in OVPN3-184-generate-warning (pull request #1) a73d2ce68 Merged in antonio/OVPN3-169-pure-ssl-transport (pull request #3) 8d7f5f3c1 Merged in feature/docker (pull request #2) d9b5055cd [OVPN3-169] cli.cpp: compile with -DOPENVPN_TLS_LINK when requested 2d99bbfea [OVPN3-169] cliopt.hpp: add support for TLS transport module 62c8461d2 [OVPN3-169] tcpcli.hpp: add runtime support for TLSLink e0e76bb28 [OVPN3-169] tcplink: introduce LinkBase abstract class a71014d40 [OVPN3-169] tcplink: create LinkCommon class and inherit from it cfd6df5bc build system: fix 'git apply' 3e49de7de [OVPN3-210] ovpncli: handle "allow-name-constraints" for OpenSSL 08d72bd76 [OVPN3-184] mbedtls: handle Name Constraints 40c70113d [OVPN3-184] Add mbedTLS patch ef8d11f34 [OVPN3-169] OpenSSL: implement write_ciphertext_unbuffered() function 37dc86378 [OVPN3-169] mbedTLS: implement write_ciphertext_unbuffered() function 5834ed401 [OVPN3-169] SSLAPI: add write_ciphertext_unbuffered() function 071050b5f vars-linux-dbg: update linux debug profile 5bbfe68c3 [OVPN3-169] Protocol: add support for TLS transport protocol type dc12d3189 [OVPN3-223] build: add docker images git-subtree-dir: OpenVPN Adapter/Vendors/openvpn git-subtree-split: 35bbca799dfa3fbe8e17f8d6e94c3946c397b593
95 lines
2.9 KiB
C++
95 lines
2.9 KiB
C++
// OpenVPN -- An application to securely tunnel IP networks
|
|
// over a single port, with support for SSL/TLS-based
|
|
// session authentication and key exchange,
|
|
// packet encryption, packet authentication, and
|
|
// packet compression.
|
|
//
|
|
// Copyright (C) 2012-2017 OpenVPN Inc.
|
|
//
|
|
// This program is free software: you can redistribute it and/or modify
|
|
// it under the terms of the GNU Affero General Public License Version 3
|
|
// as published by the Free Software Foundation.
|
|
//
|
|
// This program is distributed in the hope that it will be useful,
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
// GNU Affero General Public License for more details.
|
|
//
|
|
// You should have received a copy of the GNU Affero General Public License
|
|
// along with this program in the COPYING file.
|
|
// If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
#ifndef OPENVPN_SSL_SSLCHOOSE_H
|
|
#define OPENVPN_SSL_SSLCHOOSE_H
|
|
|
|
#ifdef USE_OPENSSL
|
|
#include <openvpn/openssl/crypto/api.hpp>
|
|
#include <openvpn/openssl/ssl/sslctx.hpp>
|
|
#include <openvpn/openssl/util/rand.hpp>
|
|
#endif
|
|
|
|
#ifdef USE_APPLE_SSL
|
|
#include <openvpn/applecrypto/crypto/api.hpp>
|
|
#include <openvpn/applecrypto/ssl/sslctx.hpp>
|
|
#include <openvpn/applecrypto/util/rand.hpp>
|
|
#endif
|
|
|
|
#ifdef USE_MBEDTLS
|
|
#include <mbedtls/platform.h>
|
|
#include <mbedtls/debug.h> // for debug_set_threshold
|
|
#include <openvpn/mbedtls/crypto/api.hpp>
|
|
#include <openvpn/mbedtls/ssl/sslctx.hpp>
|
|
#include <openvpn/mbedtls/util/rand.hpp>
|
|
#ifdef HAVE_OPENVPN_COMMON
|
|
#include <openvpn/mbedtls/ssl/sslctxnc.hpp>
|
|
#endif
|
|
#ifdef OPENVPN_PLATFORM_UWP
|
|
#include <openvpn/mbedtls/util/uwprand.hpp>
|
|
#endif
|
|
#endif
|
|
|
|
#ifdef USE_MBEDTLS_APPLE_HYBRID
|
|
#include <openvpn/applecrypto/crypto/api.hpp>
|
|
#include <openvpn/mbedtls/ssl/sslctx.hpp>
|
|
#include <openvpn/mbedtls/util/rand.hpp>
|
|
#endif
|
|
|
|
namespace openvpn {
|
|
namespace SSLLib {
|
|
#if defined(USE_MBEDTLS)
|
|
#define SSL_LIB_NAME "MbedTLS"
|
|
typedef MbedTLSCryptoAPI CryptoAPI;
|
|
#ifdef HAVE_OPENVPN_COMMON
|
|
typedef MbedTLSContextNameConstraints SSLAPI;
|
|
#else
|
|
typedef MbedTLSContext SSLAPI;
|
|
#endif
|
|
#if defined OPENVPN_PLATFORM_UWP
|
|
typedef MbedTLSRandomWithUWPEntropy RandomAPI;
|
|
#else
|
|
typedef MbedTLSRandom RandomAPI;
|
|
#endif
|
|
#elif defined(USE_MBEDTLS_APPLE_HYBRID)
|
|
// Uses Apple framework for CryptoAPI and MbedTLS for SSLAPI and RandomAPI
|
|
#define SSL_LIB_NAME "MbedTLSAppleHybrid"
|
|
typedef AppleCryptoAPI CryptoAPI;
|
|
typedef MbedTLSContext SSLAPI;
|
|
typedef MbedTLSRandom RandomAPI;
|
|
#elif defined(USE_APPLE_SSL)
|
|
#define SSL_LIB_NAME "AppleSSL"
|
|
typedef AppleCryptoAPI CryptoAPI;
|
|
typedef AppleSSLContext SSLAPI;
|
|
typedef AppleRandom RandomAPI;
|
|
#elif defined(USE_OPENSSL)
|
|
#define SSL_LIB_NAME "OpenSSL"
|
|
typedef OpenSSLCryptoAPI CryptoAPI;
|
|
typedef OpenSSLContext SSLAPI;
|
|
typedef OpenSSLRandom RandomAPI;
|
|
#else
|
|
#error no SSL library defined
|
|
#endif
|
|
}
|
|
}
|
|
|
|
#endif
|