aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitry Podgorny <pasis.ua@gmail.com>2012-10-25 00:46:34 +0300
committerDmitry Podgorny <pasis.ua@gmail.com>2012-10-25 00:46:34 +0300
commit509791f433bf79cd06bb53a5f6c73ebebe761756 (patch)
tree97a1e1a85c5bc92d9525d3d73a147a2e17677308
parent3e6412bea0e3a8a1c5d0dd56bd47d280083b9abd (diff)
downloadprofanity-509791f433bf79cd06bb53a5f6c73ebebe761756.tar.gz
profanity-509791f433bf79cd06bb53a5f6c73ebebe761756.tar.xz
dev-libs/libstrophe-0.8 add patch from upstream
The patch adds option for disabling TLS. This makes various programs compile with current version of library.
-rw-r--r--dev-libs/libstrophe/files/libstrophe-xmpp-conn-disable-tls.patch84
-rw-r--r--dev-libs/libstrophe/libstrophe-0.8.ebuild6
2 files changed, 90 insertions, 0 deletions
diff --git a/dev-libs/libstrophe/files/libstrophe-xmpp-conn-disable-tls.patch b/dev-libs/libstrophe/files/libstrophe-xmpp-conn-disable-tls.patch
new file mode 100644
index 0000000..56a801f
--- /dev/null
+++ b/dev-libs/libstrophe/files/libstrophe-xmpp-conn-disable-tls.patch
@@ -0,0 +1,84 @@
+commit 9615a55856ce6f1d0aabb4fb6b7f9a41c27a5391
+Author: James Booth <boothj5@gmail.com>
+Date: Sun May 20 01:50:32 2012 +0100
+
+ Added option to disable TLS
+
+ The connection object includes a tls_support flag, which can
+ be disabled with xmpp_conn_disable_tls().
+
+diff --git a/src/auth.c b/src/auth.c
+index d0c33cb..3bbdfec 100644
+--- a/src/auth.c
++++ b/src/auth.c
+@@ -209,9 +209,13 @@ static int _handle_features(xmpp_conn_t * const conn,
+
+ /* check for TLS */
+ if (!conn->secured) {
+- child = xmpp_stanza_get_child_by_name(stanza, "starttls");
+- if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_TLS) == 0))
+- conn->tls_support = 1;
++ if (!conn->tls_disabled) {
++ child = xmpp_stanza_get_child_by_name(stanza, "starttls");
++ if (child && (strcmp(xmpp_stanza_get_ns(child), XMPP_NS_TLS) == 0))
++ conn->tls_support = 1;
++ } else {
++ conn->tls_disabled = 0;
++ }
+ }
+
+ /* check for SASL */
+diff --git a/src/common.h b/src/common.h
+index cafcbd4..9434e6f 100644
+--- a/src/common.h
++++ b/src/common.h
+@@ -163,6 +163,7 @@ struct _xmpp_conn_t {
+ tls_t *tls;
+
+ int tls_support;
++ int tls_disabled;
+ int tls_failed; /* set when tls fails, so we don't try again */
+ int sasl_support; /* if true, field is a bitfield of supported
+ mechanisms */
+diff --git a/src/conn.c b/src/conn.c
+index 0a4e61c..e53a7f9 100644
+--- a/src/conn.c
++++ b/src/conn.c
+@@ -109,6 +109,7 @@ xmpp_conn_t *xmpp_conn_new(xmpp_ctx_t * const ctx)
+ conn->bound_jid = NULL;
+
+ conn->tls_support = 0;
++ conn->tls_disabled = 0;
+ conn->tls_failed = 0;
+ conn->sasl_support = 0;
+ conn->secured = 0;
+@@ -666,6 +667,17 @@ void conn_open_stream(xmpp_conn_t * const conn)
+ XMPP_NS_STREAMS);
+ }
+
++/** Disable TLS for this connection, called by users of the library.
++ * Occasionally a server will be misconfigured to send the starttls
++ * feature, but wil not support the handshake.
++ *
++ * @param conn a Strophe connection object
++ */
++void xmpp_conn_disable_tls(xmpp_conn_t * const conn)
++{
++ conn->tls_disabled = 1;
++}
++
+ static void _log_open_tag(xmpp_conn_t *conn, char **attrs)
+ {
+ char buf[4096];
+diff --git a/strophe.h b/strophe.h
+index 347ff7d..e3a2f4d 100644
+--- a/strophe.h
++++ b/strophe.h
+@@ -217,6 +217,7 @@ void xmpp_conn_set_jid(xmpp_conn_t * const conn, const char * const jid);
+ const char *xmpp_conn_get_pass(const xmpp_conn_t * const conn);
+ void xmpp_conn_set_pass(xmpp_conn_t * const conn, const char * const pass);
+ xmpp_ctx_t* xmpp_conn_get_context(xmpp_conn_t * const conn);
++void xmpp_conn_disable_tls(xmpp_conn_t * const conn);
+
+ int xmpp_connect_client(xmpp_conn_t * const conn,
+ const char * const altdomain,
diff --git a/dev-libs/libstrophe/libstrophe-0.8.ebuild b/dev-libs/libstrophe/libstrophe-0.8.ebuild
index d3debc9..3f7ecc1 100644
--- a/dev-libs/libstrophe/libstrophe-0.8.ebuild
+++ b/dev-libs/libstrophe/libstrophe-0.8.ebuild
@@ -4,6 +4,8 @@
EAPI=4
+inherit eutils
+
DESCRIPTION="A simple, lightweight C library for writing XMPP clients"
HOMEPAGE="http://strophe.im/libstrophe/"
SRC_URI="https://github.com/downloads/metajack/${PN}/${P}-snapshot.tar.gz"
@@ -21,6 +23,10 @@ DEPEND="${RDEPEND}
S="${WORKDIR}/${P}-snapshot"
+src_prepare() {
+ epatch "${FILESDIR}"/${PN}-xmpp-conn-disable-tls.patch
+}
+
src_configure() {
use xml && econf $(use_with xml libxml2)
# workaround for building with expat support