OpenVPN
|
#include "forward.h"
Go to the source code of this file.
Macros | |
#define | PUSH_MSG_ERROR 0 |
#define | PUSH_MSG_REQUEST 1 |
#define | PUSH_MSG_REPLY 2 |
#define | PUSH_MSG_REQUEST_DEFERRED 3 |
#define | PUSH_MSG_AUTH_FAILURE 4 |
#define | PUSH_MSG_CONTINUATION 5 |
#define | PUSH_MSG_ALREADY_REPLIED 6 |
Functions | |
int | process_incoming_push_request (struct context *c) |
int | process_incoming_push_msg (struct context *c, const struct buffer *buffer, bool honor_received_options, unsigned int permission_mask, unsigned int *option_types_found) |
bool | send_push_request (struct context *c) |
void | receive_auth_failed (struct context *c, const struct buffer *buffer) |
void | server_pushed_signal (struct context *c, const struct buffer *buffer, const bool restart, const int adv) |
void | receive_exit_message (struct context *c) |
void | server_pushed_info (struct context *c, const struct buffer *buffer, const int adv) |
void | receive_cr_response (struct context *c, const struct buffer *buffer) |
void | incoming_push_message (struct context *c, const struct buffer *buffer) |
void | clone_push_list (struct options *o) |
void | push_option (struct options *o, const char *opt, int msglevel) |
void | push_options (struct options *o, char **p, int msglevel, struct gc_arena *gc) |
void | push_reset (struct options *o) |
void | push_remove_option (struct options *o, const char *p) |
void | remove_iroutes_from_push_route_list (struct options *o) |
void | send_auth_failed (struct context *c, const char *client_reason) |
bool | send_auth_pending_messages (struct tls_multi *tls_multi, struct tls_session *session, const char *extra, unsigned int timeout) |
Sends the auth pending control messages to a client. More... | |
void | send_restart (struct context *c, const char *kill_msg) |
void | send_push_reply_auth_token (struct tls_multi *multi) |
Sends a push reply message only containin the auth-token to update the auth-token on the client. More... | |
void | receive_auth_pending (struct context *c, const struct buffer *buffer) |
Parses an AUTH_PENDING message and if in pull mode extends the timeout. More... | |
void clone_push_list | ( | struct options * | o | ) |
Definition at line 875 of file push.c.
References options::gc, push_list::head, M_FATAL, push_entry::next, push_entry::option, options::push_list, push_option_ex(), push_reset(), and string_alloc().
Referenced by options_detach().
Definition at line 506 of file push.c.
References BSTR, context::c2, cleanup(), D_PUSH, D_PUSH_ERRORS, do_up(), context_2::es, event_timeout_clear(), gc_free(), gc_new(), msg, context::options, options_postprocess_pull(), process_incoming_push_msg(), options::pull, pull_permission_mask(), PUSH_MSG_CONTINUATION, PUSH_MSG_ERROR, PUSH_MSG_REPLY, options::push_option_types_found, context_2::push_request_interval, register_signal(), sanitize_control_message(), context::sig, status, and context_2::wait_for_connect.
Referenced by parse_incoming_control_channel_command().
int process_incoming_push_msg | ( | struct context * | c, |
const struct buffer * | buffer, | ||
bool | honor_received_options, | ||
unsigned int | permission_mask, | ||
unsigned int * | option_types_found | ||
) |
Definition at line 1081 of file push.c.
References buf_string_compare_advance(), context::c2, process_incoming_push_reply(), process_incoming_push_request(), PUSH_MSG_ERROR, push_reply_cmd, and context_2::push_request_received.
Referenced by incoming_push_message().
int process_incoming_push_request | ( | struct context * | c | ) |
Definition at line 961 of file push.c.
References context::c2, CAS_CONNECT_DONE, CAS_FAILED, gc_free(), gc_new(), tls_multi::multi_state, now, openvpn_time(), prepare_push_reply(), PUSH_MSG_ALREADY_REPLIED, PUSH_MSG_AUTH_FAILURE, PUSH_MSG_ERROR, PUSH_MSG_REQUEST, PUSH_MSG_REQUEST_DEFERRED, send_auth_failed(), send_push_reply(), context_2::sent_push_reply_expiry, TLS_AUTHENTICATION_FAILED, tls_authentication_status(), TLS_AUTHENTICATION_SUCCEEDED, tls_client_reason(), and context_2::tls_multi.
Referenced by multi_client_connect_late_setup(), and process_incoming_push_msg().
void push_option | ( | struct options * | o, |
const char * | opt, | ||
int | msglevel | ||
) |
Definition at line 869 of file push.c.
References options::gc, options::push_list, and push_option_ex().
Referenced by helper_client_server(), helper_keepalive(), helper_tcp_nodelay(), multi_client_connect_compress_migrate(), and push_options().
Definition at line 891 of file push.c.
References make_extended_arg_array(), print_argv(), and push_option().
Referenced by add_option().
void push_remove_option | ( | struct options * | o, |
const char * | p | ||
) |
Definition at line 923 of file push.c.
References D_PUSH_DEBUG, push_entry::enable, push_list::head, msg, push_entry::next, push_entry::option, options::push_ifconfig_ipv4_blocked, options::push_ifconfig_ipv6_blocked, options::push_list, and streq.
Referenced by add_option().
void push_reset | ( | struct options * | o | ) |
Definition at line 917 of file push.c.
References CLEAR, and options::push_list.
Referenced by add_option(), and clone_push_list().
Definition at line 50 of file push.c.
References AR_INTERACT, AR_NOINTERACT, AR_NONE, ASSERT, auth_retry_get(), BLEN, BSTR, buf_string_compare_advance(), buf_string_match_head_str(), M_VERB0, management_auth_failure(), msg, options::no_advance, context::options, parse_auth_failed_temp(), options::pull, register_signal(), context::sig, ssl_clean_auth_token(), ssl_purge_auth(), ssl_put_auth_challenge(), and UP_TYPE_AUTH.
Referenced by parse_incoming_control_channel_command().
Parses an AUTH_PENDING message and if in pull mode extends the timeout.
c | The context struct |
buffer | Buffer containing the control message with AUTH_PENDING |
Definition at line 340 of file push.c.
References context::c2, D_PUSH, key_state::established, get_primary_key(), options::handshake_window, max_uint(), min_uint(), msg, context::options, parse_auth_pending_keywords(), options::pull, context_2::push_request_timeout, options::renegotiate_seconds, and context_2::tls_multi.
Referenced by parse_incoming_control_channel_command().
Definition at line 265 of file push.c.
References BLEN, BSTR, buf_advance(), buf_read_u8(), context::c2, D_PUSH, es, get_primary_key(), management_notify_client_cr_response(), key_state::mda_key_id, msg, tls_multi::session, context_2::tls_multi, TM_ACTIVE, verify_crresponse_plugin(), and verify_crresponse_script().
Referenced by parse_incoming_control_channel_command().
void receive_exit_message | ( | struct context * | c | ) |
Definition at line 191 of file push.c.
References D_STREAM_ERRORS, dmsg, management_notify(), options::mode, MODE_SERVER, context::options, register_signal(), schedule_exit(), and context::sig.
Referenced by parse_incoming_control_channel_command().
void remove_iroutes_from_push_route_list | ( | struct options * | o | ) |
Definition at line 1111 of file push.c.
References CLEAR, D_PUSH, D_ROUTE_DEBUG, push_entry::enable, gc_free(), gc_new(), get_ipv6_addr(), getaddr(), GETADDR_HOST_ORDER, push_list::head, options::iroutes, options::iroutes_ipv6, MAX_PARMS, msg, iroute::netbits, iroute_ipv6::netbits, netbits_to_netmask(), iroute::network, iroute_ipv6::network, push_entry::next, iroute::next, iroute_ipv6::next, push_entry::option, parse_line(), options::push_list, and SIZE.
Referenced by multi_client_connect_late_setup().
void send_auth_failed | ( | struct context * | c, |
const char * | client_reason | ||
) |
Definition at line 396 of file push.c.
References alloc_buf_gc(), BSTR, buf_printf(), context::c2, D_PUSH, D_TLS_DEBUG, gc_free(), gc_new(), buffer::len, msg, PUSH_BUNDLE_SIZE, reschedule_multi_process(), schedule_exit(), send_control_channel_string_dowork(), tls_multi::session, context_2::tls_multi, TM_ACTIVE, and TM_INITIAL.
Referenced by check_tls(), and process_incoming_push_request().
bool send_auth_pending_messages | ( | struct tls_multi * | tls_multi, |
struct tls_session * | session, | ||
const char * | extra, | ||
unsigned int | timeout | ||
) |
Sends the auth pending control messages to a client.
See doc/management-notes.txt under client-pending-auth for more details on message format
Definition at line 438 of file push.c.
References alloc_buf_gc(), key_state::auth_deferred_expire, BSTR, buf_printf(), D_PUSH, extract_iv_proto(), gc_free(), gc_new(), tls_options::handshake_window, key_state::initial, IV_PROTO_AUTH_PENDING_KW, session::key, KS_PRIMARY, buffer::len, max_uint(), min_uint(), now, tls_multi::opt, tls_multi::peer_info, PUSH_BUNDLE_SIZE, tls_options::renegotiate_seconds, and send_control_channel_string_dowork().
Referenced by key_state_check_auth_pending_file(), and management_client_pending_auth().
void send_push_reply_auth_token | ( | struct tls_multi * | multi | ) |
Sends a push reply message only containin the auth-token to update the auth-token on the client.
Always pushes to the active session
multi | - The tls_multi structure belonging to the instance to push to |
Definition at line 755 of file push.c.
References alloc_buf_gc(), ASSERT, BSTR, buf_printf(), D_PUSH, push_entry::enable, gc_free(), gc_new(), push_list::head, push_entry::option, prepare_auth_token_push_reply(), PUSH_BUNDLE_SIZE, push_reply_cmd, send_control_channel_string_dowork(), tls_multi::session, and TM_ACTIVE.
Referenced by resend_auth_token_renegotiation().
bool send_push_request | ( | struct context * | c | ) |
Definition at line 551 of file push.c.
References context::c2, D_PUSH, D_STREAM_ERRORS, key_state::established, get_primary_key(), options::handshake_window, msg, now, context::options, key_state::peer_last_packet, context_2::push_request_timeout, register_signal(), send_control_channel_string(), context::sig, and context_2::tls_multi.
Referenced by check_push_request().
void send_restart | ( | struct context * | c, |
const char * | kill_msg | ||
) |
Definition at line 495 of file push.c.
References D_PUSH, schedule_exit(), and send_control_channel_string().
Referenced by management_kill_by_cid().
Definition at line 227 of file push.c.
References alloc_buf_gc(), BLEN, BSTR, buf_advance(), buf_printf(), buf_read_u8(), D_PUSH, D_PUSH_ERRORS, gc_free(), gc_new(), management_notify_generic(), and msg.
Referenced by parse_incoming_control_channel_command().
void server_pushed_signal | ( | struct context * | c, |
const struct buffer * | buffer, | ||
const bool | restart, | ||
const int | adv | ||
) |
Definition at line 131 of file push.c.
References BLEN, BSTR, buf_advance(), buf_read_u8(), D_STREAM_ERRORS, management_notify(), msg, options::no_advance, context::options, options::pull, register_signal(), context::sig, signal_info::signal_text, and ssl_purge_auth().
Referenced by parse_incoming_control_channel_command().