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

88 Commits

Author SHA1 Message Date
Arne Schwabe
c78aaecad7 Differentiate Packet ID types into data channel and control channel ids
Data channel packet ids (in the formats that OpenVPN 3.x supports)
are plain 32 or 64 bit ids while control channel is a 32 bit time + 32
bit counter id. Seperate these more clearly and let CBC mode use the
same Packet ID implementation that AEAD mode uses.

Also add more unit tests related to data channel tests packets by
adapting the control channel test where applicable and add a few more
related to packet id wrapping

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-09-11 13:23:31 +00:00
Arne Schwabe
16b2c4afe0 Remove UDP/TCP mode from PacketIDReceiveType
This mode is only relevant for old OpenVPN 2.3.x clients in CBC mode
ciphers when using kovpn. Remove the mode from PID control and move
logic to kovpn key logic.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-09-11 13:23:31 +00:00
Charlie Vigue
ef8da98bd4 Buffer: Prepare to decouple allocated buffer / RC
Rename BufferAllocated --> BufferAllocatedRc

Buffer: split RC from BufferAllocated
Also make changes as needed where BufferAllocated is used

Buffer: Split allocation flags into own struct
Leaving flags in template causes each alias to have identical flags
by different names, which requires each type to pointlessly use
the nested name.

Make RC: Clean up headers buffer.hpp, make_rc.hpp

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2024-09-11 13:23:28 +00:00
Arne Schwabe
ca91f3e91c Implement data v3 features for AEAD tag at the end and 64 bit packet counter
Split the implementation of the packet counter for normal packet ID
that includes the "weird" long format for long 64 bit packet ids used
in tls-auth and tls-crypt and a simplified implementation for AEAD that
only does 32 bit and 64 bit flat counters.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-08-19 12:18:49 +00:00
Arne Schwabe
a384f16b32 Refactor data channel setting to CryptoDCSettingsData class
Instead of passing around a number of individual argument, use a data
holder class to describe all the settings. This will also allow adding
more data channel parameters in the future (tag location, 64 bit IV)
easier.  This has a slight cost of something passing more parameters
than needed.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2024-08-19 12:18:49 +00:00
Heiko Hund
8c8e96e138 streamline overriding virtual function syntax
In the code base three different syntaxes for overriding virtual member
functions could be found:

  1) virtual ... override
  2) virtual ...
  3) ... override

This converts all of them to the third syntax, as recommended by the ISO
C++ core guidelines in C.128

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2024-08-13 02:01:24 +02:00
Lev Stipakov
0c27550736 push update: support for dco-win
Only tun-related options are supported, such as

  ifconfig, route, dns, dhcp-option

etc.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2024-08-08 14:43:11 +00: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
David Sommerseth
149ec03864 OpenVPN 3 Core library version 3.8.5
-----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEgDq5E1p1aZrNLFFkhs+UTJZx/fIFAmYmR6wTHGRhdmlkc0Bv
 cGVudnBuLm5ldAAKCRCGz5RMlnH98rZPD/4vNyAZYSVN5HXO9SdrxCju/8VDxuDj
 0/CuS444NC4RKNLJIlorlLSi1zeL4fjuSRtEkLwB8QzCc3/sxEFFIqVk974zytMi
 ohBlNqISJTSUqugMZg1UfcySJSqHGaQfNfaiywSrQAe7hrCVPrUu+cAcXNsBeBPa
 fDOggL6K/7EVCwvZ5gcGUY0lw/LIriFkh40XD8LY+aYhGonPzDGnuQjcYHU48Hlp
 3ufsjLIQdLs4jCTmzSlURcXvaxi04o4WV+YOEGrUYSXeY8+6J4T8uKXqlMyoKQ+C
 w/m8Kgr5gQf/E020LYpWPoPWkoPrRRtBLvvXAighNEKMEtefSqxQtE1r/c/rMU12
 VeSX5LwJ3VRhCiZuTJD+08aRrGQNf+Fm6nswnyLw66bFGyIpPErEwhhbJsmPmaNN
 pOrbAxsAMwc/+jy0gqw7XFT/oDts+VN8WiYSRRaHfZ68lCvgf9AYirtygJy6oNYM
 WLTDOJjMwb42qBqyo6eYjos5yU57F5thV9M6qY5ycCIO0AIM0cFrRkZjNLF1pWS6
 6n8pwpPab29nUy3Ql3PZhW7t/4bhz0todfN7egHZrrvCkCOSQ/5DDWLLBI6ow9bM
 fXKB1sVjkNLPrHJ//5Hqh0GdO/Uc8GqdOIFngCnnjR3CS/ax+PZoAawCn1XbBpUW
 ddgSpAigLtFsLg==
 =3t/k
 -----END PGP SIGNATURE-----
gpgsig -----BEGIN PGP SIGNATURE-----
 
 iQJHBAABCAAxFiEEgDq5E1p1aZrNLFFkhs+UTJZx/fIFAmY03Y8THGRhdmlkc0Bv
 cGVudnBuLm5ldAAKCRCGz5RMlnH98sRwEACMzTmRreCO3jz456Q9gJS/kV1Ll/NB
 xOfEnhttxc19t+kjKL/AQOW3kfvP34uJUQdQAvjmp/HyJYGXQuNwGDW2/VD6aRaM
 e8agFKtKT6cGYPV3NoL3i4+hcl+ZIVnnVAQ+U7Pd9P8eAOzjALa53nAzx978Sfsc
 517M9V6M2dCAERtZYfTlUcM9Fi7055KsW8Ermna1qyRyA25F9ekVMSOMTvSzlUCa
 7W7OE0J2uJafyP4K5gGpmHZLrirEWSrtY3oOjHO0HAjur+Ir3XwcTnB9U4ACdVQV
 HYnIv3QzElQV0aGeWwqKir1i9WIefpZe28h+53UP8pTnx5C5uo+U03kNibyjDDRx
 fMxGa5fELyTMk6kttN6TtWcIbHeWTch6qzsvYJR1Exaqql3EEbRIerlsCL5ZM2TV
 JP04BWzJ7Hfz6qTS3dFUiFHfZw3ptPthE/3JiAYObIFE1YdQKYjwAKHXRjjdh1kT
 pq0ubqx9mX8OkgVZWNC9NDIZvZpdGFBn57wfG3TN29iR/J2WELsjhPOI3tMQAWMT
 ZqrDl45BciFUA2lVkZ7C9tgaGMR/nok/3bTksrNcM3h2DCE8Rt28giZwvtN2nSjq
 8ekT6jDs15WZd3kfVJHP4tb2MCh/IuP/8DPmUxW6jbg6tFJ+JqOSmD502pwZfxog
 gRbBXbdUqV9B3A==
 =nrJ0
 -----END PGP SIGNATURE-----

Merge OpenVPN 3 Core library version 3.8.5 to master

Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-05-03 14:50:21 +02:00
David Sommerseth
9d542454ea
dco: Fix incorrect #ifdef vs #if usage for ENABLE_KOVPN
The code in dco/dcocli.hpp used #if ENABLE_KOVPN, which will
fail on newer compilers if the macro is defined in a source
file.  Compilers may not complain if the macro is defined on
the command line, via -D.

This type of checks should use either #ifdef or #if defined(...).
The #if conditional expects a boolean expression.

Since these code blocks also depended on #elif (also expects
a boolean expression , the defined(...) approach was chosen
throughout this file.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2024-04-16 21:00:18 +02:00
Charlie Vigue
b6b8282d33 Addressed 2nd set of -Wconversion warnings
- Used static_cast instead of direct type conversions in places where
it's safe
- Used numeric_cast where failure is possible
- Changed types of arguments and locals when practical

Signed-off-by: Charlie Vigue <charlie.vigue@openvpn.com>
2023-08-21 13:51:50 +00:00
Antonio Quartulli
2959f1998c
ovpn-dco: no need to rearm pipe when sending NEW_PEER command
NEW_PEER does not expect any reply, therefore there is no need to rearm
the pipe.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2023-06-06 13:54:42 +02:00
Antonio Quartulli
193468cd72
ovpn-dco: change control packets flow in order to adapt to dco-v2 logic
With ovpn-co-v2 logic, control packets do not flow through netlink
anymore but they are sent directly via the transport socket.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2023-06-06 13:54:42 +02:00
Antonio Quartulli
9b976d6e2b
ovpn-dco: extend stats in order to retrieve both VPN and transport numbers
Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2023-06-06 13:54:41 +02:00
Antonio Quartulli
446558a735
ovpn-dco: include latest UAPI header in codebase
In order to avoid a useless dependency on the ovpn-dco tree, directly
include the ovpn_dco_linuc.h UAPI header in the codebase.

This is the only external requirement to build core with DCO support.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2023-06-05 15:48:34 +02:00
Lev Stipakov
de01e278cc
Display configured family address for UDP and DCO
Instead if displaying resolved family address (v4/v6),
display the one which is configured - either in ovpn profile
or config override options.

This is already the case for TCP.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-05-10 18:22:59 +02:00
Lev Stipakov
84cf8f45cd dco: check for options/config DCO compatibility
When parsing config, check DCO compatibility. Following
options break DCO compatibility:

 - http-proxy
 - compress
 - comp-lzo

Same for config settings:

 - non-preferred-algorithms
 - legacy-algorithms
 - proxyHost

DCO compatibility could be checked with

 - bool EvalConfig::dcoCompatible
 - std::string dcoIncompatibilityReason

If client nevertheless tries to connect, an exception
will be thrown:

  connect error: option_error: dco_compatibility: config/options are not
compatible with dco

Fixes OVPN3-960.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-05-08 13:51:34 +03:00
Lev Stipakov
f544e04df7
Bring back "allow local DNS resolvers" functionality
This was introduced in commit

  613aa6bf ("Win: support for local DNS resolvers")

but got removed by mistake in commit

  fd065596 ("Merge release of OpenVPN Core library 3.6.4 to master")

Besides, this never worked for DCO, so fix that too.

Fixes OVPN3-964.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-04-24 13:07:46 +02:00
Lev Stipakov
93c961e169 dco-win: add missing ioctl code string for DEL_PEER
If ioctl call fails, we print failed code's string
representation, such as "OVPN_IOCTL_DEL_PEER".

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-04-12 11:42:49 +03:00
Lev Stipakov
71b3391dee dco-win: add support for peer stats
Make DCOTransportSource aware of tun stats.

Implemenent DCOTransportSource interface. Withing
stats delta callback, fetch peer stats and return delta
between last and current stats (same as in DCO Linux).

Fixes OVPN3-947.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-03-29 14:08:33 +03:00
Lev Stipakov
fe9df4f431 dco-win: use OS-assigned random local port
The same behavior is implemented in openvpn2
and openvpn3 non-dco cases.

This also fixes some reconnect issues to
openvpn2 server.

Fixes OVPN3-949.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-03-29 11:03:38 +03:00
Lev Stipakov
3e61e624d3 dco-win: add missing socket_protect call
This call is required to add bypass route, which
is required when client reconnects with seamless tunnel.

Fixes OVPN3-948

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-03-27 14:27:04 +03:00
Lev Stipakov
20edab8dd5
dco-win: fix destroy_tun behavior
When agent-enabled client disconnects, it signals
destroy_tun event, which signals to agent that tun
has to be teared down. For dco-win, event handle is passed
to agent with /tun-open request.

Before sending /establish request, client closes previous
tun instance. Closing tun involves signaling destroy_tun event.
Event handle is closed after signaling, and here we have a problem:

 - client calls /tun-open and passes event handle to agent
 - client calls /establish, and before that it signals destroy_tun
   event, which handle is now closed
 - at some point client disconnects and signals tun_destroy event

Since event was already signaled and its handle is closed, nothing
happens and agent doesn't tear tun down. As a consequence, DNS
resolution might not work if DNS is overriden by VPN.

When client exits, agent tears tun down by failsafe logic. This doesn't
work for Connect client, which obviously doesn't exit on disconnect.

Fix this problem by avoiding signaling event between /tun-open
and /establish requests. This is done by not adding tun_setup
destructor (which signals event) to tun_persist right after /tun-open
call. There is nothing to tear down at that point yet since tun is
opened later by /establish call.

As a downside of this approach, we lose callback in client code
if agent process dies in between /tun-setup and /establish. This is
not a big problem IMO and can be fixed later.

In addition to that, send destroy_tun event also in /establish
request when using dco. This is needed to cover persist-tun case
when we reconnect and get new tun options. In this case we instantiate
new tun_setup instance, but don't call /tun-open since we keep tun
handle. Hence we have to pass destroy_tun event via /establish request.

Fixes https://github.com/OpenVPN/openvpn3/issues/257

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2023-02-01 16:39:03 +01:00
David Sommerseth
dde1574596
Reformatting source code to new coding style
This is the result after running 'clang-format -i' on all C++ files and
headers, with the defined formatting rules in .clang-format.

Only the openvpn/common/unicode-impl.hpp has been excluded, as that is
mostly a copy of an external project.

Signed-off-by: David Sommerseth <davids@openvpn.net>
2023-01-18 19:24:15 +01:00
David Sommerseth
4996c38ed4
Merge lastest changes from Core v3.7.2 2022-12-14 17:34:29 +01:00
Lev Stipakov
8eefddd18b
dco-win: fix "agent process premature exit" handling
Commit ae99307 ("tun: add persis-tun support for dco-win")
broke handling of premature exit of agent process. Introduced
"tun_persist->close_destructor()" call in "tun_start() " also closes
agent process handle within WinCommandAgent,
which triggers fail handler (without error code).

Fix by "re-arming" fail handler after "close_destructor()"
call in "tun_start()".

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-10-19 17:05:32 +02:00
Lev Stipakov
2958161e7f
dco-win: add halt check after connection attempt
parent->transport_connecting() might trigger stop(),
reset device handle and set halt to true if TCP server
is down. In this case we should not queue read.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-10-13 15:16:26 +02:00
Lev Stipakov
ae99307219
tun: add persis-tun support for dco-win
Add DcoTunPersist object to DCO::TunConfig.

DcoTunPersist stores:

 - device handle
 - tun settings
 - adapter index/name
 - pointer to TunSetup object, which itself
 stores commands to undo tun settings

When intializing client options, instantiate DcoTunPersist
object within the scope of ClientConfig, which serves as
transport and tun factory for dco. Indicate that "sock" object
(device handle) should be preserved - not replaced when persisting
tun settings.

When establishing dco-win connection in OvpnDcoWinClient,
either use tun_persist created above (if persistance is enabled)
or instantiate it in-place (no persistance).

If nothing is stored in tun_persist (means this is first
connection or reconnect without persistance), acquire device
handle from tun_setup, wrap it into ASIO's basic_stream_handle
and store it in OvpnDcoWinClient - no need to persist it yet.

When starting tun, check if persisted tun session matches
to-be-created session. If no - clear previous tun settings,
set up tun and persist tun state. If device handle is already
stored in tun_persist, it won't be replaced.

On tun stop, send DEL_PEER command, which deletes peer
from the driver but keeps adapter in connected state. Then
close locally stored ASIO handle and reset tun_persist.
In case of "short term persistance" this will undo tun settings
and close device handle. For long term persistence, tun_persist
is also stored in ClientConfig and handle won't be closed yet.

In case of disconnect, ClientConfig::finalize(disconnect=true)
is called, which resets tun_persist, which in turn
undoes tun settings and closes device handle.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-10-13 15:16:25 +02:00
David Sommerseth
8c94a8f774
copyright: Update to 2022
Signed-off-by: David Sommerseth <davids@openvpn.net>
2022-09-29 12:00:26 +02:00
Arne Schwabe
3710fa106a Implement pushable tun-mtu and tls-mtu-max
OpenVPN 3.x has the same approach/problem for buffer allocation for the
tunnel packets that OpenVPN 2.x uses. Buffers are allocated very early
in the setup, so resizing/reacting to different frame sizes is not
really possible without major refactoring.

Therefore we use the same approach as with OpenVPN 2.x and allow a
MTU of up to 1600 by default and require setting tun-mtu-max in the
configuration file to allow larger values and allocate larger buffers.

Signed-off-by: Arne Schwabe <arne@openvpn.net>
2022-07-13 16:44:31 +02:00
Lev Stipakov
e1a35028a8 dco-win: fix reconnect with dco-win driver
DCO device is "exclusive" device, meaning that only one app at the time can access it
and device is considered opened until pending IO is complete.

start_impl_() might be called on reconnect, in the same stack with closing device handle.
Closing handle also triggers completion of pending IO, such as async read. However this happens
in the next iteration of ASIO even loop. Therefore we defer opening DCO device
(i.e. calling start_impl_) to let ASIO complete pending IO.

Note that this is not required when async resolve is performed, since this implies deferring.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-07-01 14:45:31 +03:00
Lev Stipakov
1d4334c701 dco-win: support for ChaCha20-Poly1305
Probe cipher support in runtime (works in Windows Server 2022 and Windows 11)
and add it to the list of allowed ciphers.

White on it, add missing halt check in dco-win client code.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-04 18:15:07 +03:00
Lev Stipakov
3d662431fa dco-win: pass mss to kernel
Pass mss_fix value to dco-win driver via set_peer call.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-04 18:15:07 +03:00
Lev Stipakov
2b7f97c78b dco-win: reorder ioctl calls
Set keepalive parameters and start vpn on "tun start" event,
which seems like a more logical place comparison to "primary key ready" event.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-04 18:15:07 +03:00
Lev Stipakov
ac15879588 support for default mssfix
Add support for default mssfix, which is calculated
based on upper bound value 1492 minus payload and
encapculation overhead.

Payload overhead includes:

 - compression byte (except for V2, which doesn't add overhead)
 - pktid (in CBC)
 - IPv4 and TCP headers

Encapculation overhead:

 - crypto overhead (for AEAD 16 bytes auth tag, 4 bytes pktid, 4 bytes opcode/peer-id = 24)
 - 2 bytes packet size for TCP transport

Also for CBC we must take padding [1..blocksize] into account.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-05-04 18:15:07 +03:00
Lev Stipakov
481a4319e2 dco-win: support for 0.7.1 driver version
Use the latest uapi header. Instead of using vcpkg port
overlay, copy file into repository.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-04-27 13:31:10 +03:00
Lev Stipakov
11b0869b7f dco-win: improve stability
Add missing halt etc checks.

Replace dco_error with fatal exception ErrorCode(TUN_SETUP_FAILED).
IOCTL commands are not expected to fail and of they do, threat it as fatal error.

Signed-off-by: Lev Stipakov <lev@openvpn.net>
2022-04-21 17:37:27 +03:00
James Yonan
7cbac69e3d Linux tun_config(): added a flags parameter to subsume add_bypass_routes and create space for new flags
This change replaces the boolean add_bypass_routes with a new
flags parameter -- set the TunConfigFlags::ADD_BYPASS_ROUTES
flag to achieve the same functionality.

We also add some new flags for finer-grained control over
actions taken by tun_config:

* TunConfigFlags::DISABLE_IFACE_UP -- disable bringing the interface up

* TunConfigFlags::DISABLE_REROUTE_GW -- disable redirect-gateway

Signed-off-by: James Yonan <james@openvpn.net>
2021-11-24 13:18:35 -07:00
Heiko Hund
b47c72b458
add tun_builder method to check DCO availability
While using GeNLImpl::available() for ovpn-dco works, it requires more
privileges than currently granted by SElinux for openvpn3-linux to work.

Instead of extending the privileges, add method tun_builder_dco_available()
to the TUN builder API, so that the check can be done context sensitive
by the client.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-09-29 17:34:13 +02:00
Heiko Hund
0d32d45ab7 process pushed remote-cache-timeout option
Take option value if pushed for the next round of remote address
caching.

Since the push replies are processed in Session, we need to extend the
transport slightly to process pushed options. There was no need so far,
since transport options are used before the session starts. The remote
cache timeout is currently the only exception to this rule.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-09-28 15:29:03 +02:00
Lev Stipakov
fd0655969d
Merge release of OpenVPN Core library 3.6.4 to master 2021-09-22 13:56:37 +02:00
Heiko Hund
dd104e8392 make it possible to specify dc algorithms
DCO only supports a limited set of ciphers, currently it is
discovered quite late if a unsupported algorithm is configured
(or pushed).

This introduces CryptoAlgs::allow_dc_algs() with which the
supported set of data channel algorithms can be specified.

The DCO code makes use of this, at the time a new_controller()
is created.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-06-18 15:09:35 +02:00
Antonio Quartulli
cbbe9d1768
ovpndcocli.hpp: implement SessionStats::DCOTransportSource
The DCO component now implements the SessionStats::DCOTransportSource interface.
This interface is already used by ovpncli.cpp to retrieve the peer stats
from DCO.

With this patch, also the OvpnDcoCli object can be used to retrieve the
peer stats from kernel space.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2021-06-09 17:23:03 +02:00
Antonio Quartulli
73664bb85a
ovpndcocli.hpp: properly parse and store peer statistics
After invoking the get_peer() API, let the DCOClient component
extract the statistics and store them locally.

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2021-06-09 17:23:03 +02:00
Heiko Hund
51bd6d4201 use DCO opportunistically
If DCO support is compiled in, detect if it is available (i.e. Windows driver
or Linux kernel module is loaded) and then use it, if it is.

This changes the default configuration for DCO from off to on, so users of
the library need to set ClientAPI::Config::dco to false in case they do not
want to use dco for a connection.

The change is also reflected in the reference client "ovpncli". If DCO is
enabled in a build, it will detect and use it. The previously available
"ovpncliovpndco" and "ovpncliovpndcowin" clients have thus been removed.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-05-27 17:20:24 +02:00
Heiko Hund
ef45b80a97
support async connect in dco-win
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:44:51 +02:00
Heiko Hund
32a32cf04c
add support for dco-win to agent service
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:44:50 +02:00
Heiko Hund
9b03cddea9
add support for ovpn-dco-win TAP driver
Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-04-14 22:44:49 +02:00
Heiko Hund
63d38ba278 add results_type to class AsyncResolvable
Makes code more readable and implicitly declares the
correct internet protocol.

Signed-off-by: Heiko Hund <heiko@openvpn.net>
2021-03-18 18:10:30 +01:00
Antonio Quartulli
7b9db69e0f
ovpndcocli: prepend control packet with peer-id when using TunBuilder
The TunBuilder implementation needs to know which peer to send the
control packet to and for this reason the ovpndcocli component is now
prepending the data with 4 bytes representing the peer-id of the
destination.

Since this approach is incompatible with sending a const Buffer (as it
cannot be modified), send() has to allocate a temporary buffer for the
purpose.

While at it, make transport_send(Buffer) obsolete, as ovpndcocli
is not expected to handle data packets (sent as non-const).

Signed-off-by: Antonio Quartulli <antonio@openvpn.net>
2021-02-24 09:10:51 +01:00