OpenVPN 3 Core Library
|
Support deferred server-side state creation when client connects. More...
Namespaces | |
namespace | Acceptor |
namespace | AEAD |
namespace | AEADEpoch |
namespace | AppleCrypto |
namespace | AsioBoundSocket |
namespace | AsioPolySock |
namespace | AuthStatus |
namespace | AWS |
namespace | bigmutex |
namespace | bmq_dgram |
namespace | bmq_stream |
namespace | BufferFormat |
namespace | BufHex |
namespace | C2os |
namespace | CF |
namespace | ClientAPI |
namespace | ClientEvent |
namespace | ClientProto |
namespace | Crypto |
namespace | crypto |
namespace | CryptoAlgs |
namespace | DCOTransport |
namespace | Endian |
namespace | Error |
namespace | ExternalTransport |
namespace | ExternalTun |
namespace | Gremlin |
namespace | HaltRestart |
namespace | HostList |
namespace | HostPort |
namespace | HTTP |
namespace | HTTPProxy |
namespace | HTTPProxyTransport |
namespace | InitProcess |
namespace | IP |
namespace | IPChecksum |
namespace | IPCommon |
namespace | IPv4 |
namespace | IPv6 |
namespace | json |
namespace | KoRekey |
namespace | KUParse |
namespace | Listen |
namespace | Log |
namespace | logging |
namespace | LZ4 |
namespace | lzo_asym_impl |
namespace | Mac |
namespace | ManClientInstance |
namespace | mbedtls_ctx_private |
namespace | MbedTLSCrypto |
namespace | MbedTLSPKI |
namespace | MSF |
namespace | NSCert |
namespace | numeric_util |
namespace | OpenSSLCrypto |
namespace | OpenSSLPKI |
namespace | OpenSSLSign |
namespace | path |
namespace | PeerInfo |
namespace | Ping4 |
namespace | Ping6 |
namespace | Pipe |
namespace | PKCS1 |
namespace | PKType |
namespace | print_detail |
namespace | print_formatted_detail |
namespace | ProfileParseLimits |
namespace | proto_context_private |
namespace | reliable |
namespace | RGWFlags |
namespace | SelfTest |
namespace | SFINAE |
namespace | SNI |
namespace | SockOpt |
namespace | Split |
namespace | SSLConst |
namespace | SSLLib |
namespace | string |
namespace | StringTempl |
namespace | TCPTransport |
namespace | TimeSpec |
namespace | TLSCertProfile |
namespace | TLSRemote |
namespace | TLSVersion |
namespace | TransportClientInstance |
namespace | TunBuilderClient |
namespace | TunBuilderSetup |
namespace | TunClientInstance |
namespace | TunIPRoute |
namespace | TunLinux |
namespace | TunLinuxSetup |
namespace | TunMac |
namespace | TunNetlink |
namespace | TunNull |
namespace | TunWin |
DNS utilities for Windows. | |
namespace | UDPTransport |
namespace | Unicode |
namespace | URL |
namespace | UserPass |
namespace | ValidateCreds |
namespace | VPNServerPool |
namespace | WebSocket |
namespace | Win |
namespace | WS |
namespace | X509Track |
Enumerations | |
enum | { NULL_ON_ENOENT = (1 << 8) } |
enum class | TunWrapObjRetain { NO_RETAIN , RETAIN , NO_RETAIN_NO_REPLACE } |
enum | { TUN_MTU_DEFAULT = 1500 } |
Functions | |
std::string | quote_ip (const std::string &ip_addr) |
template<typename ErrorCode > | |
std::string | errinfo (ErrorCode err) |
template<class EPRANGE > | |
std::string | asio_resolver_results_to_string (const EPRANGE &endpoint_range) |
size_t | buf_clamp_read (const size_t size) |
size_t | buf_clamp_write (const size_t size) |
template<typename T > | |
ConstBufferType< T > & | const_buffer_ref (BufferType< T > &src) |
template<typename T > | |
const ConstBufferType< T > & | const_buffer_ref (const BufferType< T > &src) |
OPENVPN_EXCEPTION (buf_read_error) | |
bool | buf_read (const int fd, Buffer &buf, const std::string &title) |
BufferList | buf_read (const int fd, const std::string &title) |
std::string | buf_to_string (const Buffer &buf) |
std::string | buf_to_string (const ConstBuffer &buf) |
void | buf_write_string (Buffer &buf, const std::string &str) |
void | buf_write_string (Buffer &buf, const char *str) |
BufferPtr | buf_from_string (const std::string &str) |
BufferPtr | buf_from_string (const char *str) |
BufferAllocated | buf_alloc_from_string (const std::string &str) |
BufferAllocated | buf_alloc_from_string (const char *str) |
void | buf_append_string (Buffer &buf, const std::string &str) |
void | buf_append_string (Buffer &buf, const char *str) |
ConstBuffer | const_buf_from_string (const std::string &str) |
const char * | buf_c_str (const Buffer &buf) |
bool | buf_eq_str (const Buffer &buf, const std::string &str) |
template<typename Elem , typename Traits > | |
std::basic_ostream< Elem, Traits > & | operator<< (std::basic_ostream< Elem, Traits > &os, const SafeString &ss) |
template<typename T , typename = std::enable_if_t<std::is_trivially_copyable<T>::value>> | |
T | alignment_safe_extract (const void *toAlign) noexcept |
Converts a byte buffer to the desired type, avoiding undefined behavior due to alignment. | |
template<typename T , std::size_t N> | |
constexpr std::size_t | array_size (T(&)[N]) |
bool | async_sleep_milliseconds (int milliseconds, Stop *async_stop) |
void | base64_init_static () |
void | base64_uninit_static () |
template<typename T > | |
std::enable_if< 4==sizeof(T), T >::type | bin_prefix (const unsigned char *data) |
template<typename T > | |
std::enable_if< 8==sizeof(T), T >::type | bin_prefix (const unsigned char *data) |
template<typename T > | |
T | bin_prefix (const unsigned char *data, const size_t len) |
template<typename T > | |
T | bin_prefix_floor (const unsigned char *data, const size_t len, const T floor) |
template<typename T > | |
T | clamp (T value, T low, T high) |
template<typename T > | |
T | clamp_nonzero (T value, T low, T high) |
template<typename F > | |
CleanupType< F > | Cleanup (F method) noexcept |
void | log_compress (const std::string prefix, const size_t orig_size, const size_t new_size) |
int | n_cores () |
OPENVPN_EXCEPTION (daemon_err) | |
LogSetup::Ptr | log_setup (const std::string &log_fn, const SetUserGroup *user_group, const bool log_append, const int log_versions, const bool stdin_to_dev_null, const bool combine_out_err) |
void | daemonize () |
LogSetup::Ptr | daemonize (const std::string &log_fn, const SetUserGroup *user_group, const bool log_append, const int log_versions) |
void | write_pid (const std::string &fn) |
std::string | cxx_demangle (const char *mangled_name) |
OPENVPN_EXCEPTION (enum_dir_error) | |
template<typename F > | |
bool | enum_dir (const std::string &dirname, F func) |
std::vector< std::string > | enum_dir (const std::string &dirname, const size_t size_hint=0, const bool sort=false) |
void | throw_ref (const std::exception &e) |
template<typename T > | |
bool | is_pow2 (const T v) |
template<typename T > | |
int | log2 (const T v) |
OPENVPN_UNTAGGED_EXCEPTION (file_exception) | |
OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, open_file_error) | |
OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_too_large) | |
OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_is_binary) | |
OPENVPN_UNTAGGED_EXCEPTION_INHERIT (file_exception, file_not_utf8) | |
std::string | read_text_simple (const std::string &filename) |
BufferPtr | read_binary (const std::string &filename, const std::uint64_t max_size=0, const unsigned int buffer_flags=0) |
BufferPtr | read_binary_linear (const std::string &filename, const std::uint64_t max_size=0, const size_t block_size=1024) |
std::string | read_text (const std::string &filename, const std::uint64_t max_size=0) |
std::string | read_text_utf8 (const std::string &filename, const std::uint64_t max_size=0) |
std::string | read_stdin () |
void | write_binary (const std::string &filename, const Buffer &buf) |
template<typename BUFLIST > | |
void | write_binary_list (const std::string &filename, const BUFLIST &buflist) |
void | write_string (const std::string &filename, const std::string &str) |
void | write_binary_atomic (const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf, StrongRandomAPI &rng) |
void | write_binary_atomic (const std::string &fn, const std::string &tmpdir, const mode_t mode, const std::uint64_t mtime_ns, const Buffer &buf, StrongRandomAPI &rng) |
OPENVPN_EXCEPTION (file_unix_error) | |
void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const void *buf, const ssize_t size) |
void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const Buffer &buf) |
void | write_binary_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const ConstBuffer &buf) |
void | write_text_unix (const std::string &fn, const mode_t mode, const std::uint64_t mtime_ns, const std::string &content) |
BufferPtr | read_binary_unix (const std::string &fn, const std::uint64_t max_size=0, const unsigned int buffer_flags=0, std::uint64_t *mtime_ns=nullptr) |
template<typename STRING > | |
int | read_binary_unix_fast (const STRING &fn, Buffer &out, std::uint64_t *mtime_ns=nullptr) |
std::string | read_text_unix (const std::string &filename, const std::uint64_t max_size=0, const unsigned int buffer_flags=0, std::uint64_t *mtime_ns=nullptr) |
template<typename... Args> | |
std::string | printd (char delim, Args... args) |
template<typename... Args> | |
std::string | print (Args... args) |
template<typename... Args> | |
std::string | prints (Args... args) |
template<typename... Args> | |
std::string | printfmt (const std::string &fmt, Args... args) |
std::string | get_password (const char *prompt) |
char | render_hex_char (const int c, const bool caps=false) |
int | parse_hex_char (const int c) |
std::string | render_hex (const unsigned char *data, size_t size, const bool caps=false) |
std::string | render_hex (const void *data, const size_t size, const bool caps=false) |
std::string | render_hex_sep (const unsigned char *data, size_t size, const char sep, const bool caps=false) |
std::string | render_hex_sep (const void *data, const size_t size, const char sep, const bool caps=false) |
template<typename V > | |
std::string | render_hex_generic (const V &data, const bool caps=false) |
std::string | dump_hex (const unsigned char *data, size_t size) |
std::string | dump_hex (void *data, size_t size) |
std::string | dump_hex (const std::string &str) |
template<typename V > | |
std::string | dump_hex (const V &data) |
OPENVPN_SIMPLE_EXCEPTION (parse_hex_error) | |
template<typename V > | |
void | parse_hex (V &dest, const std::string &str) |
template<typename T > | |
bool | parse_hex_number (const char *str, T &retval) |
template<typename T > | |
bool | parse_hex_number (const std::string &str, T &retval) |
template<typename T > | |
T | parse_hex_number (const std::string &str) |
template<typename T > | |
std::string | render_hex_number (T value, const bool caps=false) |
std::string | render_hex_number (unsigned char uc, const bool caps=false) |
std::string | get_hostname () |
void | log_rotate (const std::string &fn, const int max_versions) |
template<typename TypeT , typename RcT = RC<thread_unsafe_refcount>, typename... ArgsT> | |
auto | make_rc (ArgsT &&...args) |
Helper function to create a reference-counted object with the default thread-unsafe reference counting policy. | |
int | update_file_mod_time_nanoseconds (const std::string &filename, const std::uint64_t nanoseconds_since_epooch) |
int | update_file_mod_time_nanoseconds (const int fd, const std::uint64_t nanoseconds_since_epooch) |
OPENVPN_EXCEPTION (number_parse_exception) | |
template<typename T > | |
bool | parse_number (const char *str, T &retval, const bool nondigit_term=false) |
template<typename T > | |
bool | parse_number (const std::string &str, T &retval) |
template<typename T > | |
T | parse_number_throw (const std::string &str, const std::string &error) |
template<typename T > | |
T | parse_number_throw (const std::string &str, const char *error) |
template<typename T > | |
T | parse_number_throw (const char *str, const char *error) |
template<typename T > | |
bool | parse_number_validate (const std::string &numstr, const size_t max_len, const T minimum, const T maximum, T *value_return=nullptr) |
bool | is_number (const char *str) |
OPENVPN_EXCEPTION_WITH_CODE (option_error, ERR_PROFILE_OPTION, ERR_INVALID_OPTION_DNS, ERR_INVALID_OPTION_CRYPTO, ERR_INVALID_CONFIG, ERR_INVALID_OPTION_PUSHED, ERR_INVALID_OPTION_VAL) | |
const char * | platform_name () |
std::string | platform_string (const std::string &title, const std::string &app_version) |
std::string | platform_string () |
pid_t | system_cmd_async (const std::string &cmd, const Argv &argv, const Environ *env, RedirectBase *redir, const sigset_t *sigmask) |
int | system_cmd_post (const pid_t pid) |
int | system_cmd (const std::string &cmd, const Argv &argv, RedirectBase *redir, const Environ *env, const sigset_t *sigmask) |
int | system_cmd (const std::string &cmd, const Argv &argv) |
int | system_cmd (const Argv &argv) |
int | system_cmd (const std::string &cmd, const Argv &argv, const Environ *env, RedirectPipe::InOut &inout, unsigned int redirect_pipe_flags, const sigset_t *sigmask) |
template<typename R > | |
void | intrusive_ptr_add_ref (R *rcptr) noexcept |
Helper to increment a ref count. | |
template<typename R > | |
void | intrusive_ptr_release (R *rcptr) noexcept |
Helper to decrement a ref count. | |
OPENVPN_OSTREAM (SessionID64, to_string) | |
OPENVPN_OSTREAM (SessionID128, to_string) | |
std::string | signal_name (const int signum) |
OPENVPN_EXCEPTION (signaling_exception) | |
bool | sleep_milliseconds (const unsigned int milliseconds) |
bool | file_exists (const std::string &filename) |
bool | file_exists_nonempty (const std::string &filename) |
bool | is_directory (const std::string &pathname, const bool follow_symlinks=false) |
time_t | file_mod_time (const std::string &filename) |
std::uint64_t | stat_mod_time_nanoseconds (const struct stat &s) |
std::uint64_t | file_mod_time_nanoseconds (const char *filename) |
std::uint64_t | file_mod_time_nanoseconds (const std::string &filename) |
std::uint64_t | fd_mod_time_nanoseconds (const int fd) |
std::uint64_t | file_mod_time_milliseconds (const std::string &filename) |
std::string | strerror_str (const int errnum) |
std::string | tmp_filename (const std::string &fn, const std::string &tmpdir, StrongRandomAPI &rng) |
template<typename T , typename std::enable_if< std::is_arithmetic< T >::value, int >::type = 0> | |
std::string | to_string (T value) |
template<typename T , typename std::enable_if<!std::is_arithmetic< T >::value, int >::type = 0> | |
std::string | to_string (const T &value) |
template<typename T > | |
void | delete_slab (T *ptr) |
void | unreachable () |
template<typename THREAD_COMMON > | |
void | event_loop_wait_barrier (THREAD_COMMON &tc, const unsigned int seconds=WAIT_BARRIER_TIMEOUT) |
ssize_t | write_retry (int fd, const void *buf, size_t count) |
void | write_private (const std::string &path, const void *buf, ssize_t count) |
void | write_private (const std::string &path, const Buffer &buf) |
void | write_private (const std::string &path, const std::string &str) |
bool | is_bs64_cipher (const CryptoAlgs::Type cipher) |
OPENVPN_EXCEPTION (crypto_dc_select) | |
void | ovpn_hkdf_expand (const uint8_t *secret, const uint8_t *info, int info_len, uint8_t *out, int out_len) |
void | ovpn_expand_label (const uint8_t *secret, size_t secret_len, const uint8_t *label, size_t label_len, const uint8_t *context, size_t context_len, uint8_t *out, size_t out_len) |
OPENVPN_EXCEPTION (epoch_key_exception) | |
Frame::Ptr | frame_init (const bool align_adjust_3_1, const size_t tun_mtu_max, const size_t control_channel_payload, const bool verbose) |
Frame::Context | frame_init_context_simple (const size_t payload) |
Frame::Ptr | frame_init_simple (const size_t payload) |
void | init_openssl (const std::string &engine) |
void | tcp_adjust_checksum (int acc, std::uint16_t &cksum) |
std::uint16_t | udp_checksum (const std::uint8_t *buf, const unsigned int len_udp, const std::uint8_t *src_addr, const std::uint8_t *dest_addr) |
int | bind_to_core (const int core_id) |
int | exclude_from_core (const int core_id) |
int | daemon_pid (const std::string &cmd, const std::string &pidfile) |
bool | is_daemon_alive (const std::string &cmd, const std::string &pidfile) |
const std::string | get_ssl_library_version () |
std::string | crypto_self_test_mbedtls () |
std::string | get_hwaddr (IP::Addr server_addr) |
OPENVPN_EXCEPTION (openssl_engine_error) | |
void | openssl_setup_engine (const std::string &engine) |
std::string | openssl_error () |
std::string | openssl_error (const int ssl_error) |
void | openssl_clear_error_stack () |
void | openssl_reseed_rng () |
std::string | render_options_sanitized (const OptionList &opt, const unsigned int render_flags) |
std::string | sanitize_control_message (const std::string &src_str) |
std::uint32_t | rand32_distribute (const std::uint32_t seed, const std::uint32_t end) |
OPENVPN_EXCEPTION (parse_acc_message) | |
const tls_cipher_name_pair * | tls_get_cipher_name_pair (const std::string &ciphername) |
bool | is_openvpn_protocol (const unsigned char *p, std::size_t len) |
Given either the first 2 or 3 bytes of an initial client -> server data payload, return true if the protocol is that of an OpenVPN client attempting to connect with an OpenVPN server. | |
double | cpu_time (const bool thread=false) |
void | set_duration_parm (Time::Duration &dur, const std::string &name, const std::string &valstr, const unsigned int min_value, const bool x2, const bool ms) |
const Option * | load_duration_parm (Time::Duration &dur, const std::string &name, const OptionList &opt, const unsigned int min_value, const bool x2, const bool allow_ms) |
Time::Duration | load_duration_default (const std::string &name, const OptionList &opt, const Time::Duration &default_duration, const unsigned int min_value, const bool x2, const bool allow_ms) |
Time::Duration | skew_duration (const Time::Duration &dur, const Time::Duration &min, const unsigned int flux_order, RandomAPI &rng) |
std::uint64_t | milliseconds_since_epoch () |
nanotime_t | nanoseconds_since_epoch () |
OPENVPN_SIMPLE_EXCEPTION (get_time_error) | |
std::string | date_time (const time_t t) |
std::string | date_time_utc (const time_t t) |
std::string | date_time (const struct timeval *tv, const bool msecs) |
std::string | nanosec_time_to_string (const std::uint64_t ns_time) |
std::string | date_time () |
std::string | date_time_store_time_t (time_t &save) |
std::string | date_time_rfc822 (const time_t t) |
std::string | date_time_rfc822 () |
OPENVPN_EXCEPTION (macdns_watchdog_error) | |
unsigned int | parse_tun_mtu (const OptionList &opt, unsigned int default_value) |
unsigned int | parse_tun_mtu_max (const OptionList &opt, unsigned int default_value) |
Variables | |
const Base64 * | base64 |
const Base64 * | base64_urlsafe |
static constexpr mode_t | WRITE_BINARY_UNIX_EXISTING = 010000 |
static constexpr unsigned int | WAIT_BARRIER_TIMEOUT = 30 |
static constexpr const char * | tls_crypt_v2_server_key_name = "OpenVPN tls-crypt-v2 server key" |
static constexpr const char * | tls_crypt_v2_client_key_name = "OpenVPN tls-crypt-v2 client key" |
static const tls_cipher_name_pair | tls_cipher_name_translation_table [] |
Support deferred server-side state creation when client connects.
This class implements the parsing and generating of app custom control channel messages
Creating OpenVPN protocol tracking state upon receipt of an initial client HARD_RESET packet invites the bad actor to flood the server with connection requests maintaining anonymity by spoofing the client's source address. Not only does this invite resource exhaustion, but, because of reliability layer retries, it creates an amplification attack as the server retries its un-acknowledged HARD_RESET replies to the spoofed address.
This solution treats the server's 64-bit protocol session ID ("Psid or psid") as a cookie that allows the server to defer state creation. It is ported here to openvpn3 from original work in OpenVPN. Unlike the randomly created server psid generated in psid.hpp for the server's HARD_RESET reply, this approach derives the server psid via an HMAC of information from the incoming client OpenVPN HARD_RESET control message (i.e., the psid cookie). This allows the server to verify the client as it returns the server psid in it's second packet, only then creating protocol state.
Not only does this prevent the resource exhaustion, but it has the happy consequence of avoiding the amplification attack. Since no state is created on the first packet, there is no reliability layer; and, hence, no retries of the server's HARD_RESET reply.
Definition at line 486 of file sslctx.hpp.
typedef AsyncResolvable<openvpn_io::ip::tcp::resolver> openvpn::AsyncResolvableTCP |
Definition at line 24 of file async_resolve.hpp.
typedef AsyncResolvable<openvpn_io::ip::udp::resolver> openvpn::AsyncResolvableUDP |
Definition at line 23 of file async_resolve.hpp.
using openvpn::Buffer = typedef BufferType<unsigned char> |
Definition at line 1855 of file buffer.hpp.
using openvpn::BufferAllocated = typedef BufferAllocatedType<unsigned char> |
Definition at line 1857 of file buffer.hpp.
using openvpn::BufferAllocatedRc = typedef RcEnable<BufferAllocated, RC<thread_unsafe_refcount> > |
Definition at line 1858 of file buffer.hpp.
using openvpn::BufferAllocatedTS = typedef RcEnable<BufferAllocated, RC<thread_safe_refcount> > |
Definition at line 1865 of file buffer.hpp.
typedef BufferCollection<std::list> openvpn::BufferList |
Definition at line 108 of file buflist.hpp.
using openvpn::BufferPtr = typedef RCPtr<BufferAllocatedRc> |
Definition at line 1859 of file buffer.hpp.
using openvpn::BufferPtrTS = typedef RCPtr<BufferAllocatedTS> |
Definition at line 1866 of file buffer.hpp.
typedef BufferCollection<std::vector> openvpn::BufferVector |
Definition at line 109 of file buflist.hpp.
typedef CompressLZOAsym openvpn::CompressLZO |
Definition at line 26 of file lzoselect.hpp.
using openvpn::ConstBuffer = typedef ConstBufferType<unsigned char> |
Definition at line 1856 of file buffer.hpp.
typedef long long openvpn::count_t |
typedef std::uint64_t openvpn::nanotime_t |
typedef long openvpn::olong |
typedef unsigned long openvpn::oulong |
typedef int(* openvpn::ovpn_nl_cb) (struct nl_msg *msg, void *arg) |
typedef PacketIDControlReceiveType<8, 30> openvpn::PacketIDControlReceive |
Definition at line 376 of file packet_id_control.hpp.
typedef PacketIDDataReceiveType<8, 30> openvpn::PacketIDDataReceive |
Definition at line 498 of file packet_id_data.hpp.
Definition at line 80 of file runcontext.hpp.
Definition at line 79 of file runcontext.hpp.
typedef SessionIDType<16> openvpn::SessionID128 |
Definition at line 184 of file sess_id.hpp.
typedef SessionIDType<8> openvpn::SessionID64 |
Definition at line 183 of file sess_id.hpp.
Definition at line 36 of file socket_protect.hpp.
typedef SplitLinesType<std::string> openvpn::SplitLines |
Definition at line 181 of file splitlines.hpp.
using openvpn::ssl_external_pki = typedef SSLFactoryAPI::ssl_external_pki |
Definition at line 26 of file extpki.hpp.
typedef TimeType<oulong> openvpn::Time |
typedef Time* openvpn::TimePtr |
using openvpn::unique_ptr_del = typedef std::unique_ptr<T, std::function<void(T *)> > |
Definition at line 21 of file uniqueptr.hpp.
using openvpn::unique_ptr_slab = typedef std::unique_ptr<T, slab_deleter<T> > |
Definition at line 55 of file uniqueptr.hpp.
anonymous enum |
Enumerator | |
---|---|
TUN_MTU_DEFAULT |
Definition at line 18 of file tunmtu.hpp.
anonymous enum |
Enumerator | |
---|---|
NULL_ON_ENOENT |
Definition at line 113 of file fileunix.hpp.
|
strong |
Enumerator | |
---|---|
NO_RETAIN | |
RETAIN | |
NO_RETAIN_NO_REPLACE |
Definition at line 21 of file tunwrap.hpp.
|
noexcept |
Converts a byte buffer to the desired type, avoiding undefined behavior due to alignment.
Replaces a simple cast with an alignment safe alternative. Useful when scraping data out of wire oriented buffers and so on.
T | type to convert to |
toAlign | starting address of the bytes to be converted |
Definition at line 30 of file alignment.hpp.
|
constexpr |
|
inline |
|
inline |
Definition at line 25 of file asyncsleep.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 27 of file binprefix.hpp.
|
inline |
Definition at line 37 of file binprefix.hpp.
|
inline |
Definition at line 44 of file binprefix.hpp.
|
inline |
Definition at line 58 of file binprefix.hpp.
|
inline |
Definition at line 73 of file bufstr.hpp.
|
inline |
|
inline |
Definition at line 88 of file bufstr.hpp.
|
inline |
|
inline |
Definition at line 102 of file bufstr.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 108 of file bufstr.hpp.
|
inline |
Definition at line 55 of file bufstr.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 43 of file bufread.hpp.
|
inline |
|
inline |
Definition at line 28 of file bufstr.hpp.
|
inline |
Definition at line 40 of file bufstr.hpp.
|
inline |
T openvpn::clamp | ( | T | value, |
T | low, | ||
T | high | ||
) |
T openvpn::clamp_nonzero | ( | T | value, |
T | low, | ||
T | high | ||
) |
|
inlinenoexcept |
|
inline |
|
inline |
|
inline |
Definition at line 1879 of file buffer.hpp.
|
inline |
Retrieve the time (in seconds) the current process or thread has been running. Runing time includes both system and user times.
thread | Boolean flag controlling if process or thread runtime should be returned |
Definition at line 76 of file cputime.hpp.
|
inline |
|
inline |
Definition at line 24 of file demangle.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 114 of file daemon.hpp.
|
inline |
|
inline |
Definition at line 96 of file timestr.hpp.
|
inline |
Definition at line 62 of file timestr.hpp.
|
inline |
|
inline |
Definition at line 164 of file timestr.hpp.
|
inline |
|
inline |
void openvpn::delete_slab | ( | T * | ptr | ) |
|
inline |
Renders a combined hexadecimal and character dump of a std::string buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
str | std::string containing the buffer to render |
Definition at line 313 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
data | Unsigned char pointer to the buffer to dump. |
size | Size of the buffer to render. |
Definition at line 255 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a std::vector<T> based buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
data | std::vector<T> containing the buffer to render |
Definition at line 330 of file hexstr.hpp.
|
inline |
Renders a combined hexadecimal and character dump of a buffer, with the typical 16 bytes split between hexadecimal and character separation per line.
data | Void pointer to the buffer to dump. |
size | Size of the buffer to render. |
Definition at line 298 of file hexstr.hpp.
|
inline |
Definition at line 51 of file enumdir.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 24 of file hostname.hpp.
|
inline |
|
inline |
|
inline |
Reports a human readable string of the SSL library in use and its version. E.g. mbed TLS 1.2.4
Definition at line 1679 of file sslctx.hpp.
|
inline |
|
inlinenoexcept |
Helper to increment a ref count.
R | type that has an incrementable member refcount_ |
rcptr | pointer to instance of R |
Helper function template to implement incrementing of a member 'refcount_' of a type R; acts as an adapter layer to implement this funtionality as well as some conditionally built debug logging.
Definition at line 1400 of file rc.hpp.
|
inlinenoexcept |
Helper to decrement a ref count.
R | type that has an decrementable member refcount_ |
rcptr | pointer to instance of R |
Helper function template to implement decrementing of a member 'refcount_' of a type R; acts as an adapter layer to implement this funtionality as well as some conditionally built debug logging and a conditionally built notify hook.
Definition at line 1418 of file rc.hpp.
|
inline |
|
inline |
Definition at line 43 of file daemon_alive.hpp.
|
inline |
|
inline |
|
inline |
Given either the first 2 or 3 bytes of an initial client -> server data payload, return true if the protocol is that of an OpenVPN client attempting to connect with an OpenVPN server.
p | Buffer containing packet data. |
len | Packet (buffer) length. |
Definition at line 30 of file is_openvpn_protocol.hpp.
|
inline |
|
inline |
Definition at line 68 of file durhelper.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
auto openvpn::make_rc | ( | ArgsT &&... | args | ) |
Helper function to create a reference-counted object with the default thread-unsafe reference counting policy.
TypeT | The type of the object to be created. |
RcT | The RC type that shall be used, defaults to RC<thread_unsafe_refcount> |
ArgsT | The types of the arguments to be forwarded to the constructor of TypeT. |
args | The arguments to be forwarded to the constructor of TypeT. |
Definition at line 77 of file make_rc.hpp.
|
inline |
|
inline |
Definition at line 117 of file timestr.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 21 of file reseed.hpp.
|
inline |
openvpn::OPENVPN_EXCEPTION | ( | buf_read_error | ) |
openvpn::OPENVPN_EXCEPTION | ( | crypto_dc_select | ) |
openvpn::OPENVPN_EXCEPTION | ( | daemon_err | ) |
openvpn::OPENVPN_EXCEPTION | ( | enum_dir_error | ) |
openvpn::OPENVPN_EXCEPTION | ( | epoch_key_exception | ) |
openvpn::OPENVPN_EXCEPTION | ( | file_unix_error | ) |
openvpn::OPENVPN_EXCEPTION | ( | macdns_watchdog_error | ) |
openvpn::OPENVPN_EXCEPTION | ( | number_parse_exception | ) |
openvpn::OPENVPN_EXCEPTION | ( | openssl_engine_error | ) |
openvpn::OPENVPN_EXCEPTION | ( | parse_acc_message | ) |
openvpn::OPENVPN_EXCEPTION | ( | signaling_exception | ) |
openvpn::OPENVPN_EXCEPTION_WITH_CODE | ( | option_error | , |
ERR_PROFILE_OPTION | , | ||
ERR_INVALID_OPTION_DNS | , | ||
ERR_INVALID_OPTION_CRYPTO | , | ||
ERR_INVALID_CONFIG | , | ||
ERR_INVALID_OPTION_PUSHED | , | ||
ERR_INVALID_OPTION_VAL | |||
) |
openvpn::OPENVPN_OSTREAM | ( | SessionID128 | , |
to_string | |||
) |
openvpn::OPENVPN_OSTREAM | ( | SessionID64 | , |
to_string | |||
) |
openvpn::OPENVPN_SIMPLE_EXCEPTION | ( | get_time_error | ) |
openvpn::OPENVPN_SIMPLE_EXCEPTION | ( | parse_hex_error | ) |
Declaration of a hexadecimal parsing error exception class
openvpn::OPENVPN_UNTAGGED_EXCEPTION | ( | file_exception | ) |
openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
file_is_binary | |||
) |
openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
file_not_utf8 | |||
) |
openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
file_too_large | |||
) |
openvpn::OPENVPN_UNTAGGED_EXCEPTION_INHERIT | ( | file_exception | , |
open_file_error | |||
) |
std::basic_ostream< Elem, Traits > & openvpn::operator<< | ( | std::basic_ostream< Elem, Traits > & | os, |
const SafeString & | ss | ||
) |
Definition at line 1 of file safestr.hpp.
void openvpn::ovpn_expand_label | ( | const uint8_t * | secret, |
size_t | secret_len, | ||
const uint8_t * | label, | ||
size_t | label_len, | ||
const uint8_t * | context, | ||
size_t | context_len, | ||
uint8_t * | out, | ||
size_t | out_len | ||
) |
Variant of the RFC 8446 TLS 1.3 HKDF-Expand-Label function with the following differences/restrictions:
secret | Input secret |
secret_len | length of the input secret |
label | Label for the exported key material |
label_len | length of the label |
context | optional context |
context_len | length of the context |
out | output keying material |
out_len | length of output keying material |
Note, this function accepts size_t parameter only to make using this function easier. All values must be uin16_t or smaller.
Definition at line 56 of file data_epoch.cpp.
void openvpn::ovpn_hkdf_expand | ( | const uint8_t * | secret, |
const uint8_t * | info, | ||
int | info_len, | ||
uint8_t * | out, | ||
int | out_len | ||
) |
Implementation of the RFC5869 HKDF-Expand function with the following restrictions
secret | the input keying material (HMAC key) |
info | context and application specific information |
info_len | length of the application specific information |
out | output keying material |
out_len | length of output keying material |
Definition at line 21 of file data_epoch.cpp.
|
inline |
Parses a std::string containing a hexadecimal value into a std::vector<T>.
dest | std::vector<T> destination buffer to use. |
str | std::string& containing the hexadecimal string to parse. |
parse_hex_error | will throw this exception if the input is invalid/not parsable as a hexadecimal number. |
Definition at line 352 of file hexstr.hpp.
|
inline |
Parses a character in the range {0..9,A-F,a-f} to an integer value. Used to convert hexadecimal character to integer. Only a single character is parsed by this function.
c | Character to be be parsed. |
Definition at line 65 of file hexstr.hpp.
|
inline |
Parses a char buffer (C string) containing a hexadecimal string into a templated (T) variable. The input buffer MUST be NULL terminated.
str | Char pointer (char *) to the buffer to be parsed. |
retval | Return buffer where the parsed value is stored. |
Definition at line 383 of file hexstr.hpp.
|
inline |
Parses a std::string containing a hexadecimal string into a templated (T) variable.
str | std::string containing the hexadecimal string to be parsed. |
Definition at line 440 of file hexstr.hpp.
|
inline |
Variant of parse_hex_number(const char *, ...)
which takes a std::string as the input.
str | std::string containing the hexadecimal string to be parsed. |
retval | Return buffer where the parsed value is stored. |
Definition at line 419 of file hexstr.hpp.
|
inline |
|
inline |
Definition at line 68 of file number.hpp.
|
inline |
Definition at line 94 of file number.hpp.
|
inline |
Definition at line 84 of file number.hpp.
|
inline |
Definition at line 74 of file number.hpp.
|
inline |
Definition at line 104 of file number.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 22 of file platform_string.hpp.
|
inline |
Definition at line 58 of file format.hpp.
|
inline |
|
inline |
|
inline |
std::string openvpn::quote_ip | ( | const std::string & | ip_addr | ) |
Definition at line 19 of file quoteip.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Render a byte buffer (unsigned char *) as a hexadecimal string.
data | Unsigned char pointer to buffer to render. |
size | size_t of the number of bytes to parse from the buffer. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 135 of file hexstr.hpp.
|
inline |
Render a byte buffer (void *) as a hexadecimal string.
data | Void pointer to buffer to render. |
size | size_t of the number of bytes to parse from the buffer. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 161 of file hexstr.hpp.
|
inline |
Renders an integer value within the hexadecimal range (0-15) to a hexadecimal character.
c | Integer to render as a hexadecimal character. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 42 of file hexstr.hpp.
|
inline |
Render a std::vector<T> container as a hexadecimal string. T must be a data type compatible with RenderHexByte(const unsigned char,...)
data | std::vector<T> containing the data to render |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 230 of file hexstr.hpp.
std::string openvpn::render_hex_number | ( | T | value, |
const bool | caps = false |
||
) |
Renders a templated T variable containing a numeric value into a std::string containing a hexadecimal representation.
value | Numeric (T) value to represent as hexadecimal. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 461 of file hexstr.hpp.
|
inline |
Renders a single byte as a hexadecimal string
uc | Unsigned char (byte) to be represented as hexadecimal. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 484 of file hexstr.hpp.
|
inline |
Variant of render_hex(const unsiged char *,...)
which adds a separator between each byte
data | Unsigned char pointer to buffer to render. |
size | size_t of the number of bytes to parse from the buffer. |
sep | A single character to use as the separator. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 180 of file hexstr.hpp.
|
inline |
Variant of render_hex(const void *,...)
which adds a separator between each byte
data | Void pointer to buffer to render. |
size | size_t of the number of bytes to parse from the buffer. |
sep | A single character to use as the separator. |
caps | Boolean (default false) which sets the outout to be either lower case (false) or upper case (true). |
Definition at line 212 of file hexstr.hpp.
|
inline |
|
inline |
Definition at line 43 of file sanitize.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 80 of file durhelper.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 109 of file process.hpp.
|
inline |
Definition at line 103 of file process.hpp.
|
inline |
Definition at line 120 of file process.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 192 of file exception.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 46 of file to_string.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 59 of file modstat.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 57 of file fileatomic.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 89 of file fileunix.hpp.
|
inline |
Definition at line 97 of file fileunix.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 77 of file writeprivate.hpp.
|
inline |
Definition at line 82 of file writeprivate.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 299 of file base64.hpp.
|
inline |
Definition at line 300 of file base64.hpp.
|
static |
SSL/TLS Cipher suite name translation table
Definition at line 25 of file iana_ciphers.hpp.
|
staticconstexpr |
Definition at line 37 of file tls_crypt_v2.hpp.
|
staticconstexpr |
Definition at line 36 of file tls_crypt_v2.hpp.
|
staticconstexpr |
Definition at line 23 of file waitbarrier.hpp.
|
staticconstexpr |
Definition at line 43 of file fileunix.hpp.