[vlc-devel] [PATCH 1/2] contrib: gnutls: update to 3.6.14

Steve Lhomme robux4 at ycbcr.xyz
Thu Jun 4 17:09:44 CEST 2020


ecc_scalar_random is public in the nettle they embed, but the symbol is not
mangled in the original nettle package, so it's not mangled here either. It
leads to the nettle symbol behind defined twice.

The bug is actually in nettle, not the script that imports nettle in gnutls.
---
 contrib/src/gnutls/SHA512SUMS                |  2 +-
 contrib/src/gnutls/gnutls-fix-mangling.patch | 10 ++++++++++
 contrib/src/gnutls/rules.mak                 |  9 ++-------
 3 files changed, 13 insertions(+), 8 deletions(-)
 create mode 100644 contrib/src/gnutls/gnutls-fix-mangling.patch

diff --git a/contrib/src/gnutls/SHA512SUMS b/contrib/src/gnutls/SHA512SUMS
index 4dc1221e2b46..9d3bff8a5a31 100644
--- a/contrib/src/gnutls/SHA512SUMS
+++ b/contrib/src/gnutls/SHA512SUMS
@@ -1 +1 @@
-c3c4178c8663e3d1207aaf771ceb43e7e75a9f11b4ea3a26fde9d04a23762b05bac8fe290b74d63b815a354b79fc3557cfc218c196e1f80eb1fbce762948a926  gnutls-3.6.7.1.tar.xz
+b2d427b5542a4679117c011dffa8efb0e0bffa3ce9cebc319f8998d03f80f4168d08f9fda35df18dbeaaada59e479d325a6c1c77d5ca7f8ce221b44e42bfe604  gnutls-3.6.14.tar.xz
diff --git a/contrib/src/gnutls/gnutls-fix-mangling.patch b/contrib/src/gnutls/gnutls-fix-mangling.patch
new file mode 100644
index 000000000000..ec4a9782d157
--- /dev/null
+++ b/contrib/src/gnutls/gnutls-fix-mangling.patch
@@ -0,0 +1,10 @@
+--- gnutls/lib/nettle/ecc/ecc-internal.h.ecc_random	2020-06-03 15:05:27.000000000 +0200
++++ gnutls/lib/nettle/ecc/ecc-internal.h	2020-06-04 16:31:00.523456500 +0200
+@@ -71,6 +71,7 @@
+ #define ecc_mul_g_eh _gnutls_nettle_ecc_ecc_mul_g_eh
+ #define ecc_mul_a_eh _gnutls_nettle_ecc_ecc_mul_a_eh
+ #define ecc_mul_m _gnutls_nettle_ecc_ecc_mul_m
++#define ecc_scalar_random _gnutls_nettle_ecc_scalar_random
+ #define cnd_copy _gnutls_nettle_ecc_cnd_copy
+ #define sec_add_1 _gnutls_nettle_ecc_sec_add_1
+ #define sec_sub_1 _gnutls_nettle_ecc_sec_sub_1
diff --git a/contrib/src/gnutls/rules.mak b/contrib/src/gnutls/rules.mak
index 791ced1ee3ac..7db4a149952b 100644
--- a/contrib/src/gnutls/rules.mak
+++ b/contrib/src/gnutls/rules.mak
@@ -1,6 +1,6 @@
 # GnuTLS
 
-GNUTLS_VERSION := 3.6.7.1
+GNUTLS_VERSION := 3.6.14
 GNUTLS_URL := https://www.gnupg.org/ftp/gcrypt/gnutls/v3.6/gnutls-$(GNUTLS_VERSION).tar.xz
 
 ifdef BUILD_NETWORK
@@ -17,19 +17,14 @@ $(TARBALLS)/gnutls-$(GNUTLS_VERSION).tar.xz:
 
 .sum-gnutls: gnutls-$(GNUTLS_VERSION).tar.xz
 
-# gnutls 3.6.7.1 unpacks into a dir named 3.6.7
-gnutls: UNPACK_DIR=gnutls-3.6.7
 gnutls: gnutls-$(GNUTLS_VERSION).tar.xz .sum-gnutls
 	$(UNPACK)
-ifdef HAVE_WIN32
-	cd $(UNPACK_DIR) && sed -i.orig -e s/"@INET_PTON_LIB@ @LIBPTHREAD@"/"@INET_PTON_LIB@ -lcrypt32 @LIBPTHREAD@"/g lib/gnutls.pc.in
+	$(APPLY) $(SRC)/gnutls/gnutls-fix-mangling.patch
 	# disable the dllimport in static linking (pkg-config --static doesn't handle Cflags.private)
 	cd $(UNPACK_DIR) && sed -i.orig -e s/"_SYM_EXPORT __declspec(dllimport)"/"_SYM_EXPORT"/g lib/includes/gnutls/gnutls.h.in
-endif
 ifdef HAVE_ANDROID
 	$(APPLY) $(SRC)/gnutls/no-create-time-h.patch
 endif
-	cd $(UNPACK_DIR) && sed -i.orig -e 's/@LIBATOMIC_LIBS@/@LIBATOMIC_LIBS@ @HOGWEED_LIBS@ @NETTLE_LIBS@/' lib/gnutls.pc.in
 	$(call pkg_static,"lib/gnutls.pc.in")
 	$(UPDATE_AUTOCONFIG)
 	$(MOVE)
-- 
2.26.2



More information about the vlc-devel mailing list