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

3107 Commits

Author SHA1 Message Date
Lev Stipakov
557ff6249b omi: support for dynamic challenge
When server responds with AUTH_FAILED/dynamic challenge,
openvpn stores dc cookie and prompts omi client for response. After receiving
response, openvpn sends it to server along with dc cookie.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2020-05-13 14:46:26 +00:00
Arne Schwabe
2141e23ecd Implement tls-groups option to specify eliptic curves/groups
OpenSSL 1.1+ by default only allows signatures and key exchange from the
default list of X25519:secp256r1:X448:secp521r1:secp384r1. Since in
TLS1.3 key exchange is independent from the signature/key of the
certificates, allowing all groups per default is not a sensible choice
anymore and the shorter lister is reasonable.

However, when using certificates with exotic curves the signatures of
this certificates will no longer be accepted. This option allows to
modify the list for these corner cases.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-05-13 16:23:36 +02:00
James Yonan
3b3ee130b9 cli: allow --peer-info option to accept a JSON file as input
Signed-off-by: James Yonan <james@openvpn.net>
2020-05-02 20:33:14 -06:00
James Yonan
6c9f89b092 Removed OPENVPN_LEGACY_TITLE_ABSTRACTION
The recent commit "IP address/route classes: cleanup title
usage with template approach" left in the old code and
allowed it to be re-enabled by defining
OPENVPN_LEGACY_TITLE_ABSTRACTION.  This commit removes
OPENVPN_LEGACY_TITLE_ABSTRACTION and makes the new
code permanent.

Signed-off-by: James Yonan <james@openvpn.net>
2020-04-29 16:26:51 -06:00
Arne Schwabe
d7f4c1611d Modify asio patch to avoid warning about non virtual destructor
The asio patch adds a virtual method to basic_socket. This triggers
compiler warnings about a non-virtual destructor. Fix this by also
making the destructor virtual.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
Arne Schwabe
531c29f177 Update ASIO to 1.16.1
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
Arne Schwabe
35d01b8a71 Fix indentation and unused variables related warnings from Clang 10
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
Arne Schwabe
f8fe13e07c Add missing overrides
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
Arne Schwabe
8bac99143a Use C++11 syntax instead GNUism to initialise array
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
Arne Schwabe
e6d544b8a5 Add support building deps with clang/libc++
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-29 11:55:38 +02:00
David Sommerseth
492661fd02
Merging release/3.5.5 into master 2020-04-24 17:33:51 +02:00
David Sommerseth
59f201be90
Finalizing OpenVPN 3 Core library release v3.5.5
Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-04-24 16:41:28 +02:00
James Yonan
bf69c9f046
unittests/test_comp.cpp: added missing '/' in filename lookup
Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:53 +02:00
James Yonan
ad9feaffeb
IP address/route classes: cleanup title usage with template approach
The concept of "title" in IP address/route parsing is that
when parse errors occur, we want a human-readable string
that can be included in the error message that gives the
context for the error.

For example if a bad IP address is specified in JSON data,
we might want the name of the dictionary in the JSON to be
given as title, so it can be a part of the error message.

Previously we did this by implementing multiple
constructors that accepted title as a std::string, const
char *, or allowed the title to be omitted.

The new model is to templatize title, so that title can
be anything: a std::string, const char *, nullptr,
or a custom class (such as IndexedTitle) that supports
to_string() and empty() methods.

Having a custom class for title is useful for performance
because then you can use lazy evaluation techniques that
don't have to expensively pre-format a std::string for
every possible instance of title on the off-chance that
you might throw an error.  The formatting only occurs when
the to_string() method is called, after an error has already
been confirmed.

Note: since this code has a lot of users, some of which
I haven't considered (such as Swig), I'm leaving an out
where you can revert back to the previous code by
defining OPENVPN_LEGACY_TITLE_ABSTRACTION.

Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:52 +02:00
James Yonan
1e2ca13908
unit tests: convert IPv6 addresses to lower-case when running under test framework
This is intended to make the string representation of IPv6
addresses more consistent across platforms.

Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:51 +02:00
James Yonan
cea7c77271
Added class IndexedTitle for referring to array indices when generating errors
Used by app-level JSON parsing code.

Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:50 +02:00
James Yonan
e2a9630718
unit tests: added a .gitignore for executables
Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:48 +02:00
James Yonan
79b0fb05c2
StringTempl: StringTempl::empty() should just call the object's underlying empty() method
Previously we would convert to a std::string, then call the
empty() method on the string object.  Just calling the
empty() method by itself seems smarter since all of the
objects that currently match against this method signature
have an empty() method.

Signed-off-by: James Yonan <james@openvpn.net>
2020-04-24 13:22:47 +02:00
Arne Schwabe
a5119c3a1a
Revamp OpenSSL tls cipher log message
The new message will look like this:

SSL Handshake: peer certificate: CN=OpenVPN Server, 4096 bit RSA, cipher: ECDHE-RSA-AES256-GCM-SHA384 TLSv1.2 Kx=ECDH     Au=RSA  Enc=AESGCM(256) Mac=AEAD

compared to the old message

SSL Handshake: CN=OpenVPN Access Server, TLSv1.2, cipher TLSv1/SSLv3 ECDHE-RSA-AES256-GCM-SHA384, 3072 bit RSA

The new message uses the SSL_CIPHER_description method and its
formatting instead out homegrown format. It also moves the xxx bit RSA
part closer to the certificate to make it more obvious that those belong
together

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-22 16:52:55 +02:00
Arne Schwabe
bbcf90171f Upgrade OpenSSL to 1.1.1g
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2020-04-22 14:59:00 +02:00
Dmitriy Dudnik
a88f2379c3 win/tunutil.hpp: fix TAP adapter name query
Previous attempt to fix the issue resulted in most TapNameGuidPair
structs in the list having no name. Last parameter passed to
RegQueryValueExW has to represent the amount of bytes available at wbuf.
Doing otherwise will either cause SEGFAULT or return ERROR_MORE_DATA.

Signed-off-by: Dmitriy Dudnik <dmytro.dudnik@openvpn.net>
2020-04-21 20:52:38 +03:00
James Yonan
edc62cd3b4 PeerStats: added to_string() method
Signed-off-by: James Yonan <james@openvpn.net>
2020-04-13 16:29:45 -06:00
James Yonan
81e9714326 BufferType: added constructor accepting a void *
Signed-off-by: James Yonan <james@openvpn.net>
2020-04-10 16:53:39 -06:00
Dmitriy Dudnik
abb7857452 Bump openssl version to 1.1.1f
Signed-off-by: Dmitriy Dudnik <dmytro.dudnik@openvpn.net>
2020-04-09 14:35:21 +03:00
Dmitriy Dudnik
89a3283944 Fix variable name typo in build-openssl
Signed-off-by: Dmitriy Dudnik <dmytro.dudnik@openvpn.net>
2020-04-09 14:35:21 +03:00
ybarnovych
34435cbf65 Support optional HTTP Status Code reason
In HTTP 1.1 specification reason phrase in HTTP Status becomes optional.

For example, Tomcat 9 doesn't provide it.
See details: https://bz.apache.org/bugzilla/show_bug.cgi?id=60183

We need to make changes in our HTTP response parser accordingly.

Signed-off-by: Yuriy Barnovych yuriy@openvpn.net
2020-03-31 17:14:15 +03:00
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
d5471e1846 Increase OpenSSL version to 1.1.1e 2020-03-18 18:51:15 +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
David Sommerseth
6daf928edb
Merge branch 'hotfix/3.4' into released 2020-03-03 22:14:32 +01:00
David Sommerseth
40f1419b38
Merge branch 'hotfix/3.3' into hotfix/3.4
This also finalizes the Core release of version 3.4.3

Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-03 22:10:36 +01:00
David Sommerseth
f225fcd058
Finalizing OpenVPN 3 release v3.3.4
This update only upgrades mbed TLS to version 2.7.13

Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-03 21:52:49 +01:00
David Sommerseth
44e8dd8c01
Fix build issues against OpenSSL 1.0.x
The two prior changes broke OpenSSL 1.0.x support, due to the
SSL_R_CA_MD_TOO_WEAK and SSL_R_CA_KEY_TOO_SMALL error codes arrived
first in OpenSSL 1.1.0

Signed-off-by: David Sommerseth <davids@openvpn.net>
2020-03-03 16:15:56 +01:00
Dmitriy Dudnik
65a5e959bc
Fix typo in OpenSSL error mapping
Signed-off-by: Dmitriy Dudnik <dmytro.dudnik@openvpn.net>
2020-03-03 15:54:51 +01:00