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

2478 Commits

Author SHA1 Message Date
David Sommerseth
1668f1cd9b
cliopthelper: Extend support for encrypted EC private keys
The ClientAPI::EvalConfig::privateKeyPasswordRequired bool flag was not
set correctly when the private key was an encrypted EC key.

This flag is set in EvalConfig by OpenVPNClient::parse_config()
when it calls ParseClientConfig::privateKeyPasswordRequired().

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-21 13:17:42 +01:00
Lev Stipakov
acec6e80ee
mac: add bypass route from socket_protect call
This is used to enable connectivity to a different remote
when force-tunneling is used and current VPN connection is broken.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-20 11:22:40 +01:00
Lev Stipakov
a9659a7d1f
tun mac: implement add_bypass_route() method
This method generates /sbin/route commands which
create and delete bypass route for given host.

It is needed to enable connectivity to a different remote
when force-tunneling is used and current VPN connection is broken.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-20 11:22:39 +01:00
Lev Stipakov
044c058045
xcode: update project file
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-20 11:22:38 +01:00
Lev Stipakov
11d705d2c7
wintun: fix ring buffer registration
As documentation says:

 > If lpOverlapped is NULL, lpBytesReturned cannot be NULL

While on Windows 10 passing NULL works by accident,
on Windows 7 it crashes.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-20 11:17:11 +01:00
James Yonan
93c111242c
Removed unused directories
Signed-off-by: James Yonan <james@openvpn.net>
2019-11-20 11:14:24 +01:00
James Yonan
1719681472
Added HTTP::headers_redact() for redacting basic auth creds from Authorization header
Before debug logging, HTTP headers should be passed through
HTTP::headers_redact() to prevent the creds from being logged.

Signed-off-by: James Yonan <james@openvpn.net>
2019-11-20 11:14:23 +01:00
James Yonan
fd82cec419
logsimple.hpp: OPENVPN_LOG_STRING, OPENVPN_LOG_NTNL: flush output stream
Signed-off-by: James Yonan <james@openvpn.net>
2019-11-20 11:14:23 +01:00
Arne Schwabe
a8275e13f4
Add ovpnclinull and ovpnclidco variants to cmake build script 2019-11-20 11:07:49 +01:00
David Sommerseth
02e524dcef
Merge branch 'released' into master 2019-11-20 11:07:22 +01:00
David Sommerseth
f4778a9f65
Finalizing OpenVPN 3 release v3.5.1
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-14 18:46:02 +01:00
David Sommerseth
81d6e5c3c1
Update version to indicate development base version
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-14 18:41:25 +01:00
David Sommerseth
6201b316f5
Merge branch 'hotfix/3.4' into released 2019-11-14 18:39:55 +01:00
David Sommerseth
300e0218dc
Merge hotfix/3.3 into hotfix/3.4 2019-11-13 21:12:41 +01:00
Antonio Quartulli
7f3756336d
httpcli.cpp: perform lock before running async DNS resolution
d8d14e1991 implemented a new logic which
allows the DNS resolution to happen in a detachable thread. Since then,
we must execute async_resolve_lock() before performing the resolution so
that the main event queue is kept alive, while the core is busy
resolving the hostname.

Failing to do so will result in the main event queue terminating due to
"no events in the queue" and thus closing the core process.

Add lock (and related cancel) around resolution operation to guarantee
the core process stays alive during resolution.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2019-11-08 17:19:48 +01:00
Antonio Quartulli
7f0abcb3c3
httpcli.cpp: remove unused resolver member
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2019-11-08 17:19:47 +01:00
David Sommerseth
7bd55e0a7b
mbedtls: Add support for --verify-x509-name
This is the mbed TLS counterpart of the OpenSSL change in
commit c069b7cf5fb9ba47.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:45 +01:00
David Sommerseth
ae6bf893bb
mbedtls: Add unit tests for x509_get_subject() and x509_get_common_name()
These functions are found in openvpn/mbedtls/pki/x509certinfo.hpp.

This change also adds support to build coreUnitTests against mbed TLS
instead of OpenSSL (default) by providing -DUSE_MBEDTLS=true to cmake.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:44 +01:00
David Sommerseth
fc060bd317
mbedtls: Move x509_get_subject() and x509_get_common_name() to an independent file
This is the mbed TLS counter part to the OpenSSL change in
commit e0fd92f30756.  These two methods are generic and not
tied to the MbedTLSContext in any particular way.

This is needed to be able to add a unit test for the x509_get_*()
functions.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:43 +01:00
David Sommerseth
7900c71f5c
mbedtls: Add missing include file in x509cert.hpp
This file uses BufferAllocated, which is defined in
openvpn/buffer/buffer.hpp

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:42 +01:00
David Sommerseth
61ba6e9c41
openssl: Add unit tests for OpenSSLPKI::x509_get_*() functions
This adds some basic unit tests for the various functions retrieving
information from a X.509 certificate.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:41 +01:00
David Sommerseth
5f881fe7bf
openssl: Move generic X.509 cert extraction code to a separate file
This moves generic OpenSSL related functions used to extract X.509
certificate information to an independent file which can be used more
freely.  This code does not contain anything specific to the
OpenSSLContext class group and works nicely as a separate unit.

This is needed to be able to add unit test code for the x509_get_*()
functions.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:40 +01:00
David Sommerseth
5839869202
openssl: Add --verify-x509-name support
This implements the --verify-x509-name support for builds with OpenSSL.
This change requires the x509_get_subject() to be extended to provide
the subject field in a newer format, which requires using a different
OpenSSL API.  Since we have code which might require the old format as
well, x509_get_subject() will default to use the old format.

The --verify-x509-name supports matching both against the full subject
line and the X.509 Certificate Common Name, which means we need to check
which mode is configured and extract the proper value before calling the
VerifyX509Name::verify() method.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:39 +01:00
David Sommerseth
71a14a3553
verify-x509-name: Implement base class for processing this option
This new VerifyX509Name class handles both extracting and parsing the
appropriate --verify-x509-name option and is able to verify if a given
subject or hostname is matching the expectation.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-08 10:00:34 +01:00
David Sommerseth
1d751ffb7d
Linux/TunMethods: Avoid adding IPv6 routes without an IPv6 config
In some situations, the local6 variable is nullptr but a default IPv6
route has been configured.  This causes a segfault later in the call
chain when add_del_route() is being called.

We already have avoid a similar situation with IPv4, so implement the
same kind of safe guard for IPv6:  If no local IPv6 address has been
configured, don't attempt to add IPv6 routes.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-11-07 16:30:03 +01:00
Arne Schwabe
6ae997472c Add macOS implementation in cpu time helper and adjust unit test
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:55 +01:00
Arne Schwabe
12309c31b6 Document unit tests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
f6aada9577 Tempfile.hpp is unix only, add error when including it on win32
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
204d7e4a20 Replace OPENVPN_INSECURE_RANDOM with FakeRandom class
This avoids the mistake of using the insecure MTRand in anything but
a unit test and has the advantage that not all MTRand in a unit test
suite report being secure

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
54fbe7604c Fix file modifcation time retrieval stat.hpp on macOS
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
da41ea24d8 Require internal json for sslctx json functions
These functions require methods that are not available if
jsoncp is used as json library

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
e790c45eda Add helper functions for temporary file and joining test outputs
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
717109f1f4 Build cityhash on OS X and Windows to run pg related unit test
Also increase minimum OS version to 10.12 since the 10.8 target defaults
to libstdc++, which is not available on modern macOS versions

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
16342679fe Add helper function to get the content of a expected output file
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
9baaa88f08 set PLAT macro as OPENVPN_PLAT so other cmake files can also use it
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
f5f9b4d57c Add missing override keywords in openssl/sslctx.hpp
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
7324ca879e Add OPENVPN_LOG implementation that can collect logs in a variable
To support the pre unittest tests that compare the output against an
expected output without fully rewriting them, this logger provides a
facility to integrate them in the unit test framework

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Arne Schwabe
38a5f2d413 Increase default C++ level on macOS to C++ 14
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2019-11-07 09:58:54 +01:00
Lev Stipakov
48d4fdeb4b
README.rst: update Windows build instruction
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:21 +02:00
Lev Stipakov
8e20b4c134
vcxproj: remove O3 env var
This is not needed anymore, since dependencies
are handled by vcpkg.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:21 +02:00
Lev Stipakov
b04c9a311d
win: remove python build scripts
They're replaced by vcpkg and msbuild.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:21 +02:00
Lev Stipakov
5e2bef23e3
cmake: update findcoredeps to work with vcpkg
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:21 +02:00
Lev Stipakov
317f41931f
vcpkg: add port overlays
This adds port overlays for asio and mbedtls. Those
are required because we use patched versions of those libraries.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-07 10:44:20 +02:00
David Sommerseth
8ffe1de50e
Release of OpenVPN 3 Core Library 3.5
Merge branch 'releaseprep/3.5' into released
2019-11-06 17:06:49 +01:00
Lev Stipakov
38b733dafd
vcxproj: support for vcpkg
Remove reference to DEP_DIR, all include/library paths are handled
by vcpkg+msbuild integration,

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2019-11-06 13:52:26 +02:00
David Sommerseth
c441a01d63
Finalizing OpenVPN 3 release v3.4.1
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-10-31 11:15:41 +01:00
David Sommerseth
15c71c44e9
Finalizing OpenVPN 3 release v3.3.2
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-10-31 11:10:06 +01:00
David Sommerseth
595ce9ac7d
Release of OpenVPN 3 Core Library version 3.4
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-10-24 15:29:22 +02:00
David Sommerseth
1d82cf2ec9
Merge branch 'releaseprep/3.4' into released 2019-10-24 15:24:07 +02:00
David Sommerseth
6c68c33513
Update version.hpp for releaseprep/3.5
Signed-off-by: David Sommerseth <davids@openvpn.net>
2019-10-24 15:07:39 +02:00