0
0
mirror of https://github.com/OpenVPN/openvpn3.git synced 2024-09-20 20:13:05 +02:00
Commit Graph

955 Commits

Author SHA1 Message Date
James Yonan
ba957e45cc In class RCWeak, added release notification callables. 2015-06-04 13:55:37 -06:00
James Yonan
597c2837f4 In class Option, change storage class of "bool touched_" to
mutable so we can set it without having to resort to const_cast.
2015-06-03 23:50:34 -06:00
James Yonan
da5927761c In split.hpp, use std::move where possible. 2015-06-03 23:48:36 -06:00
James Yonan
87a2a684ce Allow callers of split_host_port() to get the actual
integer port number.
2015-06-03 23:46:11 -06:00
James Yonan
84a93b7eb1 HTTP proxy client can now skip extraneous HTML content
before the proxy session starts.
2015-06-03 21:50:28 -06:00
James Yonan
a4759c5119 In bufstr.hpp, added buf_alloc_from_string() methods. 2015-06-03 20:36:57 -06:00
James Yonan
9b753715df Added bufclamp.hpp, a debugging tool that clamps the size
of network buffers on stream-based protocols.
2015-06-03 20:36:19 -06:00
James Yonan
94260d47c2 In rc.hpp, add debugging mode enabled by OPENVPN_RC_DEBUG that
will log info about objects being managed.
2015-06-01 23:35:03 -06:00
James Yonan
803b91724b In asiodispatch.hpp, added class AsioDispatchResolveArg. 2015-06-01 23:31:36 -06:00
James Yonan
7ce99e4e11 Added OPENVPN_LOG_STRING() macro.
Added Log::Context::defined() method.
2015-06-01 17:52:53 -06:00
James Yonan
cbea1175ff Added HTTP::Request::to_string_compact() method. 2015-06-01 14:50:51 -06:00
James Yonan
fe794f5084 Added Frame::Context::copy_by_value() method. 2015-05-29 08:26:14 -06:00
James Yonan
9c23b145a2 In ovpn3 command-line client (cli.cpp), scope the signal handler
(for unix) so that it's only active during thread->join() to
minimize potential deadlock issues between signal handler and
main thread.
2015-05-27 22:01:05 -06:00
James Yonan
bceb5be362 Add noexcept to some methods in process.hpp and redir.hpp
that need to run in an async-signal context, i.e. between
fork on the child side, and execve.
2015-05-27 13:54:10 -06:00
James Yonan
16bb7df1d2 Added support for weak pointers to rc.hpp. 2015-05-26 22:45:24 -06:00
James Yonan
adb617c40a Refactored daemon.hpp and process.hpp, adding a more
general-purpose stdin/stdout/stderr redirection
class.
2015-05-26 15:22:22 -06:00
James Yonan
be2922de39 Refactored methods for parsing/validating hosts/ports
into openvpn/common/hostport.hpp
2015-05-19 15:01:53 -06:00
James Yonan
e609e318ca Renamed openvpn/common/port.hpp -> openvpn/common/hostport.hpp 2015-05-19 13:33:29 -06:00
James Yonan
4366b3d3de In servproto.hpp, add to list of errors common enough that they
don't need an explicit "Session invalidated:" log message.

This list currently includes:

  Error::KEV_NEGOTIATE_ERROR
  Error::KEEPALIVE_TIMEOUT
2015-05-18 17:57:20 -06:00
James Yonan
b75c780cab Renamed boost::intrusive_ptr<T> usage to RCPtr<T>. 2015-05-17 21:26:53 -06:00
James Yonan
35ac9f6229 Renamed types.hpp to size.hpp since it now only defines
size_t and ssize_t.
2015-05-17 13:27:34 -06:00
James Yonan
e494846f7d Moved count_t to its own header file. 2015-05-17 13:17:24 -06:00
James Yonan
5d1bc1c952 Moved array_size() function to its own header file. 2015-05-17 12:57:23 -06:00
James Yonan
fe6fcefa61 C++11 : rename NULL to nullptr 2015-05-17 02:53:37 -06:00
James Yonan
68b8f12b25 Refactored ScopedPtr usage to std::unique_ptr.
Removed ScopedPtr.
2015-05-17 01:41:16 -06:00
James Yonan
fd6892f8fa Added AsioBoundSocket -- an Asio TCP socket that can be configured
so that open() method always prebinds the socket to a given local
address.  Useful for TCP clients.
2015-05-15 13:33:56 -06:00
James Yonan
53e6af884a In OptionList, added get_optional_relaxed() and
get_default_relaxed() methods.
2015-05-13 21:55:32 -06:00
James Yonan
970a41757d Modified OPENVPN_OSTREAM() macro to not require data
type to be convertible to std::string.
2015-05-10 20:05:00 -06:00
James Yonan
3bcf8743c1 More conversions of threads/mutexes from boost to C++11 std.
As part of this work, removed openvpn/common/thread.hpp
2015-05-10 20:04:22 -06:00
James Yonan
e4c2ab6c71 In cli.cpp, improve dynamic challenge/response support.
In client API, allow ClientAPI::ProvideCreds::dynamicChallengeCookie
to be set with either the dynamic challenge/response State ID
or the full cookie.
2015-05-10 15:39:57 -06:00
James Yonan
f094f93213 In cli.cpp build script, enable -DOPENVPN_SHOW_SESSION_TOKEN 2015-05-10 15:38:43 -06:00
James Yonan
3019082c6c Added Time::delta_prec() and delta() for returning
the signed difference between two time values.
2015-05-10 15:37:31 -06:00
James Yonan
39360b5cf0 Make Time() and Time::Duration() constructors noexcept. 2015-05-10 15:36:12 -06:00
James Yonan
7a6053f4b5 class RC: redefined thread_safe_refcount in a C++11 way. 2015-05-10 15:33:06 -06:00
James Yonan
e7b3af3e01 class Base64: added encode() method that accepts a raw unsigned
char * buffer.
2015-05-10 15:30:30 -06:00
James Yonan
aacdfd54f6 Added ChallengeResponse::generate_dynamic_challenge(). 2015-05-10 15:29:38 -06:00
James Yonan
05b0b586d9 Core changes to TransportClient and TransportClientParent:
* Allow users to specify if OpenVPN protocol is to be used
  via transport_is_openvpn_protocol().  This allows the
  transport classes to be used for non-OpenVPN protocols
  such as HTTPS.

* Added transport_send_queue_empty() and transport_needs_send()
  methods for flow control when using non-OpenVPN protocols.
2015-05-06 01:20:00 -06:00
James Yonan
367742001f In proto.hpp core, modified KeyContext inheritance of ProtoStackBase
to use CRTP-based static polymorphism instead of dynamic polymorphism.
2015-05-02 11:33:15 -06:00
James Yonan
c51a728a76 Added ChallengeResponse::parse_static_cookie(). 2015-05-01 13:43:10 -06:00
James Yonan
6baf23462f Added render_hex_sep() method that allows a separator between
each byte.
2015-05-01 13:41:25 -06:00
James Yonan
2c872dacb5 In AuthCert::issuer_fp_str(), add the option to format
fingerprint in OpenSSL format.
2015-05-01 13:40:05 -06:00
James Yonan
ea15d57dcd Added SSL flag LF_ALLOW_CLIENT_CERT_NOT_REQUIRED to allow the
client-cert-not-required directive to be parsed.
2015-05-01 11:40:57 -06:00
James Yonan
268608f643 Fixed inaccurate comment in PolarSSL sslctx.hpp. 2015-05-01 11:40:16 -06:00
James Yonan
2b609ba0c6 IPVerFlags::api_flags() needs to return both the new
client-API-visible flags such as EmulateExcludeRoutes
as well as the RG_x flags.  Previously, the RG_x flags
were not made visible to the API, however some clients
(such as Mac) need to see them.

This is accomplished by moving EmulateExcludeRoutes to
(1<<16) so it doesn't conflict with the RG_x flags.
2015-04-30 10:35:25 -06:00
James Yonan
d441693725 Added a second SetUserGroup constructor that accepts std::string
arguments instead of const char *.  Made both constructors
explicit.
2015-04-30 10:34:07 -06:00
James Yonan
36576a26c5 Break up existing daemonize() method into two methods:
1. log_setup -- redirect stdin/stdout/stderr
2. daemonize -- actually call daemon()

For compatibility, the old daemonize() method is still
available and is now internally composed using the new
methods.
2015-04-30 10:29:51 -06:00
James Yonan
51a8614ca8 Added SafeString::to_string() method. 2015-04-30 10:29:07 -06:00
James Yonan
6f82212004 In Protocol::parse(), when throwing exception, cite the original
string (not the one already converted to lowercase).
2015-04-25 16:55:30 -06:00
James Yonan
4d660c0eca Added OUTBIN parm to build script. 2015-04-25 15:12:15 -06:00
James Yonan
ec47f0cbdc Use ::time() when calling system time method. 2015-04-25 15:11:32 -06:00