OpenVPN 3 Core Library
|
Unit test for OpenVPN Protocol implementation (class ProtoContext) More...
#include "test_common.hpp"
#include <iostream>
#include <string>
#include <sstream>
#include <deque>
#include <algorithm>
#include <cstring>
#include <limits>
#include <thread>
#include <gmock/gmock.h>
#include <openvpn/common/platform.hpp>
#include <openvpn/ssl/sslchoose.hpp>
#include <openvpn/client/cliproto.hpp>
#include <openvpn/common/exception.hpp>
#include <openvpn/common/file.hpp>
#include <openvpn/common/count.hpp>
#include <openvpn/time/time.hpp>
#include <openvpn/random/mtrandapi.hpp>
#include <openvpn/frame/frame.hpp>
#include <openvpn/ssl/proto.hpp>
#include <openvpn/init/initprocess.hpp>
#include <openvpn/crypto/cryptodcsel.hpp>
#include <openvpn/crypto/selftest.hpp>
Go to the source code of this file.
Classes | |
class | DroughtMeasure |
class | TestProto |
class | TestProtoClient |
class | TestProtoServer |
class | NoisyWire |
class | MySessionStats |
class | ProtoUnitTest |
class | MockCallback |
class | EventQueueVector |
Macros | |
#define | OPENVPN_DEBUG |
#define | USE_TLS_CRYPT_V2 |
#define | BF 0 |
#define | TLS_TIMEOUT_CLIENT 2000 |
#define | TLS_TIMEOUT_SERVER 2000 |
#define | SIMULATE_OOO |
#define | SIMULATE_DROPPED |
#define | SIMULATE_CORRUPTED |
#define | RENEG 900 |
#define | FEEDBACK 1 |
#define | ITER 1000000 |
#define | SITER 1 |
#define | N_RETRIES 2 |
#define | STRINGIZE1(x) #x |
#define | STRINGIZE(x) STRINGIZE1(x) |
#define | PROTO_CIPHER "AES-128-CBC" |
#define | TLS_VER_MIN TLSVersion::Type::UNDEF |
#define | PROTO_DIGEST "SHA1" |
#define | COMP_METH CompressContext::LZO_STUB |
Functions | |
static auto | create_client_ssl_config (Frame::Ptr frame, ClientRandomAPI::Ptr rng, bool tls_version_mismatch=false) |
static auto | create_client_proto_context (ClientSSLAPI::Config::Ptr cc, Frame::Ptr frame, ClientRandomAPI::Ptr rng, MySessionStats::Ptr cli_stats, Time &time, const std::string &tls_crypt_v2_key_fn="") |
int | test (const int thread_num, bool use_tls_ekm, bool tls_version_mismatch, const std::string &tls_crypt_v2_key_fn="", bool use_tls_auth_with_tls_crypt_v2=false) |
int | test_retry (const int thread_num, const int n_retries, bool use_tls_ekm) |
TEST_F (ProtoUnitTest, base_single_thread_tls_ekm) | |
TEST_F (ProtoUnitTest, base_single_thread_no_tls_ekm) | |
TEST_F (ProtoUnitTest, base_single_thread_tls_crypt_v2_with_embedded_serverkey) | |
TEST_F (ProtoUnitTest, base_single_thread_tls_crypt_v2_with_missing_embedded_serverkey) | |
TEST_F (ProtoUnitTest, base_single_thread_tls_crypt_v2_with_tls_auth_also_active) | |
TEST_F (ProtoUnitTest, base_multiple_thread) | |
TEST (proto, iv_ciphers_aead) | |
TEST (proto, iv_ciphers_non_preferred) | |
TEST (proto, iv_ciphers_legacy) | |
TEST (proto, controlmessage_invalidchar) | |
TEST (proto, client_proto_check_cc_msg) | |
Variables | |
const char | message [] |
Unit test for OpenVPN Protocol implementation (class ProtoContext)
Definition in file test_proto.cpp.
#define BF 0 |
Definition at line 44 of file test_proto.cpp.
#define COMP_METH CompressContext::LZO_STUB |
Definition at line 162 of file test_proto.cpp.
#define FEEDBACK 1 |
Definition at line 101 of file test_proto.cpp.
#define ITER 1000000 |
Definition at line 110 of file test_proto.cpp.
#define N_RETRIES 2 |
Definition at line 122 of file test_proto.cpp.
#define OPENVPN_DEBUG |
Definition at line 34 of file test_proto.cpp.
#define PROTO_CIPHER "AES-128-CBC" |
Definition at line 144 of file test_proto.cpp.
#define PROTO_DIGEST "SHA1" |
Definition at line 151 of file test_proto.cpp.
#define RENEG 900 |
Definition at line 96 of file test_proto.cpp.
#define SIMULATE_CORRUPTED |
Definition at line 89 of file test_proto.cpp.
#define SIMULATE_DROPPED |
Definition at line 88 of file test_proto.cpp.
#define SIMULATE_OOO |
Definition at line 87 of file test_proto.cpp.
#define SITER 1 |
Definition at line 117 of file test_proto.cpp.
#define STRINGIZE | ( | x | ) | STRINGIZE1(x) |
Definition at line 136 of file test_proto.cpp.
#define STRINGIZE1 | ( | x | ) | #x |
Definition at line 135 of file test_proto.cpp.
#define TLS_TIMEOUT_CLIENT 2000 |
Definition at line 79 of file test_proto.cpp.
#define TLS_TIMEOUT_SERVER 2000 |
Definition at line 82 of file test_proto.cpp.
#define TLS_VER_MIN TLSVersion::Type::UNDEF |
Definition at line 145 of file test_proto.cpp.
#define USE_TLS_CRYPT_V2 |
Definition at line 39 of file test_proto.cpp.
|
static |
|
static |
Create a client ssl config for testing.
Definition at line 862 of file test_proto.cpp.
int test | ( | const int | thread_num, |
bool | use_tls_ekm, | ||
bool | tls_version_mismatch, | ||
const std::string & | tls_crypt_v2_key_fn = "" , |
||
bool | use_tls_auth_with_tls_crypt_v2 = false |
||
) |
Definition at line 974 of file test_proto.cpp.
TEST | ( | proto | , |
client_proto_check_cc_msg | |||
) |
Definition at line 1468 of file test_proto.cpp.
TEST | ( | proto | , |
controlmessage_invalidchar | |||
) |
Definition at line 1409 of file test_proto.cpp.
TEST | ( | proto | , |
iv_ciphers_aead | |||
) |
Definition at line 1325 of file test_proto.cpp.
TEST | ( | proto | , |
iv_ciphers_legacy | |||
) |
Definition at line 1363 of file test_proto.cpp.
TEST | ( | proto | , |
iv_ciphers_non_preferred | |||
) |
Definition at line 1344 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_multiple_thread | |||
) |
Definition at line 1295 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_single_thread_no_tls_ekm | |||
) |
Definition at line 1255 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_single_thread_tls_crypt_v2_with_embedded_serverkey | |||
) |
Definition at line 1276 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_single_thread_tls_crypt_v2_with_missing_embedded_serverkey | |||
) |
Definition at line 1282 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_single_thread_tls_crypt_v2_with_tls_auth_also_active | |||
) |
Definition at line 1288 of file test_proto.cpp.
TEST_F | ( | ProtoUnitTest | , |
base_single_thread_tls_ekm | |||
) |
Definition at line 1243 of file test_proto.cpp.
int test_retry | ( | const int | thread_num, |
const int | n_retries, | ||
bool | use_tls_ekm | ||
) |
const char message[] |
Definition at line 255 of file test_proto.cpp.