|
OpenVPN 3 Core Library
|
Tests for the tls-crypt-v2 arm of intercept() More...
Protected Member Functions | |
| PsidCookieTlsCryptV2Test () | |
| BufferAllocated | make_wkc (const std::string &metadata, int metadata_type=0x00) |
| Build the WKc a client appends to its handshake packets. | |
| BufferAllocated | wrap_wkc (const unsigned char *kc, const std::string &metadata, int metadata_type, size_t kc_size=OpenVPNStaticKey::KEY_SIZE) |
| BufferAllocated | build_third_packet_tls_crypt_v2 (const ProtoSessionID &cli_psid, const ProtoSessionID &cookie_psid, const BufferAllocated &wkc, unsigned char op_field) |
| Build the tls-crypt-v2 third packet of the 3-way handshake: a CONTROL_WKC_V1 wrapped with Kc, ACKing the server's HARD_RESET and echoing the cookie psid back, with the WKc appended. | |
| BufferAllocated | wrap_third_packet (const OpenVPNStaticKey &kc, const ProtoSessionID &cli_psid, const ProtoSessionID &cookie_psid, const BufferAllocated &wkc, unsigned char op_field, std::uint32_t own_pktid_be) |
| BufferAllocated | build_foreign_third_packet (const ProtoSessionID &cookie_psid, std::uint32_t own_pktid_be=0) |
| The handshake packet a client of this server can forge for another's address. | |
| BufferAllocated | build_first_packet_tls_crypt_v2 (const ProtoSessionID &cli_psid, const BufferAllocated &wkc) |
| Build the tls-crypt-v2 first handshake packet: a CONTROL_HARD_RESET_CLIENT_V3 with the WKc behind the tls-crypt frame. | |
Protected Member Functions inherited from PsidCookieInterceptTest | |
| BufferAllocated | build_third_packet_tls_auth (const ProtoSessionID &cli_psid, const ProtoSessionID &cookie_psid, std::uint32_t acked_pktid_be, std::uint32_t own_pktid_be, unsigned char ack_count, unsigned char op_field) |
| Fixture | make_fixture () |
Protected Member Functions inherited from PsidCookieTest | |
| PsidCookieTest () | |
| Time | set_clock (Time setting) |
| Time | advance_clock (uint64_t binary_ms) |
| void | SetUp () override |
| void | TearDown () override |
Static Protected Member Functions | |
| static unsigned char | wkc_v1_op_field () |
| the opcode of the third packet, the one whose WKc keys the session behind it | |
| static unsigned char | control_v1_op_field () |
| the opcode of the packets that follow, which carry no WKc to key a session from | |
Protected Attributes | |
| RCPtr< MetadataRecorderFactory > | meta_factory |
| unsigned char | client_key_raw_ [OpenVPNStaticKey::KEY_SIZE] |
| OpenVPNStaticKey | client_key_ |
| Kc, as the client keys its tls-crypt instance. | |
| OpenVPNStaticKey | server_key_ |
| Ka/Ke, used here to wrap the WKc. | |
Protected Attributes inherited from PsidCookieTest | |
| ServerProto::Factory::Ptr | spf |
| the server factory each session's ProtoConfig is cloned from | |
| std::unique_ptr< PsidCookieImpl > | pcookie_impl |
Static Protected Attributes | |
| static constexpr std::uint32_t | SERVER_KEY_ID = 0x063FE634 |
| K_id of test/ssl/06/063FE634.key, the server key the WKc names. | |
Tests for the tls-crypt-v2 arm of intercept()
The client's third packet (CONTROL_WKC_V1) carries the WKc, and unwrap_tls_crypt_wkc() strips it there, so this is the only place its metadata can be parsed; the handler that parsed the cookie layer judges it before a session exists.
The server this configures holds a tls-auth key as well, which is what PG deploys and the case reset_tls_wrap_mode() resolves to TLS_AUTH.
Definition at line 441 of file test_psid_cookie.cpp.
|
inlineprotected |
Definition at line 444 of file test_psid_cookie.cpp.
|
inlineprotected |
Build the tls-crypt-v2 first handshake packet: a CONTROL_HARD_RESET_CLIENT_V3 with the WKc behind the tls-crypt frame.
The cookie layer answers this one without decrypting it, so only the cleartext fields mean anything. What has to be exact is the geometry: on this opcode the unwrap expects the WKc to begin where the frame ends.
Definition at line 668 of file test_psid_cookie.cpp.
|
inlineprotected |
The handshake packet a client of this server can forge for another's address.
The WKc is the attacker's own, so it unwraps under the server key like any other, and the frame is wrapped with the very Kc that WKc carries, so it authenticates under the key the session installs from it. Nothing in it is the victim's.
Definition at line 641 of file test_psid_cookie.cpp.
|
inlineprotected |
Build the tls-crypt-v2 third packet of the 3-way handshake: a CONTROL_WKC_V1 wrapped with Kc, ACKing the server's HARD_RESET and echoing the cookie psid back, with the WKc appended.
Definition at line 573 of file test_psid_cookie.cpp.
|
inlinestaticprotected |
the opcode of the packets that follow, which carry no WKc to key a session from
Definition at line 698 of file test_psid_cookie.cpp.
|
inlineprotected |
Build the WKc a client appends to its handshake packets.
| metadata | Metadata payload; empty for a WKc carrying none. |
| metadata_type | Type byte prefixed to metadata: 0x00 for user metadata, 0x01 for the timestamp stock tls-crypt-v2-genkey emits. |
Definition at line 502 of file test_psid_cookie.cpp.
|
inlinestaticprotected |
the opcode of the third packet, the one whose WKc keys the session behind it
Definition at line 692 of file test_psid_cookie.cpp.
|
inlineprotected |
As build_third_packet_tls_crypt_v2(), but wrapping the frame with kc and numbering the message own_pktid_be rather than 0.
Definition at line 583 of file test_psid_cookie.cpp.
|
inlineprotected |
As make_wkc(), but wrapping kc_size bytes of kc instead of this client's key. A kc_size below KEY_SIZE builds a WKc no client should ever send: correctly tagged, and with less key inside than it takes to key anything.
Definition at line 510 of file test_psid_cookie.cpp.
|
protected |
Kc, as the client keys its tls-crypt instance.
Definition at line 708 of file test_psid_cookie.cpp.
|
protected |
Definition at line 707 of file test_psid_cookie.cpp.
|
protected |
Definition at line 706 of file test_psid_cookie.cpp.
|
protected |
Ka/Ke, used here to wrap the WKc.
Definition at line 709 of file test_psid_cookie.cpp.
|
staticconstexprprotected |
K_id of test/ssl/06/063FE634.key, the server key the WKc names.
Definition at line 704 of file test_psid_cookie.cpp.