Package: webfs
Version: 1.21+ds1-9
Severity: normal
User: [email protected]
Usertags: gnutls3

webfs necessarily links against and #includes gcrypt even when it is
not necessary.
1. The pthreads locking is now used by default in gnutls. [1]
2. Gnutls >= 3 does not use gcrypt as crypto backend, so there is no
point in setting gcry_control(GCRYCTL_ENABLE_QUICK_RANDOM, 0) when
newer gnutls versions are used because webfs itself does not use
gcrypt directly.

The respective parts of the file (especially #include <gcrypt.h>)
should conditional on a correct #if GNUTLS_VERSION_NUMBER <= setting
and the makefile should stop linking against gcrypt for gnutls >=3.

cu Andreas

[1] gnutls 2.12 release announcement:
** libgnutls: Added gnutls_global_set_mutex() to allow setting
alternative locking procedures. By default the system available
locking is used. In *NIX pthreads are used and in windows the
critical section API. This follows a different approach than the
previous versions that depended on libgcrypt initialization. The
locks are now set by default in systems that support it. Programs
that used gcry_control() to set thread locks should insert it into
a block of
#if GNUTLS_VERSION_NUMBER <= 0x020b00
        gcry_control(...)
#endif

-- 
`What a good friend you are to him, Dr. Maturin. His other friends are
so grateful to you.'
`I sew his ears on from time to time, sure'
diff -Nru xxxterm-1.11.3/debian/changelog xxxterm-1.11.3/debian/changelog
--- xxxterm-1.11.3/debian/changelog	2013-12-24 00:03:35.000000000 +0100
+++ xxxterm-1.11.3/debian/changelog	2014-04-27 15:37:45.000000000 +0200
@@ -1,3 +1,11 @@
+xxxterm (1:1.11.3-1.3) unstable; urgency=medium
+
+  * Non-maintainer upload.
+  * 0007-Unnecessary-gcrypt-requirement.diff: Only link against and #include
+    gcrypt for gnutls < 2.12.
+
+ -- Andreas Metzler <[email protected]>  Sun, 27 Apr 2014 15:37:04 +0200
+
 xxxterm (1:1.11.3-1.2) unstable; urgency=medium
 
   * Non-maintainer upload
diff -Nru xxxterm-1.11.3/debian/patches/0007-Unnecessary-gcrypt-requirement.diff xxxterm-1.11.3/debian/patches/0007-Unnecessary-gcrypt-requirement.diff
--- xxxterm-1.11.3/debian/patches/0007-Unnecessary-gcrypt-requirement.diff	1970-01-01 01:00:00.000000000 +0100
+++ xxxterm-1.11.3/debian/patches/0007-Unnecessary-gcrypt-requirement.diff	2014-04-27 15:36:34.000000000 +0200
@@ -0,0 +1,54 @@
+Description: Drop unnecessary gcrypt requirement
+ Only link against and #include gcrypt for gnutls < 2.12.
+Author: Andreas Metzler <[email protected]>
+Origin: vendor
+Last-Update: 2014-04-27
+
+--- xxxterm-1.11.3.orig/linux/Makefile
++++ xxxterm-1.11.3/linux/Makefile
+@@ -1,7 +1,8 @@
+ LIBS= gtk+-2.0 webkit-1.0 libsoup-2.4 gnutls gthread-2.0
+ 
++REQUIREGCRYPT := $(shell if pkg-config --exists 'gnutls < 2.12' ; then echo "-lgcrypt" ; fi )
+ CFLAGS+= -O2 -Wall -ggdb3 -D_GNU_SOURCE -I. -I.. $(shell pkg-config --cflags $(LIBS))
+-LDADD+= $(shell pkg-config --libs $(LIBS)) -lbsd -ldl -lgcrypt
++LDADD+= $(shell pkg-config --libs $(LIBS)) -lbsd -ldl $(REQUIREGCRYPT)
+ 
+ PREFIX?= /usr/local
+ BINDIR?= $(PREFIX)/bin
+--- xxxterm-1.11.3.orig/xxxterm.c
++++ xxxterm-1.11.3/xxxterm.c
+@@ -49,8 +49,10 @@ uint32_t		swm_debug = 0
+ #endif
+ 
+ #ifdef USE_THREADS
++#if GNUTLS_VERSION_NUMBER <= 0x020b00
+ GCRY_THREAD_OPTION_PTHREAD_IMPL;
+ #endif
++#endif
+ 
+ char		*icons[] = {
+ 	"xxxtermicon16.png",
+@@ -7602,8 +7604,10 @@ main(int argc, char **argv)
+ 	gdk_threads_init();
+ 	gdk_threads_enter();
+ 
++#if GNUTLS_VERSION_NUMBER <= 0x020b00
+ 	gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
+ #endif
++#endif
+ 	gtk_init(&argc, &argv);
+ 
+ 	gnutls_global_init();
+--- xxxterm-1.11.3.orig/xxxterm.h
++++ xxxterm-1.11.3/xxxterm.h
+@@ -78,7 +78,9 @@ u_int32_t	arc4random_uniform(u_int32_t);
+ #define USE_THREADS
+ 
+ #ifdef USE_THREADS
++#if GNUTLS_VERSION_NUMBER <= 0x020b00
+ #include <gcrypt.h>
++#endif
+ #include <pthread.h>
+ #endif
+ 
diff -Nru xxxterm-1.11.3/debian/patches/series xxxterm-1.11.3/debian/patches/series
--- xxxterm-1.11.3/debian/patches/series	2013-12-23 23:19:27.000000000 +0100
+++ xxxterm-1.11.3/debian/patches/series	2014-04-27 15:34:47.000000000 +0200
@@ -4,3 +4,4 @@
 0004-Fix-lintian-error-hyphen-used-as-minus-sign.patch
 0005-Fix-Icon-path-in-desktop-file.patch
 0006-Add-missing-includes.patch
+0007-Unnecessary-gcrypt-requirement.diff

Reply via email to