[Pkg-privacy-commits] [libotr] 17/225: * packaging/fedora/libotr.spec: Patches from Paul

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:44:46 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository libotr.

commit 3edf39a6151a106a7d45f4f78bc641def2751b79
Author: cypherpunk <cypherpunk>
Date:   Wed Oct 19 15:12:09 2005 +0000

    	* packaging/fedora/libotr.spec: Patches from Paul
    
    	* src/proto.c (rotate_dh_keys): Avoid potential double
    	gcry_cipher_close().
    
    	* src/tests.c: Regression test for double gcry_cipher_close().
---
 ChangeLog                    |  9 +++++++++
 packaging/fedora/libotr.spec |  7 ++++++-
 src/proto.c                  |  4 ++++
 src/tests.c                  | 33 ++++++++++++++++++++++++++++++++-
 4 files changed, 51 insertions(+), 2 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 3ecf988..ae388d1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2005-10-19
+
+	* packaging/fedora/libotr.spec: Patches from Paul
+
+	* src/proto.c (rotate_dh_keys): Avoid potential double
+	gcry_cipher_close().
+
+	* src/tests.c: Regression test for double gcry_cipher_close().
+
 2005-10-16
 
 	* Major overhaul with implementation of version 2 AKE.
diff --git a/packaging/fedora/libotr.spec b/packaging/fedora/libotr.spec
index 9164ae8..2a617c1 100644
--- a/packaging/fedora/libotr.spec
+++ b/packaging/fedora/libotr.spec
@@ -9,6 +9,7 @@ Url: http://www.cypherpunks.ca/otr/
 BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 Provides: libotr-toolkit = %{version}
 Obsoletes: libotr-toolkit < %{version}
+Requires: libgcrypt >= 1.2.0, libgpg-error
 BuildRequires: libgcrypt-devel >= 1.2.0, libgpg-error-devel 
 
 %description
@@ -30,6 +31,7 @@ The devel package contains the libotr library and the include files
 %setup -q
 
 %build
+
 %configure --with-pic
 make %{?_smp_mflags} all
 
@@ -50,7 +52,7 @@ rm -rf $RPM_BUILD_ROOT
 
 %files 
 %defattr(-,root,root)
-%doc AUTHORS README COPYING COPYING.LIB News Protocol
+%doc AUTHORS README COPYING COPYING.LIB NEWS Protocol*
 %{_libdir}/libotr.so.*
 %{_bindir}/*
 %{_mandir}/man1/*
@@ -66,6 +68,9 @@ rm -rf $RPM_BUILD_ROOT
 
 
 %changelog
+* Mon Oct 17 2005 Paul Wouters <paul at cypherpunks.ca> 3.0.0
+- Minor change to allow for new documentation files. Fixed Requires:
+
 * Sat Jun 19 2005 Paul Wouters <paul at cypherpunks.ca>
 - Fixed defattr, groups, description and duplicate files in devel
 
diff --git a/src/proto.c b/src/proto.c
index 53fa11e..5055ba5 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -136,11 +136,15 @@ static gcry_error_t rotate_dh_keys(ConnContext *context)
 	err = otrl_dh_session(&(context->sesskeys[0][0]),
 		&(context->our_dh_key), context->their_y);
 	if (err) return err;
+    } else {
+	otrl_dh_session_blank(&(context->sesskeys[0][0]));
     }
     if (context->their_old_y) {
 	err = otrl_dh_session(&(context->sesskeys[0][1]),
 		&(context->our_dh_key), context->their_old_y);
 	if (err) return err;
+    } else {
+	otrl_dh_session_blank(&(context->sesskeys[0][1]));
     }
     return gcry_error(GPG_ERR_NO_ERROR);
 }
diff --git a/src/tests.c b/src/tests.c
index ef6e72a..f3a51ad 100644
--- a/src/tests.c
+++ b/src/tests.c
@@ -165,7 +165,7 @@ void test(int vers, int both)
     dispatch();
 }
 
-static void test_unreadable(void)
+void test_unreadable(void)
 {
     ConnContext *bobcontext;
 
@@ -179,6 +179,36 @@ static void test_unreadable(void)
 
 }
 
+void test_crash1(void)
+{
+    ConnContext *alicecontext, *bobcontext;
+
+    printf("\n\n*** Testing old double gcry_cipher_release case ***\n\n");
+
+    otrl_context_forget_all(us);
+    ALICEPOLICY = OTRL_POLICY_DEFAULT;
+    sending(ALICE, BOB, "?OTR?");
+    dispatch();
+
+    alicecontext = otrl_context_find(us, BOB, ALICE, PROTO, 0, NULL, NULL, NULL);
+    bobcontext = otrl_context_find(us, ALICE, BOB, PROTO, 0, NULL, NULL, NULL);
+
+    sending(ALICE, BOB, "Hi!"); dispatch();
+    sending(BOB, ALICE, "There!"); dispatch();
+    sending(ALICE, BOB, "You!"); dispatch();
+    otrl_context_force_plaintext(bobcontext);
+    sending(BOB, ALICE, "?OTR?"); dispatch();
+    sending(ALICE, BOB, "now."); dispatch();
+    printf("%d %p %p\n", alicecontext->our_keyid, alicecontext->their_y, alicecontext->their_old_y);
+    printf("%p %p %p %p\n",
+    alicecontext->sesskeys[0][0].sendenc,
+    alicecontext->sesskeys[0][1].sendenc,
+    alicecontext->sesskeys[1][0].sendenc,
+    alicecontext->sesskeys[1][1].sendenc);
+    sending(BOB, ALICE, "then."); dispatch();
+
+}
+
 int main(int argc, char **argv)
 {
     OTRL_INIT;
@@ -191,6 +221,7 @@ int main(int argc, char **argv)
     test(1,1);
     test(2,1);
     test_unreadable();
+    test_crash1();
 
 
     otrl_userstate_free(us);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/libotr.git



More information about the Pkg-privacy-commits mailing list