|
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 |
| struct | proto_test |
| class | ProtoUnitTest |
| class | TlsCryptV2WkcUnwrapTest |
| 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="", bool tls_auth_only=false, bool use_dynamic_tls_crypt=false) |
| int | test (const struct proto_test &t) |
| int | test_retry (const int n_retries, const struct proto_test &test_config) |
| TEST_F (ProtoUnitTest, BaseSingleThreadTlsEkm) | |
| TEST_F (ProtoUnitTest, BaseSingleThreadNoTlsEkm) | |
| TEST_F (ProtoUnitTest, BaseSingleThreadTlsCryptV2WithEmbeddedServerkey) | |
| TEST_F (ProtoUnitTest, BaseSingleThreadTlsCryptV2WithMissingEmbeddedServerkey) | |
| TEST_F (ProtoUnitTest, BaseSingleThreadTlsCryptV2WithTlsAuthAlsoActive) | |
| TEST_F (ProtoUnitTest, TlsAuthSessionSurvivesSpoofedTlsCryptV2Opcode) | |
| TEST_F (ProtoUnitTest, DynamicTlsCryptRekeysTlsCryptV2WithServerkeyInConfig) | |
| TEST_F (ProtoUnitTest, DynamicTlsCryptRekeysTlsCryptV2WithServerkeyId) | |
| TEST_F (ProtoUnitTest, DynamicTlsCryptRekeysTlsCryptV2OnTlsAuthServerWithServerkeyInConfig) | |
| TEST_F (ProtoUnitTest, DynamicTlsCryptRekeysTlsCryptV2OnTlsAuthServerWithServerkeyId) | |
| TEST_F (ProtoUnitTest, TlsCryptV2WkcRidesFirstControlPacket) | |
| TEST_F (ProtoUnitTest, TlsCryptV2WkcLargerThanControlPayload) | |
| TEST_F (ProtoUnitTest, TlsCryptV2ControlPacketCapHonored) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, RejectsWkcLenLargerThanPacket) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, RejectsWkcLenSmallerThanAuthTag) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, UnknownServerKeyIdIsAnErrorAndNotAnException) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripsResentWkc) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripRejectsWkcLenLargerThanPacket) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripRejectsWkcLenSmallerThanClientKey) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripRejectsWkcLeavingNoTlsCryptFrame) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripRejectsPacketShorterThanAFrame) | |
| TEST_F (TlsCryptV2WkcUnwrapTest, StripAccountsForServerKeyId) | |
| TEST_F (ProtoUnitTest, BaseMultipleThread) | |
| TEST (Proto, IvCiphersAead) | |
| TEST (Proto, IvCiphersNonPreferred) | |
| TEST (Proto, IvCiphersLegacy) | |
| TEST (Proto, ControlmessageInvalidchar) | |
| TEST (Proto, ClientProtoCheckCcMsg) | |
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 895 of file test_proto.cpp.
| int test | ( | const struct proto_test & | t | ) |
Definition at line 1042 of file test_proto.cpp.
| TEST | ( | Proto | , |
| ClientProtoCheckCcMsg | |||
| ) |
Definition at line 1886 of file test_proto.cpp.
| TEST | ( | Proto | , |
| ControlmessageInvalidchar | |||
| ) |
Definition at line 1827 of file test_proto.cpp.
| TEST | ( | Proto | , |
| IvCiphersAead | |||
| ) |
Definition at line 1743 of file test_proto.cpp.
| TEST | ( | Proto | , |
| IvCiphersLegacy | |||
| ) |
Definition at line 1781 of file test_proto.cpp.
| TEST | ( | Proto | , |
| IvCiphersNonPreferred | |||
| ) |
Definition at line 1762 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseMultipleThread | |||
| ) |
Definition at line 1713 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseSingleThreadNoTlsEkm | |||
| ) |
Definition at line 1392 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseSingleThreadTlsCryptV2WithEmbeddedServerkey | |||
| ) |
Definition at line 1413 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseSingleThreadTlsCryptV2WithMissingEmbeddedServerkey | |||
| ) |
Definition at line 1419 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseSingleThreadTlsCryptV2WithTlsAuthAlsoActive | |||
| ) |
Definition at line 1425 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| BaseSingleThreadTlsEkm | |||
| ) |
Definition at line 1380 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| DynamicTlsCryptRekeysTlsCryptV2OnTlsAuthServerWithServerkeyId | |||
| ) |
Definition at line 1489 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| DynamicTlsCryptRekeysTlsCryptV2OnTlsAuthServerWithServerkeyInConfig | |||
| ) |
Definition at line 1478 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| DynamicTlsCryptRekeysTlsCryptV2WithServerkeyId | |||
| ) |
Definition at line 1462 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| DynamicTlsCryptRekeysTlsCryptV2WithServerkeyInConfig | |||
| ) |
Definition at line 1453 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| TlsAuthSessionSurvivesSpoofedTlsCryptV2Opcode | |||
| ) |
Definition at line 1436 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| TlsCryptV2ControlPacketCapHonored | |||
| ) |
Definition at line 1529 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| TlsCryptV2WkcLargerThanControlPayload | |||
| ) |
Definition at line 1519 of file test_proto.cpp.
| TEST_F | ( | ProtoUnitTest | , |
| TlsCryptV2WkcRidesFirstControlPacket | |||
| ) |
Definition at line 1507 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| RejectsWkcLenLargerThanPacket | |||
| ) |
Definition at line 1606 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| RejectsWkcLenSmallerThanAuthTag | |||
| ) |
Definition at line 1617 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripAccountsForServerKeyId | |||
| ) |
Definition at line 1697 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripRejectsPacketShorterThanAFrame | |||
| ) |
Definition at line 1689 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripRejectsWkcLeavingNoTlsCryptFrame | |||
| ) |
Definition at line 1680 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripRejectsWkcLenLargerThanPacket | |||
| ) |
Definition at line 1663 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripRejectsWkcLenSmallerThanClientKey | |||
| ) |
Definition at line 1671 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| StripsResentWkc | |||
| ) |
Definition at line 1655 of file test_proto.cpp.
| TEST_F | ( | TlsCryptV2WkcUnwrapTest | , |
| UnknownServerKeyIdIsAnErrorAndNotAnException | |||
| ) |
Definition at line 1637 of file test_proto.cpp.
| int test_retry | ( | const int | n_retries, |
| const struct proto_test & | test_config | ||
| ) |
| const char message[] |
Definition at line 252 of file test_proto.cpp.