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

18 Commits

Author SHA1 Message Date
Arne Schwabe
53d22aca99
Remove unneed windows/console.hpp include
This breaks build on non Windows platforms

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-01-16 15:34:59 +01:00
Lev Stipakov
394b5b2258
omi: add password protection
Implemented as in openvpn2.

If --management option includes "stdin",
client immediately prompts for password.

When there is incoming OMI connection, client
prompts for password and, if it doesn't match
the one entered via stdin, closes OMI connection.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-10 12:30:15 +02:00
Lev Stipakov
a4d9989d81
Update license on files moved from common
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-01-09 12:24:20 +02:00
James Yonan
0c5c0cbe57
Acceptor::TCP: don't set reuseport flag by default on listener socket
Previously, all listener sockets were configured with both
reuseaddr and reuseport.  reuseaddr is reasonable to use as
a default, but reuseport should only be used when different
threads are listening on the same local port/address for
load-balancing purposes.

This patch adds two new socket option flags DISABLE_REUSE_ADDR
and REUSE_PORT, to provide finer-grained control over
these options.

Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:21 +02:00
James Yonan
80e754d00a
Replace AsioTimer with AsioTimerSafe in cases where handler doesn't clearly check for late cancellation
As noted in the Asio documentation, an AsioTimer handler can be
called with a non-error status after timer cancellation.

Unfortunately, this can lead to race conditions, so I'm moving over
all AsioTimer users to AsioTimerSafe when I don't see the handler
clearly checking for late cancellation.

Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:21 +02:00
James Yonan
ac158fd0bf
OMICore: support asynchronous command response
To support asynchronous command response, the virtual
method omi_command_in() should now return a boolean.

When omi_command_in() returns false, synchronous mode
is chosen (the previous default).  This means that
omi_command_in() must emit "SUCCESS: ..." or
"ERROR: ..." before it returns.

When omi_command_in() returns true, the new asynchronous
mode is chosen, and omi_command_in() may return before
emitting SUCCESS or ERROR.  In this mode, OMICore will
pause the incoming command pipeline and not make any
further calls to omi_command_in() until
OMICore::async_done() is called.

Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:21 +02:00
James Yonan
fd1ed92b68
Make lambda functions mutable that benefit from using std::move() on closure vars
Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:20 +02:00
James Yonan
35c0480180
AsioTimer: use expires_after() method when possible.
A common AsioTimer usage pattern is:

  expires_at(Time::now() + duration)

This is more succinctly and efficiently stated as:

  expires_after(duration).

Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:20 +02:00
James Yonan
d3da69e35c
Added i/o abstraction layer.
Created a lightweight abstraction layer so that another i/o
reactor can be dropped in place of asio.

This commit includes:

* Added ASIO=1 to many "go" scripts that require asio
* Renamed "asio::" to "openvpn_io::".

Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:20 +02:00
James Yonan
cff607cae1
copyright: updated to 2017
Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:20 +02:00
James Yonan
658efb6232
license : this branch (common) is proprietary, so remove all GPL headers.
Signed-off-by: James Yonan <james@openvpn.net>
2020-01-09 12:23:19 +02:00
James Yonan
c747b20e2b
asio: deal with symbol renaming in latest github master
mutable_buffers_1 -> mutable_buffer
const_buffers_1 -> const_buffer
2020-01-09 12:23:19 +02:00
James Yonan
c0d93bbd5f
copyright : updated to 2016 2020-01-09 12:23:19 +02:00
James Yonan
4a45609b29
Updated OMI to support server-side usage. 2020-01-09 12:23:19 +02:00
James Yonan
061daa8e3c
OMI : Windows seems to lose >FATAL: notifications that are transmitted immediately before OMI socket close. Work around the issue by adding a 250ms delay between the last write to the socket and the close. 2020-01-09 12:23:19 +02:00
James Yonan
26e99b1a37
Ported OpenVPN 3 OMI to Windows
* Added build script buildomi.py

* Implemented logging using Win::LogUtil

* Still an issue with External PKI that is documented in
  omi/doc/omi.log
2020-01-09 12:23:18 +02:00
James Yonan
d0c63d3150
First working OMI wrapper for OpenVPN 3 client. Tested with OpenVPN Connect on Mac.
Could benefit from some minor modifications to
python client backend and tray app:

* Client backend and ovpn3 both implement connection timeout.
  Client backend should defer to the ovpn3 implementation.

* Client backend and ovpn3 both implement DNS server config
  and SystemConfiguration event sent to
  'Setup:/Network/Global/IPv4' for 'VPN up'.
  Client backend should defer to the ovpn3 implementation.

* Ensure that system state changes (sleep, wakeup, network
  roam, fast user switching, etc.) don't cause conflicts
  between client backend and ovpn3 core both trying to
  implement similar functionality.

* Tray app should render error detail in >FATAL: messages.
  Right now tray raises a Disconnected notification but
  loses any error detail.
2020-01-09 12:23:18 +02:00
James Yonan
e8a21acb25
Initial OMI (OpenVPN Management Interface) commit, still unfinished. 2020-01-09 12:23:18 +02:00