summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortonio <tonio>2008-04-20 09:29:45 +0000
committertonio <tonio>2008-04-20 09:29:45 +0000
commit973597641bc3fbcbacff5c824df3e590f5f427f2 (patch)
treeb62d5c4e8133e3574ba6354615ce5413d60dcbc2
parent9246c7b4426974beb1467bb65f430e5c4e1cbf45 (diff)
downloadpkgsrc-973597641bc3fbcbacff5c824df3e590f5f427f2.tar.gz
Add patch taken from the devel branch, to fix issues with openssl and jabber
Patch is taken from http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359 And the issue: http://bugs.bitlbee.org/bitlbee/ticket/368 Thanks to Frederic Jaeckel for the report.
-rw-r--r--chat/bitlbee/Makefile3
-rw-r--r--chat/bitlbee/distinfo7
-rw-r--r--chat/bitlbee/patches/patch-aa17
-rw-r--r--chat/bitlbee/patches/patch-ab20
-rw-r--r--chat/bitlbee/patches/patch-ac20
-rw-r--r--chat/bitlbee/patches/patch-ad50
-rw-r--r--chat/bitlbee/patches/patch-ae23
7 files changed, 138 insertions, 2 deletions
diff --git a/chat/bitlbee/Makefile b/chat/bitlbee/Makefile
index 74bfe10e338..0cab9a078e6 100644
--- a/chat/bitlbee/Makefile
+++ b/chat/bitlbee/Makefile
@@ -1,7 +1,8 @@
-# $NetBSD: Makefile,v 1.40 2008/04/09 18:51:30 tonio Exp $
+# $NetBSD: Makefile,v 1.41 2008/04/20 09:29:45 tonio Exp $
#
DISTNAME= bitlbee-1.2
+PKGREVISION= 1
CATEGORIES= chat
MASTER_SITES= http://get.bitlbee.org/src/
diff --git a/chat/bitlbee/distinfo b/chat/bitlbee/distinfo
index 6ad506ace2e..c884568febd 100644
--- a/chat/bitlbee/distinfo
+++ b/chat/bitlbee/distinfo
@@ -1,5 +1,10 @@
-$NetBSD: distinfo,v 1.18 2008/04/09 18:51:30 tonio Exp $
+$NetBSD: distinfo,v 1.19 2008/04/20 09:29:45 tonio Exp $
SHA1 (bitlbee-1.2.tar.gz) = 71dc24e9025375460e999345db70fb5dff7d45d8
RMD160 (bitlbee-1.2.tar.gz) = c48c5f8af418ba4fe7310732ced6290521cc656e
Size (bitlbee-1.2.tar.gz) = 469482 bytes
+SHA1 (patch-aa) = 39f16450f87ee37b16ac4e13991ddc6baecf460b
+SHA1 (patch-ab) = 249a77118d76e1495713f28f9caf9923734afac3
+SHA1 (patch-ac) = 6ba0b3fff28f8bcc29d3d07bd7692104d5ae4bc1
+SHA1 (patch-ad) = 1d6733eed422feeac7568f519d7ae0336cbfbead
+SHA1 (patch-ae) = bd55911a6cfe49f02ecd1b7f0469dc9bfea8f5d6
diff --git a/chat/bitlbee/patches/patch-aa b/chat/bitlbee/patches/patch-aa
new file mode 100644
index 00000000000..83d4d4a3f06
--- /dev/null
+++ b/chat/bitlbee/patches/patch-aa
@@ -0,0 +1,17 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-aa,v 1.7 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_client.h.orig Sat Jun 30 23:18:42 2007
++++ lib/ssl_client.h
+@@ -59,6 +59,9 @@ G_MODULE_EXPORT void *ssl_starttls( int
+ G_MODULE_EXPORT int ssl_read( void *conn, char *buf, int len );
+ G_MODULE_EXPORT int ssl_write( void *conn, const char *buf, int len );
+
++/* See ssl_openssl.c for an explanation. */
++G_MODULE_EXPORT int ssl_pending( void *conn );
++
+ /* Abort the SSL connection and disconnect the socket. Do not use close()
+ directly, both the SSL library and the peer will be unhappy! */
+ G_MODULE_EXPORT void ssl_disconnect( void *conn_ );
diff --git a/chat/bitlbee/patches/patch-ab b/chat/bitlbee/patches/patch-ab
new file mode 100644
index 00000000000..afa9cbae4d4
--- /dev/null
+++ b/chat/bitlbee/patches/patch-ab
@@ -0,0 +1,20 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ab,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_gnutls.c.orig Sat Mar 15 18:32:14 2008
++++ lib/ssl_gnutls.c
+@@ -210,6 +210,12 @@ int ssl_write( void *conn, const char *b
+ return st;
+ }
+
++/* See ssl_openssl.c for an explanation. */
++int ssl_pending( void *conn )
++{
++ return 0;
++}
++
+ void ssl_disconnect( void *conn_ )
+ {
+ struct scd *conn = conn_;
diff --git a/chat/bitlbee/patches/patch-ac b/chat/bitlbee/patches/patch-ac
new file mode 100644
index 00000000000..3bbb4c6d15d
--- /dev/null
+++ b/chat/bitlbee/patches/patch-ac
@@ -0,0 +1,20 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ac,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_nss.c.orig Sat Jun 30 23:18:42 2007
++++ lib/ssl_nss.c
+@@ -168,6 +168,12 @@ int ssl_write( void *conn, const char *b
+ return( PR_Write ( ((struct scd*)conn)->prfd, buf, len ) );
+ }
+
++/* See ssl_openssl.c for an explanation. */
++int ssl_pending( void *conn )
++{
++ return 0;
++}
++
+ void ssl_disconnect( void *conn_ )
+ {
+ struct scd *conn = conn_;
diff --git a/chat/bitlbee/patches/patch-ad b/chat/bitlbee/patches/patch-ad
new file mode 100644
index 00000000000..b5c532a8b67
--- /dev/null
+++ b/chat/bitlbee/patches/patch-ad
@@ -0,0 +1,50 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ad,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- lib/ssl_openssl.c.orig Sat Jun 30 23:18:42 2007
++++ lib/ssl_openssl.c
+@@ -61,16 +61,16 @@ void *ssl_connect( char *host, int port,
+ struct scd *conn = g_new0( struct scd, 1 );
+
+ conn->fd = proxy_connect( host, port, ssl_connected, conn );
+- conn->func = func;
+- conn->data = data;
+- conn->inpa = -1;
+-
+ if( conn->fd < 0 )
+ {
+ g_free( conn );
+ return NULL;
+ }
+
++ conn->func = func;
++ conn->data = data;
++ conn->inpa = -1;
++
+ return conn;
+ }
+
+@@ -228,6 +228,21 @@ int ssl_write( void *conn, const char *b
+ }
+
+ return st;
++}
++
++/* Only OpenSSL *really* needs this (and well, maybe NSS). See for more info:
++ http://www.gnu.org/software/gnutls/manual/gnutls.html#index-gnutls_005frecord_005fcheck_005fpending-209
++ http://www.openssl.org/docs/ssl/SSL_pending.html
++
++ Required because OpenSSL empties the TCP buffer completely but doesn't
++ necessarily give us all the unencrypted data.
++
++ Returns 0 if there's nothing left or if we don't have to care (GnuTLS),
++ 1 if there's more data. */
++int ssl_pending( void *conn )
++{
++ return ( ((struct scd*)conn) && ((struct scd*)conn)->established ) ?
++ SSL_pending( ((struct scd*)conn)->ssl ) > 0 : 0;
+ }
+
+ void ssl_disconnect( void *conn_ )
diff --git a/chat/bitlbee/patches/patch-ae b/chat/bitlbee/patches/patch-ae
new file mode 100644
index 00000000000..c14614121af
--- /dev/null
+++ b/chat/bitlbee/patches/patch-ae
@@ -0,0 +1,23 @@
+Fix stalling issue with OpenSSL and Jabber
+From http://bugs.bitlbee.org/bitlbee/changeset/devel%2C359
+
+$NetBSD: patch-ae,v 1.1 2008/04/20 09:29:45 tonio Exp $
+
+--- protocols/jabber/io.c.orig Sat Feb 16 23:39:47 2008
++++ protocols/jabber/io.c
+@@ -240,8 +240,13 @@ static gboolean jabber_read_callback( gp
+ return FALSE;
+ }
+
+- /* EAGAIN/etc or a successful read. */
+- return TRUE;
++ if( ssl_pending( jd->ssl ) )
++ /* OpenSSL empties the TCP buffers completely but may keep some
++ data in its internap buffers. select() won't see that, but
++ ssl_pending() does. */
++ return jabber_read_callback( data, fd, cond );
++ else
++ return TRUE;
+ }
+
+ gboolean jabber_connected_plain( gpointer data, gint source, b_input_condition cond )