2010-02-15 11:40:21 +00:00
|
|
|
diff -up cups-1.4.2/config-scripts/cups-ssl.m4.gnutls-gcrypt-threads cups-1.4.2/config-scripts/cups-ssl.m4
|
|
|
|
--- cups-1.4.2/config-scripts/cups-ssl.m4.gnutls-gcrypt-threads 2010-02-15 12:21:32.000000000 +0100
|
|
|
|
+++ cups-1.4.2/config-scripts/cups-ssl.m4 2010-02-15 12:24:57.000000000 +0100
|
|
|
|
@@ -61,7 +61,7 @@ if test x$enable_ssl != xno; then
|
|
|
|
if test "x${SSLLIBS}" = "x" -a "x${enable_gnutls}" != "xno" -a "x$PKGCONFIG" != x; then
|
|
|
|
AC_PATH_PROG(LIBGNUTLSCONFIG,libgnutls-config)
|
|
|
|
if $PKGCONFIG --exists gnutls; then
|
|
|
|
- SSLLIBS=`$PKGCONFIG --libs gnutls`
|
|
|
|
+ SSLLIBS="`$PKGCONFIG --libs gnutls` -lgcrypt"
|
|
|
|
SSLFLAGS=`$PKGCONFIG --cflags gnutls`
|
|
|
|
AC_DEFINE(HAVE_SSL)
|
|
|
|
AC_DEFINE(HAVE_GNUTLS)
|
2009-12-21 17:11:58 +00:00
|
|
|
diff -up cups-1.4.2/cups/http.c.gnutls-gcrypt-threads cups-1.4.2/cups/http.c
|
2010-02-15 11:40:21 +00:00
|
|
|
--- cups-1.4.2/cups/http.c.gnutls-gcrypt-threads 2010-02-15 12:21:32.000000000 +0100
|
|
|
|
+++ cups-1.4.2/cups/http.c 2010-02-15 12:25:57.000000000 +0100
|
|
|
|
@@ -1161,6 +1161,12 @@ httpHead(http_t *http, /* I - Conne
|
2009-12-21 17:11:58 +00:00
|
|
|
return (http_send(http, HTTP_HEAD, uri));
|
|
|
|
}
|
|
|
|
|
|
|
|
+#ifdef HAVE_GNUTLS
|
2010-02-15 11:40:21 +00:00
|
|
|
+/* We always have to initialize threading in gcrypt here in libcups
|
|
|
|
+ * even if cupsd is configured without threading, because an
|
|
|
|
+ * application using libcups may be using threads itself. */
|
2009-12-21 17:11:58 +00:00
|
|
|
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
|
|
|
+#endif
|
|
|
|
|
|
|
|
/*
|
|
|
|
* 'httpInitialize()' - Initialize the HTTP interface library and set the
|
2010-02-15 11:40:21 +00:00
|
|
|
@@ -1205,6 +1211,7 @@ httpInitialize(void)
|
2009-12-21 17:11:58 +00:00
|
|
|
#endif /* WIN32 */
|
|
|
|
|
|
|
|
#ifdef HAVE_GNUTLS
|
|
|
|
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
|
|
|
gnutls_global_init();
|
|
|
|
#endif /* HAVE_GNUTLS */
|
|
|
|
|
|
|
|
diff -up cups-1.4.2/cups/http-private.h.gnutls-gcrypt-threads cups-1.4.2/cups/http-private.h
|
2010-02-15 11:40:21 +00:00
|
|
|
--- cups-1.4.2/cups/http-private.h.gnutls-gcrypt-threads 2009-04-07 17:48:14.000000000 +0200
|
|
|
|
+++ cups-1.4.2/cups/http-private.h 2010-02-15 12:26:30.000000000 +0100
|
2009-12-21 17:11:58 +00:00
|
|
|
@@ -98,6 +98,8 @@ extern BIO_METHOD *_httpBIOMethods(void)
|
|
|
|
* The GNU TLS library is more of a "bare metal" SSL/TLS library...
|
|
|
|
*/
|
|
|
|
# include <gnutls/gnutls.h>
|
|
|
|
+# include <gcrypt.h>
|
|
|
|
+# include <pthread.h>
|
|
|
|
|
|
|
|
typedef struct
|
|
|
|
{
|
|
|
|
diff -up cups-1.4.2/scheduler/server.c.gnutls-gcrypt-threads cups-1.4.2/scheduler/server.c
|
2010-02-15 11:40:21 +00:00
|
|
|
--- cups-1.4.2/scheduler/server.c.gnutls-gcrypt-threads 2008-09-11 00:05:29.000000000 +0200
|
|
|
|
+++ cups-1.4.2/scheduler/server.c 2010-02-15 12:24:13.000000000 +0100
|
|
|
|
@@ -35,6 +35,9 @@
|
2009-12-21 17:11:58 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
static int started = 0;
|
2010-02-15 11:40:21 +00:00
|
|
|
+#if !defined(HAVE_LIBSSL) && defined(HAVE_GNUTLS) && defined(HAVE_PTHREAD_H)
|
2009-12-21 17:11:58 +00:00
|
|
|
+GCRY_THREAD_OPTION_PTHREAD_IMPL;
|
|
|
|
+#endif
|
|
|
|
|
2010-02-15 11:40:21 +00:00
|
|
|
|
2009-12-21 17:11:58 +00:00
|
|
|
/*
|
2010-02-15 11:40:21 +00:00
|
|
|
@@ -75,7 +78,9 @@ cupsdStartServer(void)
|
2009-12-21 17:11:58 +00:00
|
|
|
/*
|
|
|
|
* Initialize the encryption libraries...
|
|
|
|
*/
|
|
|
|
-
|
2010-02-15 11:40:21 +00:00
|
|
|
+#ifdef HAVE_PTHREAD_H
|
2009-12-21 17:11:58 +00:00
|
|
|
+ gcry_control (GCRYCTL_SET_THREAD_CBS, &gcry_threads_pthread);
|
2010-02-15 11:40:21 +00:00
|
|
|
+#endif /* HAVE_PTHREAD_H */
|
2009-12-21 17:11:58 +00:00
|
|
|
gnutls_global_init();
|
|
|
|
#endif /* HAVE_LIBSSL */
|
|
|
|
|