[Pkg-privacy-commits] [libotr] 23/225: * src/message.c: Use the gone_secure callback instead of the still_secure callback if the other side changes its fingerprint.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 12:44:47 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 b0e7c4f5b127df22dccd2a43c4179e2b684049a6
Author: cypherpunk <cypherpunk>
Date:   Thu Oct 27 20:24:11 2005 +0000

    	* src/message.c: Use the gone_secure callback instead of the
    	still_secure callback if the other side changes its fingerprint.
---
 ChangeLog     | 3 +++
 src/message.c | 4 +++-
 2 files changed, 6 insertions(+), 1 deletion(-)

diff --git a/ChangeLog b/ChangeLog
index cfa462a..a2117a5 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -16,6 +16,9 @@
 	* toolkit/otr_parse.c:
 	* toolkit/otr_remac.c: Deal with the new kind of Data Message.
 
+	* src/message.c: Use the gone_secure callback instead of the
+	still_secure callback if the other side changes its fingerprint.
+
 2005-10-19
 
 	* src/context.h:
diff --git a/src/message.c b/src/message.c
index 7b07756..7ac99f8 100644
--- a/src/message.c
+++ b/src/message.c
@@ -303,6 +303,7 @@ static gcry_error_t go_encrypted(const OtrlAuthInfo *auth, void *asdata)
     Fingerprint *found_print = NULL;
     int fprint_added = 0;
     OtrlMessageState oldstate = edata->context->msgstate;
+    Fingerprint *oldprint = edata->context->active_fingerprint;
 
     /* See if we're talking to ourselves */
     if (!gcry_mpi_cmp(auth->their_pub, auth->our_dh.pub)) {
@@ -346,6 +347,7 @@ static gcry_error_t go_encrypted(const OtrlAuthInfo *auth, void *asdata)
 
     /* Is this a new session or just a refresh of an existing one? */
     if (edata->context->msgstate == OTRL_MSGSTATE_ENCRYPTED &&
+	    oldprint == found_print &&
 	    edata->context->our_keyid - 1 == edata->context->auth.our_keyid &&
 	    !gcry_mpi_cmp(edata->context->our_old_dh_key.pub,
 		edata->context->auth.our_dh.pub) &&
@@ -414,7 +416,7 @@ static gcry_error_t go_encrypted(const OtrlAuthInfo *auth, void *asdata)
     if (edata->ops->update_context_list) {
 	edata->ops->update_context_list(edata->opdata);
     }
-    if (oldstate == OTRL_MSGSTATE_ENCRYPTED) {
+    if (oldstate == OTRL_MSGSTATE_ENCRYPTED && oldprint == found_print) {
 	if (edata->ops->still_secure) {
 	    edata->ops->still_secure(edata->opdata, edata->context,
 		    edata->context->auth.initiated);

-- 
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