~ubuntu-branches/ubuntu/vivid/irssi-plugin-xmpp/vivid

« back to all changes in this revision

Viewing changes to debian/patches/set_ssl-conflicting-declarations.patch

  • Committer: Package Import Robot
  • Author(s): Florian Schlichting
  • Date: 2014-07-15 15:01:05 UTC
  • Revision ID: package-import@ubuntu.com-20140715150105-b15bondvgyduzfwd
Tags: 0.52+git20140102-2
* Add require-starttls.patch to ensure encrypted connections and prevent
  ssl-stripping attacks (closes: #754839). Thanks dkg for the patch!
* Fix conflicting declarations of set_ssl and ensure encryption when
  registering (closes: #749411)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
Description: Fix conflicting declarations of function set_ssl
 
2
 causing a stack underflow (closes: #749411). Also, use
 
3
 STARTTLS if TLS-on-connect was not specified
 
4
Author: Florian Schlichting <fsfs@debian.org>
 
5
 
 
6
--- a/src/core/xep/registration.c
 
7
+++ b/src/core/xep/registration.c
 
8
@@ -36,7 +36,7 @@
 
9
 #define XMLNS_REGISTRATION "http://jabber.org/features/iq-register"
 
10
 #define XMLNS_REGISTER "jabber:iq:register"
 
11
 
 
12
-gboolean set_ssl(LmConnection *, GError **, gpointer);
 
13
+gboolean set_ssl(LmConnection *, GError **, gpointer, gboolean);
 
14
 gboolean set_proxy(LmConnection *, GError **);
 
15
 
 
16
 struct register_data {
 
17
@@ -173,8 +173,13 @@
 
18
        GError *error = NULL;
 
19
 
 
20
        lmconn = lm_connection_new(NULL);
 
21
-       if (rd->use_ssl && !set_ssl(lmconn, &error, NULL))
 
22
-               goto err;
 
23
+       if (rd->use_ssl) {
 
24
+               if (!set_ssl(lmconn, &error, NULL, FALSE))
 
25
+                       goto err;
 
26
+       } else {
 
27
+               if (!set_ssl(lmconn, &error, NULL, TRUE))
 
28
+                       goto err;
 
29
+       }
 
30
        if (settings_get_bool("xmpp_use_proxy") && !set_proxy(lmconn, &error))
 
31
                goto err;
 
32
        if (rd->port <= 0)