[arch-commits] Commit in libetpan/trunk (PKGBUILD fix_STARTTLS_negotiation.diff)

Andreas Radke andyrtr at archlinux.org
Mon Mar 28 12:52:38 UTC 2016


    Date: Monday, March 28, 2016 @ 14:52:38
  Author: andyrtr
Revision: 263208

upgpkg: libetpan 1.6-4

fix STARTTLS negotiation; FS#48531

Added:
  libetpan/trunk/fix_STARTTLS_negotiation.diff
Modified:
  libetpan/trunk/PKGBUILD

-------------------------------+
 PKGBUILD                      |   14 ++++++++--
 fix_STARTTLS_negotiation.diff |   55 ++++++++++++++++++++++++++++++++++++++++
 2 files changed, 66 insertions(+), 3 deletions(-)

Modified: PKGBUILD
===================================================================
--- PKGBUILD	2016-03-28 12:40:36 UTC (rev 263207)
+++ PKGBUILD	2016-03-28 12:52:38 UTC (rev 263208)
@@ -3,15 +3,23 @@
 
 pkgname=libetpan
 pkgver=1.6
-pkgrel=3
+pkgrel=4
 pkgdesc="A portable middleware for email access"
 arch=('i686' 'x86_64')
 url="http://www.etpan.org/libetpan.html"
 license=("custom:etpan")
 depends=('libsasl' 'curl' 'expat')
-source=($pkgname-$pkgver.tar.gz::https://github.com/dinhviethoa/${pkgname}/archive/${pkgver}.tar.gz)
-md5sums=('1158c4ce291876c2b7bb003cd4b3566e')
+source=($pkgname-$pkgver.tar.gz::https://github.com/dinhviethoa/${pkgname}/archive/${pkgver}.tar.gz
+        fix_STARTTLS_negotiation.diff)
+md5sums=('1158c4ce291876c2b7bb003cd4b3566e'
+         '63c65052f6cd82a23ba9e15b14c85e24')
 
+prepare() {
+  cd ${pkgname}-${pkgver}
+  # FS#48531 - https://github.com/dinhviethoa/libetpan/commit/7f1f97f4d59d5724af97f4d32424c2841715561c
+  patch -Np1 -i ${srcdir}/fix_STARTTLS_negotiation.diff
+}
+
 build() {
   cd ${pkgname}-${pkgver}
   

Added: fix_STARTTLS_negotiation.diff
===================================================================
--- fix_STARTTLS_negotiation.diff	                        (rev 0)
+++ fix_STARTTLS_negotiation.diff	2016-03-28 12:52:38 UTC (rev 263208)
@@ -0,0 +1,55 @@
+diff --git a/src/data-types/mailstream_ssl.c b/src/data-types/mailstream_ssl.c
+index 9ed676d..05a035b 100644
+--- a/src/data-types/mailstream_ssl.c
++++ b/src/data-types/mailstream_ssl.c
+@@ -495,13 +495,19 @@ static struct mailstream_ssl_data * ssl_data_new_full(int fd, time_t timeout,
+ static struct mailstream_ssl_data * ssl_data_new(int fd, time_t timeout,
+ 	void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
+ {
+-  return ssl_data_new_full(fd, timeout, SSLv23_client_method(), callback, cb_data);
+-}
+-
+-static struct mailstream_ssl_data * tls_data_new(int fd, time_t timeout,
+-  void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
+-{
+-  return ssl_data_new_full(fd, timeout, TLSv1_client_method(), callback, cb_data);
++  return ssl_data_new_full(fd, timeout,
++#if (OPENSSL_VERSION_NUMBER >= 0x10100000L)
++		TLS_client_method(),
++#else
++	/* Despite their name the SSLv23_*method() functions have nothing to do
++	 * with the availability of SSLv2 or SSLv3. What these functions do is
++	 * negotiate with the peer the highest available SSL/TLS protocol version
++	 * available. The name is as it is for historic reasons. This is a very
++	 * common confusion and is the main reason why these names have been
++	 * deprecated in the latest dev version of OpenSSL. */
++		SSLv23_client_method(),
++#endif
++		callback, cb_data);
+ }
+ 
+ #else
+@@ -635,11 +641,6 @@ static struct mailstream_ssl_data * ssl_data_new(int fd, time_t timeout,
+  err:
+   return NULL;
+ }
+-static struct mailstream_ssl_data * tls_data_new(int fd, time_t timeout,
+-  void (* callback)(struct mailstream_ssl_context * ssl_context, void * cb_data), void * cb_data)
+-{
+-  return ssl_data_new(fd, timeout, callback, cb_data);
+-}
+ #endif
+ 
+ static void  ssl_data_free(struct mailstream_ssl_data * ssl_data)
+@@ -691,10 +692,7 @@ static mailstream_low * mailstream_low_ssl_open_full(int fd, int starttls, time_
+   mailstream_low * s;
+   struct mailstream_ssl_data * ssl_data;
+ 
+-  if (starttls)
+-    ssl_data = tls_data_new(fd, timeout, callback, cb_data);
+-  else
+-    ssl_data = ssl_data_new(fd, timeout, callback, cb_data);
++  ssl_data = ssl_data_new(fd, timeout, callback, cb_data);
+ 
+   if (ssl_data == NULL)
+     goto err;



More information about the arch-commits mailing list