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

4167 Commits

Author SHA1 Message Date
Charlie Vigue
4aca9606c6 Change ::value --> _v and ::type --> _t
Also add doxygen and make requested changes from code review

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2024-07-22 17:36:18 +00:00
Charlie Vigue
18c3dfe103 Respect data encapsulation 2024-07-22 17:36:18 +00:00
Charlie Vigue
6b3db207d2 Move all impl to bottom 2024-07-22 17:36:18 +00:00
Charlie Vigue
8443be9f6d Move BufferType impl into ConstBufferType 2024-07-22 17:36:18 +00:00
Charlie Vigue
28787e03a1 Move all impl from declarations
Move ConstBufferType BufferType BufferAllocatedType member function
implementations out of declaration
2024-07-22 17:36:18 +00:00
RenovateBot
13d6b06e1c chore(deps): update dependency google/googletest to v1.15.0 2024-07-17 10:00:24 +00:00
Frank Lichtenheld
bf6f42dc19 Merge current state of releaseprep/3.10 to master
* origin/releaseprep/3.10:
  Do not reject control message with trailing newlines
  aws: account for RandomAPI change
  Allow disabling TLS 1.3 in certcheck to more easily debug problems
  Implement changes to allow test dpc certcheck to be tested
  Allow setting a maximum TLS version
  Change cxa1 protocol tag to dpc1
  Fix spelling errors raised by Debian linter
  mac agent: reinstall host route during restart
  Preparing QA cycle for OpenVPN 3 Core library release v3.10

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-07-16 17:19:49 +02:00
Frank Lichtenheld
27ceba227a Release Merge: OpenVPN 3 Core library version 3.9
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-07-16 17:19:23 +02:00
Razvan Cojocaru
f15261b8dd Fix crash if no tls-auth section is present in the config
We are now only initializing TLS-related objects if TLS auth mode
is enabled.

This fixes internal Jira issue PG-122.

Signed-off-by: Razvan Cojocaru <razvan.cojocaru@openvpn.com>
2024-07-12 09:29:27 +00:00
Leonard Ossa
e929058607 Refactor by getting rid of redundant value in loop
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-10 16:43:19 +02:00
Leonard Ossa
a8b6cb01fc Refactor iterating to range-based loop in find()
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-10 16:43:19 +02:00
Leonard Ossa
c52419411e Refactor enum to enum class in addrspacesplit
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-10 16:43:19 +02:00
Leonard Ossa
a00a4c6241 Refactor empty constructor to default
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-10 16:43:19 +02:00
Razvan Cojocaru
5329d67521 Update the copyright years used by core consumers
Signed-off-by: Razvan Cojocaru <razvan.cojocaru@openvpn.com>
2024-07-09 15:28:13 +00:00
Leonard Ossa
3819357192 Refactor iterating to range-based loop
Do we actually need / use this code?

Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-09 14:39:33 +02:00
Leonard Ossa
f2856ec8ba Refactor exists method in AddrList to use std::find
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-09 14:33:52 +02:00
Arne Schwabe
b201027807 Do not reject control message with trailing newlines
The previous fix to reject invalid control message was a bit too aggressive
as scripts often accidentally include an extra newline at the end of the
control message.

Jira: OVPN3-1225
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-07-05 12:54:03 +02:00
Leonard Ossa
3646265d15 Refactor nested namespace to C++17 style
Signed-off-by: Leonard Ossa <leonard.ossa@openvpn.com>
2024-07-03 10:20:11 +00:00
Frank Lichtenheld
a89b6cb184 Update Linux build instructions in README.rst
- Remove dependency build. For normal use cases on a
  recent distro, installing all dependencies from distro
  should be fine. Tested on Ubuntu 20.04 (mbedTLS too old,
  otherwise okay) and Ubuntu 22.04.
- Document more dependencies. With the added dependencies a
  clean build and ctest run is possible starting with the
  default ubuntu:<version> containers.
- Use ninja. We use this for all of our non-VC builds, so
  recommend it here as well.

Based on a smaller change proposed in Github#301
by Scruel Tao.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-07-03 10:20:10 +00:00
Frank Lichtenheld
5d60f0dbee openvpn_PRF: Tell compiler some restrictions on arguments
To avoid false-positives.

Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
2024-07-03 10:20:10 +00:00
RenovateBot
dd9ca30871 Update vcpkg digest to e3ad383 2024-06-27 23:00:24 +00:00
Charlie Vigue
62c9da1879 Add unit tests to show tag works
Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2024-06-26 15:19:36 +00:00
Lev Stipakov
5022f305f5 aws: account for RandomAPI change
Signed-off-by: Lev Stipakov <lev@openvpn.net>
2024-06-26 11:06:20 +00:00
Arne Schwabe
dca41905a5
Allow disabling TLS 1.3 in certcheck to more easily debug problems
Jira: OVPN3-1216
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-06-25 19:06:31 +02:00
Arne Schwabe
2747bfc1d1
Implement changes to allow test dpc certcheck to be tested
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-06-25 19:06:14 +02:00
Arne Schwabe
fdead3f04c
Allow setting a maximum TLS version
This is something useful for debugging. We do not expose this feature
to avoid it being used for real connections.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-06-25 19:05:31 +02:00
Charlie Vigue
c7e1dce5b3 Use LoggerMixin tag to segregate SSLAPI log
Prior to this branch the various instances of the LoggerMixin were
coincidentally shared, depending on whether the default levels had
the same values in the template arguments or not. Since it's not clear
this sharing was intended or accidental I made it possible to tag if
desired to ensure the similarly tagged instances are unique.
2024-06-22 04:04:56 +00:00
Charlie Vigue
345b1ee180 Use LoggerMixin tag to segregate ProtoContext log 2024-06-21 10:57:53 +00:00
Charlie Vigue
1bf5b91392 Make LoggerMixin specializations unique by tag
Adds an optional TAG type to the LoggerMixin so that each class or
subsystem may have a distinct specialization if desired.
2024-06-21 08:13:42 +00:00
Charlie Vigue
ac4f7a5c19
Change cxa1 protocol tag to dpc1
Minor change to a string tag.

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2024-06-20 09:53:21 +02:00
David Sommerseth
5e83af3e2c
Fix spelling errors raised by Debian linter
Reported-by: Marc Leeman <marc.leeman@gmail.com>
Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-06-19 20:57:15 +02:00
Heiko Hund
1477df691e mac agent: reinstall host route during restart
The host route to the VPN server disappeared when a mac client, using
the agent, was reconnecting. That was causing --redirect-gateway tunnels
to break because no traffic could be sent anymore. Cause for this was
some internal state in the agent not being reset when the utun device
is temporarily removed during the restart.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2024-06-11 18:04:23 +02:00
David Sommerseth
eb3a36681c
version: Reset git:master reference to 3.11
Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-06-06 15:40:32 +02:00
David Sommerseth
19bec178fb
Preparing QA cycle for OpenVPN 3 Core library release v3.10
Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-06-06 15:38:41 +02:00
RenovateBot
cb017dca52 Update github actions 2024-06-06 09:48:59 +00:00
Razvan Cojocaru
a9e812227c LoggingMixin: fix typo
log_level() was returning a function (log_.log_level instead
of log_.log_level()). Now fixed.

Signed-off-by: Razvan Cojocaru <razvan.cojocaru@openvpn.com>
2024-06-05 17:33:18 +03:00
David Sommerseth
10c6a56cb1
Release: OpenVPN 3 Core Library, version 3.9
Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-06-05 14:18:58 +02:00
David Sommerseth
f2e67aaf9b
Merge OpenVPN 3 Core Library v3.9 to master
Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-06-05 10:40:55 +02:00
Arne Schwabe
3ceb4fff0c Allow ACC communication before PUSH_REPLY by using auth pending method
This is reusing the auth pending method as this is just another method where
the final authentication decision is pending on some results. In this case
custom messages going back and forth. This can be tested using

   client-pending-auth 5 1 "ACC:1000 A:6 cck1:certcheck:cxa1:fortune" 60'

with OpenVPN 2.x servers easily.

Also correctly use ClientEvent::Base::Ptr with the Clientevents to avoid
problems with not correctly using RCPtr

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-06-04 14:28:08 +00:00
Lev Stipakov
8c15ed2ac5 Fix broken disableClientCert config option
Commit 0c5e356 ("Simplify client options classes") has
indeed simplified options handling by consolidating
options into the base class. However "disble_client_cert"
option was copied, not moved, from its original location.
As a consequence, it become broken.

Fix by removing unneeded copy of this option and use the
one from correct location in options base class.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2024-06-03 12:29:48 +03:00
Arne Schwabe
47cd774423 Allow setting a logger prefix
Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-05-30 20:09:19 +00:00
Arne Schwabe
0f32847f2c Reject invalid control channel messages
Instead of silently ignoring errors in control channel message and removing
invalid characters, we should be more strict and reject these message.

A similar change has been also submitted to OpenVPN 2.x
2024-05-30 15:27:29 +00:00
Charlie Vigue
75d9d0fae5 Add certificate to EvalConfig
Clients need access to the server VPN ca for whitelisting reasons
so it is now available inside the EvalConfig structure. Implemented
the change and added a unit test for same.

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.net>
2024-05-30 15:27:29 +00:00
Razvan Cojocaru
272d0ef07d Fix LOG_{DEBUG, INFO} conflicts with syslog.h
The syslog.h UNIX header already #defines LOG_{DEBUG, INFO} as
log-level constants, which means that we can't have code that
includes both openvpn/log/logger.hpp and syslog.h.

This patch renames all the LOG_<LEVEL>() macros to
OVPN_LOG_<LEVEL>(), to hopefully eliminate "macro already defined"
conflicts in the future.

Signed-off-by: Razvan Cojocaru <razvan.cojocaru@openvpn.com>
2024-05-30 08:45:08 +03:00
Arne Schwabe
7db23f14fe Remove OpenSSL < 1.1.1 support 2024-05-29 19:32:20 +00:00
Arne Schwabe
8833600936 Allow outputting certificates in PEM encoding during handshake
This allow debugging the certificates the server sends. It did this as hack
two times before. I think it is now time to get this officially in.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-05-29 19:32:19 +00:00
Arne Schwabe
b1de7b2e76 Make functions in x509certinfo.hpp static inline
Compilers will otherwise complain about unused function when this header
is included in a compilation unit that only uses a subset of the functions
(e.g. in a unit test).

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-05-29 19:32:19 +00:00
Heiko Hund
733d00b7e6 WFP: block DNS traffic to loopback conditionally
Before this commit traffic to loopback was limited when only DNS
(port 53) was blocked, due to the "not loopback" match condition being
replaced instead of the match condition being made more specific.

This broke the client option to override access to DNS servers listening
on loopback.

To fix this three things are done:
  1) do not add DNS block rules if the override option is active.
  2) explicitly block port 53 on loopback, except when the override
     option is active.
  3) remove the implicit block of port 53 on loopback and instead let
     the firewall rule for non-loopback devices only.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2024-05-28 14:57:04 +02:00
Arne Schwabe
d554fdcd8e Properly implement certcheck using EPKI
This also moves some of the reasonsibility from ClientProto to
OpenVPNClient. This plays better with the EPKI implementation and also
does not break the idea of the current certcheck implementation as we now
just give the certcheck in client protocol a preconfigured SSL Config instead
of all the certificates individually.
2024-05-28 10:48:07 +00:00
Arne Schwabe
0cafed2016 Allow the EPKI API to properly use the epki alias to distinguish certs
The implementation would previously return the alias the client library
requested to use but would not allow to have multiple different
external aliases be correctly used. This adds supports to have the
correct alias being used as part of the signature callback.
2024-05-28 10:48:07 +00:00