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

3446 Commits

Author SHA1 Message Date
Arne Schwabe
ec5ea70de2 Allow GIT version to be reported as part of platform (version) string
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-08-15 13:52:35 +02:00
Arne Schwabe
a1c44bd0c6
Update OpenSSL to 3.0.5, build fat lib for macos, drop 32 bit on iOS 2022-07-13 20:42:52 +02:00
Frank Lichtenheld
c3129ddac8 README.rst: some fixes for macOS instructions
- Fix rst syntax error
- Add pkg-config to list of brew packages to
  install. While here, order them alphabetically.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-07-11 14:47:34 +02:00
Frank Lichtenheld
15343b0133 extpki.hpp: ignore deprecated EC_KEY_* functions
Doing first -Werror builds on Linux against OpenSSL 3.0.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
(cherry picked from commit ab55c9fdb2)
2022-07-11 13:34:59 +02:00
Frank Lichtenheld
a04266120d mingw: fix OpenSSL on x86_64
Hardcode libdir to lib, because openssl3 chooses
lib64 otherwise.

While here, some small changes:
- remove dangerous "|| true" after openssl make
- remove "-j1" for openssl "make install". Speeds
  up the documentation generation.
- use set -x

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
(cherry picked from commit f27157e28b)
2022-07-11 12:21:08 +02:00
Lev Stipakov
029ac68090 mingw: fix broken OpenSSL checkout
OpenSSL has changed tags naming to
something like openssl-3.0.2, so adapt
our script accordingly.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
(cherry picked from commit 296abfca32)
2022-07-11 12:20:56 +02:00
Frank Lichtenheld
18af519fae test_ssl: fix ssl.enablelegacyProvider
Since we didn't have any regular builds against
OpenSSL 3.0 so far we didn't notice that it was
broken by commit 291e675748
(Move SSL context from OpenSSL Context to OpenSSL Config)

Since context is now part of config, we need to use
separate configs.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
(cherry picked from commit 6715afd4c7)
2022-07-11 12:20:17 +02:00
Antonio Quartulli
46b13ec65e
dco/GeNL: ignore message for unrelated interfaces
Some netlink messages are sent as multicast by the kernel and will reach
all listening userspace processes. For this reason, the receiving
handler should discard non-interesting messages to avoid messing up the
local state.

Reported-by: David Sommerseth <davids@openvpn.net>
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2022-05-20 10:24:37 +02:00
Frank Lichtenheld
88f7f7c70b
deps/lib-versions: update OpenSSL to 1.1.1n
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-17 18:13:01 +01:00
Frank Lichtenheld
592b6c4604 cmake: create findswigdeps to reduce code duplication
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-16 13:02:19 +01:00
Lev Stipakov
77b0bae736 client/CMakeLists.txt: build swig library only on Windows x64 arch
Swig library build uses Python library which has the the same arch
as build machine arch, which in our case is always x64.

Building for other archs causes machine type conflicts.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-03-16 11:56:09 +01:00
Lev Stipakov
78410b290e size:hpp: fix 'ssize_t': redefinition error when building swig library on Windows
When building swig library, pyconfig.h is
included which, before version 3.10, defines ssize_t:

/* Define like size_t, omitting the "unsigned" */
#ifdef MS_WIN64
typedef __int64 ssize_t;
#else
typedef _W64 int ssize_t;
#endif
#define HAVE_SSIZE_T 1

which causes redefinition error. Take this into account
and add additional ifdef guard.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-03-16 11:56:09 +01:00
Lev Stipakov
70d0f23305 client/CMakeLists.txt: don't use gcc-specific flags in Windows build
Commit 9ad98bae8f ("Add building ovpncli swig library to cmake build")
added GCC-specific compiler flags which are unknown on Windows.

Remove those flags from Windows build.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-03-16 11:56:09 +01:00
Frank Lichtenheld
b4152600c2 Rename PThreadBarrier::ERROR to fix build issue on Windows
Some Windows header defines an macro ERROR which then
leads to build errors:
...\ovpn3-build\ovpn3\common\tlshttps\tlshttpsclient.cpp(167,28):
error C2589: "constant": Invalid token on the right side of "::"
[...\ovpn3\common\tlshttps\tlshttpsclient.vcxproj]

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-16 11:56:09 +01:00
Frank Lichtenheld
5f12014ca1 client: Fix build with SWIG 3.0 and new GCC
We saw problems with this on our RHEL7 builds because
we upgraded gcc but not swig. Work-around the issue
for now until we can require SWIG 4.0.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-11 18:51:10 +01:00
Frank Lichtenheld
14295c94de Fix Windows build after merge of released
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-11 18:51:10 +01:00
David Sommerseth
92751e23aa
Finalizing OpenVPN 3 Core library release v3.7
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-03-11 00:19:44 +01:00
David Sommerseth
81441e8fa1 OpenVPN 3 Core library version 3.6.6
-----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEgDq5E1p1aZrNLFFkhs+UTJZx/fIFAmIqffMTHGRhdmlkc0Bv
 cGVudnBuLm5ldAAKCRCGz5RMlnH98oX4EACzfbeJuJcHMueL4Q54m8dqAVFxaev+
 kdm0KCjxuMlTB5ERtekJ7+6choeLdcs3K1nLV3jsDooXoNH0egdkNOEWX/cWnsdO
 WKtgz8a6oxx8c6H3Ow71tXIoRuJTQF/Tt9qUdjWu2TUpbbQSzC/h5onDP6+i5zct
 0qgySyDlB8yPnyBw8VIl+ZgKH0kacNGC3aO9+csQ1KPi1hlng9cUqycrX9m+zBxA
 g2hCXm92JtIeo2ti5RwoJVAqaeOmddAgLg5hHrX8LA37Bm4f+7eQEUM36CZnDoXr
 g4H/YHltn6W2dXpQKmYLIrhDVfWsLZ/fW7ASzzgfI2nwugmWsIgwXTtvsGLsocfX
 bbvI85HkTy8q6+oAHsC35IdHZcvpK/ekAda7zDSmpi7jRYBqB04vVTWuUu9O8HJt
 0wcwaTo5DzqYgGc461JFSw7j2lwIhCCfSnIBZP/Cb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UXMyxm33AJIuV5
 CHOSjo6kpWN7Fw==
 =ONLf
 -----END PGP SIGNATURE-----

Merge OpenVPN 3 Core library version 3.6.6 changes
2022-03-11 00:16:55 +01:00
David Sommerseth
699a46de6e
Finalizing OpenVPN 3 Core library release v3.6.6
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-03-10 23:38:09 +01:00
Frank Lichtenheld
e77069e29e
Rand2: Fix USE_AFTER_MOVE (CID 10990)
CID 10990 (#2 of 2): Using a moved object (USE_AFTER_MOVE)
2. use_after_move: rng_arg is used after it has been already moved.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-03-10 01:00:56 +01:00
Frank Lichtenheld
2cd6c9ef5f unicode-impl.hpp: Document source information with PURL
Original source is only available via web archive.
This code should be replaced anyway since the license
is dubious regarding modification.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-25 16:11:30 +01:00
Frank Lichtenheld
17f3a867d0 getopt.hpp: add some sort of PURL
Closest I could identify so far. The fact that it is in
CVS and has no useful tags doesn't make it better.
Probably we can improve upon this.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-25 15:31:58 +01:00
Frank Lichtenheld
b62863336d openvpn/http: document source and add license text
While the link is probably fine for most people
it is not strictly enough to fulfill the license
terms. Since this code is very limited in scope
I decided to add the txt file not in top directory
but rather near the files where it matters.

Add PURL to document where the source came from.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-25 15:08:52 +01:00
Frank Lichtenheld
aca3d6df21 getopt.hpp: Fix old BSD-4-Clause-UC reference
As per ftp://ftp.cs.berkeley.edu/pub/4bsd/README.Impt.License.Change
the 3rd clause was removed 1999. So remove it here.
This removes also any potential GPL conflicts.
Renumber 4th clause to 3 as all the BSDs seem to have
done so.

While here, add SPDX-License-Identifier

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-25 14:12:56 +01:00
Frank Lichtenheld
94a197493a ovpncli: add missing break in option parsing (CID 11054)
Introduced in commit
1b5d913503

CID 11054 (#1 of 1): Missing break in switch (MISSING_BREAK)
unterminated_case: The case for value 71 is not terminated
by a break statement

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-21 13:23:33 +01:00
Frank Lichtenheld
f3f6f580b3 ovpncli: fix uninitialied value in config_templ (CID 11125)
CID 11125 (#1 of 1): Uninitialized scalar variable (UNINIT)
8. uninit_use_in_call: Using uninitialized value
config_templ.enableNonPreferredDCAlgorithms when calling Config.
flood.cpp:1320

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-02-21 13:23:06 +01:00
Arne Schwabe
a219ce0303 update mbed TLS to latest 2.7 version
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-02-10 18:59:01 +01:00
Arne Schwabe
568f6615cf Update build instruction for macOS and cleanup/remove build var
Remove the vars-osx64 and vars-iossim files which are no longer used.
The IOS simulator does not support the VPN API and builds for the
IOS simulator have not been done in a very long time nor are they
particular useful.

Also switch to pkg-config for jsoncpp by default.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-02-10 18:59:01 +01:00
Lev Stipakov
91c589263f
GitHub Actions: fix broken script
- build for x86/x64/arm64
 - fix run-cmake step
 - fix caching
 - add upload artifacts
 - update vcpkg commit

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-02-10 18:36:59 +01:00
Heiko Hund
b660e5642b
add support for --dns option
As a first step towards DNS configuration in openvpn and a unified way
to push DNS related settings to clients in v2 and v3, this commit adds
support for parsing the new --dns option. Later commits will add support
for setting up DNS on different platforms.

For now, --dns and DNS related --dhcp-option can be used together for
smoother transition. Settings from --dns will override ones --dhcp-option
where applicable.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2022-02-10 18:35:02 +01:00
James Yonan
7baf7b5978 ManClientInstance, ServerProto::Session, TransportClientInstance::Recv: added ipma_notify() virtual method
Signed-off-by: James Yonan <james@openvpn.net>
2022-02-07 13:56:13 -07:00
James Yonan
026df465cf read_binary_unix_fast(): templatize filename argument to accept std::string or C string
Signed-off-by: James Yonan <james@openvpn.net>
2022-02-07 13:56:13 -07:00
James Yonan
620fa19a68 Time: added nanoseconds_since_epoch() method
Signed-off-by: James Yonan <james@openvpn.net>
2022-02-07 13:56:13 -07:00
James Yonan
50b066ddef file_mod_time_nanoseconds(): accept filename as either const std::string& or const char *
Also prefix standard C library methods with "::"

Signed-off-by: James Yonan <james@openvpn.net>
2022-02-07 13:56:13 -07:00
James Yonan
dfcc7dd709 bufstr: added buf_c_str() and buf_eq_str() functions
Signed-off-by: James Yonan <james@openvpn.net>
2022-02-07 13:56:13 -07:00
Frank Lichtenheld
7b2413eee2 scripts/{linux,mac}/build-all: cleanup
- remove commented out lines that are unlikely to be useful
- enable set -u
- allow to skip mbedtls build on linux
2022-01-28 12:20:02 +01:00
Frank Lichtenheld
e82303ad2a deps: remove unused dependencies
Most of these haven't been used in years and are
probably useless now. If required they can always
be recovered from the git history.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-01-28 12:18:39 +01:00
Frank Lichtenheld
ad503c7c7a dockerfiles: remove, as unmaintained
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-01-28 12:05:24 +01:00
Frank Lichtenheld
5ce5514fbe findcoredeps: use pkg config for libjsoncpp on Mac OS
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2022-01-24 13:50:03 +01:00
James Yonan
a1c1a5b043 cli tool: fixed typos
Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 11:03:15 -06:00
James Yonan
6a71527c22 proto.cpp test: define USE_TLS_EKM to test CryptoAlgs::KeyDerivation::TLS_EKM mode
This mode uses the OpenSSL method SSL_export_keying_material()
as an alternative to TLS PRF.

Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
James Yonan
03c2406fd0 ProtoContext: fixed state bug in KeyContext::init_data_channel()
This fixes an issue introduced in the previous commit:

  Implement TLS Keying Material Export data key derivation

init_data_channel() is not supposed to run until the
KeyContext state reaches ACTIVE.  This fix will cause
init_data_channel() to return without side effects when
data_channel_key is undefined, as it should be before
the KeyContext state reaches ACTIVE.

Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
James Yonan
6f34be26e3 OpenSSL: fixed bug that causes a segfault if SSL_export_keying_material() is called when SSL session is undefined
OpenSSLContext::SSL::export_keying_material() will now
return an error status (false) if SSL_get_session(ssl)
returns null.

Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
James Yonan
3ac1f0d613 HTTP: attempt to fix a lockup bug in HTTPS cleartext read path
Previously, ssl_up_stack() in httpcommon.hpp would
loop indefinitely until ssl_sess->read_cleartext_ready()
returned false, or halt is set. read_cleartext_ready()
will return true as long as the SSL_pending() function in
OpenSSL returns non-zero.  But recent experience as well
as updates to the SSL_pending() man page suggest that
SSL_pending() may return non-zero even though no data is
actually readable from the object.  In this case,
the previous code would enter an infinite loop.

The fix is to break out of the ssl_up_stack() loop when
ssl_sess->read_cleartext() returns zero size, rather
than solely relying on the return value of SSL_pending().

Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
James Yonan
67a7ec8631 WS::Client: added a comment about general timeout and websocket streaming
Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
James Yonan
5be7dee87f Added fast IP address formatting via BufferFormat::ipv4/ipv6
Signed-off-by: James Yonan <james@openvpn.net>
2022-01-13 09:40:13 -06:00
Arne Schwabe
292465a3ae
Do not use deprecated vfork on macOS
from the man page:

     The vfork system call can be used to create new processes. As of macOS
     12.0, this system call behaves identically to the fork(2) system call,
     except without calling any handlers registered with pthread_atfork(2).

     This system call is deprecated. In a future release, it may begin to return
     errors in all cases, or may be removed entirely.  It is extremely strongly
     recommended to replace all uses with fork(2) or, ideally, posix_spawn(3).
2022-01-12 18:36:06 +01:00
Arne Schwabe
d7cd1a6605
Revert "Removed OPENVPN_LEGACY_TITLE_ABSTRACTION"
This reverts commit 6c9f89b092.

OpenVPN AS IP parsing depends on the legacy way of doing things. Revert this
commit to allow AS to work again.
2022-01-12 18:34:27 +01:00
Arne Schwabe
0de7a58347
Lower xxHash minimum version to 0.7.0
xxHash works just as well and allows us to compile with system libraries
on Ubuntu 20 and Debian 11
2022-01-12 18:34:26 +01:00
Arne Schwabe
39443bff46
Rename enableNonPreferredDCOAlgorithms to config.enableNonPreferredDCAlgorithms
This should be DC for data channel instead DCO for data channel offload.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-01-12 18:30:06 +01:00