packages: irssi/irssi.spec, irssi/irssi-ssl.patch (NEW) - rel 5; ssl enhanc...

arekm arekm at pld-linux.org
Mon Feb 1 15:39:30 CET 2010


Author: arekm                        Date: Mon Feb  1 14:39:30 2010 GMT
Module: packages                      Tag: HEAD
---- Log message:
- rel 5; ssl enhancements from upstream

---- Files affected:
packages/irssi:
   irssi.spec (1.169 -> 1.170) , irssi-ssl.patch (NONE -> 1.1)  (NEW)

---- Diffs:

================================================================
Index: packages/irssi/irssi.spec
diff -u packages/irssi/irssi.spec:1.169 packages/irssi/irssi.spec:1.170
--- packages/irssi/irssi.spec:1.169	Fri Jan 15 13:28:56 2010
+++ packages/irssi/irssi.spec	Mon Feb  1 15:39:24 2010
@@ -14,7 +14,7 @@
 Summary(pl.UTF-8):	Irssi - wygodny w użyciu klient IRC
 Name:		irssi
 Version:	0.8.14
-Release:	4
+Release:	5
 License:	GPL
 Group:		Applications/Communications
 #Source0:	http://www.irssi.org/files/snapshots/%{name}-%{_snap}.tar.gz
@@ -36,6 +36,7 @@
 Patch7:		%{name}-color_support_for_gui_entry.patch
 Patch8:		%{name}-libs-nopoison.patch
 Patch9:		irssi.conf.patch
+Patch10:	%{name}-ssl.patch
 URL:		http://www.irssi.org/
 BuildRequires:	autoconf
 BuildRequires:	automake
@@ -97,6 +98,7 @@
 %patch7 -p0
 %patch8 -p1
 %patch9 -p1
+%patch10 -p0
 
 echo 'AC_DEFUN([AM_PATH_GLIB],[:])' > glib1.m4
 
@@ -227,6 +229,9 @@
 All persons listed below can be reached at <cvs_login>@pld-linux.org
 
 $Log$
+Revision 1.170  2010/02/01 14:39:24  arekm
+- rel 5; ssl enhancements from upstream
+
 Revision 1.169  2010/01/15 12:28:56  glen
 - release 4
 

================================================================
Index: packages/irssi/irssi-ssl.patch
diff -u /dev/null packages/irssi/irssi-ssl.patch:1.1
--- /dev/null	Mon Feb  1 15:39:30 2010
+++ packages/irssi/irssi-ssl.patch	Mon Feb  1 15:39:24 2010
@@ -0,0 +1,130 @@
+Index: src/core/network-openssl.c
+===================================================================
+--- src/core/network-openssl.c	(wersja 5094)
++++ src/core/network-openssl.c	(wersja 5095)
+@@ -317,6 +317,9 @@
+ 		return NULL;
+ 	}
+ 
++	SSL_set_mode(ssl, SSL_MODE_ENABLE_PARTIAL_WRITE |
++			SSL_MODE_ACCEPT_MOVING_WRITE_BUFFER);
++
+ 	chan = g_new0(GIOSSLChannel, 1);
+ 	chan->fd = fd;
+ 	chan->giochan = handle;
+Index: src/core/network-openssl.c
+===================================================================
+--- src/core/network-openssl.c	(wersja 5106)
++++ src/core/network-openssl.c	(wersja 5107)
+@@ -43,15 +43,14 @@
+ 	const char *hostname;
+ } GIOSSLChannel;
+ 
+-static SSL_CTX *ssl_ctx = NULL;
++static int ssl_inited = FALSE;
+ 
+ static void irssi_ssl_free(GIOChannel *handle)
+ {
+ 	GIOSSLChannel *chan = (GIOSSLChannel *)handle;
+ 	g_io_channel_unref(chan->giochan);
+ 	SSL_free(chan->ssl);
+-	if (chan->ctx != ssl_ctx)
+-		SSL_CTX_free(chan->ctx);
++	SSL_CTX_free(chan->ctx);
+ 	g_free(chan);
+ }
+ 
+@@ -375,14 +374,8 @@
+ {
+ 	SSL_library_init();
+ 	SSL_load_error_strings();
++	ssl_inited = TRUE;
+ 
+-	ssl_ctx = SSL_CTX_new(SSLv23_client_method());
+-	if(!ssl_ctx)
+-	{
+-		g_error("Initialization of the SSL library failed");
+-		return FALSE;
+-	}
+-
+ 	return TRUE;
+ 
+ }
+@@ -397,18 +390,20 @@
+ 
+ 	g_return_val_if_fail(handle != NULL, NULL);
+ 
+-	if(!ssl_ctx && !irssi_ssl_init())
++	if(!ssl_inited && !irssi_ssl_init())
+ 		return NULL;
+ 
+ 	if(!(fd = g_io_channel_unix_get_fd(handle)))
+ 		return NULL;
+ 
++	ctx = SSL_CTX_new(SSLv23_client_method());
++	if (ctx == NULL) {
++		g_error("Could not allocate memory for SSL context");
++		return NULL;
++	}
++
+ 	if (mycert && *mycert) {
+ 		char *scert = NULL, *spkey = NULL;
+-		if ((ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) {
+-			g_error("Could not allocate memory for SSL context");
+-			return NULL;
+-		}
+ 		scert = convert_home(mycert);
+ 		if (mypkey && *mypkey)
+ 			spkey = convert_home(mypkey);
+@@ -425,10 +420,6 @@
+ 	if ((cafile && *cafile) || (capath && *capath)) {
+ 		char *scafile = NULL;
+ 		char *scapath = NULL;
+-		if (! ctx && (ctx = SSL_CTX_new(SSLv23_client_method())) == NULL) {
+-			g_error("Could not allocate memory for SSL context");
+-			return NULL;
+-		}
+ 		if (cafile && *cafile)
+ 			scafile = convert_home(cafile);
+ 		if (capath && *capath)
+@@ -443,14 +434,15 @@
+ 		g_free(scafile);
+ 		g_free(scapath);
+ 		verify = TRUE;
++	} else {
++		if (!SSL_CTX_set_default_verify_paths(ctx))
++			g_warning("Could not load default certificates");
+ 	}
+ 
+-	if (ctx == NULL)
+-		ctx = ssl_ctx;
+-
+ 	if(!(ssl = SSL_new(ctx)))
+ 	{
+ 		g_warning("Failed to allocate SSL structure");
++		SSL_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 
+@@ -458,8 +450,7 @@
+ 	{
+ 		g_warning("Failed to associate socket to SSL stream");
+ 		SSL_free(ssl);
+-		if (ctx != ssl_ctx)
+-			SSL_CTX_free(ctx);
++		SSL_CTX_free(ctx);
+ 		return NULL;
+ 	}
+ 
+Index: src/core/network-openssl.c
+===================================================================
+--- src/core/network-openssl.c	(wersja 5107)
++++ src/core/network-openssl.c	(wersja 5108)
+@@ -374,6 +374,7 @@
+ {
+ 	SSL_library_init();
+ 	SSL_load_error_strings();
++	OpenSSL_add_all_algorithms();
+ 	ssl_inited = TRUE;
+ 
+ 	return TRUE;
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/cgi-bin/cvsweb.cgi/packages/irssi/irssi.spec?r1=1.169&r2=1.170&f=u



More information about the pld-cvs-commit mailing list