Re: [Openvpn-devel] [PATCH 19/25] dco-win: implement GetOverlappedResultEx for mingw32

2022-06-24 Thread Selva Nair
Hi, On Fri, Jun 24, 2022 at 5:10 AM Antonio Quartulli wrote: > GetOverlappedResultEx is not available on ming32 therefore we must > provide some compat layer before being able to use this function. > I suppose "mingw32" here refers to I mingw-w64 for 32 bit (i686) target. This symbol has been

Re: [Openvpn-devel] [PATCH 4/6] Implement a function to calculate the default MTU

2022-06-24 Thread Frank Lichtenheld
NACK, doesn't build: mtu.c: In function ‘frame_calculate_default_mtu’: mtu.c:223:31: error: too few arguments to function ‘frame_calculate_payload_overhead’ 223 | size_t payload_overhead = frame_calculate_payload_overhead(0, , ); |

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Frank Lichtenheld
Code changes look fine to me, but several documentation suggestions. On Tue, Jun 21, 2022 at 06:16:48PM +0200, Arne Schwabe wrote: > This changes the default MTU of the tun-mtu to 1420 to avoid MTU related > issues that are even more prominent when DCO server or clients are involved. > > To

[Openvpn-devel] [PATCH 05/25] dco: let open_tun_generic handle the DCO case

2022-06-24 Thread Antonio Quartulli
open_tun_generic already contains the logic required to find a device name when not specified b the user. For this reason the DCO case can easily leverage on function and avoid code duplication. Signed-off-by: Antonio Quartulli --- src/openvpn/init.c | 2 +- src/openvpn/tun.c | 133

[Openvpn-devel] [PATCH 08/25] dco: allow user to disable it at runtime

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- src/openvpn/options.c | 29 + 1 file changed, 29 insertions(+) diff --git a/src/openvpn/options.c b/src/openvpn/options.c index 9a0634a5..7b450296 100644 --- a/src/openvpn/options.c +++ b/src/openvpn/options.c @@ -61,6 +61,7 @@

[Openvpn-devel] [PATCH 03/25] dco: use specific metric when installing routes

2022-06-24 Thread Antonio Quartulli
When using DCO iroutes and routes all live in the same routing table, However, the latter should always come after the former. for this reason assign a default metric of 200 to routes. iroutes will later get a metric of 100. Signed-off-by: Antonio Quartulli --- src/openvpn/dco.h | 2 ++

[Openvpn-devel] [PATCH 01/25] dco: introduce low-level code for handling ovpn-dco in the Linux kernel

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- configure.ac| 34 + dev-tools/special-files.lst | 1 + src/openvpn/Makefile.am | 3 + src/openvpn/dco.h | 165 + src/openvpn/dco_internal.h | 78 +++ src/openvpn/dco_linux.c

[Openvpn-devel] [PATCH 02/25] dco: add helper function to detect if DCO is enabled or not

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- src/openvpn/options.h | 20 src/openvpn/tun.h | 1 + 2 files changed, 21 insertions(+) diff --git a/src/openvpn/options.h b/src/openvpn/options.h index c2937dc3..8152e755 100644 --- a/src/openvpn/options.h +++

[Openvpn-devel] [PATCH 00/25] ovpn-dco: introduce data-channel offload support

2022-06-24 Thread Antonio Quartulli
This patchset is *almost* the same as the previous patchset, but it got fragmented in multiple patches for easier review. I am not setting any version on these patches as they do not match previous versions. The idea behind splitting patches is that they should be mergeable and compilable

[Openvpn-devel] [PATCH 07/25] dco: add option check - disable DCO if conflict is detected

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- src/openvpn/Makefile.am | 2 +- src/openvpn/dco.c | 149 src/openvpn/openvpn.vcxproj | 1 + src/openvpn/openvpn.vcxproj.filters | 3 + 4 files changed, 154 insertions(+), 1 deletion(-)

[Openvpn-devel] [PATCH 04/25] dco: create DCO interface using SITNL

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- src/openvpn/networking_sitnl.c | 11 +++ 1 file changed, 11 insertions(+) diff --git a/src/openvpn/networking_sitnl.c b/src/openvpn/networking_sitnl.c index bffcb067..0944ad0a 100644 --- a/src/openvpn/networking_sitnl.c +++

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Frank Lichtenheld
On Fri, Jun 24, 2022 at 10:35:24AM +0200, Frank Lichtenheld wrote: > Code changes look fine to me, but several documentation suggestions. Hmm, after reading the next patch might I suggest to move the change to push.c actually to the next patch? Both references to IV_MTU and tun-max-mtu only make

[Openvpn-devel] [PATCH 14/25] dco: implement dco support for p2mp/server code path

2022-06-24 Thread Antonio Quartulli
This change introduces ovpn-dco support along the p2mp/server code path. Some code seems to be duplicate of the p2p version, but details are different, so it couldn't be shared. Signed-off-by: Antonio Quartulli --- src/openvpn/dco.c | 203 ++

Re: [Openvpn-devel] [PATCH 3/6] Extract update_session_cipher into standalone function

2022-06-24 Thread Frank Lichtenheld
Acked-By: Frank Lichtenheld Trivial code move. On Tue, Jun 21, 2022 at 06:16:46PM +0200, Arne Schwabe wrote: > This allow the code later to check if the cipher is okay to use and > update it for the calculation for the max MTU size. > > Signed-off-by: Arne Schwabe > --- > src/openvpn/ssl.c

Re: [Openvpn-devel] [PATCH] Insert client connection data into PAM environment, upgraded

2022-06-24 Thread Antonio Quartulli
Hi Paolo, On 20/06/2022 14:21, Paolo Cerrito wrote: From: paolo Is this a new version of your previous patch having subject "Insert client connection data into PAM environment"? If yes, you should send it as a v2 (i.e. with subject starting with "[PATCH v2]") instead of appending ",

[Openvpn-devel] [PATCH 13/25] dco: implement dco support for p2p/client code path

2022-06-24 Thread Antonio Quartulli
With this change we introduce ovpn-dco support only along the p2p/client code path. Server codebase is still unchanged. Signed-off-by: Antonio Quartulli --- src/openvpn/dco.c | 90 +++ src/openvpn/dco.h | 48 +++

[Openvpn-devel] [PATCH 19/25] dco-win: implement GetOverlappedResultEx for mingw32

2022-06-24 Thread Antonio Quartulli
GetOverlappedResultEx is not available on ming32 therefore we must provide some compat layer before being able to use this function. Signed-off-by: Antonio Quartulli Signed-off-by: Lev Stipakov --- src/compat/Makefile.am| 3 +-

[Openvpn-devel] [PATCH 18/25] dco: turn supported ciphers list into a function

2022-06-24 Thread Antonio Quartulli
Other platforms may need more complex logic to decide whether a cipher is supported or not, therefore turn hardcoded list into a function that can be implemented by each platform independently. Signed-off-by: Lev Stipakov Signed-off-by: Antonio Quartulli --- src/openvpn/dco.c | 4 ++--

[Openvpn-devel] [PATCH 17/25] tun: extract close_tun_handle into its own fucntion and print correct type

2022-06-24 Thread Antonio Quartulli
From: Arne Schwabe This moves closing the tun handle into its own function and also prints the adapter type we are operating on, instead hardcoding it to tap-windows. While at it, set the handle to NULL after closing, to prevent a double close due to multiple invocations of this helper.

[Openvpn-devel] [PATCH 25/25] dco-win: update GH Actions config file

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Lev Stipakov Signed-off-by: Antonio Quartulli --- .github/workflows/build.yaml | 7 +-- 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index b905c0d2..536dd9d6 100644 --- a/.github/workflows/build.yaml

[Openvpn-devel] [PATCH 06/25] dco: initialize context and save pointer in TLS object

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- src/openvpn/init.c | 49 src/openvpn/ssl_common.h | 23 +++ 2 files changed, 63 insertions(+), 9 deletions(-) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index 7099eba4..7ab2c9a2 100644

[Openvpn-devel] [PATCH 09/25] dco: configure keys in DCO right after generating them

2022-06-24 Thread Antonio Quartulli
The ovpn-dco kernel module needs to be informed about the keys to be used to encrypt/decrypt data traffic to/from a peer. Configure keys in DCO right afte they are generated by the SSL code, to avoid keeping them in memory longer than needed. Signed-off-by: Antonio Quartulli ---

Re: [Openvpn-devel] [PATCH 6/6] Allow tun-mtu to be pushed

2022-06-24 Thread Frank Lichtenheld
Only skimmed this. A few small typo fixes and the like. On Tue, Jun 21, 2022 at 06:16:49PM +0200, Arne Schwabe wrote: > This allows tun-mtu to pushed but only up to the size of the preallocated > buffers. This is not a perfect solution but should allow most of the use > cases where the mtu is

[Openvpn-devel] [PATCH 15/25] dco: add documentation for ovpn-dco-linux

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- Changes.rst | 9 ++ README.dco.md | 123 ++ doc/man-sections/advanced-options.rst | 13 +++ doc/man-sections/server-options.rst | 6 ++ 4 files changed, 151 insertions(+) create

[Openvpn-devel] [PATCH 11/25] dco: split option parsing routines

2022-06-24 Thread Antonio Quartulli
DCO will try to install keys upon generating them, however, this happens when parsing pushed cipher options (due to NCP). For this reason we need to postpone parsing pushed cipher options to *after* the tunnel interface has been opened, otherwise we would have no DCO netdev object to operate on.

[Openvpn-devel] [PATCH 20/25] dco-win: add platform dependant check on incompatible options

2022-06-24 Thread Antonio Quartulli
Some platforms may have different constraints in terms of incompatible opions, therefore we add a function that explicitly checks those. Also, add generic option check for when ovpn-dco-win is in use. Signed-off-by: Antonio Quartulli Signed-off-by: Lev Stipakov --- src/openvpn/dco.c | 25

[Openvpn-devel] [PATCH 24/25] dco-win: add documentation to README.dco.md

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Arne Schwabe Signed-off-by: Lev Stipakov Signed-off-by: Antonio Quartulli --- README.dco.md | 9 + 1 file changed, 9 insertions(+) diff --git a/README.dco.md b/README.dco.md index e73e0fc2..ef56f0fe 100644 --- a/README.dco.md +++ b/README.dco.md @@ -58,6 +58,13 @@ see a

[Openvpn-devel] [PATCH 16/25] GitHub Actions: add Linux DCO build (on Ubuntu 20.04)

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Antonio Quartulli --- .github/workflows/build.yaml | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 6c267a61..b905c0d2 100644 --- a/.github/workflows/build.yaml +++

[Openvpn-devel] [PATCH 22/25] dco-win: introduce low-level code for handling ovpn-dco-win in Windows

2022-06-24 Thread Antonio Quartulli
Signed-off-by: Arne Schwabe Signed-off-by: Lev Stipakov Signed-off-by: Antonio Quartulli --- config-msvc.h | 2 + configure.ac| 9 +- dev-tools/special-files.lst | 1 + src/openvpn/Makefile.am | 4 +-

[Openvpn-devel] [PATCH 23/25] dco-win: implement ovpn-dco support in P2P Windows code path

2022-06-24 Thread Antonio Quartulli
With this change it is possible to use ovpn-dco-win when running OpenVPN in client or P2P mode. Signed-off-by: Arne Schwabe Signed-off-by: Lev Stipakov Signed-off-by: Antonio Quartulli --- src/openvpn/forward.c | 7 src/openvpn/init.c| 29 +++-- src/openvpn/options.c | 19

[Openvpn-devel] [PATCH 12/25] dco: check that pulled options are compatible

2022-06-24 Thread Antonio Quartulli
A server may push options that are not compatible with DCO. In this case we should log a message and bail out. Signed-off-by: Antonio Quartulli --- src/openvpn/init.c | 23 +++ 1 file changed, 23 insertions(+) diff --git a/src/openvpn/init.c b/src/openvpn/init.c index

[Openvpn-devel] [PATCH 10/25] dco: periodically check and possibly rotate/delete keys

2022-06-24 Thread Antonio Quartulli
Data channel keys are periodically regenarated and installed in ovpn-dco. However, there is a certain moment when keys are rotated in order to elect the new primary one. Check the key status in userspace so that kernelspace can be informed as well when rotations happen. Signed-off-by: Antonio

[Openvpn-devel] [PATCH 21/25] do_open_tun: restyle "can preserve TUN" check

2022-06-24 Thread Antonio Quartulli
The current condition checking if the TUN interface was preserved is dependant on the platform being Android or not. This makes the code reasonably ugly, especially because uncrustify can't indent properly. On top of that, we will require an extra condition only for windows+DCO, which will make

Re: [Openvpn-devel] [PATCH] Rate-limit incoming P_CONTROL_HARD_RESET_* packets.

2022-06-24 Thread Antonio Quartulli
Hi, do we still need this patch after having merged Arne's HMAC feature? Regards, -- Antonio Quartulli ___ Openvpn-devel mailing list Openvpn-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/openvpn-devel

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Gert Doering
Hi, On Tue, Jun 21, 2022 at 06:16:48PM +0200, Arne Schwabe wrote: > This changes the default MTU of the tun-mtu to 1420 to avoid MTU related > issues that are even more prominent when DCO server or clients are involved. I'm not convinced that this change "by default" is a desirable change.

Re: [Openvpn-devel] [PATCH v2 2/4] Implement a function to calculate the default MTU

2022-06-24 Thread Frank Lichtenheld
On Fri, Jun 24, 2022 at 01:13:16PM +0200, Arne Schwabe wrote: > We could also just hardcode this value to 1420 but this approach does > not add much (complicated) code and it is a bit better than to have > a magic number to just be there. > [...] > +/** > + * Function to calculate the default MTU

[Openvpn-devel] [PATCH] test_crypto: fix test_occ_mtu_calculation with --disable-fragment

2022-06-24 Thread Frank Lichtenheld
Doesn't make sense to test with fragment, if the code ignores it. Signed-off-by: Frank Lichtenheld --- tests/unit_tests/openvpn/test_crypto.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/tests/unit_tests/openvpn/test_crypto.c

[Openvpn-devel] [PATCH v2 1/4] Extract update_session_cipher into standalone function

2022-06-24 Thread Arne Schwabe
This allow the code later to check if the cipher is okay to use and update it for the calculation for the max MTU size. Signed-off-by: Arne Schwabe --- src/openvpn/ssl.c | 11 +-- src/openvpn/ssl_ncp.c | 22 ++ src/openvpn/ssl_ncp.h | 8 3 files

[Openvpn-devel] [PATCH v2 2/4] Implement a function to calculate the default MTU

2022-06-24 Thread Arne Schwabe
We could also just hardcode this value to 1420 but this approach does not add much (complicated) code and it is a bit better than to have a magic number to just be there. Signed-off-by: Arne Schwabe --- src/openvpn/mtu.c | 22 ++ src/openvpn/mtu.h

[Openvpn-devel] [PATCH v2 3/4] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Arne Schwabe
This changes the default MTU of the tun-mtu to 1420 to avoid MTU related issues that are even more prominent when DCO server or clients are involved. To maximise compatibility to lie our MTU in the default OCC message and also push the real MTU to clients that support pushing the MTU. Patch v2:

[Openvpn-devel] [PATCH v2 4/4] Allow tun-mtu to be pushed

2022-06-24 Thread Arne Schwabe
This allows tun-mtu to pushed but only up to the size of the preallocated buffers. This is not a perfect solution but should allow most of the use cases where the mtu is close enough to 1500. Signed-off-by: Arne Schwabe --- Changes.rst | 8

Re: [Openvpn-devel] [PATCH] Rate-limit incoming P_CONTROL_HARD_RESET_* packets.

2022-06-24 Thread Arne Schwabe
Am 24.06.22 um 12:26 schrieb Gert Doering: Hi, On Fri, Jun 24, 2022 at 11:13:40AM +0200, Antonio Quartulli wrote: do we still need this patch after having merged Arne's HMAC feature? Yes and no. *This* patch won't apply anymore, but Arne said "we're now much faster in replying to packets

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Gert Doering
Hi, On Fri, Jun 24, 2022 at 12:52:23PM +0200, Arne Schwabe wrote: > I still think this is a reasonable change. Yes, it might break in some > very obscure setups but for those setups, people can still set the MTU > back to 1500. Tap still uses the 1500 default anyway. It will break all setups

Re: [Openvpn-devel] [PATCH] Rate-limit incoming P_CONTROL_HARD_RESET_* packets.

2022-06-24 Thread Gert Doering
Hi, On Fri, Jun 24, 2022 at 01:15:05PM +0200, Arne Schwabe wrote: > > *This* patch won't apply anymore, but Arne said "we're now much faster > > in replying to packets than ever before" so we might indeed need a > > per-source-ip rate-limiter, to something like "10 per 10 seconds" or > > so

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Arne Schwabe
Am 24.06.22 um 10:38 schrieb Frank Lichtenheld: On Fri, Jun 24, 2022 at 10:35:24AM +0200, Frank Lichtenheld wrote: Code changes look fine to me, but several documentation suggestions. Hmm, after reading the next patch might I suggest to move the change to push.c actually to the next patch?

Re: [Openvpn-devel] [PATCH] Rate-limit incoming P_CONTROL_HARD_RESET_* packets.

2022-06-24 Thread Gert Doering
Hi, On Fri, Jun 24, 2022 at 11:13:40AM +0200, Antonio Quartulli wrote: > do we still need this patch after having merged Arne's HMAC feature? Yes and no. *This* patch won't apply anymore, but Arne said "we're now much faster in replying to packets than ever before" so we might indeed need a

Re: [Openvpn-devel] [PATCH 5/6] Change default MTU in server mode to 1420 and push it to client

2022-06-24 Thread Arne Schwabe
Am 24.06.22 um 12:35 schrieb Gert Doering: Hi, On Tue, Jun 21, 2022 at 06:16:48PM +0200, Arne Schwabe wrote: This changes the default MTU of the tun-mtu to 1420 to avoid MTU related issues that are even more prominent when DCO server or clients are involved. I'm not convinced that this

[Openvpn-devel] [PATCH v2] Insert client connection data into PAM environment v2

2022-06-24 Thread Paolo Cerrito
From: paolo "Changes from v1: changed sprintf for logging to plugin_log " change to reflect current head openvpn repository this patch put remote host ip into pam environment, so this make pam module able to use it. in simple, this patch get ip (ipv4 and ipv6) from openvpn, put into pam