[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [tor-messenger-build/master] Add libotr patch for bug.otr.im/issues/72



commit c59d2b146a0ea8427b1e7f62ab073c64a787eeba
Author: Arlo Breault <arlolra@xxxxxxxxx>
Date:   Tue Sep 29 14:42:53 2015 +0200

    Add libotr patch for bug.otr.im/issues/72
---
 projects/libotr/bugs-otr-im-72.patch |   60 ++++++++++++++++++++++++++++++++++
 projects/libotr/build                |    1 +
 projects/libotr/config               |    1 +
 3 files changed, 62 insertions(+)

diff --git a/projects/libotr/bugs-otr-im-72.patch b/projects/libotr/bugs-otr-im-72.patch
new file mode 100644
index 0000000..a56dda3
--- /dev/null
+++ b/projects/libotr/bugs-otr-im-72.patch
@@ -0,0 +1,60 @@
+From f466e0c698d022cbd6ddb279e1ca4c84a0703b3b Mon Sep 17 00:00:00 2001
+From: David Goulet <dgoulet@xxxxxxxxx>
+Date: Tue, 18 Aug 2015 09:32:19 +0200
+Subject: [PATCH] Fix: set to NULL the sendsmp pointer when handling SMP
+
+Also, for extra precaution, set the message pointer in
+otrl_proto_create_data() to NULL at the beginning.
+
+Fixes #72
+
+Signed-off-by: David Goulet <dgoulet@xxxxxxxxx>
+---
+ src/message.c | 4 ++--
+ src/proto.c   | 4 ++--
+ 2 files changed, 4 insertions(+), 4 deletions(-)
+
+diff --git a/src/message.c b/src/message.c
+index f17e5e1..9572fc9 100644
+--- a/src/message.c
++++ b/src/message.c
+@@ -1502,7 +1502,7 @@ int otrl_message_receiving(OtrlUserState us, const OtrlMessageAppOps *ops,
+ 			    unsigned char* nextmsg;
+ 			    int nextmsglen;
+ 			    OtrlTLV *sendtlv;
+-			    char *sendsmp;
++			    char *sendsmp = NULL;
+ 			    otrl_sm_step3(context->smstate, tlv->data,
+ 				    tlv->len, &nextmsg, &nextmsglen);
+ 
+@@ -1557,7 +1557,7 @@ int otrl_message_receiving(OtrlUserState us, const OtrlMessageAppOps *ops,
+ 			    unsigned char* nextmsg;
+ 			    int nextmsglen;
+ 			    OtrlTLV *sendtlv;
+-			    char *sendsmp;
++			    char *sendsmp = NULL;
+ 			    err = otrl_sm_step4(context->smstate, tlv->data,
+ 				    tlv->len, &nextmsg, &nextmsglen);
+ 			    /* Set trust level based on result */
+diff --git a/src/proto.c b/src/proto.c
+index f560a82..a8813ab 100644
+--- a/src/proto.c
++++ b/src/proto.c
+@@ -497,6 +497,8 @@ gcry_error_t otrl_proto_create_data(char **encmessagep, ConnContext *context,
+     char *msgdup;
+     int version = context->protocol_version;
+ 
++	*encmessagep = NULL;
++
+     /* Make sure we're actually supposed to be able to encrypt */
+     if (context->msgstate != OTRL_MSGSTATE_ENCRYPTED ||
+ 	    context->context_priv->their_keyid == 0) {
+@@ -511,8 +513,6 @@ gcry_error_t otrl_proto_create_data(char **encmessagep, ConnContext *context,
+     }
+     strcpy(msgdup, msg);
+ 
+-    *encmessagep = NULL;
+-
+     /* Header, msg flags, send keyid, recv keyid, counter, msg len, msg
+      * len of revealed mac keys, revealed mac keys, MAC */
+     buflen = OTRL_HEADER_LEN + (version == 3 ? 8 : 0)
diff --git a/projects/libotr/build b/projects/libotr/build
old mode 100644
new mode 100755
index c0753d6..ecd94ee
--- a/projects/libotr/build
+++ b/projects/libotr/build
@@ -12,6 +12,7 @@ cd $rootdir
 distdir=/var/tmp/dist/[% project %]
 tar xf libotr-[% c('version') %].tar.gz
 cd libotr-[% c('version') %]
+patch -p1 < ../bugs-otr-im-72.patch
 ./configure --prefix=$distdir [% c("var/configure_opt") %]
 make -j4 [% IF c("var/windows") %]LDFLAGS='-no-undefined -lssp'[% END %]
 make prefix=$distdir install
diff --git a/projects/libotr/config b/projects/libotr/config
index 8ca4a78..73081c7 100644
--- a/projects/libotr/config
+++ b/projects/libotr/config
@@ -38,6 +38,7 @@ input_files:
     file_gpg_id: 1
     sig_ext: asc
     gpg_keyring: libotr.gpg
+  - filename: bugs-otr-im-72.patch
   - project: libgcrypt
     name: libgcrypt
   - project: libgpg-error

_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits