Skip to contentSkip to conversation

build: Remove compat-lz4

PATCH In review David Sommerseth 3 participants 4 messages Mar 17, 2021 – Mar 18, 2021

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 build: Remove compat-lz4

From: David Sommerseth <[email protected]...>

Since 2014, the OpenVPN project has shipped an adopted LZ4 library to be enabled if no LZ4 libraries was found on the system. This was due to the LZ4 library not being available on all platforms and it was vastly better than the older LZO compression algorithm. But this was years before VORACLE and related attack vectors affecting VPN connections, where compression is considered a vulnerability.

The OpenVPN project is gradually moving away from supporting compression, so shipping our own LZ4 library is no longer wanted. It will now only use the LZ4 compression libraries found on the host, and can otherwise be disabled completely with ./configure --disable-lz4.

---
 config-msvc.h            |    1 -
 configure.ac             |    5 +-
 dev-tools/lz4-rebaser.sh |   68 --
 src/compat/Makefile.am   |    1 -
 src/compat/compat-lz4.c  | 2409 --------------------------------------
 src/compat/compat-lz4.h  |  764 ------------
 src/openvpn/comp-lz4.c   |    5 -
 7 files changed, 2 insertions(+), 3251 deletions(-)
 delete mode 100755 dev-tools/lz4-rebaser.sh
 delete mode 100644 src/compat/compat-lz4.c
 delete mode 100644 src/compat/compat-lz4.h
config-msvc.h +0 -1
index 6126ac05..40ad7889 100644
@@ -10,7 +10,6 @@
 #define ENABLE_HTTP_PROXY 1
 #define ENABLE_LZO 1
 #define ENABLE_LZ4 1
-#define NEED_COMPAT_LZ4 1
 #define ENABLE_MANAGEMENT 1
 #define ENABLE_MULTIHOME 1
 #define ENABLE_PKCS11 1
configure.ac +2 -3
index c65df3e2..54427d83 100644
@@ -1110,7 +1110,7 @@ if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then
 		    AC_MSG_RESULT([ok])
 		    have_lz4="yes"
 		],
-		[AC_MSG_RESULT([system LZ4 library is too old])]
+		[AC_MSG_ERROR([system LZ4 library is too old])]
 	    )
 	fi
     fi
@@ -1128,8 +1128,7 @@ if test "$enable_lz4" = "yes" && test "$enable_comp_stub" = "no"; then
     fi
 
     if test "${have_lz4}" != "yes" ; then
-	AC_MSG_RESULT([		usable LZ4 library or header not found, using version in src/compat/compat-lz4.*])
-	AC_DEFINE([NEED_COMPAT_LZ4], [1], [use copy of LZ4 source in compat/])
+	AC_MSG_ERROR([No compatible LZ4 compression library found. Consider --disable-lz4])
 	LZ4_LIBS=""
     fi
     OPTIONAL_LZ4_CFLAGS="${LZ4_CFLAGS}"
dev-tools/lz4-rebaser.sh deleted +0 -68

68 lines not on this page · raw message

src/compat/Makefile.am +0 -1
index 2e94e943..34b7ce77 100644
@@ -29,6 +29,5 @@ libcompat_la_SOURCES = \
 	compat-daemon.c \
 	compat-inet_ntop.c \
 	compat-inet_pton.c \
-	compat-lz4.c compat-lz4.h \
 	compat-strsep.c \
 	compat-versionhelpers.h
src/compat/compat-lz4.c deleted +0 -2409

2,409 lines not on this page · raw message

src/compat/compat-lz4.h deleted +0 -764

493 lines not on this page · raw message

src/openvpn/comp-lz4.c +0 -5
index 30e6da95..2168a783 100644

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
2.27.0

Part of the diff is not shown here. View the raw message.

Acked-by on v1 1/1
#1 lore raw

I have tested compilation "with default options" on FreeBSD with lz4 (works), Gentoo without lz4 (errors out), Gentoo with lz4 (works), and with --disable-lz4 on Gentoo without lz4 (works).

I assume some of the buildbots will need a bit of tending now (because "no lz4 installed, since we bundle it anyway"). They will tell me...

Your patch has been applied to the master branch.

commit 24596b258aa3a9c0bd79e7e7bd4753c48a435408

Author: David Sommerseth
Date:   Wed Mar 17 23:06:42 2021 +0100
     build: Remove compat-lz4

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...>
     URL: https://www.mail-archive.com/search?l=mid&[email protected]...
     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

#2 lore raw

this probably will break windows cross compile (it uses lz4 bundle).

Samuli, can you please keep any eye on it (new test installer maybe) ?

чт, 18 мар. 2021 г. в 12:45, Gert Doering <[email protected]...>:

Quoted 38 lines

I have tested compilation "with default options" on FreeBSD with lz4 (works), Gentoo without lz4 (errors out), Gentoo with lz4 (works), and with --disable-lz4 on Gentoo without lz4 (works).

I assume some of the buildbots will need a bit of tending now (because "no lz4 installed, since we bundle it anyway"). They will tell me...

Your patch has been applied to the master branch.

commit 24596b258aa3a9c0bd79e7e7bd4753c48a435408

Author: David Sommerseth
Date:   Wed Mar 17 23:06:42 2021 +0100
     build: Remove compat-lz4

     Signed-off-by: David Sommerseth <[email protected]...>
     Acked-by: Gert Doering <[email protected]...>
     Message-Id: <[email protected]...
Quoted 1 line

URL:
https://www.mail-archive.com/search?l=mid&[email protected]...

     Signed-off-by: Gert Doering <[email protected]...>

--
kind regards,

Gert Doering

_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel

#3 lore raw
Quoted 3 lines · Илья Шипицин

this probably will break windows cross compile (it uses lz4 bundle).

Samuli, can you please keep any eye on it  (new test installer maybe) ?

Is it too early to consider --disable-lz4 all together? Maybe try that initially for the 2.6 and see how well it is received by beta/rc testers. And further, for 2.7 we can consider having --enable-comp-stub by default.

I can do a similar move with the Fedora Copr openvpn-git development builds.

Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc
Quoted 48 lines

чт, 18 мар. 2021 г. в 12:45, Gert Doering <[email protected]... <mailto:[email protected]...>>:

    Acked-by: Gert Doering <[email protected]...
    <mailto:[email protected]...>>

    I have tested compilation "with default options" on FreeBSD with lz4
    (works), Gentoo without lz4 (errors out), Gentoo with lz4 (works), and
    with --disable-lz4 on Gentoo without lz4 (works).

    I assume some of the buildbots will need a bit of tending now (because
    "no lz4 installed, since we bundle it anyway").  They will tell me...

    Your patch has been applied to the master branch.

    commit 24596b258aa3a9c0bd79e7e7bd4753c48a435408
    Author: David Sommerseth
    Date:   Wed Mar 17 23:06:42 2021 +0100

          build: Remove compat-lz4

          Signed-off-by: David Sommerseth <[email protected]...
    <mailto:[email protected]...>>
          Acked-by: Gert Doering <[email protected]...
    <mailto:[email protected]...>>
          Message-Id:
    <[email protected]...
    <mailto:[email protected]...>>
          URL:
    https://www.mail-archive.com/search?l=mid&[email protected]...
    <https://www.mail-archive.com/search?l=mid&[email protected]...>
          Signed-off-by: Gert Doering <[email protected]...
    <mailto:[email protected]...>>


    --
    kind regards,

    Gert Doering



    _______________________________________________
    Openvpn-devel mailing list
    [email protected]
    <mailto:[email protected]>
    https://lists.sourceforge.net/lists/listinfo/openvpn-devel
    <https://lists.sourceforge.net/lists/listinfo/openvpn-devel>
Signature · 4 lines
kind regards,

David Sommerseth
OpenVPN Inc