OpenVPN 3 Core Library
Loading...
Searching...
No Matches
openvpn::ProtoContext::ProbeWrap Class Reference

Wrap an out-of-band SERVER_PROBE / unwrap the matching PROBE_REPLY. More...

#include <proto.hpp>

Collaboration diagram for openvpn::ProtoContext::ProbeWrap:
[legend]

Public Member Functions

 ProbeWrap (const ProtoConfig::Ptr &config_arg, const SessionStats::Ptr &stats)
 Pick the wrap mode from config_arg and build the crypto contexts for it.
 
const ProtoSessionIDself_psid () const
 the client session id carried in the probe (echoed back in the reply)
 
void wrap (BufferAllocated &buf, BufferAllocated &work)
 Wrap an already-encoded SERVER_PROBE payload in place.
 
UnwrapStatus unwrap (BufferAllocated &recv, BufferAllocated &work, ProtoSessionID &src_psid, PacketIDControl &pid)
 Unwrap a received PROBE_REPLY in place.
 

Private Attributes

ProtoConfig::Ptr config
 
TLSWrapMode mode = TLS_PLAIN
 
size_t hmac_size = 0
 
OvpnHMACInstance::Ptr ta_hmac_send
 
OvpnHMACInstance::Ptr ta_hmac_recv
 
TLSCryptInstance::Ptr tls_crypt_send
 
TLSCryptInstance::Ptr tls_crypt_recv
 
PacketIDControlSend ta_pid_send
 
PacketIDControlReceive ta_pid_recv
 
ProtoSessionID psid_self
 

Static Private Attributes

static constexpr unsigned int KEY_ID = 0
 

Detailed Description

Wrap an out-of-band SERVER_PROBE / unwrap the matching PROBE_REPLY.

Applies whichever control-channel protection is configured (tls-auth, tls-crypt, tls-crypt-v2 or plaintext), built directly from a ProtoConfig – no session exists yet. The on-wire framing is identical to an in-session control packet (the wrap_ / unwrap_ helpers), so a standard server accepts it. The probe is always sent by the client; for tls-crypt-v2 the wrapped client key (WKc) is appended (opcode CONTROL_OOB_WKC_V1) so a stateless server can derive the session key and unwrap the probe.

Definition at line 1995 of file proto.hpp.

Constructor & Destructor Documentation

◆ ProbeWrap()

openvpn::ProtoContext::ProbeWrap::ProbeWrap ( const ProtoConfig::Ptr config_arg,
const SessionStats::Ptr stats 
)
inline

Pick the wrap mode from config_arg and build the crypto contexts for it.

Definition at line 1999 of file proto.hpp.

Member Function Documentation

◆ self_psid()

const ProtoSessionID & openvpn::ProtoContext::ProbeWrap::self_psid ( ) const
inline

the client session id carried in the probe (echoed back in the reply)

Definition at line 2029 of file proto.hpp.

Here is the caller graph for this function:

◆ unwrap()

UnwrapStatus openvpn::ProtoContext::ProbeWrap::unwrap ( BufferAllocated recv,
BufferAllocated work,
ProtoSessionID src_psid,
PacketIDControl pid 
)
inline

Unwrap a received PROBE_REPLY in place.

Parameters
recvthe wrapped packet on entry, the plaintext OOB payload on return (when OK)
workscratch buffer (used only by the tls-crypt paths)
src_psidset to the server's session id
pidset to the packet id (unset for plaintext)
Returns
the crypto/framing status; OK means recv holds the payload

Definition at line 2069 of file proto.hpp.

Here is the caller graph for this function:

◆ wrap()

void openvpn::ProtoContext::ProbeWrap::wrap ( BufferAllocated buf,
BufferAllocated work 
)
inline

Wrap an already-encoded SERVER_PROBE payload in place.

Parameters
bufholds the plaintext OOB payload on entry, the wrapped packet on return
workscratch buffer (used only by the tls-crypt paths)

Definition at line 2040 of file proto.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ config

ProtoConfig::Ptr openvpn::ProtoContext::ProbeWrap::config
private

Definition at line 2107 of file proto.hpp.

◆ hmac_size

size_t openvpn::ProtoContext::ProbeWrap::hmac_size = 0
private

Definition at line 2109 of file proto.hpp.

◆ KEY_ID

constexpr unsigned int openvpn::ProtoContext::ProbeWrap::KEY_ID = 0
staticconstexprprivate

Definition at line 2105 of file proto.hpp.

◆ mode

TLSWrapMode openvpn::ProtoContext::ProbeWrap::mode = TLS_PLAIN
private

Definition at line 2108 of file proto.hpp.

◆ psid_self

ProtoSessionID openvpn::ProtoContext::ProbeWrap::psid_self
private

Definition at line 2118 of file proto.hpp.

◆ ta_hmac_recv

OvpnHMACInstance::Ptr openvpn::ProtoContext::ProbeWrap::ta_hmac_recv
private

Definition at line 2112 of file proto.hpp.

◆ ta_hmac_send

OvpnHMACInstance::Ptr openvpn::ProtoContext::ProbeWrap::ta_hmac_send
private

Definition at line 2111 of file proto.hpp.

◆ ta_pid_recv

PacketIDControlReceive openvpn::ProtoContext::ProbeWrap::ta_pid_recv
private

Definition at line 2117 of file proto.hpp.

◆ ta_pid_send

PacketIDControlSend openvpn::ProtoContext::ProbeWrap::ta_pid_send
private

Definition at line 2116 of file proto.hpp.

◆ tls_crypt_recv

TLSCryptInstance::Ptr openvpn::ProtoContext::ProbeWrap::tls_crypt_recv
private

Definition at line 2114 of file proto.hpp.

◆ tls_crypt_send

TLSCryptInstance::Ptr openvpn::ProtoContext::ProbeWrap::tls_crypt_send
private

Definition at line 2113 of file proto.hpp.


The documentation for this class was generated from the following file: