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

2971 Commits

Author SHA1 Message Date
Jani Väyrynen
afc40b78d3 Add asio patch that adds kovpn route_id support
Adds a patch formed from ovpn-asio repository:

 - branch 1-14-ovpn
 - commit df7759c141a31159d0ca4267b63f64dfd2a385b1

The patch adds kovpn route_id support to endpoints for sendto/recvfrom.

Signed-off-by: Jani Väyrynen <jani.vayrynen@openvpn.net>
2020-03-27 15:35:42 +02:00
James Yonan
6688f2d372
scripts/build: added PCRE=1 to build with PCRE (Perl-compatible regular expressions) library
Signed-off-by: James Yonan <james@openvpn.net>
2020-03-25 18:49:10 +01:00
Lev Stipakov
811dac2e3a xmlhelper.hpp: support for various tinyxml2 versions
This is mostly used by Linux client, which supports
among other distros CentOS7, Ubuntu 16 and Ubuntu 18 -
all of them have different tinyxml2 versions.

Signed-off-by: Lev Stipakov <lstipakov@gmail.com>
2020-03-19 07:35:36 +02:00
David Sommerseth
3fbe0a2701
Update copyrights
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-18 19:37:32 +01:00
Arne Schwabe
941104cf49
Implement supporting IANA cipher names in tls-cipher and unit tests
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-03-11 19:51:37 +01:00
Arne Schwabe
6e463ca1f4
Implement tls-cipher and tls-ciphersuite
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-03-11 19:51:37 +01:00
Arne Schwabe
fa5f0f0b02
Ensure that InitProcess is always called before starting unit test
This is needed for the tls-cipehr/tls-ciphersuites to have an
initialised OpenSSL when using OpenSSL < 1.1.0

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-03-11 19:51:37 +01:00
Arne Schwabe
9c547ba3ff
Remove force_aes_cbc_ciphersuites option
This option has been very likely been to fix some incompatibilities
between some TLS libraries. But nobody really remember what it fixes
and its usage today is questionable. So remove the option instead
of supporting an option we cannot even test anymore.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-03-11 19:51:18 +01:00
Lev Stipakov
aaafb33d30
omi\openvpn.cpp: cancel wait on exit event
When OMI is stopped, we must cancel wait on
exit event, otherwise ASIO won't terminate event loop
and process won't exit.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:54 +01:00
Lev Stipakov
516b32c2b8
findcoredeps.cmake: fix incorrect pkg_check_modules() behavior for mingw
pkg_check_modules() sets PKG_CONFIG_PATH by
joining values of CMAKE_PREFIX_PATH list and then replacing
separator ";" with ":". However, replacing was broken for mingw and
was fixed very recently. As a workaroud, create CMAKE_PREFIX_PATH
with single value to avoid broken join.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:53 +01:00
Lev Stipakov
7f4cd36f2e
travis: add mingw builds
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:53 +01:00
Lev Stipakov
5bb7beb379
wstring.hpp: workaround for mingw's codecvt_utf8 bug
mingw produces incorrect result when converting
from utf8 to wchar_t using codecvt_utf8.

https://sourceforge.net/p/mingw-w64/bugs/538/
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:52 +01:00
Lev Stipakov
532ebf1798
cli agent: disable agent path check for test client
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:51 +01:00
Lev Stipakov
7cf2e210d1
mingw: fix various warnings
- remove unused variable
 - replace deprecated JsonReader with CharReader
 - fix initialization order
 - fix signed-unsigned comparison
 - fix string constant to char* conversion
 - fix unknown (to mingw) format character
 - fix passing NULL to non-pointer agrument
 - remove unneeded #pragma once

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-03-11 19:44:40 +01:00
James Yonan
9f430b46ba cli: added --write-url option to write URLs received via INFO/OPEN_URL notifications to a file
Signed-off-by: James Yonan <james@openvpn.net>
2020-03-11 11:11:56 -06:00
James Yonan
f669831556 Base64: fixed issue where decode() method would ignore bad chars rather than throwing base64_decode_error()
Added a unit test to confirm the fix.

Other changes:

* In Base64 decode(), avoid the use of std::strlen() in favor
  of std::string length() method since a std::string could
  conceivably contain embedded null chars.

* In Base64 unit test, renamed b64_test_bad() to
  b64_test_bad_decode() for clarity.

Signed-off-by: James Yonan <james@openvpn.net>
2020-03-11 11:11:56 -06:00
James Yonan
995b6bf467 Added Time::from_seconds_since_epoch() method
Signed-off-by: James Yonan <james@openvpn.net>
2020-03-08 17:37:26 -06:00
James Yonan
9ee92254a3 Time: added OPENVPN_TIME_NO_BASE preprocessor flag to optimize out the base variable for 64-bit platforms
The Time code was originally designed to be efficient on 32-bit
processors.  On 64-bit processors, define OPENVPN_TIME_NO_BASE
to optimize out the base_ variable.  This also has the benefit
of allowing Time to represent any arbitrary time_t value.

Signed-off-by: James Yonan <james@openvpn.net>
2020-03-08 17:35:21 -06:00
Arne Schwabe
ac25908d25 [JSON] Implement get_int64_optional and get_integer_optional
The get_integer_optional select the type to get from the JSON
dependent on the default_value parameter, making it simple to ensure
that the returned value will fit the requested type and range.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
c7972b0532 WS::Client: reworked SIMULATE_HTTPCLI_FAILURES to more closely hew to asio error throw points
Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
93f6ed83c5 system_cmd_async: added optional sigset_t* parameter to configure signals in child
This is useful for running a command from a worker thread
where signals have been blocked, but we want the child
process to run with the original pre-blocked signal configuration.

Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
f004e09ae1 json: fixed get_string_ref() to properly return a string reference
Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
84ef4533c6 WS::Client: implemented simulated network fault injection
Enable with SIMULATE_HTTPCLI_FAILURES

Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
05b51a9ec0 KoTun::API: added set_simulate_mesh_keepalive_failures() method
Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:04 -07:00
James Yonan
021e10b5b1 openssl/compat.hpp: added missing #include
Signed-off-by: James Yonan <james@openvpn.net>
2020-02-28 11:56:03 -07:00
Arne Schwabe
f014afdf5c Fix potential double free reported by Coverity
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-26 17:04:26 +01:00
Arne Schwabe
4330c67a46 OpenSSL: Use ctx != nullptr to infer if initialised
Before the OpenSSL 1.1 changes ctx was a struct and not a pointer, so
the extra variable was necessary
This also solves a defect reported by Coverity of ctx not always
initialised.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-26 17:04:26 +01:00
Arne Schwabe
bade36f2ad Add missing openssl/dh.h include in dh.hpp
This is needed when compiling without OPENSSL_API_COMPAT

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-26 12:45:59 +01:00
David Sommerseth
6969264a94
Merge changes applied to coming Core release
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-02-19 18:24:49 +01:00
David Sommerseth
1f92c424e1
Finalizing OpenVPN 3 Core library release v3.5.4
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-02-19 18:06:17 +01:00
Lev Stipakov
2fbea7bebe
mingw/build: add build options
ARCH enables to build certain architecture only.

NO_DEPS disables downloading and building dependencies.

NO_OPENSSL disables downloading and building OpenSSL.

OPENSSL_ROOT_DIR allows to specify location for OpenSSL root

Example:

    ARCH=x86_64 NO_OPENSSL=1 ./build

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-19 17:57:42 +01:00
Lev Stipakov
ad5f819ea3
win/tunutil.hpp: read adapter name as Unicode
Adapter name can contain non-ascii chars. Read it as unicode
and convert to utf-8.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-19 17:56:34 +01:00
Antonio Quartulli
16db74d10a
async_resolve: detach resolve thread when resolution is cancelled by the user
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2020-02-19 16:38:06 +01:00
Arne Schwabe
73c9a592ae Pin googletest version due to google/googletest#2711
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Arne Schwabe
a2e2bf626e Increase frame size in proto test to 378
The added IV_CIPHER string that we send, brought the Frame used in
the proto test client over the 256 byte limit. Change the proto test
to use a larger test frame of 378 byte.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Arne Schwabe
a1250b9bed Announce Chacha20-poly1305 in IV_CIPHER if supported
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Arne Schwabe
80399075d4 Implement CHACHA20-Poly1305 support for data channel
This also changes the mbed TLS implementation from using the AES GCM
specific API to the generic AEAD API in mbed TLS. As result we can
refactor the commonly used parts of AEAD and normal cipher into a
common class.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Arne Schwabe
424d9b34af Rename GCM classes and files to AEAD
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-02-18 18:50:27 +01:00
Lev Stipakov
a5853870a8
fix clang warnings: remove unused variables
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:46 +02:00
Lev Stipakov
4a7294bd31
mingw: add .gitignore
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00
Lev Stipakov
31fe32c925
mingw: add build script
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00
Lev Stipakov
81e1353ea9
mingw: add build dependencies to cmake
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:45 +02:00
Lev Stipakov
46673d2c9a
mingw: add WFP-specific guids
MinGW doesn't have those.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:44 +02:00
Lev Stipakov
1fabe7e674
mingw: fix ndisguid include
ndisguid.h is located in different directory
in mingw, comparison to msvc.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:44 +02:00
Lev Stipakov
1a3b5235cc
mingw: use generic way to install gtest
find_package() works with vcpkg, which
is used only by msvc build system.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:44 +02:00
Lev Stipakov
b17889fcd6
mingw: add missing include
FOLDERID_System used in this file is defined in "knownfloders.h"

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:43 +02:00
Lev Stipakov
0a2663cc2b
scoped_handle.hpp: remove SEH code
This code is MSVC specific (other compilers
don't support SEH) and is only useful during
debugging.

It is better to remove it and mute exception
in debugger, than add ifdefs for other compilers.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:43 +02:00
Lev Stipakov
a0af80be25
file.hpp: use best available ifstream constuctor
c++17 provides overload, which accepts
std::filestream::path, which accepts wchar_t,

MSVS provides overload, which directly accepts wchar_t.

In other cases use char constructor. This likely breaks
support of non-ascii profile paths.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 21:48:43 +02:00
Lev Stipakov
e844bd466b
mingw: change arguments order in lambda
Having capture without initializer after nested struct
is broken in GCC 7.x and is fixed starting from GCC 8.1
(see https://stackoverflow.com/questions/60110629/).

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 16:12:20 +02:00
Lev Stipakov
9393206d74
mingw: add bswap64 implementation for mingw
Because MinGW doesn't provide it
(see https://sourceforge.net/p/mingw/mailman/message/18337754/)
and we use compiler-specific implementations.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-02-12 16:12:19 +02:00