|
| | OPENVPN_UNTAGGED_EXCEPTION_INHERIT (option_error, proto_error) |
| |
| | OPENVPN_UNTAGGED_EXCEPTION_INHERIT (option_error, process_server_push_error) |
| |
| | OPENVPN_UNTAGGED_EXCEPTION_INHERIT (option_error, proto_option_error) |
| |
| std::string | dump_packet (const Buffer &buf) |
| |
| template<typename S > |
| void | write_control_string (const S &str) |
| |
| | OPENVPN_SIMPLE_EXCEPTION (select_key_context_error) |
| |
| | ProtoContext (ProtoContextCallbackInterface *cb_arg, const ProtoConfig::Ptr &config_arg, const SessionStats::Ptr &stats_arg) |
| |
| void | reset_tls_wrap_mode (const ProtoConfig &c) |
| |
| uint32_t | get_tls_warnings () const |
| |
| bool | uses_bs64_cipher () const |
| |
| void | reset_tls_crypt (const ProtoConfig &c, const OpenVPNStaticKey &key) |
| |
| void | set_dynamic_tls_crypt (const ProtoConfig &c, const KeyContext::Ptr &key_ctx) |
| |
| void | reset_tls_crypt_server (const ProtoConfig &c) |
| |
| void | reset (const ProtoSessionID cookie_psid=ProtoSessionID()) |
| | Resets ProtoContext *this to it's initial state.
|
| |
| void | set_protocol (const Protocol &p) |
| |
| void | pre_destroy () |
| |
| bool | primary_defined () |
| |
| virtual | ~ProtoContext ()=default |
| |
| PacketType | packet_type (const Buffer &buf) |
| |
| void | start (const ProtoSessionID cookie_psid=ProtoSessionID()) |
| | Initialize the state machine and start protocol negotiation.
|
| |
| void | renegotiate () |
| |
| void | flush (const bool control_channel) |
| |
| void | housekeeping () |
| |
| Time | next_housekeeping () const |
| |
| void | control_send (BufferPtr &&app_bp) |
| |
| void | control_send (BufferAllocated &&app_buf) |
| |
| bool | control_net_validate (const PacketType &type, const Buffer &net_buf) |
| |
| bool | control_net_recv (const PacketType &type, BufferPtr &&net_bp) |
| |
| bool | control_net_recv (const PacketType &type, BufferAllocated &&net_buf) |
| | pass received control channel network packets (ciphertext) into protocol object
|
| |
| void | data_encrypt (BufferAllocated &in_out) |
| |
| bool | data_decrypt (const PacketType &type, BufferAllocated &in_out) |
| |
| void | disconnect (const Error::Type reason) |
| |
| void | send_explicit_exit_notify () |
| |
| void | update_last_sent () |
| |
| bool | data_channel_ready () const |
| |
| unsigned int | negotiations () const |
| |
| const Time::Duration & | slowest_handshake () |
| |
| bool | invalidated () const |
| |
| Error::Type | invalidation_reason () const |
| |
| void | init_data_channel () |
| |
| void | process_push (const OptionList &opt, const ProtoContextCompressionOptions &pco) |
| |
| size_t | align_adjust_hint () const |
| |
| bool | is_keepalive_enabled () const |
| |
| void | disable_keepalive (unsigned int &keepalive_ping, unsigned int &keepalive_timeout) |
| |
| void | data_limit_notify (const unsigned int key_id, const DataLimit::Mode cdl_mode, const DataLimit::State cdl_status) |
| |
| CryptoDCSettings & | dc_settings () |
| |
| void | reset_dc_factory () |
| |
| void | set_local_peer_id (const int local_peer_id) |
| |
| const Time & | now () const |
| |
| void | update_now () |
| |
| const Frame & | frame () const |
| |
| const Frame::Ptr & | frameptr () const |
| |
| const Mode & | mode () const |
| |
| bool | is_server () const |
| |
| bool | is_client () const |
| |
| bool | is_tcp () |
| |
| bool | is_udp () |
| |
| const ProtoConfig & | conf () const |
| |
| ProtoConfig & | conf () |
| |
| ProtoConfig::Ptr | conf_ptr () const |
| |
| SessionStats & | stat () const |
| |
| bool | is_state_client_wait_reset_ack () const |
| |
|
| static const char * | opcode_name (const unsigned int opcode) |
| |
| static void | write_uint16_length (const size_t size, Buffer &buf) |
| |
| static uint16_t | read_uint16_length (Buffer &buf) |
| |
| template<typename S > |
| static void | write_auth_string (const S &str, Buffer &buf) |
| |
| template<typename S > |
| static S | read_auth_string (Buffer &buf) |
| |
| template<typename S > |
| static void | write_control_string (const S &str, Buffer &buf) |
| |
| static void | write_empty_string (Buffer &buf) |
| |
| template<typename S > |
| static S | read_control_string (const Buffer &buf) |
| |
| static bool | opcode_carries_wkc (const unsigned int opcode) |
| | Does a packet with this opcode carry a WKc?
|
| |
| static void | wrap_tls_auth (const unsigned int opcode, Buffer &buf, PacketIDControlSend &pid_send, const PacketIDControl::time_t now_secs, const size_t hmac_size, const ProtoSessionID &psid_self, const unsigned int key_id, OvpnHMACInstance &ta_hmac_send) |
| | tls-auth: [op][psid][hmac][pid][payload]
|
| |
| static void | wrap_tls_crypt (const unsigned int opcode, BufferAllocated &buf, BufferAllocated &work, Frame &frame, PacketIDControlSend &pid_send, const PacketIDControl::time_t now_secs, const size_t hmac_size, const ProtoSessionID &psid_self, const unsigned int key_id, TLSCryptInstance &tls_crypt_send, const Buffer *wkc) |
| |
| static void | wrap_tls_plain (const unsigned int opcode, Buffer &buf, const ProtoSessionID &psid_self, const unsigned int key_id) |
| | plaintext control channel: [op][psid][payload]
|
| |
| static UnwrapStatus | unwrap_tls_auth (Buffer &recv, const size_t hmac_size, OvpnHMACInstance &ta_hmac_recv, const PacketIDControlReceive &pid_recv, ProtoSessionID &src_psid, PacketIDControl &pid) |
| |
| static UnwrapStatus | unwrap_tls_crypt (BufferAllocated &recv, BufferAllocated &work, Frame &frame, const size_t hmac_size, TLSCryptInstance &tls_crypt_recv, const PacketIDControlReceive &pid_recv, ProtoSessionID &src_psid, PacketIDControl &pid) |
| |
| static void | build_tls_auth (const ProtoConfig &c, OvpnHMACInstance::Ptr &send, OvpnHMACInstance::Ptr &recv) |
| |
| static void | build_tls_crypt (const ProtoConfig &c, const bool server, const OpenVPNStaticKey &key, TLSCryptInstance::Ptr &send, TLSCryptInstance::Ptr &recv) |
| |
| static int | log_level () |
| | return the current logging level for all logging
|
| |
| static void | set_log_level (int level) |
| | set the log level for all loggigng
|
| |
|
| enum | {
KEY_ID_MASK = 0x07
, OPCODE_SHIFT = 3
, CONTROL_SOFT_RESET_V1 = 3
, CONTROL_V1 = 4
,
CONTROL_WKC_V1 = 11
, CONTROL_OOB_V1 = 12
, CONTROL_OOB_WKC_V1 = 13
, ACK_V1 = 5
,
DATA_V1 = 6
, DATA_V2 = 9
, CONTROL_HARD_RESET_CLIENT_V2 = 7
, CONTROL_HARD_RESET_CLIENT_V3 = 10
,
CONTROL_HARD_RESET_SERVER_V2 = 8
, INVALID_OPCODE = 0
, OP_SIZE_V2 = 4
, OP_PEER_ID_UNDEF = 0x00FFFFFF
,
STATE_UNDEF = -1
, C_WAIT_RESET_ACK = 0
, C_WAIT_AUTH_ACK = 1
, S_WAIT_RESET_ACK = 2
,
S_WAIT_AUTH_ACK = 3
, LAST_ACK_STATE = 3
, C_INITIAL = 4
, C_WAIT_RESET = 5
,
C_WAIT_AUTH = 6
, S_INITIAL = 7
, S_WAIT_RESET = 8
, S_WAIT_AUTH = 9
,
ACTIVE = 10
} |
| |
| enum | iv_proto_flag : unsigned int {
IV_PROTO_DATA_V2 = (1 << 1)
, IV_PROTO_REQUEST_PUSH = (1 << 2)
, IV_PROTO_TLS_KEY_EXPORT = (1 << 3)
, IV_PROTO_AUTH_PENDING_KW = (1 << 4)
,
IV_PROTO_NCP_P2P = (1 << 5)
, IV_PROTO_DNS_OPTION = (1 << 6)
, IV_PROTO_CC_EXIT_NOTIFY = (1 << 7)
, IV_PROTO_AUTH_FAIL_TEMP = (1 << 8)
,
IV_PROTO_DYN_TLS_CRYPT = (1 << 9)
, IV_PROTO_DATA_EPOCH = (1 << 10)
, IV_PROTO_DNS_OPTION_V2 = (1 << 11)
, IV_PROTO_PUSH_UPDATE = (1 << 12)
} |
| |
| enum | tlv_types : uint16_t { EARLY_NEG_FLAGS = 0x0001
} |
| |
| enum | early_neg_flags : uint16_t { EARLY_NEG_FLAG_RESEND_WKC = 0x0001
} |
| |
Definition at line 205 of file proto.hpp.
Resets ProtoContext *this to it's initial state.
- Parameters
-
| cookie_psid | the ProtoSessionID parameter that allows a server implementation using the psid cookie mechanism to pass in the verified hmac server session cookie. In the client implementation, the parameter is meaningless and defaults to an empty ProtoSessionID which is created at compile time since the default ProtoSessionID ctor is constexpr. For the default cookie_psid, defined() returns false (vs true for the verified session cookie) so the absence of a parameter selects the correct code path. |
tls-auth/tls-crypt packet id. We start with a different id here to indicate EARLY_NEG_START/CONTROL_WKC_V1 support
Initialize tls_auth packet ID for the send case
The second argument sets the expected packet id. If the server implementation is using the psid cookie mechanism, the state creation is deferred until the client's second packet, id 1, is received; otherwise we expect to handle the 1st packet, id 0.
Definition at line 4733 of file proto.hpp.
Kc, the tls-crypt-v2 client key this session's control channel is keyed with.
Per session: a server has one per client, unwrapped from that client's WKc, where ProtoConfig::tls_crypt_key holds the server key every WKc is wrapped with – or, with tls_crypt_v2_serverkey_id, nothing at all. A client has only its own. The contexts above do the encrypting; this is kept because set_dynamic_tls_crypt() has to mix the same key in at both ends.
Definition at line 5569 of file proto.hpp.