Change in openvpn[master]: Automatically enable --compress migrate on the server
A message that is not in the archive (sent off-list or not yet received): gerrit.1727014533000.I00209b880cfcedd93e28f97fc3941d8b85e095f3@...2715...
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to do a code review.
Please visit
http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
to review the following change.
Change subject: Automatically enable --compress migrate on the server
......................................................................
Automatically enable --compress migrate on the server
If we enable LZO compression, automatically switch to migrate mode.
---
M doc/man-sections/protocol-options.rst
M src/openvpn/comp.h
M src/openvpn/options.c
3 files changed, 56 insertions(+), 62 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/756/1
doc/man-sections/protocol-options.rst +25 -34
@@ -30,7 +30,9 @@ framing (stub). :code:`yes` - OpenVPN will send and receive compressed packets. + **DEPRECATED** This option is an alias for :code:`asym`. Previously + it did enable compression for uplink packets, but OpenVPN never + compresses uplink packets now. --auth alg Authenticate data channel packets and (if enabled) ``tls-auth`` control
@@ -125,6 +127,12 @@ configuration if supported by the client and otherwise switch to ``comp-lzo no`` and add ``--push comp-lzo`` to the client specific configuration. + If used in a server configuration :code:`lzo` is an alias for :code:`migrate` in + current versions of OpenVPN. Compression will only be enabled if there is no + other choice. Note that these versions of OpenVPN also never actually compress + any packets. But they still will decompress packets received from the other side + of the connection if required. + ***Security Considerations*** Compression and encryption is a tricky combination. If an attacker knows
@@ -135,48 +143,31 @@ entirely sure that the above does not apply to your traffic, you are advised to *not* enable compression. + For this reason compression support was removed from current versions + of OpenVPN. It will still decompress compressed packets removed via + a VPN connection but it will never compress any outgoing packets. + --comp-lzo mode **DEPRECATED** Enable LZO compression algorithm. Compression is generally not recommended. VPN tunnels which uses compression are suspectible to the VORALCE attack vector. - Use LZO compression -- may add up to 1 byte per packet for incompressible - data. ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive` - (default). + Allows the other side of the connection to use LZO compression. Due + to difference in packet format this may adds 1 additional byte per packet. + With current versions of OpenVPN no actual compression will happen. - In a server mode setup, it is possible to selectively turn compression - on or off for individual clients. + ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive` + but there is no actual change in behavior anymore. - First, make sure the client-side config file enables selective - compression by having at least one ``--comp-lzo`` directive, such as - ``--comp-lzo no``. This will turn off compression by default, but allow - a future directive push from the server to dynamically change the - :code:`on`/:code:`off`/:code:`adaptive` setting. - - Next in a ``--client-config-dir`` file, specify the compression setting - for the client, for example: - :: - - comp-lzo yes - push "comp-lzo yes" - - The first line sets the ``comp-lzo`` setting for the server side of the - link, the second sets the client side. + In server mode we convert this setting to ``--compress migrate`` to + automatically disable it when the client doesn't need it. If you want + to remove this setting from your server config you might need to add + an explicit ``--compress migrate`` instead if some clients still have + any variant of ``--comp-lzo`` in their config. --comp-noadapt - **DEPRECATED** When used in conjunction with ``--comp-lzo``, this option - will disable OpenVPN's adaptive compression algorithm. Normally, adaptive - compression is enabled with ``--comp-lzo``. - - Adaptive compression tries to optimize the case where you have - compression enabled, but you are sending predominantly incompressible - (or pre-compressed) packets over the tunnel, such as an FTP or rsync - transfer of a large, compressed file. With adaptive compression, OpenVPN - will periodically sample the compression process to measure its - efficiency. If the data being sent over the tunnel is already - compressed, the compression efficiency will be very low, triggering - openvpn to disable compression for a period of time until the next - re-sample test. + **DEPRECATED** This option does not have any effect anymore since current + versions of OpenVPN never compress outgoing packets. --key-direction Alternative way of specifying the optional direction parameter for the
src/openvpn/comp.h +2 -1
@@ -32,8 +32,8 @@* outside of the USE_COMP define */ /* Compression flags */ -#define COMP_F_ADAPTIVE (1<<0)/* COMP_ALG_LZO only */ /*Removed */ +/*#define COMP_F_ADAPTIVE (1<<0) / * COMP_ALG_LZO only */ /*#define COMP_F_ALLOW_COMPRESS (1<<1) / * not only downlink is compressed but also uplink * / */ #define COMP_F_SWAP (1<<2)/* initial command byte is swapped with last byte in buffer to preserve payload alignment */ #define COMP_F_ADVERTISE_STUBS_ONLY (1<<3)/* tell server that we only support compression stubs */
@@ -49,6 +49,7 @@#define COMP_ALG_LZO 2/* LZO algorithm */ #define COMP_ALG_SNAPPY 3/* Snappy algorithm (no longer supported) */ #define COMP_ALG_LZ4 4/* LZ4 algorithm */ +#define COMP_ALG_LZO_NO 5/* --comp-lzo no which is similar to COMP_ALG_STUB, but no SWAP */ /* algorithm v2 */
src/openvpn/options.c +29 -27
87 lines not on this page · raw message
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I00209b880cfcedd93e28f97fc3941d8b85e095f3
Gerrit-Change-Number: 756
Gerrit-PatchSet: 1
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newchange
Attention is currently required from: plaisthos.
Hello plaisthos,
I'd like you to reexamine a change. Please visit
http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
to look at the new patch set (#2).
Change subject: Automatically enable --compress migrate on the server
......................................................................
Automatically enable --compress migrate on the server
If we enable LZO compression, automatically switch to migrate mode.
---
M doc/man-sections/protocol-options.rst
M src/openvpn/comp.h
M src/openvpn/options.c
3 files changed, 31 insertions(+), 1 deletion(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/56/756/2
doc/man-sections/protocol-options.rst +11 -0
@@ -127,6 +127,12 @@ configuration if supported by the client and otherwise switch to ``comp-lzo no`` and add ``--push comp-lzo`` to the client specific configuration. + If used in a server configuration :code:`lzo` is an alias for :code:`migrate` in + current versions of OpenVPN. Compression will only be enabled if there is no + other choice. Note that these versions of OpenVPN also never actually compress + any packets. But they still will decompress packets received from the other side + of the connection if required. + ***Security Considerations*** Compression and encryption is a tricky combination. If an attacker knows
@@ -153,6 +159,11 @@ ``mode`` may be :code:`yes`, :code:`no`, or :code:`adaptive` but there is no actual change in behavior anymore. + In server mode we convert this setting to ``--compress migrate`` to + automatically disable it when the client doesn't need it. If you want + to remove this setting from your server config you might need to add + an explicit ``--compress migrate`` instead if some clients still have + any variant of ``--comp-lzo`` in their config. --comp-noadapt **DEPRECATED** This option does not have any effect anymore since current
src/openvpn/comp.h +1 -0
@@ -49,6 +49,7 @@#define COMP_ALG_LZO 2/* LZO algorithm */ #define COMP_ALG_SNAPPY 3/* Snappy algorithm (no longer supported) */ #define COMP_ALG_LZ4 4/* LZ4 algorithm */ +#define COMP_ALG_LZO_NO 5/* --comp-lzo no which is similar to COMP_ALG_STUB, but no SWAP */ /* algorithm v2 */
src/openvpn/options.c +19 -1
@@ -3448,6 +3448,24 @@ }#endif /* ifdef _WIN32 */ +if (options->mode ==MODE_SERVER ) + { +/* +* Enable comp migrate automatically on server +*/ +if (options->comp.alg ==COMP_ALG_LZO || options->comp.alg ==COMP_ALG_LZO_NO ) + { +msg (M_INFO ,"DEPRECATED OPTION: LZO compression enabled on the server side. " +"We will enable --compress migrate instead." ); + options->comp.alg =COMP_ALG_UNDEF ; + options->comp.flags =COMP_F_MIGRATE ; + } + } +else if (options->comp.alg ==COMP_ALG_LZO_NO ) + { + options->comp.alg =COMP_ALG_STUB ; + } +#ifdef DEFAULT_PKCS11_MODULE /* If p11-kit is present on the system then load its p11-kit-proxy.so * by default if the user asks for PKCS#11 without otherwise specifying
@@ -8456,7 +8474,7 @@ {if (streq (p[1 ],"no" )) { - options->comp.alg =COMP_ALG_STUB ; + options->comp.alg =COMP_ALG_LZO_NO ; }/* There is no actual difference anymore between these variants. * We never compress. On the server side we replace this with
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I00209b880cfcedd93e28f97fc3941d8b85e095f3
Gerrit-Change-Number: 756
Gerrit-PatchSet: 2
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: plaisthos <[email protected]...>
Gerrit-MessageType: newpatchset
Attention is currently required from: flichtenheld.
plaisthos has posted comments on this change. ( http://gerrit.openvpn.net/c/openvpn/+/756?usp=email )
Change subject: Automatically enable --compress migrate on the server
......................................................................
Patch Set 4:
(1 comment)
File src/openvpn/options.c:
http://gerrit.openvpn.net/c/openvpn/+/756/comment/834676ef_0db434b3 :
PS4, Line 3456: if (options->comp.alg == COMP_ALG_LZO || options->comp.alg == COMP_ALG_LZO_NO)
I think you need to check for && !options->comp.flag & COMP_F_SWAP for COMP_ALG_LZO because otherwise we also enable this for copress lzo. Although those configs that have compress lzo will also have pushable ciphers, so I don't think there isa config that will break. But I would say that is the same as compress lz4 enabling compress migrate.
btw. instead of introducing COMP_ALG_LZO_NO here you could test for
(options->comp.alg == COMP_ALG_STUB && !options->comp.flag & COMP_F_SWAP)
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I00209b880cfcedd93e28f97fc3941d8b85e095f3
Gerrit-Change-Number: 756
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: flichtenheld <[email protected]...>
Gerrit-Comment-Date: Tue, 24 Sep 2024 15:07:23 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
flichtenheld has abandoned this change. ( http://gerrit.openvpn.net/c/openvpn/+/756?usp=email )
Change subject: Automatically enable --compress migrate on the server
......................................................................
Abandoned
Not worth the hassle
--
To view, visit http://gerrit.openvpn.net/c/openvpn/+/756?usp=email
To unsubscribe, or for help writing mail filters, visit http://gerrit.openvpn.net/settings
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: I00209b880cfcedd93e28f97fc3941d8b85e095f3
Gerrit-Change-Number: 756
Gerrit-PatchSet: 4
Gerrit-Owner: flichtenheld <[email protected]...>
Gerrit-Reviewer: plaisthos <[email protected]...>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-MessageType: abandon