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

1881 Commits

Author SHA1 Message Date
Antonio Quartulli
115fab562d
scripts: generate version automatically from git branch/commit
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-06-25 16:37:50 +08:00
Antonio Quartulli
08dfbf98c1
version: make OPENVPN_VERSION a compile time option
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-06-25 16:34:43 +08:00
Lev Stipakov
8aa6f2f847 Merged in feature/dco-nopg (pull request #13)
[OVPN3-230] Add client-side dco code

Approved-by: James Yonan <james@openvpn.net>
2018-06-23 18:48:33 +00:00
Lev Stipakov
695e09477c Merged in fix/missing_include (pull request #15)
tunio: add missing include

Approved-by: Antonio Quartulli <antonio@openvpn.net>
2018-06-08 09:24:14 +00:00
Lev Stipakov
2cde34e972 tunio: add missing include
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-06-08 11:22:23 +03:00
Arne Schwabe
c1d542c2da Merged in schwabe/build_android (pull request #14)
Modify build script of lz4/mbedtls to allow src only builds of dependencies

Approved-by: Lev Stipakov <lev@openvpn.net>
Approved-by: James Yonan <james@openvpn.net>
2018-06-08 08:04:14 +00:00
Lev Stipakov
9e600c89e7 Merged in OVPN3-211-implement-big-mutex (pull request #5)
[OVPN3-211] bigmutex: introduce macro to ensure thread-safety

Approved-by: James Yonan <james@openvpn.net>
2018-06-08 08:03:44 +00:00
Lev Stipakov
83a041b87a Merged in OC-71-dns-search-domain-default-suffix-a (pull request #9)
[OC-71] tun: make Windows use pushed DNS search domain

Approved-by: James Yonan <james@openvpn.net>
2018-06-08 08:03:15 +00:00
Lev Stipakov
5b030ed835 Merged in OC-70-dns-search-domain-default-suffix-a (pull request #11)
macdns: refactor split-DNS and domain autocompletion logic

Approved-by: James Yonan <james@openvpn.net>
2018-06-08 08:02:51 +00:00
Lev Stipakov
fd147e450b Merged in OVPN3-229-compression (pull request #8)
OVPN3-229 compression

Approved-by: Arne Schwabe <arne@openvpn.net>
Approved-by: Antonio Quartulli <antonio@openvpn.net>
Approved-by: James Yonan <james@openvpn.net>
Approved-by: Lev Stipakov <lev@openvpn.net>
2018-06-08 08:02:35 +00:00
Lev Stipakov
ccc17a5631 [OVPN3-211] bigmutex: introduce macro to ensure thread-safety
Platforms like UWP and iOS may call core methods
from another threads. Since core is not thread-safe,
we provide OPENVPN_ASYNC_HANDLER macro which instantiates
lock guard. It follows RAII principle and locks global
mutex in constructor and unlocks in destructor. This
guarantees that code in block protected with this macro
won't be called simultaneously from different threads.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-06-07 21:17:42 +03:00
Lev Stipakov
643ada4395 [OVPN3-230] Add client-side dco code
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-05-31 16:27:50 +03:00
Lev Stipakov
3d4bac496e macdns: refactor split-DNS and domain autocompletion logic
Implement domain autocompletion by adding ADAPTER_DOMAIN_SUFFIX value
to SearchDomains (see https://support.apple.com/en-ca/HT200303).

Note that autocompletion won't work in case of split-DNS, when macOS
uses network adapter's domain suffix instead of one provided by VPN.

Exclude split-DNS domains from autocompletion list.

Do not add "dhcp-option DOMAIN" values to SearchDomains
when redirecting DNS to not to use them for autocompletion.

This fixes OC-70 and OC-72.

Signed-off-by: Lev Stipakov <lev@openvpn.net>

do not add DOMAIN values to search domains when redirect DNS
2018-05-25 19:37:09 +03:00
Lev Stipakov
5c5ac5151c [OC-71] tun: make Windows use pushed DNS search domain
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-05-24 13:36:17 +03:00
Arne Schwabe
d339b684ac Modify build script of lz4/mbedtls to allow src only builds
The modern cmake build for the Android core does build the library
during the build of the core. Prebudiling these libraries is not
necessary.
2018-05-22 19:57:43 +02:00
James Yonan
af661e2f1c Merged in jy.20180513 (pull request #12)
Jy.20180513

Approved-by: Lev Stipakov <lev@openvpn.net>
2018-05-21 09:00:48 +00:00
James Yonan
68170941fb manage: pass ProtoContext::Config::Ptr by value
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:02 +03:00
James Yonan
46d2a642f8 RC: added is_thread_safe() method to indicate if refcount is thread-safe
is_thread_safe() is constexpr, so it can be checked at compile time
using static_assert().

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:02 +03:00
James Yonan
1da56fcce6 ValidateCreds: added strict flag for use with OMI
The OMI model (OpenVPN management interface) can't deal
with control characters in credentials, so we add a strict
flag to ValidateCreds::is_valid() that when true will
validate according to OMI requirements.

Also increased max length for credentials under strict=true
to 512 for OMI.

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:02 +03:00
James Yonan
96f6347839 ServerProto: misc changes for AUTH_PENDING
* Added schedule_auth_pending_timeout()

* Removed the throw_on_error parameter to set_acl_index()

* Forward all PUSH_REQUEST messages to the management layer,
  not just the first message.

* Added enum DisconnectType for labeling the disconnect type,
  since there are now several different disconnect types
  including halt/restart, relay transition, and auth pending.

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:02 +03:00
James Yonan
877464675c Implemented client-side AUTH_PENDING protocol state
AUTH_PENDING is a control channel message sent from server
to client before PUSH_REPLY or AUTH_FAILED and is intended
to signal the client that a browser-based out-of-band
authentication challenge (such as SAML) needs to occur
before the connection request can succeed or fail.

When the core receives the AUTH_PENDING message, it will
enter the AUTH_PENDING state and forward the message
to the client UI as an event.

The core will also dial back the PUSH_REQUEST transmit
frequency to one message every 8 seconds, and the server is
expected to reply with an AUTH_PENDING message after every
PUSH_REQUEST.  This is done as a sort of keepalive
replacement since the normal OpenVPN protocol keepalive
functionality isn't enabled until the crypto state is
established, which doesn't happen until the PUSH_REPLY
message is received from the server.

During the AUTH_PENDING state, the server will likely want to
push INFO messages to the client UI (such as INFO,OPEN_URL:)
to facilitate the out-of-band authentication challenge.
Normally, the client core buffers early INFO messages
and doesn't release them to the UI until 1 second after
the CONNECTED event.  This is done because it was
presumed that the server wouldn't want the client to
act on the INFO messages until the tunnel is established.

But the AUTH_PENDING state creates a need for an unbuffered
INFO message, since the server may want to message the client
UI during the AUTH_PENDING state and have that message
be immediately processed.

I've solved this problem by introducing a new control channel
message called "INFO_PRE".  INFO_PRE is handled exactly the
same as INFO except it is never buffered.  Also, note that
INFO_PRE messages are delivered to the client UI as
ordinary INFO events (I didn't actually create a new client
event for INFO_PRE since I can't think of a reason why the
client UI would need to distinguish between them).

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
0e673f1e0b Cleaned up cli build script
Also added an option to build with OpenSSL
instead of mbedTLS.

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
58cfd26d20 IP Addr library: added random_addr() and random_subnet()
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
2c06ac24cd SessionIDType: allow generation from non-crypto RNGs
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
a0eb88a6ba RemoteList::next(): better handling of null return from remote_override->get()
If remote_override->get() returns null, treat as if remote_override
isn't enabled.

Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
d6627ed480 IP::RouteType: added operator!=() method
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
a8e9605f15 ClientAPI::OpenVPNClient: fixed erroneous comment
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
b7075014a4 RemoteOverride: handle exceptions thrown from virtual remote_override() method
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
f051a10f34 IP packet headers: Added IPv6 and ICMPv6
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-21 11:34:01 +03:00
James Yonan
6224ade511 library: added quote_ip() function to return IP addr in brackets if it is IPv6
Signed-off-by: James Yonan <james@openvpn.net>
2018-05-13 23:03:09 -06:00
Antonio Quartulli
ed590569ce Merged tcplink: do not re-implement send_queue_size() function
Approved-by: Lev Stipakov <lev@openvpn.net>
Approved-by: David Sommerseth <davids@openvpn.net>
2018-05-09 14:21:37 +00:00
Arne Schwabe
f0198627b5 Merged in cityhash building fix
Add script for building cityhash

Approved-by: Antonio Quartulli <antonio@openvpn.net>
Approved-by: Lev Stipakov <lev@openvpn.net>
2018-05-09 10:01:56 +00:00
Antonio Quartulli
d37db831e8
tcplink: do not re-implement send_queue_size() function
send_queue_size() is already defined in LinkCommon and
does not need to be overridden by Link.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-05-04 19:44:34 +08:00
Lev Stipakov
c5e41d8624 xcode project: add liblz4
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-30 13:44:45 +03:00
Lev Stipakov
701f73c27c [OVPN3-229] proto.hpp: streamline compressor selection logic
Abort connection if server pushes unsupported compression.

Degrade compression to asym (server->client) if server pushes compression
which is supported but disabled.

This fixes problem with non-working tunnel - server pushes compression,
client has compression disabled and instantiates stub. As a result,
server uses compression and client uses stub.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-30 13:44:45 +03:00
Lev Stipakov
35bbca799d Merged in OVPN3-184-generate-warning (pull request #1)
OVPN3-184 Name Constraints

Approved-by: Antonio Quartulli <antonio@openvpn.net>
Approved-by: James Yonan <james@openvpn.net>
2018-04-25 18:10:21 +00:00
Antonio Quartulli
a73d2ce68f Merged in antonio/OVPN3-169-pure-ssl-transport (pull request #3)
Antonio/OVPN3-169 pure ssl transport

Approved-by: James Yonan <james@openvpn.net>
2018-04-25 18:09:09 +00:00
Arne Schwabe
dd47138adf Add script for building cityhash 2018-04-25 18:25:28 +02:00
Lev Stipakov
8d7f5f3c12 Merged in feature/docker (pull request #2)
[OVPN3-223] build: add docker images

Approved-by: David Sommerseth <davids@openvpn.net>
2018-04-24 10:36:12 +00:00
Antonio Quartulli
d9b5055cda
[OVPN3-169] cli.cpp: compile with -DOPENVPN_TLS_LINK when requested
Compile with -DOPENVPN_TLS_LINK if TLS=1 was specified on
the command line

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 17:38:19 +08:00
Antonio Quartulli
2d99bbfeaf
[OVPN3-169] cliopt.hpp: add support for TLS transport module
When compiled with -DOPENVPN_TLS_LINK, the core will
ship support for the TLS Transport component.
However, note that its implementation must be provided
externally.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 17:38:19 +08:00
Antonio Quartulli
62c8461d26
[OVPN3-169] tcpcli.hpp: add runtime support for TLSLink
A configuration switch can now be used to tell
the TCPTransport client to use TLS.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 17:38:19 +08:00
Antonio Quartulli
e0e76bb283
[OVPN3-169] tcplink: introduce LinkBase abstract class
This class is an "interface" for TCP Links. It can be used by Transport
layers instead of the actual concrete Link class.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 17:38:18 +08:00
Antonio Quartulli
a71014d407
[OVPN3-169] tcplink: create LinkCommon class and inherit from it
To allow other types of TCP Link to be implemented,
factor out code that can be re-used by other implementations
and move it to the LinkCommon class.

TCPTransport::Link now inherits from LinkCommon.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 17:31:51 +08:00
Lev Stipakov
cfd6df5bc2 build system: fix 'git apply'
When 'git apply' is run inside repository folder, it ignores files
missing in index. To make it work, run 'git apply' outside of repository.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 11:11:39 +03:00
Lev Stipakov
3e49de7dea [OVPN3-210] ovpncli: handle "allow-name-constraints" for OpenSSL
This is mbedTLS-only option, which has no effect on OpenSSL-built client.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 11:11:39 +03:00
Lev Stipakov
08d72bd76d [OVPN3-184] mbedtls: handle Name Constraints
Introduce profile flag "allow-name-constraints".

mbedTLS doesn't support x509v3 'Name Constrains'
extension. To allow client to connect, make mbedTLS
not to fail on this extension and drop a warning to UI.

This depends on "Enable allowing unsupported critical extensions in runtime"
patch to mbedTLS.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 11:11:39 +03:00
Lev Stipakov
40c70113d4 [OVPN3-184] Add mbedTLS patch
Add mbedTLS patch which enables to allow
unsupported critical extensions in runtime.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2018-04-19 10:59:35 +03:00
Antonio Quartulli
ef8d11f340
[OVPN3-169] OpenSSL: implement write_ciphertext_unbuffered() function
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 12:10:02 +08:00
Antonio Quartulli
37dc863783
[OVPN3-169] mbedTLS: implement write_ciphertext_unbuffered() function
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2018-04-19 12:10:00 +08:00